From: Chandler Carruth Date: Tue, 6 Jan 2015 04:49:38 +0000 (+0000) Subject: [PM] Simplify how we use the registry by including it only once. Still X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2be089def565b34c12808ff635a974440d674919;p=platform%2Fupstream%2Fllvm.git [PM] Simplify how we use the registry by including it only once. Still more verbose than I'd like, but the code really isn't that interesting, and this still seems vastly simpler than any other solutions I've come up with. =] Maybe if we get to the 10th IR unit, this will be a problem in practice. llvm-svn: 225245 --- diff --git a/llvm/tools/opt/Passes.cpp b/llvm/tools/opt/Passes.cpp index 3acd0f3..9073862 100644 --- a/llvm/tools/opt/Passes.cpp +++ b/llvm/tools/opt/Passes.cpp @@ -104,9 +104,6 @@ void llvm::registerFunctionAnalyses(FunctionAnalysisManager &FAM) { static bool isModulePassName(StringRef Name) { #define MODULE_PASS(NAME, CREATE_PASS) if (Name == NAME) return true; -#include "PassRegistry.def" - - // We also support building a require pass around any analysis. #define MODULE_ANALYSIS(NAME, CREATE_PASS) \ if (Name == "require<" NAME ">") \ return true; @@ -117,9 +114,6 @@ static bool isModulePassName(StringRef Name) { static bool isCGSCCPassName(StringRef Name) { #define CGSCC_PASS(NAME, CREATE_PASS) if (Name == NAME) return true; -#include "PassRegistry.def" - - // We also support building a require pass around any analysis. #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \ if (Name == "require<" NAME ">") \ return true; @@ -130,9 +124,6 @@ static bool isCGSCCPassName(StringRef Name) { static bool isFunctionPassName(StringRef Name) { #define FUNCTION_PASS(NAME, CREATE_PASS) if (Name == NAME) return true; -#include "PassRegistry.def" - - // We also support building a require pass around any analysis. #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \ if (Name == "require<" NAME ">") \ return true; @@ -147,9 +138,6 @@ static bool parseModulePassName(ModulePassManager &MPM, StringRef Name) { MPM.addPass(CREATE_PASS); \ return true; \ } -#include "PassRegistry.def" - - // We also support building a require pass around any analysis. #define MODULE_ANALYSIS(NAME, CREATE_PASS) \ if (Name == "require<" NAME ">") { \ MPM.addPass(NoopAnalysisRequirementPass()); \ @@ -166,9 +154,6 @@ static bool parseCGSCCPassName(CGSCCPassManager &CGPM, StringRef Name) { CGPM.addPass(CREATE_PASS); \ return true; \ } -#include "PassRegistry.def" - - // We also support building a require pass around any analysis. #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \ if (Name == "require<" NAME ">") { \ CGPM.addPass(NoopAnalysisRequirementPass()); \ @@ -185,9 +170,6 @@ static bool parseFunctionPassName(FunctionPassManager &FPM, StringRef Name) { FPM.addPass(CREATE_PASS); \ return true; \ } -#include "PassRegistry.def" - - // We also support building a require pass around any analysis. #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \ if (Name == "require<" NAME ">") { \ FPM.addPass(NoopAnalysisRequirementPass()); \