summaryrefslogtreecommitdiff
path: root/lib/IR/LLVMContext.cpp
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2014-04-08 16:42:38 +0000
committerDiego Novillo <dnovillo@google.com>2014-04-08 16:42:38 +0000
commit35d647b6f371265519df465ad1e7b28de7515185 (patch)
treead63e722df8f390fd5ad581e07aebba71c5bb7e9 /lib/IR/LLVMContext.cpp
parentccbf1d2a05a63f18bedbeddffe930cc70d5f5823 (diff)
downloadllvm-35d647b6f371265519df465ad1e7b28de7515185.tar.gz
llvm-35d647b6f371265519df465ad1e7b28de7515185.tar.bz2
llvm-35d647b6f371265519df465ad1e7b28de7515185.tar.xz
Add -pass-remarks flag to 'opt'.
Summary: This adds support in 'opt' to filter pass remarks emitted by optimization passes. A new flag -pass-remarks specifies which passes should emit a diagnostic when LLVMContext::emitOptimizationRemark is invoked. This will allow the front end to simply pass along the regular expression from its own -Rpass flag when launching the backend. Depends on D3227. Reviewers: qcolombet CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3291 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205775 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/LLVMContext.cpp')
-rw-r--r--lib/IR/LLVMContext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/IR/LLVMContext.cpp b/lib/IR/LLVMContext.cpp
index 3f05561a2c..0c922005b7 100644
--- a/lib/IR/LLVMContext.cpp
+++ b/lib/IR/LLVMContext.cpp
@@ -160,7 +160,8 @@ void LLVMContext::emitOptimizationRemark(const char *PassName,
const Function &Fn,
const DebugLoc &DLoc,
const Twine &Msg) {
- diagnose(DiagnosticInfoOptimizationRemark(PassName, Fn, DLoc, Msg));
+ if (pImpl->optimizationRemarksEnabledFor(PassName))
+ diagnose(DiagnosticInfoOptimizationRemark(PassName, Fn, DLoc, Msg));
}
//===----------------------------------------------------------------------===//