diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-09-19 21:26:49 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-09-19 21:26:49 +0000 |
commit | fffc1b3f81637315476549eec57d69f96f3edd3c (patch) | |
tree | b8a33911e6d48f1296cb770987345dae2d20e70a /include | |
parent | f8209dfca17528382d928118307c2fe3b833ab9d (diff) | |
download | external_llvm-fffc1b3f81637315476549eec57d69f96f3edd3c.zip external_llvm-fffc1b3f81637315476549eec57d69f96f3edd3c.tar.gz external_llvm-fffc1b3f81637315476549eec57d69f96f3edd3c.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/GraphWriter.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/Support/GraphWriter.h b/include/llvm/Support/GraphWriter.h index 08bc861..85cf718 100644 --- a/include/llvm/Support/GraphWriter.h +++ b/include/llvm/Support/GraphWriter.h @@ -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) { |