From 7b7768a269d01983c7c3d881841cabbcf3200506 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 5 Sep 2010 23:09:30 +0000 Subject: fit in 80 columns and don't crash on exit, fixes PR8080 llvm-svn: 113123 --- llvm/examples/Fibonacci/fibonacci.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'llvm/examples') diff --git a/llvm/examples/Fibonacci/fibonacci.cpp b/llvm/examples/Fibonacci/fibonacci.cpp index 353e17380c6..a7bbf8c7268 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 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; } -- cgit v1.2.3