From: Abramo Bagnara Date: Tue, 8 Mar 2011 16:41:52 +0000 (+0000) Subject: Fixed source range for StaticAssertDecl and LinkageSpecDecl. Fixed source range for... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2026c96d3935e7909e049ad9096762844544ed6;p=clang Fixed source range for StaticAssertDecl and LinkageSpecDecl. Fixed source range for declarations using postfix types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127251 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 85d16a0267..24ad92141e 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -575,9 +575,8 @@ public: /// getOuterLocStart - Return SourceLocation representing start of source /// range taking into account any outer template declarations. SourceLocation getOuterLocStart() const; - SourceRange getSourceRange() const { - return SourceRange(getOuterLocStart(), getLocation()); - } + + virtual SourceRange getSourceRange() const; /// \brief Retrieve the nested-name-specifier that qualifies the name of this /// declaration, if it was present in the source. @@ -1393,12 +1392,9 @@ public: const PrintingPolicy &Policy, bool Qualified) const; - virtual SourceRange getSourceRange() const { - return SourceRange(getOuterLocStart(), EndRangeLoc); - } - void setLocEnd(SourceLocation E) { - EndRangeLoc = E; - } + void setRangeEnd(SourceLocation E) { EndRangeLoc = E; } + + virtual SourceRange getSourceRange() const; /// \brief Returns true if the function has a body (definition). The /// function body might be in any of the (re-)declarations of this @@ -1955,7 +1951,7 @@ public: SourceLocation getLocStart() const { return LocStart; } void setLocStart(SourceLocation L) { LocStart = L; } - SourceRange getSourceRange() const { + virtual SourceRange getSourceRange() const { if (LocStart.isValid()) return SourceRange(LocStart, getLocation()); else @@ -2013,6 +2009,8 @@ public: TInfo = newType; } + SourceRange getSourceRange() const; + // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { return classofKind(D->getKind()); } static bool classof(const TypedefDecl *D) { return true; } diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index 3a2a3393b2..c25e6619f0 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -1718,30 +1718,35 @@ public: private: /// Language - The language for this linkage specification. LanguageIDs Language; - + /// ExternLoc - The source location for the extern keyword. + SourceLocation ExternLoc; /// RBraceLoc - The source location for the right brace (if valid). SourceLocation RBraceLoc; - LinkageSpecDecl(DeclContext *DC, SourceLocation L, LanguageIDs lang, + LinkageSpecDecl(DeclContext *DC, SourceLocation ExternLoc, + SourceLocation LangLoc, LanguageIDs lang, SourceLocation RBLoc) - : Decl(LinkageSpec, DC, L), DeclContext(LinkageSpec), - Language(lang), RBraceLoc(RBLoc) { } + : Decl(LinkageSpec, DC, LangLoc), DeclContext(LinkageSpec), + Language(lang), ExternLoc(ExternLoc), RBraceLoc(RBLoc) { } public: static LinkageSpecDecl *Create(ASTContext &C, DeclContext *DC, - SourceLocation L, LanguageIDs Lang, + SourceLocation ExternLoc, + SourceLocation LangLoc, LanguageIDs Lang, SourceLocation RBraceLoc = SourceLocation()); /// \brief Return the language specified by this linkage specification. LanguageIDs getLanguage() const { return Language; } - /// \brief Set the language specified by this linkage specification. void setLanguage(LanguageIDs L) { Language = L; } /// \brief Determines whether this linkage specification had braces in /// its syntactic form. bool hasBraces() const { return RBraceLoc.isValid(); } + + SourceLocation getExternLoc() const { return ExternLoc; } SourceLocation getRBraceLoc() const { return RBraceLoc; } + void setExternLoc(SourceLocation L) { ExternLoc = L; } void setRBraceLoc(SourceLocation L) { RBraceLoc = L; } SourceLocation getLocEnd() const { @@ -1753,7 +1758,7 @@ public: } SourceRange getSourceRange() const { - return SourceRange(getLocation(), getLocEnd()); + return SourceRange(ExternLoc, getLocEnd()); } static bool classof(const Decl *D) { return classofKind(D->getKind()); } @@ -2269,15 +2274,19 @@ public: class StaticAssertDecl : public Decl { Expr *AssertExpr; StringLiteral *Message; + SourceLocation RParenLoc; - StaticAssertDecl(DeclContext *DC, SourceLocation L, - Expr *assertexpr, StringLiteral *message) - : Decl(StaticAssert, DC, L), AssertExpr(assertexpr), Message(message) { } + StaticAssertDecl(DeclContext *DC, SourceLocation StaticAssertLoc, + Expr *assertexpr, StringLiteral *message, + SourceLocation RParenLoc) + : Decl(StaticAssert, DC, StaticAssertLoc), AssertExpr(assertexpr), + Message(message), RParenLoc(RParenLoc) { } public: static StaticAssertDecl *Create(ASTContext &C, DeclContext *DC, - SourceLocation L, Expr *AssertExpr, - StringLiteral *Message); + SourceLocation StaticAssertLoc, + Expr *AssertExpr, StringLiteral *Message, + SourceLocation RParenLoc); Expr *getAssertExpr() { return AssertExpr; } const Expr *getAssertExpr() const { return AssertExpr; } @@ -2285,6 +2294,13 @@ public: StringLiteral *getMessage() { return Message; } const StringLiteral *getMessage() const { return Message; } + SourceLocation getRParenLoc() const { return RParenLoc; } + void setRParenLoc(SourceLocation L) { RParenLoc = L; } + + SourceRange getSourceRange() const { + return SourceRange(getLocation(), getRParenLoc()); + } + static bool classof(const Decl *D) { return classofKind(D->getKind()); } static bool classof(StaticAssertDecl *D) { return true; } static bool classofKind(Kind K) { return K == StaticAssert; } diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index 1d956f17dd..f7d9e80c7b 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -2921,9 +2921,10 @@ public: void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, Decl *Method); void ActOnFinishDelayedMemberDeclarations(Scope *S, Decl *Record); - Decl *ActOnStaticAssertDeclaration(SourceLocation AssertLoc, + Decl *ActOnStaticAssertDeclaration(SourceLocation StaticAssertLoc, Expr *AssertExpr, - Expr *AssertMessageExpr); + Expr *AssertMessageExpr, + SourceLocation RParenLoc); FriendDecl *CheckFriendTypeDecl(SourceLocation FriendLoc, TypeSourceInfo *TSInfo); diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index c6d9391e0a..a7f6c45dd4 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -975,6 +975,55 @@ SourceLocation DeclaratorDecl::getOuterLocStart() const { return getTemplateOrInnerLocStart(this); } +namespace { + +// Helper function: returns true if QT is or contains a type +// having a postfix component. +bool typeIsPostfix(clang::QualType QT) { + while (true) { + const Type* T = QT.getTypePtr(); + switch (T->getTypeClass()) { + default: + return false; + case Type::Pointer: + QT = cast(T)->getPointeeType(); + break; + case Type::BlockPointer: + QT = cast(T)->getPointeeType(); + break; + case Type::MemberPointer: + QT = cast(T)->getPointeeType(); + break; + case Type::LValueReference: + case Type::RValueReference: + QT = cast(T)->getPointeeType(); + break; + case Type::PackExpansion: + QT = cast(T)->getPattern(); + break; + case Type::Paren: + case Type::ConstantArray: + case Type::DependentSizedArray: + case Type::IncompleteArray: + case Type::VariableArray: + case Type::FunctionProto: + case Type::FunctionNoProto: + return true; + } + } +} + +} // namespace + +SourceRange DeclaratorDecl::getSourceRange() const { + SourceLocation RangeEnd = getLocation(); + if (TypeSourceInfo *TInfo = getTypeSourceInfo()) { + if (typeIsPostfix(TInfo->getType())) + RangeEnd = TInfo->getTypeLoc().getSourceRange().getEnd(); + } + return SourceRange(getOuterLocStart(), RangeEnd); +} + void QualifierInfo::setTemplateParameterListsInfo(ASTContext &Context, unsigned NumTPLists, @@ -1035,7 +1084,7 @@ void VarDecl::setStorageClass(StorageClass SC) { SourceRange VarDecl::getSourceRange() const { if (getInit()) return SourceRange(getOuterLocStart(), getInit()->getLocEnd()); - return SourceRange(getOuterLocStart(), getLocation()); + return DeclaratorDecl::getSourceRange(); } bool VarDecl::isExternC() const { @@ -1927,6 +1976,10 @@ bool FunctionDecl::isOutOfLine() const { return false; } +SourceRange FunctionDecl::getSourceRange() const { + return SourceRange(getOuterLocStart(), EndRangeLoc); +} + //===----------------------------------------------------------------------===// // FieldDecl Implementation //===----------------------------------------------------------------------===// @@ -1969,8 +2022,9 @@ unsigned FieldDecl::getFieldIndex() const { } SourceRange FieldDecl::getSourceRange() const { - return SourceRange(getInnerLocStart(), - isBitField() ? BitWidth->getLocEnd() : getLocation()); + if (isBitField()) + return SourceRange(getInnerLocStart(), BitWidth->getLocEnd()); + return DeclaratorDecl::getSourceRange(); } //===----------------------------------------------------------------------===// @@ -2284,6 +2338,15 @@ TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *DC, return new (C) TypedefDecl(DC, StartLoc, IdLoc, Id, TInfo); } +SourceRange TypedefDecl::getSourceRange() const { + SourceLocation RangeEnd = getLocation(); + if (TypeSourceInfo *TInfo = getTypeSourceInfo()) { + if (typeIsPostfix(TInfo->getType())) + RangeEnd = TInfo->getTypeLoc().getSourceRange().getEnd(); + } + return SourceRange(getLocStart(), RangeEnd); +} + FileScopeAsmDecl *FileScopeAsmDecl::Create(ASTContext &C, DeclContext *DC, StringLiteral *Str, SourceLocation AsmLoc, diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index abed12de2e..14e81231bf 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -1273,10 +1273,11 @@ CXXConversionDecl::Create(ASTContext &C, CXXRecordDecl *RD, LinkageSpecDecl *LinkageSpecDecl::Create(ASTContext &C, DeclContext *DC, - SourceLocation L, + SourceLocation ExternLoc, + SourceLocation LangLoc, LanguageIDs Lang, SourceLocation RBraceLoc) { - return new (C) LinkageSpecDecl(DC, L, Lang, RBraceLoc); + return new (C) LinkageSpecDecl(DC, ExternLoc, LangLoc, Lang, RBraceLoc); } UsingDirectiveDecl *UsingDirectiveDecl::Create(ASTContext &C, DeclContext *DC, @@ -1379,9 +1380,12 @@ UnresolvedUsingTypenameDecl::Create(ASTContext &C, DeclContext *DC, } StaticAssertDecl *StaticAssertDecl::Create(ASTContext &C, DeclContext *DC, - SourceLocation L, Expr *AssertExpr, - StringLiteral *Message) { - return new (C) StaticAssertDecl(DC, L, AssertExpr, Message); + SourceLocation StaticAssertLoc, + Expr *AssertExpr, + StringLiteral *Message, + SourceLocation RParenLoc) { + return new (C) StaticAssertDecl(DC, StaticAssertLoc, AssertExpr, Message, + RParenLoc); } static const char *getAccessName(AccessSpecifier AS) { diff --git a/lib/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp index 6fd4d7ec07..de0e71ebac 100644 --- a/lib/AST/DeclTemplate.cpp +++ b/lib/AST/DeclTemplate.cpp @@ -508,10 +508,10 @@ NonTypeTemplateParmDecl::Create(const ASTContext &C, DeclContext *DC, } SourceRange NonTypeTemplateParmDecl::getSourceRange() const { - SourceLocation End = getLocation(); if (hasDefaultArgument() && !defaultArgumentWasInherited()) - End = getDefaultArgument()->getSourceRange().getEnd(); - return SourceRange(getOuterLocStart(), End); + return SourceRange(getOuterLocStart(), + getDefaultArgument()->getSourceRange().getEnd()); + return DeclaratorDecl::getSourceRange(); } SourceLocation NonTypeTemplateParmDecl::getDefaultArgumentLoc() const { diff --git a/lib/AST/TypeLoc.cpp b/lib/AST/TypeLoc.cpp index d42f42ed15..0873e837d8 100644 --- a/lib/AST/TypeLoc.cpp +++ b/lib/AST/TypeLoc.cpp @@ -118,18 +118,37 @@ SourceLocation TypeLoc::getBeginLoc() const { SourceLocation TypeLoc::getEndLoc() const { TypeLoc Cur = *this; + TypeLoc Last; while (true) { switch (Cur.getTypeLocClass()) { default: + if (!Last) + Last = Cur; + return Last.getLocalSourceRange().getEnd(); + case Paren: + case ConstantArray: + case DependentSizedArray: + case IncompleteArray: + case VariableArray: + case FunctionProto: + case FunctionNoProto: + Last = Cur; + break; + case Pointer: + case BlockPointer: + case MemberPointer: + case LValueReference: + case RValueReference: + case PackExpansion: + if (!Last) + Last = Cur; break; case Qualified: case Elaborated: - Cur = Cur.getNextTypeLoc(); - continue; + break; } - break; + Cur = Cur.getNextTypeLoc(); } - return Cur.getLocalSourceRange().getEnd(); } diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 1f0e282822..c214610f64 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -194,9 +194,9 @@ Decl *Parser::ParseLinkage(ParsingDeclSpec &DS, unsigned Context) { ParseScope LinkageScope(this, Scope::DeclScope); Decl *LinkageSpec = Actions.ActOnStartLinkageSpecification(getCurScope(), - /*FIXME: */SourceLocation(), + DS.getSourceRange().getBegin(), Loc, Lang, - Tok.is(tok::l_brace)? Tok.getLocation() + Tok.is(tok::l_brace) ? Tok.getLocation() : SourceLocation()); ParsedAttributesWithRange attrs; @@ -441,14 +441,15 @@ Decl *Parser::ParseStaticAssertDeclaration(SourceLocation &DeclEnd){ if (AssertMessage.isInvalid()) return 0; - MatchRHSPunctuation(tok::r_paren, LParenLoc); + SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc); DeclEnd = Tok.getLocation(); ExpectAndConsumeSemi(diag::err_expected_semi_after_static_assert); return Actions.ActOnStaticAssertDeclaration(StaticAssertLoc, AssertExpr.take(), - AssertMessage.take()); + AssertMessage.take(), + RParenLoc); } /// ParseDecltypeSpecifier - Parse a C++0x decltype specifier. diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 995b2b9ef6..978e7a2e1e 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -4254,7 +4254,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, RegisterLocallyScopedExternCDecl(NewFD, Previous, S); // Set this FunctionDecl's range up to the right paren. - NewFD->setLocEnd(D.getSourceRange().getEnd()); + NewFD->setRangeEnd(D.getSourceRange().getEnd()); if (getLangOptions().CPlusPlus) { if (FunctionTemplate) { diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index bdfdb17704..a2528a6140 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -6588,7 +6588,7 @@ Decl *Sema::ActOnStartLinkageSpecification(Scope *S, SourceLocation ExternLoc, // FIXME: Add all the various semantics of linkage specifications LinkageSpecDecl *D = LinkageSpecDecl::Create(Context, CurContext, - LangLoc, Language); + ExternLoc, LangLoc, Language); CurContext->addDecl(D); PushDeclContext(S, D); return D; @@ -6788,21 +6788,23 @@ Decl *Sema::ActOnExceptionDeclarator(Scope *S, Declarator &D) { return ExDecl; } -Decl *Sema::ActOnStaticAssertDeclaration(SourceLocation AssertLoc, +Decl *Sema::ActOnStaticAssertDeclaration(SourceLocation StaticAssertLoc, Expr *AssertExpr, - Expr *AssertMessageExpr_) { + Expr *AssertMessageExpr_, + SourceLocation RParenLoc) { StringLiteral *AssertMessage = cast(AssertMessageExpr_); if (!AssertExpr->isTypeDependent() && !AssertExpr->isValueDependent()) { llvm::APSInt Value(32); if (!AssertExpr->isIntegerConstantExpr(Value, Context)) { - Diag(AssertLoc, diag::err_static_assert_expression_is_not_constant) << + Diag(StaticAssertLoc, + diag::err_static_assert_expression_is_not_constant) << AssertExpr->getSourceRange(); return 0; } if (Value == 0) { - Diag(AssertLoc, diag::err_static_assert_failed) + Diag(StaticAssertLoc, diag::err_static_assert_failed) << AssertMessage->getString() << AssertExpr->getSourceRange(); } } @@ -6810,8 +6812,8 @@ Decl *Sema::ActOnStaticAssertDeclaration(SourceLocation AssertLoc, if (DiagnoseUnexpandedParameterPack(AssertExpr, UPPC_StaticAssertExpression)) return 0; - Decl *Decl = StaticAssertDecl::Create(Context, CurContext, AssertLoc, - AssertExpr, AssertMessage); + Decl *Decl = StaticAssertDecl::Create(Context, CurContext, StaticAssertLoc, + AssertExpr, AssertMessage, RParenLoc); CurContext->addDecl(Decl); return Decl; diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index d3672689fa..1d4f3359ed 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -528,7 +528,8 @@ Decl *TemplateDeclInstantiator::VisitStaticAssertDecl(StaticAssertDecl *D) { D->getMessage(); return SemaRef.ActOnStaticAssertDeclaration(D->getLocation(), InstantiatedAssertExpr.get(), - Message.get()); + Message.get(), + D->getRParenLoc()); } Decl *TemplateDeclInstantiator::VisitEnumDecl(EnumDecl *D) { diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index e07bba4f6b..8d32bde5fc 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -744,6 +744,7 @@ void ASTDeclReader::VisitBlockDecl(BlockDecl *BD) { void ASTDeclReader::VisitLinkageSpecDecl(LinkageSpecDecl *D) { VisitDecl(D); D->setLanguage((LinkageSpecDecl::LanguageIDs)Record[Idx++]); + D->setExternLoc(ReadSourceLocation(Record, Idx)); D->setRBraceLoc(ReadSourceLocation(Record, Idx)); } @@ -1241,6 +1242,7 @@ void ASTDeclReader::VisitStaticAssertDecl(StaticAssertDecl *D) { VisitDecl(D); D->AssertExpr = Reader.ReadExpr(F); D->Message = cast(Reader.ReadExpr(F)); + D->RParenLoc = ReadSourceLocation(Record, Idx); } std::pair @@ -1440,7 +1442,7 @@ Decl *ASTReader::ReadDeclRecord(unsigned Index, DeclID ID) { DeclarationName(), QualType(), 0); break; case DECL_LINKAGE_SPEC: - D = LinkageSpecDecl::Create(*Context, 0, SourceLocation(), + D = LinkageSpecDecl::Create(*Context, 0, SourceLocation(), SourceLocation(), (LinkageSpecDecl::LanguageIDs)0, SourceLocation()); break; @@ -1538,7 +1540,8 @@ Decl *ASTReader::ReadDeclRecord(unsigned Index, DeclID ID) { false, 0, 0); break; case DECL_STATIC_ASSERT: - D = StaticAssertDecl::Create(*Context, 0, SourceLocation(), 0, 0); + D = StaticAssertDecl::Create(*Context, 0, SourceLocation(), 0, 0, + SourceLocation()); break; case DECL_OBJC_METHOD: diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp index 128361e4bb..a5c4398042 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp @@ -648,6 +648,7 @@ void ASTDeclWriter::VisitBlockDecl(BlockDecl *D) { void ASTDeclWriter::VisitLinkageSpecDecl(LinkageSpecDecl *D) { VisitDecl(D); Record.push_back(D->getLanguage()); + Writer.AddSourceLocation(D->getExternLoc(), Record); Writer.AddSourceLocation(D->getRBraceLoc(), Record); Code = serialization::DECL_LINKAGE_SPEC; } @@ -1054,6 +1055,7 @@ void ASTDeclWriter::VisitStaticAssertDecl(StaticAssertDecl *D) { VisitDecl(D); Writer.AddStmt(D->getAssertExpr()); Writer.AddStmt(D->getMessage()); + Writer.AddSourceLocation(D->getRParenLoc(), Record); Code = serialization::DECL_STATIC_ASSERT; } diff --git a/test/Index/c-index-api-loadTU-test.m b/test/Index/c-index-api-loadTU-test.m index 64cffb2f63..98a41d837f 100644 --- a/test/Index/c-index-api-loadTU-test.m +++ b/test/Index/c-index-api-loadTU-test.m @@ -102,7 +102,7 @@ struct X0 {}; // CHECK: c-index-api-loadTU-test.m:43:3: EnumConstantDecl=someEnum:43:3 (Definition) Extent=[43:3 - 43:11] // CHECK: c-index-api-loadTU-test.m:46:5: FunctionDecl=main:46:5 (Definition) Extent=[46:1 - 55:2] // CHECK: c-index-api-loadTU-test.m:46:15: ParmDecl=argc:46:15 (Definition) Extent=[46:11 - 46:19] -// CHECK: c-index-api-loadTU-test.m:46:34: ParmDecl=argv:46:34 (Definition) Extent=[46:21 - 46:38] +// CHECK: c-index-api-loadTU-test.m:46:34: ParmDecl=argv:46:34 (Definition) Extent=[46:21 - 46:40] // CHECK: c-index-api-loadTU-test.m:47:8: VarDecl=bee:47:8 (Definition) Extent=[47:2 - 47:11] // CHECK: c-index-api-loadTU-test.m:47:2: ObjCClassRef=Baz:33:12 Extent=[47:2 - 47:5] // CHECK: c-index-api-loadTU-test.m:48:5: VarDecl=a:48:5 (Definition) Extent=[48:2 - 48:18] diff --git a/test/Index/c-index-getCursor-test.m b/test/Index/c-index-getCursor-test.m index 651a1e5fe4..c2ff6963c9 100644 --- a/test/Index/c-index-getCursor-test.m +++ b/test/Index/c-index-getCursor-test.m @@ -109,8 +109,8 @@ void f() { // CHECK: [44:1 - 44:11] FunctionDecl=main:44:5 (Definition) // CHECK: [44:11 - 44:19] ParmDecl=argc:44:15 (Definition) // CHECK: [44:19 - 44:21] FunctionDecl=main:44:5 (Definition) -// CHECK: [44:21 - 44:38] ParmDecl=argv:44:34 (Definition) -// CHECK: [44:38 - 44:42] FunctionDecl=main:44:5 (Definition) +// CHECK: [44:21 - 44:40] ParmDecl=argv:44:34 (Definition) +// CHECK: [44:40 - 44:42] FunctionDecl=main:44:5 (Definition) // CHECK: [44:42 - 45:2] UnexposedStmt= // CHECK: [45:2 - 45:5] ObjCClassRef=Baz:31:12 // CHECK: [45:5 - 45:11] VarDecl=bee:45:8 (Definition) diff --git a/test/Index/recursive-cxx-member-calls.cpp b/test/Index/recursive-cxx-member-calls.cpp index c5f1325fd5..3f5419d35d 100644 --- a/test/Index/recursive-cxx-member-calls.cpp +++ b/test/Index/recursive-cxx-member-calls.cpp @@ -858,7 +858,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK-tokens: Punctuation: ")" [88:61 - 88:62] ParmDecl=S:88:60 (Definition) // CHECK-tokens: Punctuation: "[" [88:62 - 88:63] ParmDecl=S:88:60 (Definition) // CHECK-tokens: Identifier: "N" [88:63 - 88:64] DeclRefExpr=N:88:23 -// CHECK-tokens: Punctuation: "]" [88:64 - 88:65] FunctionTemplate=Case:88:42 (Definition) +// CHECK-tokens: Punctuation: "]" [88:64 - 88:65] ParmDecl=S:88:60 (Definition) // CHECK-tokens: Punctuation: "," [88:65 - 88:66] FunctionTemplate=Case:88:42 (Definition) // CHECK-tokens: Keyword: "const" [89:47 - 89:52] FunctionTemplate=Case:88:42 (Definition) // CHECK-tokens: Identifier: "T" [89:53 - 89:54] ParmDecl=Value:89:57 (Definition) @@ -1532,7 +1532,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK: 4:20: TemplateTypeParameter=_T1:4:20 (Definition) Extent=[4:14 - 4:23] // CHECK: 4:31: TemplateTypeParameter=_T2:4:31 (Definition) Extent=[4:25 - 4:34] // CHECK: 4:55: FieldDecl=second:4:55 (Definition) Extent=[4:51 - 4:61] -// CHECK: 6:8: UnexposedDecl=:6:8 (Definition) Extent=[6:8 - 9:2] +// CHECK: 6:8: UnexposedDecl=:6:8 (Definition) Extent=[6:1 - 9:2] // CHECK: 7:7: FunctionDecl=memcmp:7:7 Extent=[7:3 - 7:49] // CHECK: 7:26: ParmDecl=:7:26 (Definition) Extent=[7:14 - 7:27] // CHECK: 7:40: ParmDecl=:7:40 (Definition) Extent=[7:28 - 7:41] @@ -1851,7 +1851,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { // CHECK: 87:62: UnexposedStmt= Extent=[87:62 - 87:64] // CHECK: 88:42: FunctionTemplate=Case:88:42 (Definition) Extent=[88:3 - 91:4] // CHECK: 88:23: NonTypeTemplateParameter=N:88:23 (Definition) Extent=[88:14 - 88:24] -// CHECK: 88:60: ParmDecl=S:88:60 (Definition) Extent=[88:47 - 88:61] +// CHECK: 88:60: ParmDecl=S:88:60 (Definition) Extent=[88:47 - 88:65] // CHECK: 88:63: DeclRefExpr=N:88:23 Extent=[88:63 - 88:64] // CHECK: 89:57: ParmDecl=Value:89:57 (Definition) Extent=[89:47 - 89:62] // CHECK: 89:64: UnexposedStmt= Extent=[89:64 - 91:4]