[llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Dec 8 02:24:01 PST 2003


Changes in directory llvm/lib/ExecutionEngine:

ExecutionEngine.cpp updated: 1.38 -> 1.39

---
Log message:

Use the new method, though noone currently implements it any better than before


---
Diffs of the changes:  (+5 -1)

Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp
diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.38 llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.39
--- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.38	Wed Nov 19 15:08:57 2003
+++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp	Mon Dec  8 02:22:48 2003
@@ -150,7 +150,11 @@
     if (isa<ConstantPointerNull>(C)) {
       Result.PointerVal = 0;
     } else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(C)){
-      Result = PTOGV(getPointerToGlobal(CPR->getValue()));
+      if (Function *F =
+          const_cast<Function*>(dyn_cast<Function>(CPR->getValue())))
+        Result = PTOGV(getPointerToFunctionOrStub(F));
+      else 
+        Result = PTOGV(getPointerToGlobal(CPR->getValue()));
 
     } else {
       assert(0 && "Unknown constant pointer type!");





More information about the llvm-commits mailing list