mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 22:30:33 +00:00
fit in 80 columns and don't crash on exit, fixes PR8080
llvm-svn: 113123
This commit is contained in:
parent
c0e5368884
commit
df0d49314e
@ -96,17 +96,22 @@ int main(int argc, char **argv) {
|
||||
LLVMContext Context;
|
||||
|
||||
// Create some module to put our function into it.
|
||||
Module *M = new Module("test", Context);
|
||||
OwningPtr<Module> M(new Module("test", Context));
|
||||
|
||||
// We are about to create the "fib" function:
|
||||
Function *FibF = CreateFibFunction(M, Context);
|
||||
Function *FibF = CreateFibFunction(M.get(), Context);
|
||||
|
||||
// Now we going to create JIT
|
||||
std::string errStr;
|
||||
ExecutionEngine *EE = EngineBuilder(M).setErrorStr(&errStr).setEngineKind(EngineKind::JIT).create();
|
||||
ExecutionEngine *EE =
|
||||
EngineBuilder(M.get())
|
||||
.setErrorStr(&errStr)
|
||||
.setEngineKind(EngineKind::JIT)
|
||||
.create();
|
||||
|
||||
if (!EE) {
|
||||
errs() << argv[0] << ": Failed to construct ExecutionEngine: " << errStr << "\n";
|
||||
errs() << argv[0] << ": Failed to construct ExecutionEngine: " << errStr
|
||||
<< "\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -127,5 +132,6 @@ int main(int argc, char **argv) {
|
||||
|
||||
// import result of execution
|
||||
outs() << "Result: " << GV.IntVal << "\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user