clover: Move back to using build_error to signal compilation failure.
This partially reverts 7e0180d57d
.
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>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user