From 0a5d4e4ccaa7da934898917755b2b2b0a6e7b55c Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 4 Apr 2017 01:17:09 +0000 Subject: [PATCH] Partial merge of r293110 into the 4.0 branch Avoid printing optimization remarks from llc unless they are enabled. Fixes http://llvm.org/PR32184 git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_40@299409 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llc/llc.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index a76d3249674..96e851debdb 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -233,6 +233,10 @@ static void DiagnosticHandler(const DiagnosticInfo &DI, void *Context) { if (DI.getSeverity() == DS_Error) *HasError = true; + if (auto *Remark = dyn_cast(&DI)) + if (!Remark->isEnabled()) + return; + DiagnosticPrinterRawOStream DP(errs()); errs() << LLVMContext::getDiagnosticMessagePrefix(DI.getSeverity()) << ": "; DI.print(DP); -- 2.40.0