LLVMReactor: Build fixes for REACTOR_EMIT_DEBUG_INFO

Always use toLLVM() to avoid a compiler warning / error that the function was declared by never used.

Fix the arguments passed to the DebugInfo constructor.

Change-Id: I1df069c028c9bfcf1f8e7f4221ffffd4f0261069
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/34329
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp
index c5e4e0f..106ac35 100644
--- a/src/Reactor/LLVMReactor.cpp
+++ b/src/Reactor/LLVMReactor.cpp
@@ -197,7 +197,7 @@
 		return targetMachines.getOrCreate(static_cast<int>(optlevel), [&]() {
 			return TargetMachineSPtr(llvm::EngineBuilder()
 #ifdef ENABLE_RR_DEBUG_INFO
-				.setOptLevel(llvm::CodeGenOpt::None)
+				.setOptLevel(toLLVM(rr::Optimization::Level::None))
 #else
 				.setOptLevel(toLLVM(optlevel))
 #endif // ENABLE_RR_DEBUG_INFO
@@ -1329,7 +1329,7 @@
 		jit->function = rr::createFunction("", T(ReturnType), T(Params));
 
 #ifdef ENABLE_RR_DEBUG_INFO
-		jit->debugInfo = std::unique_ptr<DebugInfo>(new DebugInfo(jit->builder, jit->context, jit->module.get(), jit->function));
+		jit->debugInfo = std::unique_ptr<DebugInfo>(new DebugInfo(jit->builder.get(), &jit->context, jit->module.get(), jit->function));
 #endif // ENABLE_RR_DEBUG_INFO
 
 		jit->builder->SetInsertPoint(llvm::BasicBlock::Create(jit->context, "", jit->function));