[llvm-commits] CVS: llvm/tools/analyze/GraphPrinters.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Apr 12 00:38:04 PDT 2004
Changes in directory llvm/tools/analyze:
GraphPrinters.cpp updated: 1.6 -> 1.7
---
Log message:
finegrainify namespacification
---
Diffs of the changes: (+16 -17)
Index: llvm/tools/analyze/GraphPrinters.cpp
diff -u llvm/tools/analyze/GraphPrinters.cpp:1.6 llvm/tools/analyze/GraphPrinters.cpp:1.7
--- llvm/tools/analyze/GraphPrinters.cpp:1.6 Tue Nov 11 16:41:34 2003
+++ llvm/tools/analyze/GraphPrinters.cpp Mon Apr 12 00:38:01 2004
@@ -19,8 +19,7 @@
#include "llvm/Value.h"
#include "llvm/Analysis/CallGraph.h"
#include <fstream>
-
-namespace llvm {
+using namespace llvm;
template<typename GraphType>
static void WriteGraphToFile(std::ostream &O, const std::string &GraphName,
@@ -41,19 +40,21 @@
// Call Graph Printer
//===----------------------------------------------------------------------===//
-template<>
-struct DOTGraphTraits<CallGraph*> : 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<CallGraph*> : 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 @@
RegisterAnalysis<CallGraphPrinter> P2("print-callgraph",
"Print Call Graph to 'dot' file");
};
-
-} // End llvm namespace
More information about the llvm-commits
mailing list