Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself."
It leads to a compiler crash in the Bullet benchmark.
This reverts commit r12014.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150684 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 2ab693e..beec4d2 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -1856,8 +1856,9 @@
AddStmt(E->getBase());
}
void EnqueueVisitor::VisitCXXNewExpr(CXXNewExpr *E) {
- // Enqueue the initializer , if any.
- AddStmt(E->getInitializer());
+ // Enqueue the initializer or constructor arguments.
+ for (unsigned I = E->getNumConstructorArgs(); I > 0; --I)
+ AddStmt(E->getConstructorArg(I-1));
// Enqueue the array size, if any.
AddStmt(E->getArraySize());
// Enqueue the allocated type.