forked from OSchip/llvm-project
Propagate a better error message to the C api.
llvm-svn: 227934
This commit is contained in:
parent
6a196ce691
commit
dcfd6ed183
|
@ -41,9 +41,11 @@ LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
|
|||
|
||||
ErrorOr<Module *> ModuleOrErr = parseBitcodeFile(
|
||||
Buf, Ctx, [&](const DiagnosticInfo &DI) { DI.print(DP); });
|
||||
if (std::error_code EC = ModuleOrErr.getError()) {
|
||||
if (OutMessage)
|
||||
*OutMessage = strdup(EC.message().c_str());
|
||||
if (ModuleOrErr.getError()) {
|
||||
if (OutMessage) {
|
||||
Stream.flush();
|
||||
*OutMessage = strdup(Message.c_str());
|
||||
}
|
||||
*OutModule = wrap((Module*)nullptr);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
; RUN: not llvm-c-test --module-dump < %S/Inputs/invalid.ll.bc 2>&1 | FileCheck %s
|
||||
|
||||
CHECK: Error parsing bitcode: Corrupted bitcode
|
||||
CHECK: Error parsing bitcode: Unknown attribute kind (48)
|
||||
|
|
Loading…
Reference in New Issue