blob: 60694381373eed647678d665a57bb43d0a6d451a [file] [log] [blame]
Ted Kremenekfc7b6f72007-08-24 20:21:10 +00001//===--- ExprCXX.cpp - (C++) Expression AST Node Implementation -----------===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner959e5be2007-12-29 19:59:25 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Ted Kremenekfc7b6f72007-08-24 20:21:10 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file implements the subclesses of Expr class declared in ExprCXX.h
11//
12//===----------------------------------------------------------------------===//
13
14#include "clang/AST/ExprCXX.h"
15using namespace clang;
16
17//===----------------------------------------------------------------------===//
18// Child Iterators for iterating over subexpressions/substatements
19//===----------------------------------------------------------------------===//
20
21
22// CXXCastExpr
Ted Kremenek156714e2008-06-17 03:11:08 +000023Stmt::child_iterator CXXCastExpr::child_begin() { return &Op; }
24Stmt::child_iterator CXXCastExpr::child_end() { return &Op+1; }
Ted Kremenekfc7b6f72007-08-24 20:21:10 +000025
26// CXXBoolLiteralExpr
Ted Kremeneka6478552007-10-18 23:28:49 +000027Stmt::child_iterator CXXBoolLiteralExpr::child_begin() {
28 return child_iterator();
29}
30Stmt::child_iterator CXXBoolLiteralExpr::child_end() {
31 return child_iterator();
32}
Chris Lattnera7447ba2008-02-26 00:51:44 +000033
34// CXXThrowExpr
Ted Kremenek156714e2008-06-17 03:11:08 +000035Stmt::child_iterator CXXThrowExpr::child_begin() { return &Op; }
Chris Lattnera7447ba2008-02-26 00:51:44 +000036Stmt::child_iterator CXXThrowExpr::child_end() {
37 // If Op is 0, we are processing throw; which has no children.
Ted Kremenek156714e2008-06-17 03:11:08 +000038 return Op ? &Op+1 : &Op;
Chris Lattnera7447ba2008-02-26 00:51:44 +000039}
Chris Lattner3e254fb2008-04-08 04:40:51 +000040
41// CXXDefaultArgExpr
42Stmt::child_iterator CXXDefaultArgExpr::child_begin() {
Chris Lattner97316c02008-04-10 02:22:51 +000043 return child_iterator();
Chris Lattner3e254fb2008-04-08 04:40:51 +000044}
45Stmt::child_iterator CXXDefaultArgExpr::child_end() {
Chris Lattner97316c02008-04-10 02:22:51 +000046 return child_iterator();
Chris Lattner3e254fb2008-04-08 04:40:51 +000047}