diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-09-06 09:08:13 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-09-06 09:08:13 +0000 |
commit | 2b291257ece238655ef7f85f2f6f11c8d9f3efef (patch) | |
tree | 5193eedb354120bcaab2c36287ab54db5ff6d1b2 | |
parent | ee8092b5dd6cd29712f2411bc3c90af9843a828e (diff) | |
download | llvm-2b291257ece238655ef7f85f2f6f11c8d9f3efef.zip llvm-2b291257ece238655ef7f85f2f6f11c8d9f3efef.tar.gz llvm-2b291257ece238655ef7f85f2f6f11c8d9f3efef.tar.bz2 |
Approved by Chris:
$ svn merge -c 113123 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r113123 into '.':
U examples/Fibonacci/fibonacci.cpp
fit in 80 columns and don't crash on exit, fixes PR8080
llvm-svn: 113150
-rw-r--r-- | llvm/examples/Fibonacci/fibonacci.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/examples/Fibonacci/fibonacci.cpp b/llvm/examples/Fibonacci/fibonacci.cpp index 353e173..a7bbf8c 100644 --- a/llvm/examples/Fibonacci/fibonacci.cpp +++ b/llvm/examples/Fibonacci/fibonacci.cpp @@ -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; } |