From 30e304e2a646ccd5f34d5697cad0be9dcccfaa2d Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 14 Dec 2016 00:03:17 +0000 Subject: Remove custom handling of array copies in lambda by-value array capture and copy constructors of classes with array members, instead using ArrayInitLoopExpr to represent the initialization loop. This exposed a bug in the static analyzer where it was unable to differentiate between zero-initialized and unknown array values, which has also been fixed here. llvm-svn: 289618 --- clang/lib/Serialization/ASTWriterStmt.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'clang/lib/Serialization/ASTWriterStmt.cpp') diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index fbe1d843cd6..f66cc029f52 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -1257,10 +1257,6 @@ void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) { void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) { VisitExpr(E); Record.push_back(E->NumCaptures); - unsigned NumArrayIndexVars = 0; - if (E->HasArrayIndexVars) - NumArrayIndexVars = E->getArrayIndexStarts()[E->NumCaptures]; - Record.push_back(NumArrayIndexVars); Record.AddSourceRange(E->IntroducerRange); Record.push_back(E->CaptureDefault); // FIXME: stable encoding Record.AddSourceLocation(E->CaptureDefaultLoc); @@ -1275,15 +1271,6 @@ void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) { Record.AddStmt(*C); } - // Add array index variables, if any. - if (NumArrayIndexVars) { - Record.append(E->getArrayIndexStarts(), - E->getArrayIndexStarts() + E->NumCaptures + 1); - VarDecl **ArrayIndexVars = E->getArrayIndexVars(); - for (unsigned I = 0; I != NumArrayIndexVars; ++I) - Record.AddDeclRef(ArrayIndexVars[I]); - } - Code = serialization::EXPR_LAMBDA; } -- cgit v1.2.3