diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-29 05:26:09 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-29 05:26:09 +0000 |
commit | f32a6a3091e0b01d17926f4b1cf78972854b8cb5 (patch) | |
tree | 12a35a7b53cc71961a5eecc2913bb06842e142af /lib/ExecutionEngine/ExecutionEngine.cpp | |
parent | 7a8b33a9a4da1724a652585ad805ea84a59b90e7 (diff) | |
download | external_llvm-f32a6a3091e0b01d17926f4b1cf78972854b8cb5.zip external_llvm-f32a6a3091e0b01d17926f4b1cf78972854b8cb5.tar.gz external_llvm-f32a6a3091e0b01d17926f4b1cf78972854b8cb5.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r-- | lib/ExecutionEngine/ExecutionEngine.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index c61ab87..21499e5 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/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; |