aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprCXX.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2008-12-02 14:43:59 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2008-12-02 14:43:59 +0000
commitcee63fbf0e64ac526582312bf8cf33263fc5c16e (patch)
tree274408c3fad7aaaaa463f5f50bce9f516ff3422b /lib/AST/ExprCXX.cpp
parent04f9d468f7abfd8a1d85a2ef7cd9c48adb1efa58 (diff)
Handle new by passing the Declaration to the Action, not a processed type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60413 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprCXX.cpp')
-rw-r--r--lib/AST/ExprCXX.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp
index c0f2985f1e..1bf07c4a63 100644
--- a/lib/AST/ExprCXX.cpp
+++ b/lib/AST/ExprCXX.cpp
@@ -80,30 +80,32 @@ Stmt::child_iterator CXXConditionDeclExpr::child_end() {
// CXXNewExpr
CXXNewExpr::CXXNewExpr(bool globalNew, FunctionDecl *operatorNew,
Expr **placementArgs, unsigned numPlaceArgs,
- bool parenTypeId, QualType alloc,
+ bool parenTypeId, Expr *arraySize,
CXXConstructorDecl *constructor, bool initializer,
Expr **constructorArgs, unsigned numConsArgs,
FunctionDecl *operatorDelete, QualType ty,
SourceLocation startLoc, SourceLocation endLoc)
: Expr(CXXNewExprClass, ty), GlobalNew(globalNew), ParenTypeId(parenTypeId),
- Initializer(initializer), NumPlacementArgs(numPlaceArgs),
+ Initializer(initializer), Array(arraySize), NumPlacementArgs(numPlaceArgs),
NumConstructorArgs(numConsArgs), OperatorNew(operatorNew),
- OperatorDelete(operatorDelete), Constructor(constructor), AllocType(alloc),
+ OperatorDelete(operatorDelete), Constructor(constructor),
StartLoc(startLoc), EndLoc(endLoc)
{
- unsigned TotalSize = NumPlacementArgs + NumConstructorArgs;
+ unsigned TotalSize = Array + NumPlacementArgs + NumConstructorArgs;
SubExprs = new Stmt*[TotalSize];
unsigned i = 0;
- for(unsigned j = 0; j < NumPlacementArgs; ++j)
+ if (Array)
+ SubExprs[i++] = arraySize;
+ for (unsigned j = 0; j < NumPlacementArgs; ++j)
SubExprs[i++] = placementArgs[j];
- for(unsigned j = 0; j < NumConstructorArgs; ++j)
+ for (unsigned j = 0; j < NumConstructorArgs; ++j)
SubExprs[i++] = constructorArgs[j];
assert(i == TotalSize);
}
Stmt::child_iterator CXXNewExpr::child_begin() { return &SubExprs[0]; }
Stmt::child_iterator CXXNewExpr::child_end() {
- return &SubExprs[0] + getNumPlacementArgs() + getNumConstructorArgs();
+ return &SubExprs[0] + Array + getNumPlacementArgs() + getNumConstructorArgs();
}
// CXXDeleteExpr