diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:08:18 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:08:18 +0000 |
commit | 5ca98fd98791947eba83a1ed3f2c8191ef7afa6c (patch) | |
tree | f5944309621cee4fe0976be6f9ac619b7ebfc4c2 /examples/ExceptionDemo | |
parent | 68bcb7db193e4bc81430063148253d30a791023e (diff) |
Diffstat (limited to 'examples/ExceptionDemo')
-rw-r--r-- | examples/ExceptionDemo/CMakeLists.txt | 11 | ||||
-rw-r--r-- | examples/ExceptionDemo/ExceptionDemo.cpp | 9 |
2 files changed, 15 insertions, 5 deletions
diff --git a/examples/ExceptionDemo/CMakeLists.txt b/examples/ExceptionDemo/CMakeLists.txt index ea818faf3b33..a08a7c30bd8a 100644 --- a/examples/ExceptionDemo/CMakeLists.txt +++ b/examples/ExceptionDemo/CMakeLists.txt @@ -1,5 +1,14 @@ -set(LLVM_LINK_COMPONENTS jit mcjit nativecodegen) +set(LLVM_LINK_COMPONENTS + Core + ExecutionEngine + MCJIT + Support + nativecodegen + ) + +# Enable EH and RTTI for this demo set(LLVM_REQUIRES_EH 1) +set(LLVM_REQUIRES_RTTI 1) add_llvm_example(ExceptionDemo ExceptionDemo.cpp diff --git a/examples/ExceptionDemo/ExceptionDemo.cpp b/examples/ExceptionDemo/ExceptionDemo.cpp index d6954e83be4b..24e538cacf20 100644 --- a/examples/ExceptionDemo/ExceptionDemo.cpp +++ b/examples/ExceptionDemo/ExceptionDemo.cpp @@ -48,7 +48,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Analysis/Verifier.h" +#include "llvm/IR/Verifier.h" #include "llvm/ExecutionEngine/MCJIT.h" #include "llvm/ExecutionEngine/SectionMemoryManager.h" #include "llvm/IR/DataLayout.h" @@ -915,7 +915,7 @@ void generateStringPrint(llvm::LLVMContext &context, new llvm::GlobalVariable(module, stringConstant->getType(), true, - llvm::GlobalValue::LinkerPrivateLinkage, + llvm::GlobalValue::PrivateLinkage, stringConstant, ""); } @@ -959,7 +959,7 @@ void generateIntegerPrint(llvm::LLVMContext &context, new llvm::GlobalVariable(module, stringConstant->getType(), true, - llvm::GlobalValue::LinkerPrivateLinkage, + llvm::GlobalValue::PrivateLinkage, stringConstant, ""); } @@ -1976,7 +1976,8 @@ int main(int argc, char *argv[]) { // Set up the optimizer pipeline. // Start with registering info about how the // target lays out data structures. - fpm.add(new llvm::DataLayout(*executionEngine->getDataLayout())); + module->setDataLayout(executionEngine->getDataLayout()); + fpm.add(new llvm::DataLayoutPass(module)); // Optimizations turned on #ifdef ADD_OPT_PASSES |