EngineBuilder: support for custom TargetOptions. Fixes the

ExceptionDemo example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146108 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Peter Collingbourne
2011-12-07 23:58:57 +00:00
parent 0c89f7fda2
commit d40e103ea5
4 changed files with 19 additions and 3 deletions

View File

@ -2005,7 +2005,8 @@ int main(int argc, char *argv[]) {
}
// If not set, exception handling will not be turned on
llvm::JITExceptionHandling = true;
llvm::TargetOptions Opts;
Opts.JITExceptionHandling = true;
llvm::InitializeNativeTarget();
llvm::LLVMContext &context = llvm::getGlobalContext();
@ -2018,6 +2019,7 @@ int main(int argc, char *argv[]) {
llvm::EngineBuilder factory(module);
factory.setEngineKind(llvm::EngineKind::JIT);
factory.setAllocateGVsWithCode(false);
factory.setTargetOptions(Opts);
llvm::ExecutionEngine *executionEngine = factory.create();
{