[llvm-commits] [llvm] r115900 - in /llvm/trunk: include/llvm/PassSupport.h lib/Analysis/DbgInfoPrinter.cpp lib/Analysis/RegionPrinter.cpp lib/Transforms/Utils/InstructionNamer.cpp
Owen Anderson
resistor at mac.com
Wed Oct 6 21:13:09 PDT 2010
Author: resistor
Date: Wed Oct 6 23:13:08 2010
New Revision: 115900
URL: http://llvm.org/viewvc/llvm-project?rev=115900&view=rev
Log:
Move the pass initialization helper functions into the llvm namespace, and add
a header declaring them all. This is also where we will declare per-library pass-set
initializer functions down the road.
Modified:
llvm/trunk/include/llvm/PassSupport.h
llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp
llvm/trunk/lib/Analysis/RegionPrinter.cpp
llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp
Modified: llvm/trunk/include/llvm/PassSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=115900&r1=115899&r2=115900&view=diff
==============================================================================
--- llvm/trunk/include/llvm/PassSupport.h (original)
+++ llvm/trunk/include/llvm/PassSupport.h Wed Oct 6 23:13:08 2010
@@ -23,6 +23,7 @@
#include "Pass.h"
#include "llvm/PassRegistry.h"
+#include "llvm/InitializePasses.h"
#include <vector>
namespace llvm {
@@ -128,7 +129,7 @@
};
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis) \
- void initialize##passName##Pass(PassRegistry &Registry) { \
+ void llvm::initialize##passName##Pass(PassRegistry &Registry) { \
PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \
PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis); \
Registry.registerPass(*PI); \
@@ -211,14 +212,14 @@
};
#define INITIALIZE_ANALYSIS_GROUP(agName, name) \
- void initialize##agName##AnalysisGroup(PassRegistry &Registry) { \
+ void llvm::initialize##agName##AnalysisGroup(PassRegistry &Registry) { \
PassInfo *AI = new PassInfo(name, & agName :: ID); \
Registry.registerAnalysisGroup(& agName ::ID, 0, *AI, false); \
} \
static RegisterAnalysisGroup<agName> agName##_info (name)
#define INITIALIZE_AG_PASS(passName, agName, arg, name, cfg, analysis, def) \
- void initialize##passName##Pass(PassRegistry &Registry) { \
+ void llvm::initialize##passName##Pass(PassRegistry &Registry) { \
PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \
PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis); \
Registry.registerPass(*PI); \
Modified: llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp?rev=115900&r1=115899&r2=115900&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp (original)
+++ llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp Wed Oct 6 23:13:08 2010
@@ -48,10 +48,11 @@
}
};
char PrintDbgInfo::ID = 0;
- INITIALIZE_PASS(PrintDbgInfo, "print-dbginfo",
- "Print debug info in human readable form", false, false);
}
+INITIALIZE_PASS(PrintDbgInfo, "print-dbginfo",
+ "Print debug info in human readable form", false, false);
+
FunctionPass *llvm::createDbgInfoPrinterPass() { return new PrintDbgInfo(); }
void PrintDbgInfo::printVariableDeclaration(const Value *V) {
Modified: llvm/trunk/lib/Analysis/RegionPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionPrinter.cpp?rev=115900&r1=115899&r2=115900&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/RegionPrinter.cpp (original)
+++ llvm/trunk/lib/Analysis/RegionPrinter.cpp Wed Oct 6 23:13:08 2010
@@ -123,21 +123,14 @@
static char ID;
RegionViewer() : DOTGraphTraitsViewer<RegionInfo, false>("reg", ID){}
};
-
char RegionViewer::ID = 0;
-INITIALIZE_PASS(RegionViewer, "view-regions", "View regions of function",
- true, true);
struct RegionOnlyViewer
: public DOTGraphTraitsViewer<RegionInfo, true> {
static char ID;
RegionOnlyViewer() : DOTGraphTraitsViewer<RegionInfo, true>("regonly", ID){}
};
-
char RegionOnlyViewer::ID = 0;
-INITIALIZE_PASS(RegionOnlyViewer, "view-regions-only",
- "View regions of function (with no function bodies)",
- true, true);
struct RegionPrinter
: public DOTGraphTraitsPrinter<RegionInfo, false> {
@@ -145,12 +138,19 @@
RegionPrinter() :
DOTGraphTraitsPrinter<RegionInfo, false>("reg", ID) {}
};
+char RegionPrinter::ID = 0;
} //end anonymous namespace
-char RegionPrinter::ID = 0;
INITIALIZE_PASS(RegionPrinter, "dot-regions",
"Print regions of function to 'dot' file", true, true);
+INITIALIZE_PASS(RegionViewer, "view-regions", "View regions of function",
+ true, true);
+
+INITIALIZE_PASS(RegionOnlyViewer, "view-regions-only",
+ "View regions of function (with no function bodies)",
+ true, true);
+
namespace {
struct RegionOnlyPrinter
Modified: llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp?rev=115900&r1=115899&r2=115900&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp Wed Oct 6 23:13:08 2010
@@ -48,11 +48,10 @@
};
char InstNamer::ID = 0;
- INITIALIZE_PASS(InstNamer, "instnamer",
- "Assign names to anonymous instructions", false, false);
}
-
+INITIALIZE_PASS(InstNamer, "instnamer",
+ "Assign names to anonymous instructions", false, false);
char &llvm::InstructionNamerID = InstNamer::ID;
//===----------------------------------------------------------------------===//
//
More information about the llvm-commits
mailing list