EngineBuilder: support for custom TargetOptions. Fixes the
[oota-llvm.git] / examples / ExceptionDemo / ExceptionDemo.cpp
index 20516a783b9d8cbeba2b9fa802d6fca472be9945..41f41e8ffe718dc7a307c2dbbe954fc8429d6b41 100644 (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();
   
   {