[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h

Chris Lattner lattner at cs.uiuc.edu
Tue Feb 15 20:58:37 PST 2005



Changes in directory llvm-poolalloc/lib/PoolAllocate:

PoolAllocate.h updated: 1.40 -> 1.41
---
Log message:

Add a helper method.


---
Diffs of the changes:  (+8 -0)

 PoolAllocate.h |    8 ++++++++
 1 files changed, 8 insertions(+)


Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h
diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.40 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.41
--- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.40	Mon Feb 14 17:08:53 2005
+++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h	Tue Feb 15 22:58:22 2005
@@ -84,6 +84,14 @@
     /// the values they correspond to in the old function.
     ///
     std::map<Value*, const Value*> NewToOldValueMap;
+
+    /// MapValueToOriginal - Given a value in the cloned version of this
+    /// function, map it back to the original.
+    Value *MapValueToOriginal(Value *V) const {
+      std::map<Value*,const Value*>::const_iterator I =NewToOldValueMap.find(V);
+      assert(I != NewToOldValueMap.end() && "This is not a cloned value!");
+      return const_cast<Value*>(I->second);
+    }
   };
 
 }; // end PA namespace






More information about the llvm-commits mailing list