forked from OSchip/llvm-project
Remove the last use of llvm::ExecutionEngine::create.
llvm-svn: 213869
This commit is contained in:
parent
4b6d090bd3
commit
fb3d5d1750
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue