Fix the build.
authorZoltan Varga <vargaz@gmail.com>
Tue, 26 Aug 2014 19:01:08 +0000 (15:01 -0400)
committerZoltan Varga <vargaz@gmail.com>
Tue, 26 Aug 2014 19:01:24 +0000 (15:01 -0400)
mono/mini/mini-llvm-cpp.cpp

index 106b17bee3d63fab7006be634cb467d9e5360b5c..7560fcf012b2f17193f4548f1830cac936fb0d54 100644 (file)
@@ -600,12 +600,11 @@ mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, Func
   TargetOptions opts;
   opts.JITExceptionHandling = 1;
 
-  std::unique_ptr<Module> Owner(unwrap(MP));
-
 #if LLVM_API_VERSION >= 2
   StringRef cpu_name = sys::getHostCPUName ();
 
   // EngineBuilder no longer has a copy assignment operator (?)
+  std::unique_ptr<Module> Owner(unwrap(MP));
   EngineBuilder b (std::move(Owner));
   EngineBuilder &eb = b;
 #ifdef TARGET_AMD64
@@ -616,7 +615,7 @@ mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, Func
 
 #else
 
-  EngineBuilder b (std::move(Owner));
+  EngineBuilder b (unwrap (MP));
   EngineBuilder &eb = b;
   eb = eb.setJITMemoryManager (mono_mm).setTargetOptions (opts).setAllocateGVsWithCode (true);
 #if LLVM_API_VERSION >= 1