summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-29 05:26:09 +0000
committerChris Lattner <sabre@nondot.org>2009-10-29 05:26:09 +0000
commit0c778f70e9259d869732c59731d152277a365f72 (patch)
tree991a236f54224fc09270b9a89f51b6a2efa6e775 /llvm/lib/ExecutionEngine/ExecutionEngine.cpp
parent08bb9ef7f71f2053a3683913bbad19941e0a6dc9 (diff)
downloadbcm5719-llvm-0c778f70e9259d869732c59731d152277a365f72.tar.gz
bcm5719-llvm-0c778f70e9259d869732c59731d152277a365f72.zip
add interpreter support for indirect goto / blockaddress. The interpreter
now correctly runs clang's test/CodeGen/indirect-goto.c. The JIT will abort on it until someone feels compelled to implement this. llvm-svn: 85488
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/ExecutionEngine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
index c61ab875972..21499e5f64e 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -760,8 +760,11 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
Result.PointerVal = 0;
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))
+ else if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(C))
Result = PTOGV(getOrEmitGlobalVariable(const_cast<GlobalVariable*>(GV)));
+ else if (const BlockAddress *BA = dyn_cast<BlockAddress>(C))
+ Result = PTOGV(getPointerToBasicBlock(const_cast<BasicBlock*>(
+ BA->getBasicBlock())));
else
llvm_unreachable("Unknown constant pointer type!");
break;
OpenPOWER on IntegriCloud