aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/ExecutionEngine.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-12-08 08:22:48 +0000
committerChris Lattner <sabre@nondot.org>2003-12-08 08:22:48 +0000
commit38f0ebad9aff85786c1273cfb8aa1b4bd838100a (patch)
tree48d70966b909ca36eb6d90bd03f4729c7caf1c46 /lib/ExecutionEngine/ExecutionEngine.cpp
parent18cb4c3c747ac2439ca9fb1218edd8993df69d7a (diff)
Use the new method, though noone currently implements it any better than before
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10320 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index 2681790e56..0252595926 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -150,7 +150,11 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
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!");