summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover/llvm
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2016-06-19 14:31:59 -0700
committerFrancisco Jerez <currojerez@riseup.net>2016-07-11 20:34:34 -0700
commit4ef1c0918da4363aa20b7c1a91d344fae6c01942 (patch)
treefa5d65f8d020464691d4c512aa9627a6abe51c21 /src/gallium/state_trackers/clover/llvm
parent70fe6267a37dfc97ef8b6dd22a0431fcfc293d2a (diff)
downloadexternal_mesa3d-4ef1c0918da4363aa20b7c1a91d344fae6c01942.zip
external_mesa3d-4ef1c0918da4363aa20b7c1a91d344fae6c01942.tar.gz
external_mesa3d-4ef1c0918da4363aa20b7c1a91d344fae6c01942.tar.bz2
clover: Move back to using build_error to signal compilation failure.
This partially reverts 7e0180d57d330bd8d3047e841086712376b2a1cc. Having two different exception subclasses for compilation and linking makes it more difficult to share or move code between the two codepaths, because the exact same function under the same error condition would need to throw one exception or the other depending on what top-level API is being implemented with it. There is little benefit anyway because clCompileProgram() and clLinkProgram() can tell whether they are linking or compiling a program. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
Diffstat (limited to 'src/gallium/state_trackers/clover/llvm')
-rw-r--r--src/gallium/state_trackers/clover/llvm/codegen/native.cpp8
-rw-r--r--src/gallium/state_trackers/clover/llvm/invocation.cpp6
2 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/clover/llvm/codegen/native.cpp b/src/gallium/state_trackers/clover/llvm/codegen/native.cpp
index 4adb05f..b96236b 100644
--- a/src/gallium/state_trackers/clover/llvm/codegen/native.cpp
+++ b/src/gallium/state_trackers/clover/llvm/codegen/native.cpp
@@ -98,7 +98,7 @@ namespace {
const auto elf = elf::get(code);
const auto symtab = elf::get_symbol_table(elf.get());
if (!symtab)
- fail(r_log, compile_error(), "Unable to find symbol table.");
+ fail(r_log, build_error(), "Unable to find symbol table.");
return elf::get_symbol_offsets(elf.get(), symtab);
}
@@ -110,7 +110,7 @@ namespace {
std::string err;
auto t = ::llvm::TargetRegistry::lookupTarget(target.triple, err);
if (!t)
- fail(r_log, compile_error(), err);
+ fail(r_log, build_error(), err);
std::unique_ptr<TargetMachine> tm {
t->createTargetMachine(target.triple, target.cpu, "", {},
@@ -118,7 +118,7 @@ namespace {
::llvm::CodeModel::Default,
::llvm::CodeGenOpt::Default) };
if (!tm)
- fail(r_log, compile_error(),
+ fail(r_log, build_error(),
"Could not create TargetMachine: " + target.triple);
::llvm::SmallVector<char, 1024> data;
@@ -133,7 +133,7 @@ namespace {
(ft == TargetMachine::CGFT_AssemblyFile);
if (tm->addPassesToEmitFile(pm, fos, ft))
- fail(r_log, compile_error(), "TargetMachine can't emit this file");
+ fail(r_log, build_error(), "TargetMachine can't emit this file");
pm.run(mod);
}
diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index 40b00b7..db3b481 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -70,7 +70,7 @@ namespace {
raw_string_ostream os { *reinterpret_cast<std::string *>(data) };
::llvm::DiagnosticPrinterRawOStream printer { os };
di.print(printer);
- throw compile_error();
+ throw build_error();
}
}
@@ -173,7 +173,7 @@ namespace {
// Compile the code
clang::EmitLLVMOnlyAction act(&ctx);
if (!c.ExecuteAction(act))
- throw compile_error();
+ throw build_error();
return act.takeModule();
}
@@ -241,7 +241,7 @@ namespace {
for (auto &m : modules) {
if (compat::link_in_module(*linker,
parse_module_library(m, ctx, r_log)))
- throw compile_error();
+ throw build_error();
}
return std::move(mod);