summaryrefslogtreecommitdiffstats
path: root/llvm/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
commite6492f10575fbdcee74db7b45a4ab883baf00ce7 (patch)
treeded220788ef6a712d479ce81abef234ff8d67392 /llvm/lib/ExecutionEngine/ExecutionEngine.cpp
parentd71a03337021cab34e001438150d0005085e7740 (diff)
downloadbcm5719-llvm-e6492f10575fbdcee74db7b45a4ab883baf00ce7.tar.gz
bcm5719-llvm-e6492f10575fbdcee74db7b45a4ab883baf00ce7.zip
Use the new method, though noone currently implements it any better than before
llvm-svn: 10320
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/ExecutionEngine.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
index 2681790e56a..0252595926e 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/llvm/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!");
OpenPOWER on IntegriCloud