diff options
author | Diego Novillo <dnovillo@google.com> | 2014-05-22 14:19:46 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@google.com> | 2014-05-22 14:19:46 +0000 |
commit | 7f8af8bf91ac2d33eceac932e3f5282ab2db25ba (patch) | |
tree | b06d9fa0fdd5966834b5095d553f2c184128e61c /llvm/lib/IR/LLVMContextImpl.h | |
parent | 8ff177ede3a1647b71a7db11e273f3dd81ef0ccb (diff) | |
download | bcm5719-llvm-7f8af8bf91ac2d33eceac932e3f5282ab2db25ba.tar.gz bcm5719-llvm-7f8af8bf91ac2d33eceac932e3f5282ab2db25ba.zip |
Add support for missed and analysis optimization remarks.
Summary:
This adds two new diagnostics: -pass-remarks-missed and
-pass-remarks-analysis. They take the same values as -pass-remarks but
are intended to be triggered in different contexts.
-pass-remarks-missed is used by LLVMContext::emitOptimizationRemarkMissed,
which passes call when they tried to apply a transformation but
couldn't.
-pass-remarks-analysis is used by LLVMContext::emitOptimizationRemarkAnalysis,
which passes call when they want to inform the user about analysis
results.
The patch also:
1- Adds support in the inliner for the two new remarks and a
test case.
2- Moves emitOptimizationRemark* functions to the llvm namespace.
3- Adds an LLVMContext argument instead of making them member functions
of LLVMContext.
Reviewers: qcolombet
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D3682
llvm-svn: 209442
Diffstat (limited to 'llvm/lib/IR/LLVMContextImpl.h')
-rw-r--r-- | llvm/lib/IR/LLVMContextImpl.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h index b1ad9ff4a5a..6ad9b8a70af 100644 --- a/llvm/lib/IR/LLVMContextImpl.h +++ b/llvm/lib/IR/LLVMContextImpl.h @@ -37,6 +37,9 @@ namespace llvm { class ConstantInt; class ConstantFP; +class DiagnosticInfoOptimizationRemark; +class DiagnosticInfoOptimizationRemarkMissed; +class DiagnosticInfoOptimizationRemarkAnalysis; class LLVMContext; class Type; class Value; @@ -373,7 +376,12 @@ public: /// \brief Return true if the given pass name should emit optimization /// remarks. - bool optimizationRemarksEnabledFor(const char *PassName) const; + bool optimizationRemarkEnabledFor( + const DiagnosticInfoOptimizationRemark *DI) const; + bool optimizationRemarkEnabledFor( + const DiagnosticInfoOptimizationRemarkMissed *DI) const; + bool optimizationRemarkEnabledFor( + const DiagnosticInfoOptimizationRemarkAnalysis *DI) const; int getOrAddScopeRecordIdxEntry(MDNode *N, int ExistingIdx); int getOrAddScopeInlinedAtIdxEntry(MDNode *Scope, MDNode *IA,int ExistingIdx); |