mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Previously GraphWriter assumed operator*() for node_iterator always
returned a reference type. This patch allows operator*() to return a non-reference type while still maintaining the old behavior when it does return a reference type. This patch was motivated when I tried to use "df_iterator" (see llvm/ADT/DepthFirstIterator.h) as a "node_iterator", as df_iterator does not return a reference type and thus we would get a compilation error when trying to take the address of a temporary. llvm-svn: 42151
This commit is contained in:
parent
648d7a1074
commit
c924fd3edf
@ -101,7 +101,11 @@ public:
|
||||
// Loop over the graph, printing it out...
|
||||
for (node_iterator I = GTraits::nodes_begin(G), E = GTraits::nodes_end(G);
|
||||
I != E; ++I)
|
||||
writeNode(&*I);
|
||||
writeNode(*I);
|
||||
}
|
||||
|
||||
void writeNode(NodeType& Node) {
|
||||
writeNode(&Node);
|
||||
}
|
||||
|
||||
void writeNode(NodeType *const *Node) {
|
||||
|
Loading…
Reference in New Issue
Block a user