From 5f688f4b15d02aa7ad159c46b1f78fe59d412f12 Mon Sep 17 00:00:00 2001 From: Sebastian Redl Date: Thu, 16 Feb 2012 10:58:10 +0000 Subject: Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself. Holding the constructor directly makes no sense when list-initialized arrays come into play. The constructor is now held in a CXXConstructExpr, if construction is what is done. The new design can also distinguish properly between list-initialization and direct-initialization, as well as implicit default-initialization constructors and explicit value-initialization constructors. Finally, doing it this way removes redundance from the AST because CXXNewExpr doesn't try to handle both the allocation and the initialization responsibilities. This breaks the static analysis of new expressions. I've filed PR12014 to track this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150682 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/libclang/CIndex.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tools/libclang/CIndex.cpp') diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index beec4d2352..2ab693e183 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -1856,9 +1856,8 @@ VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E) { AddStmt(E->getBase()); } void EnqueueVisitor::VisitCXXNewExpr(CXXNewExpr *E) { - // Enqueue the initializer or constructor arguments. - for (unsigned I = E->getNumConstructorArgs(); I > 0; --I) - AddStmt(E->getConstructorArg(I-1)); + // Enqueue the initializer , if any. + AddStmt(E->getInitializer()); // Enqueue the array size, if any. AddStmt(E->getArraySize()); // Enqueue the allocated type. -- cgit v1.2.3-18-g5258