[PATCH] D25047: [AST] Add a const version of CallExpr::children() (NFC)

Vedant Kumar via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 28 14:42:04 PDT 2016


vsk created this revision.
vsk added reviewers: bkramer, rsmith.
vsk added a subscriber: cfe-commits.

This makes it possible to visit the children of a CallExpr from a ConstStmtVisitor.

https://reviews.llvm.org/D25047

Files:
  include/clang/AST/Expr.h

Index: include/clang/AST/Expr.h
===================================================================
--- include/clang/AST/Expr.h
+++ include/clang/AST/Expr.h
@@ -2297,6 +2297,9 @@
     return child_range(&SubExprs[0],
                        &SubExprs[0]+NumArgs+getNumPreArgs()+PREARGS_START);
   }
+  const_child_range children() const {
+    return const_child_range(const_cast<CallExpr *>(this)->children());
+  }
 };
 
 /// Extra data stored in some MemberExpr objects.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25047.72903.patch
Type: text/x-patch
Size: 475 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160928/67d2cc68/attachment-0001.bin>


More information about the cfe-commits mailing list