diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2016-07-07 07:52:07 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2016-07-07 07:52:07 +0000 |
commit | 168800c97d852bcda062200be861eb30aa334941 (patch) | |
tree | e17be79ec4d7df5d75740157cbed0e40aed89c9e /llvm/lib | |
parent | f73a25812f68e1dbe59a5b6589044d7a0e63e66f (diff) | |
download | bcm5719-llvm-168800c97d852bcda062200be861eb30aa334941.tar.gz bcm5719-llvm-168800c97d852bcda062200be861eb30aa334941.zip |
[LCG] Hoist the definitions of the stream operator friends to be inline
friend definitions.
Based on the experiments Sean Silva and Reid did, this seems the safest
course of action and also will work around a questionable warning
provided by GCC6 on the old form of the code. Thanks for Davide pointing
out the issue and other suggesting ways to fix.
llvm-svn: 274740
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/LazyCallGraph.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp index 2d34a243f47..acff8529b15 100644 --- a/llvm/lib/Analysis/LazyCallGraph.cpp +++ b/llvm/lib/Analysis/LazyCallGraph.cpp @@ -15,7 +15,6 @@ #include "llvm/IR/PassManager.h" #include "llvm/Support/Debug.h" #include "llvm/Support/GraphWriter.h" -#include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -120,10 +119,6 @@ void LazyCallGraph::Node::removeEdgeInternal(Function &Target) { EdgeIndexMap.erase(IndexMapI); } -raw_ostream &llvm::operator<<(raw_ostream &OS, const LazyCallGraph::Node &N) { - return OS << N.F.getName(); -} - void LazyCallGraph::Node::dump() const { dbgs() << *this << '\n'; } @@ -181,24 +176,6 @@ LazyCallGraph &LazyCallGraph::operator=(LazyCallGraph &&G) { return *this; } -raw_ostream &llvm::operator<<(raw_ostream &OS, const LazyCallGraph::SCC &C) { - OS << '('; - int i = 0; - for (LazyCallGraph::Node &N : C) { - if (i > 0) - OS << ", "; - // Elide the inner elements if there are too many. - if (i > 8) { - OS << "..., " << *C.Nodes.back(); - break; - } - OS << N; - ++i; - } - OS << ')'; - return OS; -} - void LazyCallGraph::SCC::dump() const { dbgs() << *this << '\n'; } @@ -224,25 +201,6 @@ void LazyCallGraph::SCC::verify() { LazyCallGraph::RefSCC::RefSCC(LazyCallGraph &G) : G(&G) {} -raw_ostream &llvm::operator<<(raw_ostream &OS, - const LazyCallGraph::RefSCC &RC) { - OS << '['; - int i = 0; - for (LazyCallGraph::SCC &C : RC) { - if (i > 0) - OS << ", "; - // Elide the inner elements if there are too many. - if (i > 4) { - OS << "..., " << *RC.SCCs.back(); - break; - } - OS << C; - ++i; - } - OS << ']'; - return OS; -} - void LazyCallGraph::RefSCC::dump() const { dbgs() << *this << '\n'; } |