Remove the last use of llvm::ExecutionEngine::create.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 24 Jul 2014 15:54:23 +0000 (15:54 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 24 Jul 2014 15:54:23 +0000 (15:54 +0000)
llvm-svn: 213869

clang/examples/clang-interpreter/main.cpp

index 8b8ccfd..8278d28 100644 (file)
@@ -42,12 +42,19 @@ std::string GetExecutablePath(const char *Argv0) {
   return llvm::sys::fs::getMainExecutable(Argv0, MainAddr);
 }
 
+static llvm::ExecutionEngine *createExecutionEngine(llvm::Module *M,
+                                                    std::string *ErrorStr) {
+  llvm::EngineBuilder EB = llvm::EngineBuilder(M)
+                               .setEngineKind(llvm::EngineKind::Either)
+                               .setErrorStr(ErrorStr);
+  return EB.create();
+}
+
 static int Execute(llvm::Module *Mod, char * const *envp) {
   llvm::InitializeNativeTarget();
 
   std::string Error;
-  std::unique_ptr<llvm::ExecutionEngine> EE(
-      llvm::ExecutionEngine::create(Mod, /*ForceInterpreter*/ false, &Error));
+  std::unique_ptr<llvm::ExecutionEngine> EE(createExecutionEngine(Mod, &Error));
   if (!EE) {
     llvm::errs() << "unable to make execution engine: " << Error << "\n";
     return 255;