clover/llvm: Fold compile_native() call into build_module_native().
authorFrancisco Jerez <currojerez@riseup.net>
Tue, 28 Jun 2016 06:46:26 +0000 (23:46 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Tue, 12 Jul 2016 03:22:56 +0000 (20:22 -0700)
Reviewed-by: Serge Martin <edb+mesa@sigluy.net>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
src/gallium/state_trackers/clover/llvm/invocation.cpp

index 242c096107f1d73ad513f8e0aa9924585faaeff1..754e477bd292ca0a242bf4b74b81599ae2ac490e 100644 (file)
@@ -673,10 +673,10 @@ namespace {
    }
 
    module
-   build_module_native(std::vector<char> &code,
-                       llvm::Module *mod,
+   build_module_native(llvm::Module *mod, const target &target,
                        const clang::CompilerInstance &c,
                        std::string &r_log) {
+      const auto code = compile_native(mod, target, r_log);
       return build_module_common(*mod, code,
                                  get_symbol_offsets(code, r_log), c);
    }
@@ -721,11 +721,9 @@ clover::compile_program_llvm(const std::string &source,
       case PIPE_SHADER_IR_LLVM:
          m = build_module_llvm(&*mod, *c);
          break;
-      case PIPE_SHADER_IR_NATIVE: {
-         std::vector<char> code = compile_native(&*mod, target, r_log);
-         m = build_module_native(code, &*mod, *c, r_log);
+      case PIPE_SHADER_IR_NATIVE:
+         m = build_module_native(&*mod, target, *c, r_log);
          break;
-      }
    }
 
    return m;