void removeEdgeInternal(Function &ChildF);
/// Print the name of this node's function.
- friend raw_ostream &operator<<(raw_ostream &OS, const Node &N);
+ friend raw_ostream &operator<<(raw_ostream &OS, const Node &N) {
+ return OS << N.F.getName();
+ }
/// Dump the name of this node's function to stderr.
void dump() const;
///
/// We print the function names in the SCC wrapped in '()'s and skipping
/// the middle functions if there are a large number.
- friend raw_ostream &operator<<(raw_ostream &OS, const SCC &C);
+ //
+ // Note: this is defined inline to dodge issues with GCC's interpretation
+ // of enclosing namespaces for friend function declarations.
+ friend raw_ostream &operator<<(raw_ostream &OS, const 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;
+ }
/// Dump a short description of this SCC to stderr.
void dump() const;
///
/// We print the SCCs wrapped in '[]'s and skipping the middle SCCs if
/// there are a large number.
- friend raw_ostream &operator<<(raw_ostream &OS, const RefSCC &RC);
+ //
+ // Note: this is defined inline to dodge issues with GCC's interpretation
+ // of enclosing namespaces for friend function declarations.
+ friend raw_ostream &operator<<(raw_ostream &OS, const 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;
+ }
/// Dump a short description of this RefSCC to stderr.
void dump() const;
#include "llvm/IR/PassManager.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/GraphWriter.h"
-#include "llvm/Support/raw_ostream.h"
using namespace llvm;
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';
}
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';
}
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';
}