diff options
author | Diego Novillo <dnovillo@google.com> | 2014-04-08 16:42:38 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@google.com> | 2014-04-08 16:42:38 +0000 |
commit | c6574c1aa3b3e0f1e4ce5732188d61642c1c7d19 (patch) | |
tree | 208e5fd0e6717d3cf5d5411b8317c2ed56c9d779 /llvm/lib/IR/LLVMContext.cpp | |
parent | a9298b22976513857f7c8ded491e67c6a95a04c9 (diff) | |
download | bcm5719-llvm-c6574c1aa3b3e0f1e4ce5732188d61642c1c7d19.tar.gz bcm5719-llvm-c6574c1aa3b3e0f1e4ce5732188d61642c1c7d19.zip |
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
llvm-svn: 205775
Diffstat (limited to 'llvm/lib/IR/LLVMContext.cpp')
-rw-r--r-- | llvm/lib/IR/LLVMContext.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp index 3f05561a2cb..0c922005b74 100644 --- a/llvm/lib/IR/LLVMContext.cpp +++ b/llvm/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)); } //===----------------------------------------------------------------------===// |