summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-07-18 00:41:27 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-07-18 00:41:27 +0000
commit6a0fd73bee206b2640ff0f840334013475c5955a (patch)
tree14df43ed92a4a5920c7d81922dd024371b7d34ca /llvm/lib/ExecutionEngine/ExecutionEngine.cpp
parent874368790f5516a5eb861227da5e9b60d3c43d24 (diff)
downloadbcm5719-llvm-6a0fd73bee206b2640ff0f840334013475c5955a.tar.gz
bcm5719-llvm-6a0fd73bee206b2640ff0f840334013475c5955a.zip
bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage - Correct isa<Constant> for GlobalValue subclass llvm-svn: 14951
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/ExecutionEngine.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
index e53c468a2f3..e6f096f8aad 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -263,19 +263,14 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
GET_CONST_VAL(Double , ConstantFP);
#undef GET_CONST_VAL
case Type::PointerTyID:
- if (isa<ConstantPointerNull>(C)) {
+ if (isa<ConstantPointerNull>(C))
Result.PointerVal = 0;
- } else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(C)){
- if (Function *F =
- const_cast<Function*>(dyn_cast<Function>(CPR->getValue())))
- Result = PTOGV(getPointerToFunctionOrStub(F));
- else
- Result = PTOGV(getOrEmitGlobalVariable(
- cast<GlobalVariable>(CPR->getValue())));
-
- } else {
+ else if (const Function *F = dyn_cast<Function>(C))
+ Result = PTOGV(getPointerToFunctionOrStub(const_cast<Function*>(F)));
+ else if (const GlobalVariable* GV = dyn_cast<GlobalVariable>(C))
+ Result = PTOGV(getOrEmitGlobalVariable(const_cast<GlobalVariable*>(GV)));
+ else
assert(0 && "Unknown constant pointer type!");
- }
break;
default:
std::cout << "ERROR: Constant unimp for type: " << *C->getType() << "\n";
OpenPOWER on IntegriCloud