From a2a3bbc668cdebcc87e18e93b4576d59dfab625c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 20 Aug 2010 00:56:16 +0000 Subject: [PATCH] Minor cleanups to follow the common convention for pass registration variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111596 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint-passes/TestPasses.cpp | 12 ++++++------ tools/opt/AnalysisWrappers.cpp | 14 ++++++++------ tools/opt/GraphPrinters.cpp | 16 ++++++++-------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/tools/bugpoint-passes/TestPasses.cpp b/tools/bugpoint-passes/TestPasses.cpp index 4ae23f5b762..1535b038856 100644 --- a/tools/bugpoint-passes/TestPasses.cpp +++ b/tools/bugpoint-passes/TestPasses.cpp @@ -41,12 +41,12 @@ namespace { return false; } }; +} - char CrashOnCalls::ID = 0; - RegisterPass +char CrashOnCalls::ID = 0; +static RegisterPass X("bugpoint-crashcalls", "BugPoint Test Pass - Intentionally crash on CallInsts"); -} namespace { /// DeleteCalls - This pass is used to test bugpoint. It intentionally @@ -67,9 +67,9 @@ namespace { return false; } }; +} - char DeleteCalls::ID = 0; - RegisterPass +char DeleteCalls::ID = 0; +static RegisterPass Y("bugpoint-deletecalls", "BugPoint Test Pass - Intentionally 'misoptimize' CallInsts"); -} diff --git a/tools/opt/AnalysisWrappers.cpp b/tools/opt/AnalysisWrappers.cpp index 2fe5d226ec7..a2b57bb3e11 100644 --- a/tools/opt/AnalysisWrappers.cpp +++ b/tools/opt/AnalysisWrappers.cpp @@ -66,12 +66,14 @@ namespace { AU.setPreservesAll(); } }; +} - char ExternalFunctionsPassedConstants::ID = 0; - RegisterPass +char ExternalFunctionsPassedConstants::ID = 0; +static RegisterPass P1("print-externalfnconstants", "Print external fn callsites passed constants"); +namespace { struct CallGraphPrinter : public ModulePass { static char ID; // Pass ID, replacement for typeid CallGraphPrinter() : ModulePass(ID) {} @@ -85,8 +87,8 @@ namespace { return false; } }; - - char CallGraphPrinter::ID = 0; - RegisterPass - P2("print-callgraph", "Print a call graph"); } + +char CallGraphPrinter::ID = 0; +static RegisterPass + P2("print-callgraph", "Print a call graph"); diff --git a/tools/opt/GraphPrinters.cpp b/tools/opt/GraphPrinters.cpp index fa4339a0554..6a9e96516db 100644 --- a/tools/opt/GraphPrinters.cpp +++ b/tools/opt/GraphPrinters.cpp @@ -79,12 +79,12 @@ namespace { AU.setPreservesAll(); } }; - - char CallGraphPrinter::ID = 0; - RegisterPass P2("dot-callgraph", - "Print Call Graph to 'dot' file"); } +char CallGraphPrinter::ID = 0; +static RegisterPass P2("dot-callgraph", + "Print Call Graph to 'dot' file"); + //===----------------------------------------------------------------------===// // DomInfoPrinter Pass //===----------------------------------------------------------------------===// @@ -110,8 +110,8 @@ namespace { return false; } }; - - char DomInfoPrinter::ID = 0; - static RegisterPass - DIP("print-dom-info", "Dominator Info Printer", true, true); } + +char DomInfoPrinter::ID = 0; +static RegisterPass +DIP("print-dom-info", "Dominator Info Printer", true, true); -- 2.34.1