]> granicus.if.org Git - clang/commitdiff
Implementation of child_begin/child_end for C++ expressions.
authorTed Kremenek <kremenek@apple.com>
Fri, 24 Aug 2007 20:21:10 +0000 (20:21 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 24 Aug 2007 20:21:10 +0000 (20:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41369 91177308-0d34-0410-b5e6-96231b3b80d8

AST/ExprCXX.cpp [new file with mode: 0644]

diff --git a/AST/ExprCXX.cpp b/AST/ExprCXX.cpp
new file mode 100644 (file)
index 0000000..093c37e
--- /dev/null
@@ -0,0 +1,33 @@
+//===--- ExprCXX.cpp - (C++) Expression AST Node Implementation -----------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by Ted Kremenek and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the subclesses of Expr class declared in ExprCXX.h
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/AST/ExprCXX.h"
+using namespace clang;
+
+//===----------------------------------------------------------------------===//
+//  Child Iterators for iterating over subexpressions/substatements
+//===----------------------------------------------------------------------===//
+
+
+// CXXCastExpr
+Stmt::child_iterator CXXCastExpr::child_begin() {
+  return reinterpret_cast<Stmt**>(&Op);
+}
+
+Stmt::child_iterator CXXCastExpr::child_end() {
+  return child_begin()+1;
+}
+
+// CXXBoolLiteralExpr
+Stmt::child_iterator CXXBoolLiteralExpr::child_begin() { return NULL; }
+Stmt::child_iterator CXXBoolLiteralExpr::child_end() { return NULL; }