diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
commit | cd749a9c07f1de2fb8affde90537efa4bc3e7c54 (patch) | |
tree | b21f6de4e08b89bb7931806bab798fc2a5e3a686 /include/llvm/PassAnalysisSupport.h | |
parent | 72621d11de5b873f1695f391eb95f0b336c3d2d4 (diff) | |
download | FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.zip FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.tar.gz |
Update llvm to r84119.
Diffstat (limited to 'include/llvm/PassAnalysisSupport.h')
-rw-r--r-- | include/llvm/PassAnalysisSupport.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/llvm/PassAnalysisSupport.h b/include/llvm/PassAnalysisSupport.h index b09ba45..f339481 100644 --- a/include/llvm/PassAnalysisSupport.h +++ b/include/llvm/PassAnalysisSupport.h @@ -24,6 +24,8 @@ namespace llvm { +class StringRef; + // No need to include Pass.h, we are being included by it! //===----------------------------------------------------------------------===// @@ -79,6 +81,9 @@ public: return *this; } + // addPreserved - Add the specified Pass class to the set of analyses + // preserved by this pass. + // template<class PassClass> AnalysisUsage &addPreserved() { assert(Pass::getClassPassInfo<PassClass>() && "Pass class not registered!"); @@ -86,6 +91,18 @@ public: return *this; } + // addPreserved - Add the Pass with the specified argument string to the set + // of analyses preserved by this pass. If no such Pass exists, do nothing. + // This can be useful when a pass is trivially preserved, but may not be + // linked in. Be careful about spelling! + // + AnalysisUsage &addPreserved(const StringRef &Arg) { + const PassInfo *PI = Pass::lookupPassInfo(Arg); + // If the pass exists, preserve it. Otherwise silently do nothing. + if (PI) Preserved.push_back(PI); + return *this; + } + // setPreservesAll - Set by analyses that do not transform their input at all void setPreservesAll() { PreservesAll = true; } bool getPreservesAll() const { return PreservesAll; } |