]> granicus.if.org Git - clang/commitdiff
Analysis: Make CFG::graph_iterator dereference to non-const
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 9 Oct 2015 16:50:55 +0000 (16:50 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 9 Oct 2015 16:50:55 +0000 (16:50 +0000)
Since the original commit in r145858, we've had `CFG::graph_iterator`
and `CFG::const_graph_iterator`, and both have derefenced to a
`const`-ified `value_type`.  The former has an implicit conversion to
non-`const`, which is how this worked at all until r249782 started using
the dereference operator (partially reverted in r249783).

This fixes the non-const iterator to be non-const (sometimes
const-iterators are intentional, but with a separate const-ified class
(and a non-const implicit conversion leak) that's not likely to be the
case here).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249849 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/CFG.h

index c39db8268f70e4e33d0e3ce29a46efc9ee7d2351..293990c88e703f0498efef9a45f9b0d711bba306 100644 (file)
@@ -766,7 +766,7 @@ public:
   /// (not a pointer to CFGBlock).
   class graph_iterator {
   public:
-    typedef const CFGBlock                  value_type;
+    typedef CFGBlock                        value_type;
     typedef value_type&                     reference;
     typedef value_type*                     pointer;
     typedef BumpVector<CFGBlock*>::iterator ImplTy;