From 619bfa47e3c6dbaa0b53ef6f2fefd8bb41b2af0f Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 14 May 2007 14:21:46 +0000 Subject: [PATCH] Add a addRequiredTransitiveID member function, which is to addRequiredTransitive as addRequiredID is to addRequired. llvm-svn: 37031 --- llvm/include/llvm/PassAnalysisSupport.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/llvm/include/llvm/PassAnalysisSupport.h b/llvm/include/llvm/PassAnalysisSupport.h index 75434a25ef2b..0454f2143fe7 100644 --- a/llvm/include/llvm/PassAnalysisSupport.h +++ b/llvm/include/llvm/PassAnalysisSupport.h @@ -44,24 +44,26 @@ public: // for a pass. // AnalysisUsage &addRequiredID(AnalysisID ID) { + assert(ID && "Pass class not registered!"); Required.push_back(ID); return *this; } template AnalysisUsage &addRequired() { - assert(Pass::getClassPassInfo() && "Pass class not registered!"); - Required.push_back(Pass::getClassPassInfo()); - return *this; + return addRequiredID(Pass::getClassPassInfo()); } - template - AnalysisUsage &addRequiredTransitive() { - AnalysisID ID = Pass::getClassPassInfo(); + AnalysisUsage &addRequiredTransitiveID(AnalysisID ID) { assert(ID && "Pass class not registered!"); Required.push_back(ID); RequiredTransitive.push_back(ID); return *this; } + template + AnalysisUsage &addRequiredTransitive() { + AnalysisID ID = Pass::getClassPassInfo(); + return addRequiredTransitiveID(ID); + } // addPreserved - Add the specified ID to the set of analyses preserved by // this pass