diff options
author | dim <dim@FreeBSD.org> | 2010-09-17 15:48:55 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2010-09-17 15:48:55 +0000 |
commit | 5d5cc59cc77afe655b3707cb0e69e0827b444cad (patch) | |
tree | 36453626c792cccd91f783a38a169d610a6b9db9 /examples/Fibonacci/fibonacci.cpp | |
parent | 786a18553586229ad99ecb5ecde8a9d914c45e27 (diff) | |
download | FreeBSD-src-5d5cc59cc77afe655b3707cb0e69e0827b444cad.zip FreeBSD-src-5d5cc59cc77afe655b3707cb0e69e0827b444cad.tar.gz |
Vendor import of llvm r114020 (from the release_28 branch):
http://llvm.org/svn/llvm-project/llvm/branches/release_28@114020
Approved by: rpaulo (mentor)
Diffstat (limited to 'examples/Fibonacci/fibonacci.cpp')
-rw-r--r-- | examples/Fibonacci/fibonacci.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/examples/Fibonacci/fibonacci.cpp b/examples/Fibonacci/fibonacci.cpp index 353e173..a7bbf8c 100644 --- a/examples/Fibonacci/fibonacci.cpp +++ b/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; } |