From: Tim Northover Date: Thu, 31 Mar 2016 19:19:24 +0000 (+0000) Subject: Diagnostics: remove dodgy handler for bitcode inlineasm diagnostics. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=362757ea7a3a3c3ca97215a02a1949b2aefce4bb;p=clang Diagnostics: remove dodgy handler for bitcode inlineasm diagnostics. Whatever crash it was there to present appears to have been fixed in the backend now, and it had the nasty side-effect of causing clang to exit(0) and leave a .o containing goodness knows what even when an error hit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265038 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenAction.cpp b/lib/CodeGen/CodeGenAction.cpp index edd258d3d5..658c2b8c77 100644 --- a/lib/CodeGen/CodeGenAction.cpp +++ b/lib/CodeGen/CodeGenAction.cpp @@ -756,12 +756,6 @@ CodeGenAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { return std::move(Result); } -static void BitcodeInlineAsmDiagHandler(const llvm::SMDiagnostic &SM, - void *Context, - unsigned LocCookie) { - SM.print(nullptr, llvm::errs()); -} - void CodeGenAction::ExecuteAction() { // If this is an IR file, we have to treat it specially. if (getCurrentFileKind() == IK_LLVM_IR) { @@ -810,8 +804,6 @@ void CodeGenAction::ExecuteAction() { TheModule->setTargetTriple(TargetOpts.Triple); } - LLVMContext &Ctx = TheModule->getContext(); - Ctx.setInlineAsmDiagnosticHandler(BitcodeInlineAsmDiagHandler); EmitBackendOutput(CI.getDiagnostics(), CI.getCodeGenOpts(), TargetOpts, CI.getLangOpts(), CI.getTarget().getDataLayout(), TheModule.get(), BA, OS); diff --git a/test/CodeGen/asm-errors.c b/test/CodeGen/asm-errors.c index 7042f313d7..7edce64f20 100644 --- a/test/CodeGen/asm-errors.c +++ b/test/CodeGen/asm-errors.c @@ -3,7 +3,7 @@ // RUN: not %clang_cc1 -triple i386-apple-darwin10 -emit-obj %s -o /dev/null > %t 2>&1 // RUN: FileCheck %s < %t // RUN: %clang_cc1 -triple i386-apple-darwin10 -emit-llvm-bc %s -o %t.bc -// RUN: %clang_cc1 -triple i386-apple-darwin10 -emit-obj %t.bc -o /dev/null 2>&1 | \ +// RUN: not %clang_cc1 -triple i386-apple-darwin10 -emit-obj %t.bc -o /dev/null 2>&1 | \ // RUN: FileCheck --check-prefix=CRASH-REPORT %s // CRASH-REPORT: : // CRASH-REPORT: error: invalid instruction mnemonic 'abc'