[llvm-branch-commits] [llvm-branch] r113150 - in /llvm/branches/release_28: ./ examples/Fibonacci/fibonacci.cpp

Bill Wendling isanbard at gmail.com
Mon Sep 6 02:08:14 PDT 2010


Author: void
Date: Mon Sep  6 04:08:13 2010
New Revision: 113150

URL: http://llvm.org/viewvc/llvm-project?rev=113150&view=rev
Log:
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


Modified:
    llvm/branches/release_28/   (props changed)
    llvm/branches/release_28/examples/Fibonacci/fibonacci.cpp

Propchange: llvm/branches/release_28/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep  6 04:08:13 2010
@@ -1,2 +1,2 @@
 /llvm/branches/Apple/Pertwee:110850,110961
-/llvm/trunk:113109
+/llvm/trunk:113109,113123

Modified: llvm/branches/release_28/examples/Fibonacci/fibonacci.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_28/examples/Fibonacci/fibonacci.cpp?rev=113150&r1=113149&r2=113150&view=diff
==============================================================================
--- llvm/branches/release_28/examples/Fibonacci/fibonacci.cpp (original)
+++ llvm/branches/release_28/examples/Fibonacci/fibonacci.cpp Mon Sep  6 04:08:13 2010
@@ -96,17 +96,22 @@
   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 @@
 
   // import result of execution
   outs() << "Result: " << GV.IntVal << "\n";
+  
   return 0;
 }





More information about the llvm-branch-commits mailing list