From 27829ec5ff18e5d055e3727360567f761b3269b1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 12 Apr 2004 05:38:01 +0000 Subject: [PATCH] finegrainify namespacification git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12862 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/analyze/GraphPrinters.cpp | 33 ++++++++++++++++----------------- tools/opt/GraphPrinters.cpp | 33 ++++++++++++++++----------------- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/tools/analyze/GraphPrinters.cpp b/tools/analyze/GraphPrinters.cpp index 6d2750f5e2e..fc74c480cf2 100644 --- a/tools/analyze/GraphPrinters.cpp +++ b/tools/analyze/GraphPrinters.cpp @@ -19,8 +19,7 @@ #include "llvm/Value.h" #include "llvm/Analysis/CallGraph.h" #include - -namespace llvm { +using namespace llvm; template static void WriteGraphToFile(std::ostream &O, const std::string &GraphName, @@ -41,19 +40,21 @@ static void WriteGraphToFile(std::ostream &O, const std::string &GraphName, // Call Graph Printer //===----------------------------------------------------------------------===// -template<> -struct DOTGraphTraits : public DefaultDOTGraphTraits { - static std::string getGraphName(CallGraph *F) { - return "Call Graph"; - } - - static std::string getNodeLabel(CallGraphNode *Node, CallGraph *Graph) { - if (Node->getFunction()) - return ((Value*)Node->getFunction())->getName(); - else - return "Indirect call node"; - } -}; +namespace llvm { + template<> + struct DOTGraphTraits : public DefaultDOTGraphTraits { + static std::string getGraphName(CallGraph *F) { + return "Call Graph"; + } + + static std::string getNodeLabel(CallGraphNode *Node, CallGraph *Graph) { + if (Node->getFunction()) + return ((Value*)Node->getFunction())->getName(); + else + return "Indirect call node"; + } + }; +} namespace { @@ -74,5 +75,3 @@ namespace { RegisterAnalysis P2("print-callgraph", "Print Call Graph to 'dot' file"); }; - -} // End llvm namespace diff --git a/tools/opt/GraphPrinters.cpp b/tools/opt/GraphPrinters.cpp index 6d2750f5e2e..fc74c480cf2 100644 --- a/tools/opt/GraphPrinters.cpp +++ b/tools/opt/GraphPrinters.cpp @@ -19,8 +19,7 @@ #include "llvm/Value.h" #include "llvm/Analysis/CallGraph.h" #include - -namespace llvm { +using namespace llvm; template static void WriteGraphToFile(std::ostream &O, const std::string &GraphName, @@ -41,19 +40,21 @@ static void WriteGraphToFile(std::ostream &O, const std::string &GraphName, // Call Graph Printer //===----------------------------------------------------------------------===// -template<> -struct DOTGraphTraits : public DefaultDOTGraphTraits { - static std::string getGraphName(CallGraph *F) { - return "Call Graph"; - } - - static std::string getNodeLabel(CallGraphNode *Node, CallGraph *Graph) { - if (Node->getFunction()) - return ((Value*)Node->getFunction())->getName(); - else - return "Indirect call node"; - } -}; +namespace llvm { + template<> + struct DOTGraphTraits : public DefaultDOTGraphTraits { + static std::string getGraphName(CallGraph *F) { + return "Call Graph"; + } + + static std::string getNodeLabel(CallGraphNode *Node, CallGraph *Graph) { + if (Node->getFunction()) + return ((Value*)Node->getFunction())->getName(); + else + return "Indirect call node"; + } + }; +} namespace { @@ -74,5 +75,3 @@ namespace { RegisterAnalysis P2("print-callgraph", "Print Call Graph to 'dot' file"); }; - -} // End llvm namespace -- 2.34.1