Add InitListExpr class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41636 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Expr.cpp b/AST/Expr.cpp
index 3aed116..d664c46 100644
--- a/AST/Expr.cpp
+++ b/AST/Expr.cpp
@@ -194,6 +194,18 @@
}
}
+InitListExpr::InitListExpr(SourceLocation lbraceloc,
+ Expr **initexprs, unsigned numinits,
+ SourceLocation rbraceloc)
+ : Expr(InitListExprClass, QualType())
+ , NumInits(numinits)
+ , LBraceLoc(lbraceloc)
+ , RBraceLoc(rbraceloc)
+{
+ InitExprs = new Expr*[numinits];
+ for (unsigned i = 0; i != numinits; i++)
+ InitExprs[i] = initexprs[i];
+}
//===----------------------------------------------------------------------===//
// Generic Expression Routines
@@ -871,6 +883,14 @@
return reinterpret_cast<Stmt**>(&SubExprs)+END_EXPR;
}
+// InitListExpr
+Stmt::child_iterator InitListExpr::child_begin() {
+ return reinterpret_cast<Stmt**>(&InitExprs[0]);
+}
+Stmt::child_iterator InitListExpr::child_end() {
+ return reinterpret_cast<Stmt**>(&InitExprs[NumInits]);
+}
+
// ObjCStringLiteral
Stmt::child_iterator ObjCStringLiteral::child_begin() { return NULL; }
Stmt::child_iterator ObjCStringLiteral::child_end() { return NULL; }