[llvm-commits] CVS: reopt/include/reopt/TraceToFunction.h

Brian Gaeke gaeke at cs.uiuc.edu
Mon May 24 03:56:01 PDT 2004


Changes in directory reopt/include/reopt:

TraceToFunction.h updated: 1.13 -> 1.14

---
Log message:

Allow getCorrespondingValue to ignore live-in values on request.


---
Diffs of the changes:  (+7 -3)

Index: reopt/include/reopt/TraceToFunction.h
diff -u reopt/include/reopt/TraceToFunction.h:1.13 reopt/include/reopt/TraceToFunction.h:1.14
--- reopt/include/reopt/TraceToFunction.h:1.13	Sun May 23 05:09:43 2004
+++ reopt/include/reopt/TraceToFunction.h	Mon May 24 03:54:45 2004
@@ -78,10 +78,14 @@
   ///
   ValueToIntMap LiveInToParameterMap;
 
-  Value *getCorrespondingValue (const Value *V) {
-    if (LiveInToParameterMap.find (V) != LiveInToParameterMap.end ()) {
-      return getFunctionArg (TraceFn, LiveInToParameterMap[V]);
+  Value *getCorrespondingValue (const Value *V, bool preferLiveIn = true) {
+    if (preferLiveIn) {
+      ValueToIntMap::iterator It = LiveInToParameterMap.find (V);
+      if (It != LiveInToParameterMap.end ())
+        return getFunctionArg (TraceFn, It->second);
     }
+    // Otherwise, ignore live-in values (useful for getting the live-out
+    // version of a value that is both live-out and live-in)
     ValueMap::iterator i = O2CMap.find (V);
     assert (O2CMap.end() != i
             && "getCorrespondingValue called on value not in map");





More information about the llvm-commits mailing list