summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-04-24 18:27:29 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-04-24 18:27:29 +0000
commit0d9ec713e78d0970b4dcf8c21332664827f773fb (patch)
tree52f9a343ec637b892710d30a2046141887991156 /llvm/lib
parent7ceec07cf6be763267f757b3bc1b1cd46eccf89c (diff)
downloadbcm5719-llvm-0d9ec713e78d0970b4dcf8c21332664827f773fb.tar.gz
bcm5719-llvm-0d9ec713e78d0970b4dcf8c21332664827f773fb.zip
[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.) llvm-svn: 207133
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/EdgeBundles.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/EdgeBundles.cpp b/llvm/lib/CodeGen/EdgeBundles.cpp
index 3bb04657b58..83d1517f9f7 100644
--- a/llvm/lib/CodeGen/EdgeBundles.cpp
+++ b/llvm/lib/CodeGen/EdgeBundles.cpp
@@ -69,15 +69,11 @@ bool EdgeBundles::runOnMachineFunction(MachineFunction &mf) {
return false;
}
-/// view - Visualize the annotated bipartite CFG with Graphviz.
-void EdgeBundles::view() const {
- ViewGraph(*this, "EdgeBundles");
-}
-
/// Specialize WriteGraph, the standard implementation won't work.
-raw_ostream &llvm::WriteGraph(raw_ostream &O, const EdgeBundles &G,
- bool ShortNames,
- const Twine &Title) {
+template<>
+raw_ostream &llvm::WriteGraph<>(raw_ostream &O, const EdgeBundles &G,
+ bool ShortNames,
+ const Twine &Title) {
const MachineFunction *MF = G.getMachineFunction();
O << "digraph {\n";
@@ -95,3 +91,8 @@ raw_ostream &llvm::WriteGraph(raw_ostream &O, const EdgeBundles &G,
O << "}\n";
return O;
}
+
+/// view - Visualize the annotated bipartite CFG with Graphviz.
+void EdgeBundles::view() const {
+ ViewGraph(*this, "EdgeBundles");
+}
OpenPOWER on IntegriCloud