diff options
author | Matt Arsenault <[email protected]> | 2014-06-09 22:21:52 -0700 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2014-07-02 15:15:13 -0400 |
commit | 2ab44f657e3c8800aa610d39a04e88d6bf3bad01 (patch) | |
tree | 5ea06be3afb1ad840ba182772bf04f775c3cd92a /src/gallium/state_trackers/clover/llvm | |
parent | d2504ead2f7eb02b6a33545de2cf1b5957306fd6 (diff) |
clover: Fix not setting build log if the build succeeds v2
If there were only warnings, they would not be added to the log.
v2:
- Use compat::string.
Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover/llvm')
-rw-r--r-- | src/gallium/state_trackers/clover/llvm/invocation.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index c3daa817938..5d2efc4461c 100644 --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp @@ -120,7 +120,7 @@ namespace { compile(llvm::LLVMContext &llvm_ctx, const std::string &source, const std::string &name, const std::string &triple, const std::string &processor, const std::string &opts, - clang::LangAS::Map& address_spaces) { + clang::LangAS::Map& address_spaces, compat::string &r_log) { clang::CompilerInstance c; clang::EmitLLVMOnlyAction act(&llvm_ctx); @@ -224,11 +224,14 @@ namespace { c.getCodeGenOpts().LinkBitcodeFile = libclc_path; // Compile the code - if (!c.ExecuteAction(act)) - throw build_error(log); + bool ExecSuccess = c.ExecuteAction(act); + r_log = log; + + if (!ExecSuccess) + throw build_error(); // Get address spaces map to be able to find kernel argument address space - memcpy(address_spaces, c.getTarget().getAddressSpaceMap(), + memcpy(address_spaces, c.getTarget().getAddressSpaceMap(), sizeof(address_spaces)); return act.takeModule(); @@ -391,7 +394,8 @@ module clover::compile_program_llvm(const compat::string &source, enum pipe_shader_ir ir, const compat::string &target, - const compat::string &opts) { + const compat::string &opts, + compat::string &r_log) { std::vector<llvm::Function *> kernels; size_t processor_str_len = std::string(target.begin()).find_first_of("-"); @@ -405,7 +409,7 @@ clover::compile_program_llvm(const compat::string &source, // The input file name must have the .cl extension in order for the // CompilerInvocation class to recognize it as an OpenCL source file. llvm::Module *mod = compile(llvm_ctx, source, "input.cl", triple, processor, - opts, address_spaces); + opts, address_spaces, r_log); find_kernels(mod, kernels); |