diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-07-06 15:59:29 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-07-06 15:59:29 +0000 |
commit | 7e7eb3da052a6d80ddf2377cab0384c798f73f75 (patch) | |
tree | d73b5a19683a56585be300d5c19bb12eb0ca37a7 /lib/Parse | |
parent | 6f4a69a3107e7ff1569c747f7c6bdf7cff8cbf55 (diff) |
Keep track of the Expr used to describe the size of an array type,
from Enea Zaffanella!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74831 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 10 | ||||
-rw-r--r-- | lib/Parse/ParseExprCXX.cpp | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 4a3532c410..d599438644 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -2690,7 +2690,8 @@ void Parser::ParseBracketDeclarator(Declarator &D) { SourceLocation EndLoc = MatchRHSPunctuation(tok::r_square, StartLoc); // Remember that we parsed the empty array type. OwningExprResult NumElements(Actions); - D.AddTypeInfo(DeclaratorChunk::getArray(0, false, false, 0, StartLoc), + D.AddTypeInfo(DeclaratorChunk::getArray(0, false, false, 0, + StartLoc, EndLoc), EndLoc); return; } else if (Tok.getKind() == tok::numeric_constant && @@ -2706,8 +2707,8 @@ void Parser::ParseBracketDeclarator(Declarator &D) { ExprRes.release(); // Deallocate expr, just use []. // Remember that we parsed a array type, and remember its features. - D.AddTypeInfo(DeclaratorChunk::getArray(0, false, 0, - ExprRes.release(), StartLoc), + D.AddTypeInfo(DeclaratorChunk::getArray(0, false, 0, ExprRes.release(), + StartLoc, EndLoc), EndLoc); return; } @@ -2770,7 +2771,8 @@ void Parser::ParseBracketDeclarator(Declarator &D) { // Remember that we parsed a array type, and remember its features. D.AddTypeInfo(DeclaratorChunk::getArray(DS.getTypeQualifiers(), StaticLoc.isValid(), isStar, - NumElements.release(), StartLoc), + NumElements.release(), + StartLoc, EndLoc), EndLoc); } diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index 1220b2d27b..1c00a8eabe 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -966,7 +966,7 @@ void Parser::ParseDirectNewDeclarator(Declarator &D) { SourceLocation RLoc = MatchRHSPunctuation(tok::r_square, LLoc); D.AddTypeInfo(DeclaratorChunk::getArray(0, /*static=*/false, /*star=*/false, - Size.release(), LLoc), + Size.release(), LLoc, RLoc), RLoc); if (RLoc.isInvalid()) |