swr: [rasterizer jitter] Clean up EngineBuilder construction
authorTim Rowley <timothy.o.rowley@intel.com>
Tue, 21 Mar 2017 00:44:49 +0000 (19:44 -0500)
committerTim Rowley <timothy.o.rowley@intel.com>
Tue, 28 Mar 2017 16:24:14 +0000 (11:24 -0500)
Reviewed-by: George Kyriazis <george.kyriazis@intel.com>
src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp

index 79118f5f65ca48417a59c0960cddd1d0a9738a8e..bdb8a52e2fcb2508136af45cc0c7669a2a956c6a 100644 (file)
@@ -106,16 +106,10 @@ JitManager::JitManager(uint32_t simdWidth, const char *arch, const char* core)
     std::unique_ptr<Module> newModule(new Module(fnName.str(), mContext));
     mpCurrentModule = newModule.get();
 
-    auto &&EB = EngineBuilder(std::move(newModule));
-    EB.setTargetOptions(tOpts);
-    EB.setOptLevel(CodeGenOpt::Aggressive);
-
     StringRef hostCPUName;
 
     hostCPUName = sys::getHostCPUName();
 
-    EB.setMCPU(hostCPUName);
-
 #if defined(_WIN32)
     // Needed for MCJIT on windows
     Triple hostTriple(sys::getProcessTriple());
@@ -123,7 +117,11 @@ JitManager::JitManager(uint32_t simdWidth, const char *arch, const char* core)
     mpCurrentModule->setTargetTriple(hostTriple.getTriple());
 #endif // _WIN32
 
-    mpExec = EB.create();
+    mpExec = EngineBuilder(std::move(newModule))
+        .setTargetOptions(tOpts)
+        .setOptLevel(CodeGenOpt::Aggressive)
+        .setMCPU(hostCPUName)
+        .create();
 
 #if LLVM_USE_INTEL_JITEVENTS
     JITEventListener *vTune = JITEventListener::createIntelJITEventListener();