From 5e19bfcde35b09793bd26bf37242b7b97cbee056 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Thu, 7 Oct 2010 04:13:08 +0000 Subject: 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. llvm-svn: 115900 --- llvm/lib/Analysis/DbgInfoPrinter.cpp | 5 +++-- llvm/lib/Analysis/RegionPrinter.cpp | 16 ++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'llvm/lib/Analysis') diff --git a/llvm/lib/Analysis/DbgInfoPrinter.cpp b/llvm/lib/Analysis/DbgInfoPrinter.cpp index 05677506061..ba41361c625 100644 --- a/llvm/lib/Analysis/DbgInfoPrinter.cpp +++ b/llvm/lib/Analysis/DbgInfoPrinter.cpp @@ -48,10 +48,11 @@ namespace { } }; 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) { diff --git a/llvm/lib/Analysis/RegionPrinter.cpp b/llvm/lib/Analysis/RegionPrinter.cpp index fee5c1bae97..f39a08c5732 100644 --- a/llvm/lib/Analysis/RegionPrinter.cpp +++ b/llvm/lib/Analysis/RegionPrinter.cpp @@ -123,21 +123,14 @@ struct RegionViewer static char ID; RegionViewer() : DOTGraphTraitsViewer("reg", ID){} }; - char RegionViewer::ID = 0; -INITIALIZE_PASS(RegionViewer, "view-regions", "View regions of function", - true, true); struct RegionOnlyViewer : public DOTGraphTraitsViewer { static char ID; RegionOnlyViewer() : DOTGraphTraitsViewer("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 { @@ -145,12 +138,19 @@ struct RegionPrinter RegionPrinter() : DOTGraphTraitsPrinter("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 -- cgit v1.2.3