From e6492f10575fbdcee74db7b45a4ab883baf00ce7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 8 Dec 2003 08:22:48 +0000 Subject: Use the new method, though noone currently implements it any better than before llvm-svn: 10320 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp') 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(C)) { Result.PointerVal = 0; } else if (const ConstantPointerRef *CPR = dyn_cast(C)){ - Result = PTOGV(getPointerToGlobal(CPR->getValue())); + if (Function *F = + const_cast(dyn_cast(CPR->getValue()))) + Result = PTOGV(getPointerToFunctionOrStub(F)); + else + Result = PTOGV(getPointerToGlobal(CPR->getValue())); } else { assert(0 && "Unknown constant pointer type!"); -- cgit v1.2.3