[llvm-commits] [llvm] r42151 - /llvm/trunk/include/llvm/Support/GraphWriter.h
Ted Kremenek
kremenek at apple.com
Wed Sep 19 14:26:49 PDT 2007
Author: kremenek
Date: Wed Sep 19 16:26:49 2007
New Revision: 42151
URL: http://llvm.org/viewvc/llvm-project?rev=42151&view=rev
Log:
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.
Modified:
llvm/trunk/include/llvm/Support/GraphWriter.h
Modified: llvm/trunk/include/llvm/Support/GraphWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/GraphWriter.h?rev=42151&r1=42150&r2=42151&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/GraphWriter.h (original)
+++ llvm/trunk/include/llvm/Support/GraphWriter.h Wed Sep 19 16:26:49 2007
@@ -101,7 +101,11 @@
// 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) {
More information about the llvm-commits
mailing list