diff options
Diffstat (limited to 'include/clang/AST/StmtObjC.h')
-rw-r--r-- | include/clang/AST/StmtObjC.h | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/include/clang/AST/StmtObjC.h b/include/clang/AST/StmtObjC.h index f0c0a9aeb6..948ef2421c 100644 --- a/include/clang/AST/StmtObjC.h +++ b/include/clang/AST/StmtObjC.h @@ -1,9 +1,8 @@ //===--- StmtObjC.h - Classes for representing ObjC statements --*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -68,6 +67,10 @@ public: child_range children() { return child_range(&SubExprs[0], &SubExprs[END_EXPR]); } + + const_child_range children() const { + return const_child_range(&SubExprs[0], &SubExprs[END_EXPR]); + } }; /// Represents Objective-C's \@catch statement. @@ -114,6 +117,10 @@ public: } child_range children() { return child_range(&Body, &Body + 1); } + + const_child_range children() const { + return const_child_range(&Body, &Body + 1); + } }; /// Represents Objective-C's \@finally statement @@ -148,6 +155,10 @@ public: child_range children() { return child_range(&AtFinallyStmt, &AtFinallyStmt+1); } + + const_child_range children() const { + return const_child_range(&AtFinallyStmt, &AtFinallyStmt + 1); + } }; /// Represents Objective-C's \@try ... \@catch ... \@finally statement. @@ -249,6 +260,10 @@ public: return child_range(getStmts(), getStmts() + 1 + NumCatchStmts + HasFinally); } + + const_child_range children() const { + return const_child_range(const_cast<ObjCAtTryStmt *>(this)->children()); + } }; /// Represents Objective-C's \@synchronized statement. @@ -307,6 +322,10 @@ public: child_range children() { return child_range(&SubStmts[0], &SubStmts[0]+END_EXPR); } + + const_child_range children() const { + return const_child_range(&SubStmts[0], &SubStmts[0] + END_EXPR); + } }; /// Represents Objective-C's \@throw statement. @@ -339,6 +358,10 @@ public: } child_range children() { return child_range(&Throw, &Throw+1); } + + const_child_range children() const { + return const_child_range(&Throw, &Throw + 1); + } }; /// Represents Objective-C's \@autoreleasepool Statement @@ -370,6 +393,10 @@ public: } child_range children() { return child_range(&SubStmt, &SubStmt + 1); } + + const_child_range children() const { + return const_child_range(&SubStmt, &SubStmt + 1); + } }; } // end namespace clang |