From 7e6723e35694b3419a9d580f269d1db2f8cd10fd Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 6 Jan 2015 04:49:38 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225245 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/opt/Passes.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tools/opt/Passes.cpp b/tools/opt/Passes.cpp index 3acd0f3742c..90738620623 100644 --- a/tools/opt/Passes.cpp +++ b/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()); \ -- 2.34.1