llvm.org GIT mirror llvm / 778aacb
[modules] "Specialize" a function by actually specializing a function template rather than by adding an overload and hoping that it's declared before the code that calls it. (In a modules build, it isn't.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207133 91177308-0d34-0410-b5e6-96231b3b80d8 Richard Smith 6 years ago
2 changed file(s) with 9 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
5858 void getAnalysisUsage(AnalysisUsage&) const override;
5959 };
6060
61 /// Specialize WriteGraph, the standard implementation won't work.
62 raw_ostream &WriteGraph(raw_ostream &O, const EdgeBundles &G,
63 bool ShortNames = false,
64 const Twine &Title = "");
65
6661 } // end namespace llvm
6762
6863 #endif
6868 return false;
6969 }
7070
71 /// view - Visualize the annotated bipartite CFG with Graphviz.
72 void EdgeBundles::view() const {
73 ViewGraph(*this, "EdgeBundles");
74 }
75
7671 /// Specialize WriteGraph, the standard implementation won't work.
77 raw_ostream &llvm::WriteGraph(raw_ostream &O, const EdgeBundles &G,
78 bool ShortNames,
79 const Twine &Title) {
72 template<>
73 raw_ostream &llvm::WriteGraph<>(raw_ostream &O, const EdgeBundles &G,
74 bool ShortNames,
75 const Twine &Title) {
8076 const MachineFunction *MF = G.getMachineFunction();
8177
8278 O << "digraph {\n";
9490 O << "}\n";
9591 return O;
9692 }
93
94 /// view - Visualize the annotated bipartite CFG with Graphviz.
95 void EdgeBundles::view() const {
96 ViewGraph(*this, "EdgeBundles");
97 }