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

llvm-svn: 10320
This commit is contained in:
Chris Lattner 2003-12-08 08:22:48 +00:00
parent d71a033370
commit e6492f1057
1 changed files with 5 additions and 1 deletions

View File

@ -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!");