@@ -501,7 +501,7 @@ static clang::SourceLocation GetDeclStartLocation(clang::CompilerInstance* C,
501
501
const clang::Decl* D)
502
502
{
503
503
auto & SM = C->getSourceManager ();
504
- auto startLoc = SM.getExpansionLoc (D->getLocStart ());
504
+ auto startLoc = SM.getExpansionLoc (D->getBeginLoc ());
505
505
auto startOffset = SM.getFileOffset (startLoc);
506
506
507
507
if (clang::dyn_cast_or_null<clang::TranslationUnitDecl>(D) || !startLoc.isValid ())
@@ -519,7 +519,7 @@ static clang::SourceLocation GetDeclStartLocation(clang::CompilerInstance* C,
519
519
if (!prevDecl || !IsExplicit (prevDecl))
520
520
return lineBeginLoc;
521
521
522
- auto prevDeclEndLoc = SM.getExpansionLoc (prevDecl->getLocEnd ());
522
+ auto prevDeclEndLoc = SM.getExpansionLoc (prevDecl->getEndLoc ());
523
523
auto prevDeclEndOffset = SM.getFileOffset (prevDeclEndLoc);
524
524
525
525
if (SM.getFileID (prevDeclEndLoc) != SM.getFileID (startLoc))
@@ -532,7 +532,7 @@ static clang::SourceLocation GetDeclStartLocation(clang::CompilerInstance* C,
532
532
return lineBeginLoc;
533
533
534
534
// Declarations don't share same macro expansion
535
- if (SM.getExpansionLoc (prevDecl->getLocStart ()) != startLoc)
535
+ if (SM.getExpansionLoc (prevDecl->getBeginLoc ()) != startLoc)
536
536
return prevDeclEndLoc;
537
537
538
538
return GetDeclStartLocation (C, prevDecl);
@@ -891,7 +891,7 @@ static bool HasLayout(const clang::RecordDecl* Record)
891
891
892
892
bool Parser::IsSupported (const clang::NamedDecl* ND)
893
893
{
894
- return !c->getSourceManager ().isInSystemHeader (ND->getLocStart ()) ||
894
+ return !c->getSourceManager ().isInSystemHeader (ND->getBeginLoc ()) ||
895
895
(llvm::isa<clang::RecordDecl>(ND) &&
896
896
supportedStdTypes.find (ND->getName ()) != supportedStdTypes.end ());
897
897
}
@@ -900,7 +900,7 @@ bool Parser::IsSupported(const clang::CXXMethodDecl* MD)
900
900
{
901
901
using namespace clang ;
902
902
903
- return !c->getSourceManager ().isInSystemHeader (MD->getLocStart ()) ||
903
+ return !c->getSourceManager ().isInSystemHeader (MD->getBeginLoc ()) ||
904
904
isa<CXXConstructorDecl>(MD) || isa<CXXDestructorDecl>(MD) ||
905
905
(MD->getDeclName ().isIdentifier () && MD->getName () == " c_str" &&
906
906
supportedStdTypes.find (MD->getParent ()->getName ()) !=
@@ -918,7 +918,7 @@ void Parser::WalkRecord(const clang::RecordDecl* Record, Class* RC)
918
918
{
919
919
auto headStartLoc = GetDeclStartLocation (c.get (), Record);
920
920
auto headEndLoc = Record->getLocation (); // identifier location
921
- auto bodyEndLoc = Record->getLocEnd ();
921
+ auto bodyEndLoc = Record->getEndLoc ();
922
922
923
923
auto headRange = clang::SourceRange (headStartLoc, headEndLoc);
924
924
auto bodyRange = clang::SourceRange (headEndLoc, bodyEndLoc);
@@ -949,7 +949,7 @@ void Parser::WalkRecord(const clang::RecordDecl* Record, Class* RC)
949
949
for (auto FD : Record->fields ())
950
950
WalkFieldCXX (FD, RC);
951
951
952
- if (c->getSourceManager ().isInSystemHeader (Record->getLocStart ()))
952
+ if (c->getSourceManager ().isInSystemHeader (Record->getBeginLoc ()))
953
953
{
954
954
if (supportedStdTypes.find (Record->getName ()) != supportedStdTypes.end ())
955
955
{
@@ -2924,7 +2924,7 @@ void Parser::CompleteIfSpecializationType(const clang::QualType& QualType)
2924
2924
2925
2925
auto Diagnostics = c->getSema ().getDiagnostics ().getClient ();
2926
2926
auto SemaDiagnostics = static_cast <::DiagnosticConsumer*>(Diagnostics);
2927
- c->getSema ().InstantiateClassTemplateSpecialization (CTS->getLocStart (),
2927
+ c->getSema ().InstantiateClassTemplateSpecialization (CTS->getBeginLoc (),
2928
2928
CTS, TSK_ImplicitInstantiation, false );
2929
2929
}
2930
2930
@@ -3051,7 +3051,7 @@ void Parser::MarkValidity(Function* F)
3051
3051
if (!FD->getTemplateInstantiationPattern () ||
3052
3052
FD->getTemplateInstantiationPattern ()->isLateTemplateParsed () ||
3053
3053
!FD->isExternallyVisible () ||
3054
- c->getSourceManager ().isInSystemHeader (FD->getLocStart ()))
3054
+ c->getSourceManager ().isInSystemHeader (FD->getBeginLoc ()))
3055
3055
return ;
3056
3056
3057
3057
auto Diagnostics = c->getSema ().getDiagnostics ().getClient ();
@@ -3060,7 +3060,7 @@ void Parser::MarkValidity(Function* F)
3060
3060
auto TUScope = c->getSema ().TUScope ;
3061
3061
std::stack<Scope> Scopes = GetScopesFor (FD);
3062
3062
c->getSema ().TUScope = &Scopes.top ();
3063
- c->getSema ().InstantiateFunctionDefinition (FD->getLocStart (), FD,
3063
+ c->getSema ().InstantiateFunctionDefinition (FD->getBeginLoc (), FD,
3064
3064
/* Recursive*/ true );
3065
3065
c->getSema ().TUScope = TUScope;
3066
3066
F->isInvalid = FD->isInvalidDecl ();
@@ -3133,7 +3133,7 @@ void Parser::WalkFunction(const clang::FunctionDecl* FD, Function* F,
3133
3133
const auto & Body = GetFunctionBody (FD);
3134
3134
F->body = Body;
3135
3135
3136
- clang::SourceLocation ParamStartLoc = FD->getLocStart ();
3136
+ clang::SourceLocation ParamStartLoc = FD->getBeginLoc ();
3137
3137
clang::SourceLocation ResultLoc;
3138
3138
3139
3139
auto FTSI = FD->getTypeSourceInfo ();
@@ -3149,15 +3149,15 @@ void Parser::WalkFunction(const clang::FunctionDecl* FD, Function* F,
3149
3149
assert (!FTInfo.isNull ());
3150
3150
3151
3151
ParamStartLoc = FTInfo.getLParenLoc ();
3152
- ResultLoc = FTInfo.getReturnLoc ().getLocStart ();
3152
+ ResultLoc = FTInfo.getReturnLoc ().getBeginLoc ();
3153
3153
}
3154
3154
}
3155
3155
3156
- clang::SourceLocation BeginLoc = FD->getLocStart ();
3156
+ clang::SourceLocation BeginLoc = FD->getBeginLoc ();
3157
3157
if (ResultLoc.isValid ())
3158
3158
BeginLoc = ResultLoc;
3159
3159
3160
- clang::SourceRange Range (BeginLoc, FD->getLocEnd ());
3160
+ clang::SourceRange Range (BeginLoc, FD->getEndLoc ());
3161
3161
3162
3162
std::string Sig;
3163
3163
if (GetDeclText (Range, Sig))
@@ -3168,7 +3168,7 @@ void Parser::WalkFunction(const clang::FunctionDecl* FD, Function* F,
3168
3168
auto P = WalkParameter (VD, ParamStartLoc);
3169
3169
F->Parameters .push_back (P);
3170
3170
3171
- ParamStartLoc = VD->getLocEnd ();
3171
+ ParamStartLoc = VD->getEndLoc ();
3172
3172
}
3173
3173
3174
3174
auto & CXXABI = codeGenTypes->getCXXABI ();
@@ -3283,8 +3283,8 @@ void Parser::WalkAST()
3283
3283
auto TU = c->getASTContext ().getTranslationUnitDecl ();
3284
3284
for (auto D : TU->decls ())
3285
3285
{
3286
- if (D->getLocStart ().isValid () &&
3287
- !c->getSourceManager ().isInSystemHeader (D->getLocStart ()))
3286
+ if (D->getBeginLoc ().isValid () &&
3287
+ !c->getSourceManager ().isInSystemHeader (D->getBeginLoc ()))
3288
3288
WalkDeclarationDef (D);
3289
3289
}
3290
3290
}
@@ -3654,8 +3654,8 @@ void Parser::HandleDeclaration(const clang::Decl* D, Declaration* Decl)
3654
3654
auto IsDeclExplicit = IsExplicit (D);
3655
3655
if (IsDeclExplicit)
3656
3656
{
3657
- Decl->lineNumberStart = c->getSourceManager ().getExpansionLineNumber (D->getLocStart ());
3658
- Decl->lineNumberEnd = c->getSourceManager ().getExpansionLineNumber (D->getLocEnd ());
3657
+ Decl->lineNumberStart = c->getSourceManager ().getExpansionLineNumber (D->getBeginLoc ());
3658
+ Decl->lineNumberEnd = c->getSourceManager ().getExpansionLineNumber (D->getEndLoc ());
3659
3659
}
3660
3660
else
3661
3661
{
@@ -3676,7 +3676,7 @@ void Parser::HandleDeclaration(const clang::Decl* D, Declaration* Decl)
3676
3676
else if (IsDeclExplicit)
3677
3677
{
3678
3678
auto startLoc = GetDeclStartLocation (c.get (), D);
3679
- auto endLoc = D->getLocEnd ();
3679
+ auto endLoc = D->getEndLoc ();
3680
3680
auto range = clang::SourceRange (startLoc, endLoc);
3681
3681
3682
3682
HandlePreprocessedEntities (Decl, range);
@@ -4445,7 +4445,7 @@ Declaration* Parser::GetDeclarationFromFriend(clang::NamedDecl* FriendDecl)
4445
4445
{
4446
4446
auto DecomposedLocStart = SM.getDecomposedLoc (it->getLocation ());
4447
4447
int NewLineNumberStart = SM.getLineNumber (DecomposedLocStart.first , DecomposedLocStart.second );
4448
- auto DecomposedLocEnd = SM.getDecomposedLoc (it->getLocEnd ());
4448
+ auto DecomposedLocEnd = SM.getDecomposedLoc (it->getEndLoc ());
4449
4449
int NewLineNumberEnd = SM.getLineNumber (DecomposedLocEnd.first , DecomposedLocEnd.second );
4450
4450
if (NewLineNumberStart < MinLineNumberStart)
4451
4451
{
0 commit comments