summaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2018-08-09 21:09:38 +0000
committerStephen Kelly <steveire@gmail.com>2018-08-09 21:09:38 +0000
commit2dfd8132cf7984a86fd4cfc9d84f2195d60205ef (patch)
tree6af8bbd1c911945732be0a9272736594124e5b96 /lib/Sema
parentd7b659b592e6aaa6659904d346a0cacfa18d1661 (diff)
downloadclang-2dfd8132cf7984a86fd4cfc9d84f2195d60205ef.tar.gz
Port getLocEnd -> getEndLoc
Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50351 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339386 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/AnalysisBasedWarnings.cpp14
-rw-r--r--lib/Sema/SemaCast.cpp4
-rw-r--r--lib/Sema/SemaChecking.cpp115
-rw-r--r--lib/Sema/SemaDecl.cpp13
-rw-r--r--lib/Sema/SemaDeclAttr.cpp10
-rw-r--r--lib/Sema/SemaDeclCXX.cpp37
-rw-r--r--lib/Sema/SemaDeclObjC.cpp4
-rw-r--r--lib/Sema/SemaExpr.cpp53
-rw-r--r--lib/Sema/SemaExprCXX.cpp25
-rw-r--r--lib/Sema/SemaExprObjC.cpp9
-rw-r--r--lib/Sema/SemaInit.cpp61
-rw-r--r--lib/Sema/SemaLambda.cpp45
-rw-r--r--lib/Sema/SemaObjCProperty.cpp4
-rw-r--r--lib/Sema/SemaOpenMP.cpp8
-rw-r--r--lib/Sema/SemaOverload.cpp2
-rw-r--r--lib/Sema/SemaStmt.cpp6
-rw-r--r--lib/Sema/SemaTemplate.cpp4
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp4
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp21
-rw-r--r--lib/Sema/SemaTemplateVariadic.cpp2
-rw-r--r--lib/Sema/SemaType.cpp10
-rw-r--r--lib/Sema/TreeTransform.h123
22 files changed, 276 insertions, 298 deletions
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp
index 73787610b5..96684b321e 100644
--- a/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/lib/Sema/AnalysisBasedWarnings.cpp
@@ -651,7 +651,7 @@ static void CheckFallThroughForBody(Sema &S, const Decl *D, const Stmt *Body,
// Short circuit for compilation speed.
if (CD.checkDiagnostics(Diags, ReturnsVoid, HasNoReturn))
return;
- SourceLocation LBrace = Body->getBeginLoc(), RBrace = Body->getLocEnd();
+ SourceLocation LBrace = Body->getBeginLoc(), RBrace = Body->getEndLoc();
auto EmitDiag = [&](SourceLocation Loc, unsigned DiagID) {
if (IsCoroutine)
S.Diag(Loc, DiagID) << FSI->CoroutinePromise->getType();
@@ -748,10 +748,10 @@ static bool SuggestInitializationFixit(Sema &S, const VarDecl *VD) {
return false;
// Don't suggest a fixit inside macros.
- if (VD->getLocEnd().isMacroID())
+ if (VD->getEndLoc().isMacroID())
return false;
- SourceLocation Loc = S.getLocForEndOfToken(VD->getLocEnd());
+ SourceLocation Loc = S.getLocForEndOfToken(VD->getEndLoc());
// Suggest possible initialization (if any).
std::string Init = S.getFixItZeroInitializerForType(VariableTy, Loc);
@@ -773,9 +773,9 @@ static void CreateIfFixit(Sema &S, const Stmt *If, const Stmt *Then,
Fixit1 = FixItHint::CreateRemoval(
CharSourceRange::getCharRange(If->getBeginLoc(), Then->getBeginLoc()));
if (Else) {
- SourceLocation ElseKwLoc = S.getLocForEndOfToken(Then->getLocEnd());
- Fixit2 = FixItHint::CreateRemoval(
- SourceRange(ElseKwLoc, Else->getLocEnd()));
+ SourceLocation ElseKwLoc = S.getLocForEndOfToken(Then->getEndLoc());
+ Fixit2 =
+ FixItHint::CreateRemoval(SourceRange(ElseKwLoc, Else->getEndLoc()));
}
} else {
// If condition is always false, remove all but the 'else'.
@@ -2142,7 +2142,7 @@ AnalysisBasedWarnings::IssueWarnings(sema::AnalysisBasedWarnings::Policy P,
// Check for thread safety violations
if (P.enableThreadSafetyAnalysis) {
SourceLocation FL = AC.getDecl()->getLocation();
- SourceLocation FEL = AC.getDecl()->getLocEnd();
+ SourceLocation FEL = AC.getDecl()->getEndLoc();
threadSafety::ThreadSafetyReporter Reporter(S, FL, FEL);
if (!Diags.isIgnored(diag::warn_thread_safety_beta, D->getBeginLoc()))
Reporter.setIssueBetaWarnings(true);
diff --git a/lib/Sema/SemaCast.cpp b/lib/Sema/SemaCast.cpp
index ccf10639be..c2e314c245 100644
--- a/lib/Sema/SemaCast.cpp
+++ b/lib/Sema/SemaCast.cpp
@@ -2723,7 +2723,7 @@ ExprResult Sema::BuildCStyleCastExpr(SourceLocation LPLoc,
Expr *CastExpr) {
CastOperation Op(*this, CastTypeInfo->getType(), CastExpr);
Op.DestRange = CastTypeInfo->getTypeLoc().getSourceRange();
- Op.OpRange = SourceRange(LPLoc, CastExpr->getLocEnd());
+ Op.OpRange = SourceRange(LPLoc, CastExpr->getEndLoc());
if (getLangOpts().CPlusPlus) {
Op.CheckCXXCStyleCast(/*FunctionalStyle=*/ false,
@@ -2751,7 +2751,7 @@ ExprResult Sema::BuildCXXFunctionalCastExpr(TypeSourceInfo *CastTypeInfo,
assert(LPLoc.isValid() && "List-initialization shouldn't get here.");
CastOperation Op(*this, Type, CastExpr);
Op.DestRange = CastTypeInfo->getTypeLoc().getSourceRange();
- Op.OpRange = SourceRange(Op.DestRange.getBegin(), CastExpr->getLocEnd());
+ Op.OpRange = SourceRange(Op.DestRange.getBegin(), CastExpr->getEndLoc());
Op.CheckCXXCStyleCast(/*FunctionalStyle=*/true, /*ListInit=*/false);
if (Op.SrcExpr.isInvalid())
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 9083cbddd0..f85ce4c0e5 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -112,13 +112,13 @@ static bool checkArgCount(Sema &S, CallExpr *call, unsigned desiredArgCount) {
if (argCount == desiredArgCount) return false;
if (argCount < desiredArgCount)
- return S.Diag(call->getLocEnd(), diag::err_typecheck_call_too_few_args)
- << 0 /*function call*/ << desiredArgCount << argCount
- << call->getSourceRange();
+ return S.Diag(call->getEndLoc(), diag::err_typecheck_call_too_few_args)
+ << 0 /*function call*/ << desiredArgCount << argCount
+ << call->getSourceRange();
// Highlight all the excess arguments.
SourceRange range(call->getArg(desiredArgCount)->getBeginLoc(),
- call->getArg(argCount - 1)->getLocEnd());
+ call->getArg(argCount - 1)->getEndLoc());
return S.Diag(range.getBegin(), diag::err_typecheck_call_too_many_args)
<< 0 /*function call*/ << desiredArgCount << argCount
@@ -156,7 +156,7 @@ static bool SemaBuiltinAnnotation(Sema &S, CallExpr *TheCall) {
static bool SemaBuiltinMSVCAnnotation(Sema &S, CallExpr *TheCall) {
// We need at least one argument.
if (TheCall->getNumArgs() < 1) {
- S.Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args_at_least)
+ S.Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args_at_least)
<< 0 << 1 << TheCall->getNumArgs()
<< TheCall->getCallee()->getSourceRange();
return true;
@@ -4308,9 +4308,9 @@ ExprResult Sema::SemaAtomicOpsOverloaded(ExprResult TheCallResult,
++AdjustedNumArgs;
// Check we have the right number of arguments.
if (TheCall->getNumArgs() < AdjustedNumArgs) {
- Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)
- << 0 << AdjustedNumArgs << TheCall->getNumArgs()
- << TheCall->getCallee()->getSourceRange();
+ Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args)
+ << 0 << AdjustedNumArgs << TheCall->getNumArgs()
+ << TheCall->getCallee()->getSourceRange();
return ExprError();
} else if (TheCall->getNumArgs() > AdjustedNumArgs) {
Diag(TheCall->getArg(AdjustedNumArgs)->getBeginLoc(),
@@ -4628,9 +4628,9 @@ Sema::SemaBuiltinAtomicOverloaded(ExprResult TheCallResult) {
// Ensure that we have at least one argument to do type inference from.
if (TheCall->getNumArgs() < 1) {
- Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args_at_least)
- << 0 << 1 << TheCall->getNumArgs()
- << TheCall->getCallee()->getSourceRange();
+ Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args_at_least)
+ << 0 << 1 << TheCall->getNumArgs()
+ << TheCall->getCallee()->getSourceRange();
return ExprError();
}
@@ -4905,15 +4905,15 @@ Sema::SemaBuiltinAtomicOverloaded(ExprResult TheCallResult) {
// Now that we know how many fixed arguments we expect, first check that we
// have at least that many.
if (TheCall->getNumArgs() < 1+NumFixed) {
- Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args_at_least)
- << 0 << 1+NumFixed << TheCall->getNumArgs()
- << TheCall->getCallee()->getSourceRange();
+ Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args_at_least)
+ << 0 << 1 + NumFixed << TheCall->getNumArgs()
+ << TheCall->getCallee()->getSourceRange();
return ExprError();
}
if (WarnAboutSemanticsChange) {
- Diag(TheCall->getLocEnd(), diag::warn_sync_fetch_and_nand_semantics_change)
- << TheCall->getCallee()->getSourceRange();
+ Diag(TheCall->getEndLoc(), diag::warn_sync_fetch_and_nand_semantics_change)
+ << TheCall->getCallee()->getSourceRange();
}
// Get the decl for the concrete builtin from this, we can tell what the
@@ -5204,14 +5204,14 @@ bool Sema::SemaBuiltinVAStart(unsigned BuiltinID, CallExpr *TheCall) {
<< 0 /*function call*/ << 2 << TheCall->getNumArgs()
<< Fn->getSourceRange()
<< SourceRange(TheCall->getArg(2)->getBeginLoc(),
- (*(TheCall->arg_end() - 1))->getLocEnd());
+ (*(TheCall->arg_end() - 1))->getEndLoc());
return true;
}
if (TheCall->getNumArgs() < 2) {
- return Diag(TheCall->getLocEnd(),
- diag::err_typecheck_call_too_few_args_at_least)
- << 0 /*function call*/ << 2 << TheCall->getNumArgs();
+ return Diag(TheCall->getEndLoc(),
+ diag::err_typecheck_call_too_few_args_at_least)
+ << 0 /*function call*/ << 2 << TheCall->getNumArgs();
}
// Type-check the first argument normally.
@@ -5278,7 +5278,7 @@ bool Sema::SemaBuiltinVAStartARMMicrosoft(CallExpr *Call) {
Expr *Func = Call->getCallee();
if (Call->getNumArgs() < 3)
- return Diag(Call->getLocEnd(),
+ return Diag(Call->getEndLoc(),
diag::err_typecheck_call_too_few_args_at_least)
<< 0 /*function call*/ << 3 << Call->getNumArgs();
@@ -5323,14 +5323,14 @@ bool Sema::SemaBuiltinVAStartARMMicrosoft(CallExpr *Call) {
/// friends. This is declared to take (...), so we have to check everything.
bool Sema::SemaBuiltinUnorderedCompare(CallExpr *TheCall) {
if (TheCall->getNumArgs() < 2)
- return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)
- << 0 << 2 << TheCall->getNumArgs()/*function call*/;
+ return Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args)
+ << 0 << 2 << TheCall->getNumArgs() /*function call*/;
if (TheCall->getNumArgs() > 2)
return Diag(TheCall->getArg(2)->getBeginLoc(),
diag::err_typecheck_call_too_many_args)
<< 0 /*function call*/ << 2 << TheCall->getNumArgs()
<< SourceRange(TheCall->getArg(2)->getBeginLoc(),
- (*(TheCall->arg_end() - 1))->getLocEnd());
+ (*(TheCall->arg_end() - 1))->getEndLoc());
ExprResult OrigArg0 = TheCall->getArg(0);
ExprResult OrigArg1 = TheCall->getArg(1);
@@ -5357,7 +5357,7 @@ bool Sema::SemaBuiltinUnorderedCompare(CallExpr *TheCall) {
diag::err_typecheck_call_invalid_ordered_compare)
<< OrigArg0.get()->getType() << OrigArg1.get()->getType()
<< SourceRange(OrigArg0.get()->getBeginLoc(),
- OrigArg1.get()->getLocEnd());
+ OrigArg1.get()->getEndLoc());
return false;
}
@@ -5368,14 +5368,14 @@ bool Sema::SemaBuiltinUnorderedCompare(CallExpr *TheCall) {
/// value.
bool Sema::SemaBuiltinFPClassification(CallExpr *TheCall, unsigned NumArgs) {
if (TheCall->getNumArgs() < NumArgs)
- return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)
- << 0 << NumArgs << TheCall->getNumArgs()/*function call*/;
+ return Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args)
+ << 0 << NumArgs << TheCall->getNumArgs() /*function call*/;
if (TheCall->getNumArgs() > NumArgs)
return Diag(TheCall->getArg(NumArgs)->getBeginLoc(),
diag::err_typecheck_call_too_many_args)
<< 0 /*function call*/ << NumArgs << TheCall->getNumArgs()
<< SourceRange(TheCall->getArg(NumArgs)->getBeginLoc(),
- (*(TheCall->arg_end() - 1))->getLocEnd());
+ (*(TheCall->arg_end() - 1))->getEndLoc());
Expr *OrigArg = TheCall->getArg(NumArgs-1);
@@ -5420,13 +5420,13 @@ bool Sema::SemaBuiltinFPClassification(CallExpr *TheCall, unsigned NumArgs) {
bool Sema::SemaBuiltinVSX(CallExpr *TheCall) {
unsigned ExpectedNumArgs = 3;
if (TheCall->getNumArgs() < ExpectedNumArgs)
- return Diag(TheCall->getLocEnd(),
+ return Diag(TheCall->getEndLoc(),
diag::err_typecheck_call_too_few_args_at_least)
- << 0 /*function call*/ << ExpectedNumArgs << TheCall->getNumArgs()
+ << 0 /*function call*/ << ExpectedNumArgs << TheCall->getNumArgs()
<< TheCall->getSourceRange();
if (TheCall->getNumArgs() > ExpectedNumArgs)
- return Diag(TheCall->getLocEnd(),
+ return Diag(TheCall->getEndLoc(),
diag::err_typecheck_call_too_many_args_at_most)
<< 0 /*function call*/ << ExpectedNumArgs << TheCall->getNumArgs()
<< TheCall->getSourceRange();
@@ -5438,7 +5438,7 @@ bool Sema::SemaBuiltinVSX(CallExpr *TheCall) {
diag::err_vsx_builtin_nonconstant_argument)
<< 3 /* argument index */ << TheCall->getDirectCallee()
<< SourceRange(TheCall->getArg(2)->getBeginLoc(),
- TheCall->getArg(2)->getLocEnd());
+ TheCall->getArg(2)->getEndLoc());
QualType Arg1Ty = TheCall->getArg(0)->getType();
QualType Arg2Ty = TheCall->getArg(1)->getType();
@@ -5450,7 +5450,7 @@ bool Sema::SemaBuiltinVSX(CallExpr *TheCall) {
return Diag(BuiltinLoc, diag::err_vec_builtin_non_vector)
<< TheCall->getDirectCallee()
<< SourceRange(TheCall->getArg(0)->getBeginLoc(),
- TheCall->getArg(1)->getLocEnd());
+ TheCall->getArg(1)->getEndLoc());
}
// Check the first two arguments are the same type.
@@ -5458,7 +5458,7 @@ bool Sema::SemaBuiltinVSX(CallExpr *TheCall) {
return Diag(BuiltinLoc, diag::err_vec_builtin_incompatible_vector)
<< TheCall->getDirectCallee()
<< SourceRange(TheCall->getArg(0)->getBeginLoc(),
- TheCall->getArg(1)->getLocEnd());
+ TheCall->getArg(1)->getEndLoc());
}
// When default clang type checking is turned off and the customized type
@@ -5473,7 +5473,7 @@ bool Sema::SemaBuiltinVSX(CallExpr *TheCall) {
// This is declared to take (...), so we have to check everything.
ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) {
if (TheCall->getNumArgs() < 2)
- return ExprError(Diag(TheCall->getLocEnd(),
+ return ExprError(Diag(TheCall->getEndLoc(),
diag::err_typecheck_call_too_few_args_at_least)
<< 0 /*function call*/ << 2 << TheCall->getNumArgs()
<< TheCall->getSourceRange());
@@ -5494,7 +5494,7 @@ ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) {
Diag(TheCall->getBeginLoc(), diag::err_vec_builtin_non_vector)
<< TheCall->getDirectCallee()
<< SourceRange(TheCall->getArg(0)->getBeginLoc(),
- TheCall->getArg(1)->getLocEnd()));
+ TheCall->getArg(1)->getEndLoc()));
numElements = LHSType->getAs<VectorType>()->getNumElements();
unsigned numResElements = TheCall->getNumArgs() - 2;
@@ -5509,13 +5509,13 @@ ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) {
diag::err_vec_builtin_incompatible_vector)
<< TheCall->getDirectCallee()
<< SourceRange(TheCall->getArg(1)->getBeginLoc(),
- TheCall->getArg(1)->getLocEnd()));
+ TheCall->getArg(1)->getEndLoc()));
} else if (!Context.hasSameUnqualifiedType(LHSType, RHSType)) {
return ExprError(Diag(TheCall->getBeginLoc(),
diag::err_vec_builtin_incompatible_vector)
<< TheCall->getDirectCallee()
<< SourceRange(TheCall->getArg(0)->getBeginLoc(),
- TheCall->getArg(1)->getLocEnd()));
+ TheCall->getArg(1)->getEndLoc()));
} else if (numElements != numResElements) {
QualType eltType = LHSType->getAs<VectorType>()->getElementType();
resType = Context.getVectorType(eltType, numResElements,
@@ -5593,10 +5593,9 @@ bool Sema::SemaBuiltinPrefetch(CallExpr *TheCall) {
unsigned NumArgs = TheCall->getNumArgs();
if (NumArgs > 3)
- return Diag(TheCall->getLocEnd(),
- diag::err_typecheck_call_too_many_args_at_most)
- << 0 /*function call*/ << 3 << NumArgs
- << TheCall->getSourceRange();
+ return Diag(TheCall->getEndLoc(),
+ diag::err_typecheck_call_too_many_args_at_most)
+ << 0 /*function call*/ << 3 << NumArgs << TheCall->getSourceRange();
// Argument 0 is checked for us and the remaining arguments must be
// constant integers.
@@ -5661,10 +5660,9 @@ bool Sema::SemaBuiltinAssumeAligned(CallExpr *TheCall) {
unsigned NumArgs = TheCall->getNumArgs();
if (NumArgs > 3)
- return Diag(TheCall->getLocEnd(),
- diag::err_typecheck_call_too_many_args_at_most)
- << 0 /*function call*/ << 3 << NumArgs
- << TheCall->getSourceRange();
+ return Diag(TheCall->getEndLoc(),
+ diag::err_typecheck_call_too_many_args_at_most)
+ << 0 /*function call*/ << 3 << NumArgs << TheCall->getSourceRange();
// The alignment must be a constant integer.
Expr *Arg = TheCall->getArg(1);
@@ -5700,12 +5698,12 @@ bool Sema::SemaBuiltinOSLogFormat(CallExpr *TheCall) {
unsigned NumArgs = TheCall->getNumArgs();
unsigned NumRequiredArgs = IsSizeCall ? 1 : 2;
if (NumArgs < NumRequiredArgs) {
- return Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args)
+ return Diag(TheCall->getEndLoc(), diag::err_typecheck_call_too_few_args)
<< 0 /* function call */ << NumRequiredArgs << NumArgs
<< TheCall->getSourceRange();
}
if (NumArgs >= NumRequiredArgs + 0x100) {
- return Diag(TheCall->getLocEnd(),
+ return Diag(TheCall->getEndLoc(),
diag::err_typecheck_call_too_many_args_at_most)
<< 0 /* function call */ << (NumRequiredArgs + 0xff) << NumArgs
<< TheCall->getSourceRange();
@@ -5743,7 +5741,7 @@ bool Sema::SemaBuiltinOSLogFormat(CallExpr *TheCall) {
return true;
CharUnits ArgSize = Context.getTypeSizeInChars(Arg.get()->getType());
if (ArgSize.getQuantity() >= 0x100) {
- return Diag(Arg.get()->getLocEnd(), diag::err_os_log_argument_too_big)
+ return Diag(Arg.get()->getEndLoc(), diag::err_os_log_argument_too_big)
<< i << (int)ArgSize.getQuantity() << 0xff
<< TheCall->getSourceRange();
}
@@ -5948,7 +5946,7 @@ bool Sema::SemaBuiltinARMSpecialReg(unsigned BuiltinID, CallExpr *TheCall,
bool Sema::SemaBuiltinLongjmp(CallExpr *TheCall) {
if (!Context.getTargetInfo().hasSjLjLowering())
return Diag(TheCall->getBeginLoc(), diag::err_builtin_longjmp_unsupported)
- << SourceRange(TheCall->getBeginLoc(), TheCall->getLocEnd());
+ << SourceRange(TheCall->getBeginLoc(), TheCall->getEndLoc());
Expr *Arg = TheCall->getArg(1);
llvm::APSInt Result;
@@ -5959,7 +5957,7 @@ bool Sema::SemaBuiltinLongjmp(CallExpr *TheCall) {
if (Result != 1)
return Diag(TheCall->getBeginLoc(), diag::err_builtin_longjmp_invalid_val)
- << SourceRange(Arg->getBeginLoc(), Arg->getLocEnd());
+ << SourceRange(Arg->getBeginLoc(), Arg->getEndLoc());
return false;
}
@@ -5969,7 +5967,7 @@ bool Sema::SemaBuiltinLongjmp(CallExpr *TheCall) {
bool Sema::SemaBuiltinSetjmp(CallExpr *TheCall) {
if (!Context.getTargetInfo().hasSjLjLowering())
return Diag(TheCall->getBeginLoc(), diag::err_builtin_setjmp_unsupported)
- << SourceRange(TheCall->getBeginLoc(), TheCall->getLocEnd());
+ << SourceRange(TheCall->getBeginLoc(), TheCall->getEndLoc());
return false;
}
@@ -6119,7 +6117,7 @@ class FormatStringLiteral {
}
SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
- SourceLocation getEndLoc() const LLVM_READONLY { return FExpr->getLocEnd(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return FExpr->getEndLoc(); }
};
} // namespace
@@ -7270,7 +7268,7 @@ bool CheckPrintfHandler::checkForCStrMembers(
if (Method->getMinRequiredArguments() == 0 &&
AT.matchesType(S.Context, Method->getReturnType())) {
// FIXME: Suggest parens if the expression needs them.
- SourceLocation EndLoc = S.getLocForEndOfToken(E->getLocEnd());
+ SourceLocation EndLoc = S.getLocForEndOfToken(E->getEndLoc());
S.Diag(E->getBeginLoc(), diag::note_printf_c_str)
<< "c_str()" << FixItHint::CreateInsertion(EndLoc, ".c_str()");
return true;
@@ -7748,7 +7746,7 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS,
Hints.push_back(
FixItHint::CreateInsertion(E->getBeginLoc(), CastFix.str()));
- SourceLocation After = S.getLocForEndOfToken(E->getLocEnd());
+ SourceLocation After = S.getLocForEndOfToken(E->getEndLoc());
Hints.push_back(FixItHint::CreateInsertion(After, ")"));
}
@@ -8572,8 +8570,9 @@ static bool CheckMemorySizeofForComparison(Sema &S, const Expr *E,
S.Diag(Size->getOperatorLoc(), diag::warn_memsize_comparison)
<< SizeRange << FnName;
S.Diag(FnLoc, diag::note_memsize_comparison_paren)
- << FnName << FixItHint::CreateInsertion(
- S.getLocForEndOfToken(Size->getLHS()->getLocEnd()), ")")
+ << FnName
+ << FixItHint::CreateInsertion(
+ S.getLocForEndOfToken(Size->getLHS()->getEndLoc()), ")")
<< FixItHint::CreateRemoval(RParenLoc);
S.Diag(SizeRange.getBegin(), diag::note_memsize_comparison_cast_silence)
<< FixItHint::CreateInsertion(SizeRange.getBegin(), "(size_t)(")
@@ -11294,7 +11293,7 @@ void Sema::DiagnoseAlwaysNonNullPointer(Expr *E,
return;
}
Diag(E->getExprLoc(), diag::note_function_to_function_call)
- << FixItHint::CreateInsertion(getLocForEndOfToken(E->getLocEnd()), "()");
+ << FixItHint::CreateInsertion(getLocForEndOfToken(E->getEndLoc()), "()");
}
/// Diagnoses "dangerous" implicit conversions within the given
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 906fd89ff2..1eab58d76f 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1735,8 +1735,9 @@ static bool ShouldDiagnoseUnusedDecl(const NamedDecl *D) {
static void GenerateFixForUnusedDecl(const NamedDecl *D, ASTContext &Ctx,
FixItHint &Hint) {
if (isa<LabelDecl>(D)) {
- SourceLocation AfterColon = Lexer::findLocationAfterToken(D->getLocEnd(),
- tok::colon, Ctx.getSourceManager(), Ctx.getLangOpts(), true);
+ SourceLocation AfterColon = Lexer::findLocationAfterToken(
+ D->getEndLoc(), tok::colon, Ctx.getSourceManager(), Ctx.getLangOpts(),
+ true);
if (AfterColon.isInvalid())
return;
Hint = FixItHint::CreateRemoval(
@@ -8005,7 +8006,7 @@ static FunctionDecl* CreateNewFunctionDecl(Sema &SemaRef, Declarator &D,
return CXXDeductionGuideDecl::Create(SemaRef.Context, DC, D.getBeginLoc(),
isExplicit, NameInfo, R, TInfo,
- D.getLocEnd());
+ D.getEndLoc());
} else if (DC->isRecord()) {
// If the name of the function is the same as the name of the record,
// then this must be an invalid constructor that has a return type.
@@ -12479,7 +12480,7 @@ ParmVarDecl *Sema::CheckParameter(DeclContext *DC, SourceLocation StartLoc,
// passed by reference.
if (T->isObjCObjectType()) {
SourceLocation TypeEndLoc =
- getLocForEndOfToken(TSInfo->getTypeLoc().getLocEnd());
+ getLocForEndOfToken(TSInfo->getTypeLoc().getEndLoc());
Diag(NameLoc,
diag::err_object_cannot_be_passed_returned_by_value) << 1 << T
<< FixItHint::CreateInsertion(TypeEndLoc, "*");
@@ -13128,8 +13129,8 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
computeNRVO(Body, getCurFunction());
}
if (getCurFunction()->ObjCShouldCallSuper) {
- Diag(MD->getLocEnd(), diag::warn_objc_missing_super_call)
- << MD->getSelector().getAsString();
+ Diag(MD->getEndLoc(), diag::warn_objc_missing_super_call)
+ << MD->getSelector().getAsString();
getCurFunction()->ObjCShouldCallSuper = false;
}
if (getCurFunction()->ObjCWarnForNoDesignatedInitChain) {
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 30f8f9683d..800bf61970 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -7056,7 +7056,7 @@ struct AttributeInsertion {
StringRef Suffix;
static AttributeInsertion createInsertionAfter(const NamedDecl *D) {
- return {" ", D->getLocEnd(), ""};
+ return {" ", D->getEndLoc(), ""};
}
static AttributeInsertion createInsertionAfter(SourceLocation Loc) {
return {" ", Loc, ""};
@@ -7586,19 +7586,19 @@ public:
bool VisitObjCMessageExpr(ObjCMessageExpr *Msg) {
if (ObjCMethodDecl *D = Msg->getMethodDecl())
DiagnoseDeclAvailability(
- D, SourceRange(Msg->getSelectorStartLoc(), Msg->getLocEnd()));
+ D, SourceRange(Msg->getSelectorStartLoc(), Msg->getEndLoc()));
return true;
}
bool VisitDeclRefExpr(DeclRefExpr *DRE) {
DiagnoseDeclAvailability(DRE->getDecl(),
- SourceRange(DRE->getBeginLoc(), DRE->getLocEnd()));
+ SourceRange(DRE->getBeginLoc(), DRE->getEndLoc()));
return true;
}
bool VisitMemberExpr(MemberExpr *ME) {
DiagnoseDeclAvailability(ME->getMemberDecl(),
- SourceRange(ME->getBeginLoc(), ME->getLocEnd()));
+ SourceRange(ME->getBeginLoc(), ME->getEndLoc()));
return true;
}
@@ -7695,7 +7695,7 @@ void DiagnoseUnguardedAvailability::DiagnoseDeclAvailability(
SM.getExpansionLoc(StmtOfUse->getBeginLoc());
SourceLocation StmtEndLoc =
SM.getExpansionRange(
- (LastStmtOfUse ? LastStmtOfUse : StmtOfUse)->getLocEnd())
+ (LastStmtOfUse ? LastStmtOfUse : StmtOfUse)->getEndLoc())
.getEnd();
if (SM.getFileID(IfInsertionLoc) != SM.getFileID(StmtEndLoc))
return;
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index a7753c51ef..3d8da1f797 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -3650,7 +3650,7 @@ void Sema::ActOnFinishCXXInClassMemberInitializer(Decl *D,
FD->getInClassInitStyle() == ICIS_ListInit
? InitializationKind::CreateDirectList(InitExpr->getBeginLoc(),
InitExpr->getBeginLoc(),
- InitExpr->getLocEnd())
+ InitExpr->getEndLoc())
: InitializationKind::CreateCopy(InitExpr->getBeginLoc(), InitLoc);
InitializationSequence Seq(*this, Entity, Kind, InitExpr);
Init = Seq.Perform(*this, Entity, Kind, InitExpr);
@@ -3998,7 +3998,7 @@ Sema::BuildMemberInitializer(ValueDecl *Member, Expr *Init,
nullptr);
InitializationKind Kind =
InitList ? InitializationKind::CreateDirectList(
- IdLoc, Init->getBeginLoc(), Init->getLocEnd())
+ IdLoc, Init->getBeginLoc(), Init->getEndLoc())
: InitializationKind::CreateDirect(IdLoc, InitRange.getBegin(),
InitRange.getEnd());
@@ -4051,7 +4051,7 @@ Sema::BuildDelegatingInitializer(TypeSourceInfo *TInfo, Expr *Init,
QualType(ClassDecl->getTypeForDecl(), 0));
InitializationKind Kind =
InitList ? InitializationKind::CreateDirectList(
- NameLoc, Init->getBeginLoc(), Init->getLocEnd())
+ NameLoc, Init->getBeginLoc(), Init->getEndLoc())
: InitializationKind::CreateDirect(NameLoc, InitRange.getBegin(),
InitRange.getEnd());
InitializationSequence InitSeq(*this, DelegationEntity, Kind, Args);
@@ -8444,7 +8444,7 @@ void Sema::CheckConversionDeclarator(Declarator &D, QualType &R,
// If we can provide a correct fix-it hint, do so.
if (After.isInvalid() && ConvTSI) {
SourceLocation InsertLoc =
- getLocForEndOfToken(ConvTSI->getTypeLoc().getLocEnd());
+ getLocForEndOfToken(ConvTSI->getTypeLoc().getEndLoc());
DB << FixItHint::CreateInsertion(InsertLoc, " ")
<< FixItHint::CreateInsertionFromRange(
InsertLoc, CharSourceRange::getTokenRange(Before))
@@ -10237,8 +10237,7 @@ bool Sema::CheckUsingDeclQualifier(SourceLocation UsingLoc,
" = ");
} else {
// Convert 'using X::Y;' to 'typedef X::Y Y;'.
- SourceLocation InsertLoc =
- getLocForEndOfToken(NameInfo.getLocEnd());
+ SourceLocation InsertLoc = getLocForEndOfToken(NameInfo.getEndLoc());
Diag(InsertLoc, diag::note_using_decl_class_member_workaround)
<< 1 // typedef declaration
<< FixItHint::CreateReplacement(UsingLoc, "typedef")
@@ -10873,8 +10872,8 @@ void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation,
return;
}
- SourceLocation Loc = Constructor->getLocEnd().isValid()
- ? Constructor->getLocEnd()
+ SourceLocation Loc = Constructor->getEndLoc().isValid()
+ ? Constructor->getEndLoc()
: Constructor->getLocation();
Constructor->setBody(new (Context) CompoundStmt(Loc));
Constructor->markUsed(Context);
@@ -11156,8 +11155,8 @@ void Sema::DefineImplicitDestructor(SourceLocation CurrentLocation,
return;
}
- SourceLocation Loc = Destructor->getLocEnd().isValid()
- ? Destructor->getLocEnd()
+ SourceLocation Loc = Destructor->getEndLoc().isValid()
+ ? Destructor->getEndLoc()
: Destructor->getLocation();
Destructor->setBody(new (Context) CompoundStmt(Loc));
Destructor->markUsed(Context);
@@ -11828,8 +11827,8 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation,
}
// Our location for everything implicitly-generated.
- SourceLocation Loc = CopyAssignOperator->getLocEnd().isValid()
- ? CopyAssignOperator->getLocEnd()
+ SourceLocation Loc = CopyAssignOperator->getEndLoc().isValid()
+ ? CopyAssignOperator->getEndLoc()
: CopyAssignOperator->getLocation();
// Builds a DeclRefExpr for the "other" object.
@@ -12184,8 +12183,8 @@ void Sema::DefineImplicitMoveAssignment(SourceLocation CurrentLocation,
"Bad argument type of defaulted move assignment");
// Our location for everything implicitly-generated.
- SourceLocation Loc = MoveAssignOperator->getLocEnd().isValid()
- ? MoveAssignOperator->getLocEnd()
+ SourceLocation Loc = MoveAssignOperator->getEndLoc().isValid()
+ ? MoveAssignOperator->getEndLoc()
: MoveAssignOperator->getLocation();
// Builds a reference to the "other" object.
@@ -12469,8 +12468,8 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
if (SetCtorInitializers(CopyConstructor, /*AnyErrors=*/false)) {
CopyConstructor->setInvalidDecl();
} else {
- SourceLocation Loc = CopyConstructor->getLocEnd().isValid()
- ? CopyConstructor->getLocEnd()
+ SourceLocation Loc = CopyConstructor->getEndLoc().isValid()
+ ? CopyConstructor->getEndLoc()
: CopyConstructor->getLocation();
Sema::CompoundScopeRAII CompoundScope(*this);
CopyConstructor->setBody(
@@ -12592,8 +12591,8 @@ void Sema::DefineImplicitMoveConstructor(SourceLocation CurrentLocation,
if (SetCtorInitializers(MoveConstructor, /*AnyErrors=*/false)) {
MoveConstructor->setInvalidDecl();
} else {
- SourceLocation Loc = MoveConstructor->getLocEnd().isValid()
- ? MoveConstructor->getLocEnd()
+ SourceLocation Loc = MoveConstructor->getEndLoc().isValid()
+ ? MoveConstructor->getEndLoc()
: MoveConstructor->getLocation();
Sema::CompoundScopeRAII CompoundScope(*this);
MoveConstructor->setBody(ActOnCompoundStmt(
@@ -12896,7 +12895,7 @@ ExprResult Sema::BuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field) {
RecordDecl *OutermostClass = ParentRD->getOuterLexicalRecordContext();
Diag(Loc, diag::err_in_class_initializer_not_yet_parsed)
<< OutermostClass << Field;
- Diag(Field->getLocEnd(), diag::note_in_class_initializer_not_yet_parsed);
+ Diag(Field->getEndLoc(), diag::note_in_class_initializer_not_yet_parsed);
// Recover by marking the field invalid, unless we're in a SFINAE context.
if (!isSFINAEContext())
Field->setInvalidDecl();
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index f6a18e0e8b..ac1d8cf7a3 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -653,7 +653,7 @@ ActOnSuperClassOfClassInterface(Scope *S,
}
IDecl->setSuperClass(SuperClassTInfo);
- IDecl->setEndOfDefinitionLoc(SuperClassTInfo->getTypeLoc().getLocEnd());
+ IDecl->setEndOfDefinitionLoc(SuperClassTInfo->getTypeLoc().getEndLoc());
}
}
@@ -829,7 +829,7 @@ static bool checkTypeParamListConsistency(Sema &S,
if (newTypeParams->size() > prevTypeParams->size()) {
diagLoc = newTypeParams->begin()[prevTypeParams->size()]->getLocation();
} else {
- diagLoc = S.getLocForEndOfToken(newTypeParams->back()->getLocEnd());
+ diagLoc = S.getLocForEndOfToken(newTypeParams->back()->getEndLoc());
}
S.Diag(diagLoc, diag::err_objc_type_param_arity_mismatch)
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 2f1715ae4f..1259d25629 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -387,8 +387,7 @@ void Sema::DiagnoseSentinelCalls(NamedDecl *D, SourceLocation Loc,
// or 'NULL' if those are actually defined in the context. Only use
// 'nil' for ObjC methods, where it's much more likely that the
// variadic arguments form a list of object pointers.
- SourceLocation MissingNilLoc
- = getLocForEndOfToken(sentinelExpr->getLocEnd());
+ SourceLocation MissingNilLoc = getLocForEndOfToken(sentinelExpr->getEndLoc());
std::string NullValue;
if (calleeType == CT_Method && PP.isMacroDefined("nil"))
NullValue = "nil";
@@ -502,7 +501,7 @@ static void DiagnoseDirectIsaAccess(Sema &S, const ObjCIvarRefExpr *OIRE,
&S.Context.Idents.get("object_setClass"),
SourceLocation(), S.LookupOrdinaryName);
if (ObjectSetClass) {
- SourceLocation RHSLocEnd = S.getLocForEndOfToken(RHS->getLocEnd());
+ SourceLocation RHSLocEnd = S.getLocForEndOfToken(RHS->getEndLoc());
S.Diag(OIRE->getExprLoc(), diag::warn_objc_isa_assign)
<< FixItHint::CreateInsertion(OIRE->getBeginLoc(),
"object_setClass(")
@@ -522,7 +521,7 @@ static void DiagnoseDirectIsaAccess(Sema &S, const ObjCIvarRefExpr *OIRE,
<< FixItHint::CreateInsertion(OIRE->getBeginLoc(),
"object_getClass(")
<< FixItHint::CreateReplacement(
- SourceRange(OIRE->getOpLoc(), OIRE->getLocEnd()), ")");
+ SourceRange(OIRE->getOpLoc(), OIRE->getEndLoc()), ")");
else
S.Diag(OIRE->getLocation(), diag::warn_objc_isa_use);
}
@@ -897,7 +896,7 @@ ExprResult Sema::DefaultVariadicArgumentPromotion(Expr *E, VariadicCallType CT,
return ExprError();
ExprResult Call = ActOnCallExpr(TUScope, TrapFn.get(), E->getBeginLoc(),
- None, E->getLocEnd());
+ None, E->getEndLoc());
if (Call.isInvalid())
return ExprError();
@@ -4842,7 +4841,7 @@ Sema::ConvertArgumentsForCall(CallExpr *Call, Expr *Fn,
<< FnKind << FDecl->getParamDecl(0)
<< static_cast<unsigned>(Args.size()) << Fn->getSourceRange()
<< SourceRange(Args[NumParams]->getBeginLoc(),
- Args.back()->getLocEnd());
+ Args.back()->getEndLoc());
else
Diag(Args[NumParams]->getBeginLoc(),
MinArgs == NumParams
@@ -4851,7 +4850,7 @@ Sema::ConvertArgumentsForCall(CallExpr *Call, Expr *Fn,
<< FnKind << NumParams << static_cast<unsigned>(Args.size())
<< Fn->getSourceRange()
<< SourceRange(Args[NumParams]->getBeginLoc(),
- Args.back()->getLocEnd());
+ Args.back()->getEndLoc());
// Emit the location of the prototype.
if (!TC && FDecl && !FDecl->getBuiltinID() && !IsExecConfig)
@@ -5317,7 +5316,7 @@ ExprResult Sema::ActOnCallExpr(Scope *Scope, Expr *Fn, SourceLocation LParenLoc,
Diag(Fn->getBeginLoc(), diag::err_pseudo_dtor_call_with_args)
<< FixItHint::CreateRemoval(
SourceRange(ArgExprs.front()->getBeginLoc(),
- ArgExprs.back()->getLocEnd()));
+ ArgExprs.back()->getEndLoc()));
}
return new (Context)
@@ -7214,11 +7213,11 @@ static void DiagnoseConditionalPrecedence(Sema &Self,
Self, OpLoc,
Self.PDiag(diag::note_precedence_silence)
<< BinaryOperator::getOpcodeStr(CondOpcode),
- SourceRange(Condition->getBeginLoc(), Condition->getLocEnd()));
+ SourceRange(Condition->getBeginLoc(), Condition->getEndLoc()));
SuggestParentheses(Self, OpLoc,
Self.PDiag(diag::note_precedence_conditional_first),
- SourceRange(CondRHS->getBeginLoc(), RHSExpr->getLocEnd()));
+ SourceRange(CondRHS->getBeginLoc(), RHSExpr->getEndLoc()));
}
/// Compute the nullability of a conditional expression.
@@ -8915,13 +8914,13 @@ static void diagnoseStringPlusInt(Sema &Self, SourceLocation OpLoc,
return;
}
- SourceRange DiagRange(LHSExpr->getBeginLoc(), RHSExpr->getLocEnd());
+ SourceRange DiagRange(LHSExpr->getBeginLoc(), RHSExpr->getEndLoc());
Self.Diag(OpLoc, diag::warn_string_plus_int)
<< DiagRange << IndexExpr->IgnoreImpCasts()->getType();
// Only print a fixit for "str" + int, not for int + "str".
if (IndexExpr == RHSExpr) {
- SourceLocation EndLoc = Self.getLocForEndOfToken(RHSExpr->getLocEnd());
+ SourceLocation EndLoc = Self.getLocForEndOfToken(RHSExpr->getEndLoc());
Self.Diag(OpLoc, diag::note_string_plus_scalar_silence)
<< FixItHint::CreateInsertion(LHSExpr->getBeginLoc(), "&")
<< FixItHint::CreateReplacement(SourceRange(OpLoc), "[")
@@ -8956,7 +8955,7 @@ static void diagnoseStringPlusChar(Sema &Self, SourceLocation OpLoc,
return;
ASTContext &Ctx = Self.getASTContext();
- SourceRange DiagRange(LHSExpr->getBeginLoc(), RHSExpr->getLocEnd());
+ SourceRange DiagRange(LHSExpr->getBeginLoc(), RHSExpr->getEndLoc());
const QualType CharType = CharExpr->getType();
if (!CharType->isAnyCharacterType() &&
@@ -8971,7 +8970,7 @@ static void diagnoseStringPlusChar(Sema &Self, SourceLocation OpLoc,
// Only print a fixit for str + char, not for char + str.
if (isa<CharacterLiteral>(RHSExpr->IgnoreImpCasts())) {
- SourceLocation EndLoc = Self.getLocForEndOfToken(RHSExpr->getLocEnd());
+ SourceLocation EndLoc = Self.getLocForEndOfToken(RHSExpr->getEndLoc());
Self.Diag(OpLoc, diag::note_string_plus_scalar_silence)
<< FixItHint::CreateInsertion(LHSExpr->getBeginLoc(), "&")
<< FixItHint::CreateReplacement(SourceRange(OpLoc), "[")
@@ -9646,7 +9645,7 @@ static void diagnoseObjCLiteralComparison(Sema &S, SourceLocation Loc,
if (BinaryOperator::isEqualityOp(Opc) &&
hasIsEqualMethod(S, LHS.get(), RHS.get())) {
SourceLocation Start = LHS.get()->getBeginLoc();
- SourceLocation End = S.getLocForEndOfToken(RHS.get()->getLocEnd());
+ SourceLocation End = S.getLocForEndOfToken(RHS.get()->getEndLoc());
CharSourceRange OpRange =
CharSourceRange::getCharRange(Loc, S.getLocForEndOfToken(Loc));
@@ -9679,7 +9678,7 @@ static void diagnoseLogicalNotOnLHSofCheck(Sema &S, ExprResult &LHS,
// First note suggest !(x < y)
SourceLocation FirstOpen = SubExpr->getBeginLoc();
- SourceLocation FirstClose = RHS.get()->getLocEnd();
+ SourceLocation FirstClose = RHS.get()->getEndLoc();
FirstClose = S.getLocForEndOfToken(FirstClose);
if (FirstClose.isInvalid())
FirstOpen = SourceLocation();
@@ -9690,7 +9689,7 @@ static void diagnoseLogicalNotOnLHSofCheck(Sema &S, ExprResult &LHS,
// Second note suggests (!x) < y
SourceLocation SecondOpen = LHS.get()->getBeginLoc();
- SourceLocation SecondClose = LHS.get()->getLocEnd();
+ SourceLocation SecondClose = LHS.get()->getEndLoc();
SecondClose = S.getLocForEndOfToken(SecondClose);
if (SecondClose.isInvalid())
SecondOpen = SourceLocation();
@@ -10619,8 +10618,8 @@ inline QualType Sema::CheckLogicalOperands(ExprResult &LHS, ExprResult &RHS,
// Suggest replacing "Foo() && kNonZero" with "Foo()"
Diag(Loc, diag::note_logical_instead_of_bitwise_remove_constant)
<< FixItHint::CreateRemoval(
- SourceRange(getLocForEndOfToken(LHS.get()->getLocEnd()),
- RHS.get()->getLocEnd()));
+ SourceRange(getLocForEndOfToken(LHS.get()->getEndLoc()),
+ RHS.get()->getEndLoc()));
}
}
@@ -11265,7 +11264,7 @@ void Sema::DiagnoseCommaOperator(const Expr *LHS, SourceLocation Loc) {
<< FixItHint::CreateInsertion(LHS->getBeginLoc(),
LangOpts.CPlusPlus ? "static_cast<void>("
: "(void)(")
- << FixItHint::CreateInsertion(PP.getLocForEndOfToken(LHS->getLocEnd()),
+ << FixItHint::CreateInsertion(PP.getLocForEndOfToken(LHS->getEndLoc()),
")");
}
@@ -11997,7 +11996,7 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
// The meaning of x = {v} [...] is that of x = T(v) [...]. The meaning
// of x = {} is x = T().
InitializationKind Kind = InitializationKind::CreateDirectList(
- RHSExpr->getBeginLoc(), RHSExpr->getBeginLoc(), RHSExpr->getLocEnd());
+ RHSExpr->getBeginLoc(), RHSExpr->getBeginLoc(), RHSExpr->getEndLoc());
InitializedEntity Entity =
InitializedEntity::InitializeTemporary(LHSExpr->getType());
InitializationSequence InitSeq(*this, Entity, Kind, RHSExpr);
@@ -12026,7 +12025,7 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
// OpenCLC v2.0 s6.13.11.1 allows atomic variables to be initialized by
// the ATOMIC_VAR_INIT macro.
if (LHSTy->isAtomicType() || RHSTy->isAtomicType()) {
- SourceRange SR(LHSExpr->getBeginLoc(), RHSExpr->getLocEnd());
+ SourceRange SR(LHSExpr->getBeginLoc(), RHSExpr->getEndLoc());
if (BO_Assign == Opc)
Diag(OpLoc, diag::err_opencl_atomic_init) << 0 << SR;
else
@@ -12188,7 +12187,7 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
&Context.Idents.get("object_setClass"),
SourceLocation(), LookupOrdinaryName);
if (ObjectSetClass && isa<ObjCIsaExpr>(LHS.get())) {
- SourceLocation RHSLocEnd = getLocForEndOfToken(RHS.get()->getLocEnd());
+ SourceLocation RHSLocEnd = getLocForEndOfToken(RHS.get()->getEndLoc());
Diag(LHS.get()->getExprLoc(), diag::warn_objc_isa_assign)
<< FixItHint::CreateInsertion(LHS.get()->getBeginLoc(),
"object_setClass(")
@@ -12253,12 +12252,12 @@ static void DiagnoseBitwisePrecedence(Sema &Self, BinaryOperatorKind Opc,
SourceRange DiagRange = isLeftComp
? SourceRange(LHSExpr->getBeginLoc(), OpLoc)
- : SourceRange(OpLoc, RHSExpr->getLocEnd());
+ : SourceRange(OpLoc, RHSExpr->getEndLoc());
StringRef OpStr = isLeftComp ? LHSBO->getOpcodeStr() : RHSBO->getOpcodeStr();
SourceRange ParensRange =
isLeftComp
- ? SourceRange(LHSBO->getRHS()->getBeginLoc(), RHSExpr->getLocEnd())
- : SourceRange(LHSExpr->getBeginLoc(), RHSBO->getLHS()->getLocEnd());
+ ? SourceRange(LHSBO->getRHS()->getBeginLoc(), RHSExpr->getEndLoc())
+ : SourceRange(LHSExpr->getBeginLoc(), RHSBO->getLHS()->getEndLoc());
Self.Diag(OpLoc, diag::warn_precedence_bitwise_rel)
<< DiagRange << BinaryOperator::getOpcodeStr(Opc) << OpStr;
@@ -12394,7 +12393,7 @@ static void DiagnoseShiftCompare(Sema &S, SourceLocation OpLoc,
OCE->getSourceRange());
SuggestParentheses(
S, OpLoc, S.PDiag(diag::note_evaluate_comparison_first),
- SourceRange(OCE->getArg(1)->getBeginLoc(), RHSExpr->getLocEnd()));
+ SourceRange(OCE->getArg(1)->getBeginLoc(), RHSExpr->getEndLoc()));
}
/// DiagnoseBinOpPrecedence - Emit warnings for expressions with tricky
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index cef8ba320c..4b208ff6c3 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -1698,15 +1698,9 @@ Sema::ActOnCXXNew(SourceLocation StartLoc, bool UseGlobal,
if (ParenListExpr *List = dyn_cast_or_null<ParenListExpr>(Initializer))
DirectInitRange = List->getSourceRange();
- return BuildCXXNew(SourceRange(StartLoc, D.getLocEnd()), UseGlobal,
- PlacementLParen,
- PlacementArgs,
- PlacementRParen,
- TypeIdParens,
- AllocType,
- TInfo,
- ArraySize,
- DirectInitRange,
+ return BuildCXXNew(SourceRange(StartLoc, D.getEndLoc()), UseGlobal,
+ PlacementLParen, PlacementArgs, PlacementRParen,
+ TypeIdParens, AllocType, TInfo, ArraySize, DirectInitRange,
Initializer);
}
@@ -1804,7 +1798,7 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
: initStyle == CXXNewExpr::ListInit
? InitializationKind::CreateDirectList(
TypeRange.getBegin(), Initializer->getBeginLoc(),
- Initializer->getLocEnd())
+ Initializer->getEndLoc())
: InitializationKind::CreateDirect(TypeRange.getBegin(),
DirectInitRange.getBegin(),
DirectInitRange.getEnd());
@@ -2087,7 +2081,7 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
// dialect distinction.
if (ArraySize && !isLegalArrayNewInitializer(initStyle, Initializer)) {
SourceRange InitRange(Inits[0]->getBeginLoc(),
- Inits[NumInits - 1]->getLocEnd());
+ Inits[NumInits - 1]->getEndLoc());
Diag(StartLoc, diag::err_new_array_init_args) << InitRange;
return ExprError();
}
@@ -2594,7 +2588,7 @@ bool Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
SourceRange R = PlaceArgs.empty()
? SourceRange()
: SourceRange(PlaceArgs.front()->getBeginLoc(),
- PlaceArgs.back()->getLocEnd());
+ PlaceArgs.back()->getEndLoc());
Diag(StartLoc, diag::err_placement_new_non_placement_delete) << R;
if (!OperatorDelete->isImplicit())
Diag(OperatorDelete->getLocation(), diag::note_previous_decl)
@@ -5421,7 +5415,7 @@ QualType Sema::CheckPointerToMemberOperands(ExprResult &LHS, ExprResult &RHS,
CXXCastPath BasePath;
if (CheckDerivedToBaseConversion(
LHSType, Class, Loc,
- SourceRange(LHS.get()->getBeginLoc(), RHS.get()->getLocEnd()),
+ SourceRange(LHS.get()->getBeginLoc(), RHS.get()->getEndLoc()),
&BasePath))
return QualType();
@@ -7159,9 +7153,8 @@ ExprResult Sema::BuildCXXMemberCallExpr(Expr *E, NamedDecl *FoundDecl,
ExprValueKind VK = Expr::getValueKindForType(ResultType);
ResultType = ResultType.getNonLValueExprType(Context);
- CXXMemberCallExpr *CE =
- new (Context) CXXMemberCallExpr(Context, ME, None, ResultType, VK,
- Exp.get()->getLocEnd());
+ CXXMemberCallExpr *CE = new (Context) CXXMemberCallExpr(
+ Context, ME, None, ResultType, VK, Exp.get()->getEndLoc());
if (CheckFunctionCall(Method, CE,
Method->getType()->castAs<FunctionProtoType>()))
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 52909aced1..bbbe343db0 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -1034,7 +1034,7 @@ ExprResult Sema::BuildObjCDictionaryLiteral(SourceRange SR,
Diag(Element.EllipsisLoc,
diag::err_pack_expansion_without_parameter_packs)
<< SourceRange(Element.Key->getBeginLoc(),
- Element.Value->getLocEnd());
+ Element.Value->getEndLoc());
return ExprError();
}
@@ -1697,7 +1697,7 @@ bool Sema::CheckMessageArgumentTypes(QualType ReceiverType,
<< 2 /*method*/ << NumNamedArgs << static_cast<unsigned>(Args.size())
<< Method->getSourceRange()
<< SourceRange(Args[NumNamedArgs]->getBeginLoc(),
- Args.back()->getLocEnd());
+ Args.back()->getEndLoc());
}
}
@@ -4070,7 +4070,8 @@ Sema::CheckObjCBridgeRelatedConversions(SourceLocation Loc,
ExpressionString += RelatedClass->getNameAsString();
ExpressionString += " ";
ExpressionString += ClassMethod->getSelector().getAsString();
- SourceLocation SrcExprEndLoc = getLocForEndOfToken(SrcExpr->getLocEnd());
+ SourceLocation SrcExprEndLoc =
+ getLocForEndOfToken(SrcExpr->getEndLoc());
// Provide a fixit: [RelatedClass ClassMethod SrcExpr]
Diag(Loc, diag::err_objc_bridged_related_known_method)
<< SrcType << DestType << ClassMethod->getSelector() << false
@@ -4098,7 +4099,7 @@ Sema::CheckObjCBridgeRelatedConversions(SourceLocation Loc,
if (Diagnose) {
std::string ExpressionString;
SourceLocation SrcExprEndLoc =
- getLocForEndOfToken(SrcExpr->getLocEnd());
+ getLocForEndOfToken(SrcExpr->getEndLoc());
if (InstanceMethod->isPropertyAccessor())
if (const ObjCPropertyDecl *PDecl =
InstanceMethod->findPropertyDecl()) {
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 8bab240cef..766f23b05b 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -518,10 +518,10 @@ void InitListChecker::FillInEmptyInitForBase(
if (!ILE->getInit(Init)) {
ExprResult BaseInit =
- FillWithNoInit ? new (SemaRef.Context) NoInitExpr(Base.getType())
- : PerformEmptyInit(SemaRef, ILE->getLocEnd(), BaseEntity,
- /*VerifyOnly*/ false,
- TreatUnavailableAsInvalid);
+ FillWithNoInit
+ ? new (SemaRef.Context) NoInitExpr(Base.getType())
+ : PerformEmptyInit(SemaRef, ILE->getEndLoc(), BaseEntity,
+ /*VerifyOnly*/ false, TreatUnavailableAsInvalid);
if (BaseInit.isInvalid()) {
hadError = true;
return;
@@ -545,7 +545,7 @@ void InitListChecker::FillInEmptyInitForField(unsigned Init, FieldDecl *Field,
InitListExpr *ILE,
bool &RequiresSecondPass,
bool FillWithNoInit) {
- SourceLocation Loc = ILE->getLocEnd();
+ SourceLocation Loc = ILE->getEndLoc();
unsigned NumInits = ILE->getNumInits();
InitializedEntity MemberEntity
= InitializedEntity::InitializeMember(Field, &ParentEntity);
@@ -765,10 +765,9 @@ InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity,
if (FillWithNoInit)
Filler = new (SemaRef.Context) NoInitExpr(ElementType);
else {
- ExprResult ElementInit = PerformEmptyInit(SemaRef, ILE->getLocEnd(),
- ElementEntity,
- /*VerifyOnly*/false,
- TreatUnavailableAsInvalid);
+ ExprResult ElementInit =
+ PerformEmptyInit(SemaRef, ILE->getEndLoc(), ElementEntity,
+ /*VerifyOnly*/ false, TreatUnavailableAsInvalid);
if (ElementInit.isInvalid()) {
hadError = true;
return;
@@ -962,7 +961,7 @@ void InitListChecker::CheckImplicitInitList(const InitializedEntity &Entity,
StructuredSubobjectInitList->getBeginLoc(), "{")
<< FixItHint::CreateInsertion(
SemaRef.getLocForEndOfToken(
- StructuredSubobjectInitList->getLocEnd()),
+ StructuredSubobjectInitList->getEndLoc()),
"}");
}
}
@@ -1509,7 +1508,7 @@ void InitListChecker::CheckVectorType(const InitializedEntity &Entity,
if (VerifyOnly)
CheckEmptyInitializable(
InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity),
- IList->getLocEnd());
+ IList->getEndLoc());
return;
}
@@ -1556,7 +1555,7 @@ void InitListChecker::CheckVectorType(const InitializedEntity &Entity,
// Don't attempt to go past the end of the init list
if (Index >= IList->getNumInits()) {
if (VerifyOnly)
- CheckEmptyInitializable(ElementEntity, IList->getLocEnd());
+ CheckEmptyInitializable(ElementEntity, IList->getEndLoc());
break;
}
@@ -1775,9 +1774,9 @@ void InitListChecker::CheckArrayType(const InitializedEntity &Entity,
// FIXME: This needs to detect holes left by designated initializers too.
if ((maxElementsKnown && elementIndex < maxElements) ||
Entity.isVariableLengthArrayNew())
- CheckEmptyInitializable(InitializedEntity::InitializeElement(
- SemaRef.Context, 0, Entity),
- IList->getLocEnd());
+ CheckEmptyInitializable(
+ InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity),
+ IList->getEndLoc());
}
}
@@ -1861,7 +1860,7 @@ void InitListChecker::CheckStructUnionTypes(
if (VerifyOnly)
CheckEmptyInitializable(
InitializedEntity::InitializeMember(*Field, &Entity),
- IList->getLocEnd());
+ IList->getEndLoc());
else
StructuredList->setInitializedFieldInUnion(*Field);
break;
@@ -1875,7 +1874,7 @@ void InitListChecker::CheckStructUnionTypes(
// If we have any base classes, they are initialized prior to the fields.
for (auto &Base : Bases) {
Expr *Init = Index < IList->getNumInits() ? IList->getInit(Index) : nullptr;
- SourceLocation InitLoc = Init ? Init->getBeginLoc() : IList->getLocEnd();
+ SourceLocation InitLoc = Init ? Init->getBeginLoc() : IList->getEndLoc();
// Designated inits always initialize fields, so if we see one, all
// remaining base classes have no explicit initializer.
@@ -1999,7 +1998,7 @@ void InitListChecker::CheckStructUnionTypes(
if (!Field->isUnnamedBitfield() && !Field->hasInClassInitializer())
CheckEmptyInitializable(
InitializedEntity::InitializeMember(*Field, &Entity),
- IList->getLocEnd());
+ IList->getEndLoc());
}
}
@@ -2178,7 +2177,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity,
if (!ExistingInit)
StructuredList = getStructuredSubobjectInit(
IList, Index, CurrentObjectType, StructuredList, StructuredIndex,
- SourceRange(D->getBeginLoc(), DIE->getLocEnd()));
+ SourceRange(D->getBeginLoc(), DIE->getEndLoc()));
else if (InitListExpr *Result = dyn_cast<InitListExpr>(ExistingInit))
StructuredList = Result;
else {
@@ -2188,7 +2187,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity,
else {
DesignatedInitUpdateExpr *DIUE = new (SemaRef.Context)
DesignatedInitUpdateExpr(SemaRef.Context, D->getBeginLoc(),
- ExistingInit, DIE->getLocEnd());
+ ExistingInit, DIE->getEndLoc());
StructuredList->updateInit(SemaRef.Context, StructuredIndex, DIUE);
StructuredList = DIUE->getUpdater();
}
@@ -2215,7 +2214,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity,
// subobject [0], overwriting previous initializers.
SemaRef.Diag(D->getBeginLoc(),
diag::warn_subobject_initializer_overrides)
- << SourceRange(D->getBeginLoc(), DIE->getLocEnd());
+ << SourceRange(D->getBeginLoc(), DIE->getEndLoc());
SemaRef.Diag(ExistingInit->getBeginLoc(),
diag::note_previous_initializer)
@@ -2387,7 +2386,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity,
= DIE->getDesignator(DesigIdx + 1);
SemaRef.Diag(NextD->getBeginLoc(),
diag::err_designator_into_flexible_array_member)
- << SourceRange(NextD->getBeginLoc(), DIE->getLocEnd());
+ << SourceRange(NextD->getBeginLoc(), DIE->getEndLoc());
SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member)
<< *Field;
}
@@ -3491,11 +3490,11 @@ maybeRecoverWithZeroInitialization(Sema &S, InitializationSequence &Sequence,
return false;
VarDecl *VD = cast<VarDecl>(Entity.getDecl());
- if (VD->getInit() || VD->getLocEnd().isMacroID())
+ if (VD->getInit() || VD->getEndLoc().isMacroID())
return false;
QualType VariableTy = VD->getType().getCanonicalType();
- SourceLocation Loc = S.getLocForEndOfToken(VD->getLocEnd());
+ SourceLocation Loc = S.getLocForEndOfToken(VD->getEndLoc());
std::string Init = S.getFixItZeroInitializerForType(VariableTy, Loc);
if (!Init.empty()) {
Sequence.AddZeroInitializationStep(Entity.getType());
@@ -3567,7 +3566,7 @@ static bool TryInitializerListConstruction(Sema &S,
InitializedEntity HiddenArray =
InitializedEntity::InitializeTemporary(ArrayType);
InitializationKind Kind = InitializationKind::CreateDirectList(
- List->getExprLoc(), List->getBeginLoc(), List->getLocEnd());
+ List->getExprLoc(), List->getBeginLoc(), List->getEndLoc());
TryListInitialization(S, HiddenArray, Kind, List, Sequence,
TreatUnavailableAsInvalid);
if (Sequence)
@@ -7233,7 +7232,7 @@ InitializationSequence::Perform(Sema &S,
Entity.getKind() == InitializedEntity::EK_Variable && Args.size() > 0) {
S.Diag(Args[0]->getBeginLoc(), diag::err_opencl_atomic_init)
<< 1
- << SourceRange(Entity.getDecl()->getBeginLoc(), Args[0]->getLocEnd());
+ << SourceRange(Entity.getDecl()->getBeginLoc(), Args[0]->getEndLoc());
return ExprError();
}
@@ -8111,7 +8110,7 @@ bool InitializationSequence::Diagnose(Sema &S,
(void)Diagnosed;
} else // FIXME: diagnostic below could be better!
S.Diag(Kind.getLocation(), diag::err_reference_has_multiple_inits)
- << SourceRange(Args.front()->getBeginLoc(), Args.back()->getLocEnd());
+ << SourceRange(Args.front()->getBeginLoc(), Args.back()->getEndLoc());
break;
case FK_ParenthesizedListInitForReference:
S.Diag(Kind.getLocation(), diag::err_list_init_in_parens)
@@ -8322,10 +8321,10 @@ bool InitializationSequence::Diagnose(Sema &S,
auto *InitList = dyn_cast<InitListExpr>(Args[0]);
if (InitList && InitList->getNumInits() >= 1) {
- R = SourceRange(InitList->getInit(0)->getLocEnd(), InitList->getLocEnd());
+ R = SourceRange(InitList->getInit(0)->getEndLoc(), InitList->getEndLoc());
} else {
assert(Args.size() > 1 && "Expected multiple initializers!");
- R = SourceRange(Args.front()->getLocEnd(), Args.back()->getLocEnd());
+ R = SourceRange(Args.front()->getEndLoc(), Args.back()->getEndLoc());
}
R.setBegin(S.getLocForEndOfToken(R.getBegin()));
@@ -8358,7 +8357,7 @@ bool InitializationSequence::Diagnose(Sema &S,
SourceRange ArgsRange;
if (Args.size())
ArgsRange =
- SourceRange(Args.front()->getBeginLoc(), Args.back()->getLocEnd());
+ SourceRange(Args.front()->getBeginLoc(), Args.back()->getEndLoc());
if (Failure == FK_ListConstructorOverloadFailed) {
assert(Args.size() == 1 &&
@@ -8946,7 +8945,7 @@ static void DiagnoseNarrowingInInitList(Sema &S,
<< PostInit->getSourceRange()
<< FixItHint::CreateInsertion(PostInit->getBeginLoc(), OS.str())
<< FixItHint::CreateInsertion(
- S.getLocForEndOfToken(PostInit->getLocEnd()), ")");
+ S.getLocForEndOfToken(PostInit->getEndLoc()), ")");
}
//===----------------------------------------------------------------------===//
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp
index dd979318d9..3391567658 100644
--- a/lib/Sema/SemaLambda.cpp
+++ b/lib/Sema/SemaLambda.cpp
@@ -761,7 +761,7 @@ QualType Sema::buildLambdaInitCaptureInitialization(SourceLocation Loc,
InitializationKind Kind =
IsDirectInit
? (CXXDirectInit ? InitializationKind::CreateDirect(
- Loc, Init->getBeginLoc(), Init->getLocEnd())
+ Loc, Init->getBeginLoc(), Init->getEndLoc())
: InitializationKind::CreateDirectList(Loc))
: InitializationKind::CreateCopy(Loc, Init->getBeginLoc());
@@ -1296,15 +1296,12 @@ static void addFunctionPointerConversion(Sema &S,
CallOpConvNameTL.setParam(I, From);
}
- CXXConversionDecl *Conversion
- = CXXConversionDecl::Create(S.Context, Class, Loc,
- DeclarationNameInfo(ConversionName,
- Loc, ConvNameLoc),
- ConvTy,
- ConvTSI,
- /*isInline=*/true, /*isExplicit=*/false,
- /*isConstexpr=*/S.getLangOpts().CPlusPlus17,
- CallOperator->getBody()->getLocEnd());
+ CXXConversionDecl *Conversion = CXXConversionDecl::Create(
+ S.Context, Class, Loc,
+ DeclarationNameInfo(ConversionName, Loc, ConvNameLoc), ConvTy, ConvTSI,
+ /*isInline=*/true, /*isExplicit=*/false,
+ /*isConstexpr=*/S.getLangOpts().CPlusPlus17,
+ CallOperator->getBody()->getEndLoc());
Conversion->setAccess(AS_public);
Conversion->setImplicit(true);
@@ -1339,14 +1336,11 @@ static void addFunctionPointerConversion(Sema &S,
// trailing return type of the invoker would require a visitor to rebuild
// the trailing return type and adjusting all back DeclRefExpr's to refer
// to the new static invoker parameters - not the call operator's.
- CXXMethodDecl *Invoke
- = CXXMethodDecl::Create(S.Context, Class, Loc,
- DeclarationNameInfo(InvokerName, Loc),
- InvokerFunctionTy,
- CallOperator->getTypeSourceInfo(),
- SC_Static, /*IsInline=*/true,
- /*IsConstexpr=*/false,
- CallOperator->getBody()->getLocEnd());
+ CXXMethodDecl *Invoke = CXXMethodDecl::Create(
+ S.Context, Class, Loc, DeclarationNameInfo(InvokerName, Loc),
+ InvokerFunctionTy, CallOperator->getTypeSourceInfo(), SC_Static,
+ /*IsInline=*/true,
+ /*IsConstexpr=*/false, CallOperator->getBody()->getEndLoc());
for (unsigned I = 0, N = CallOperator->getNumParams(); I != N; ++I)
InvokerParams[I]->setOwningFunction(Invoke);
Invoke->setParams(InvokerParams);
@@ -1388,14 +1382,11 @@ static void addBlockPointerConversion(Sema &S,
S.Context.getCanonicalType(BlockPtrTy));
DeclarationNameLoc NameLoc;
NameLoc.NamedType.TInfo = S.Context.getTrivialTypeSourceInfo(BlockPtrTy, Loc);
- CXXConversionDecl *Conversion
- = CXXConversionDecl::Create(S.Context, Class, Loc,
- DeclarationNameInfo(Name, Loc, NameLoc),
- ConvTy,
- S.Context.getTrivialTypeSourceInfo(ConvTy, Loc),
- /*isInline=*/true, /*isExplicit=*/false,
- /*isConstexpr=*/false,
- CallOperator->getBody()->getLocEnd());
+ CXXConversionDecl *Conversion = CXXConversionDecl::Create(
+ S.Context, Class, Loc, DeclarationNameInfo(Name, Loc, NameLoc), ConvTy,
+ S.Context.getTrivialTypeSourceInfo(ConvTy, Loc),
+ /*isInline=*/true, /*isExplicit=*/false,
+ /*isConstexpr=*/false, CallOperator->getBody()->getEndLoc());
Conversion->setAccess(AS_public);
Conversion->setImplicit(true);
Class->addDecl(Conversion);
@@ -1438,7 +1429,7 @@ ExprResult Sema::ActOnLambdaExpr(SourceLocation StartLoc, Stmt *Body,
Scope *CurScope) {
LambdaScopeInfo LSI = *cast<LambdaScopeInfo>(FunctionScopes.back());
ActOnFinishFunctionBody(LSI.CallOperator, Body);
- return BuildLambdaExpr(StartLoc, Body->getLocEnd(), &LSI);
+ return BuildLambdaExpr(StartLoc, Body->getEndLoc(), &LSI);
}
static LambdaCaptureDefault
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index 87d85c1d80..3aad25b73a 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -609,7 +609,7 @@ ObjCPropertyDecl *Sema::CreatePropertyDecl(Scope *S,
}
if (T->isObjCObjectType()) {
- SourceLocation StarLoc = TInfo->getTypeLoc().getLocEnd();
+ SourceLocation StarLoc = TInfo->getTypeLoc().getEndLoc();
StarLoc = getLocForEndOfToken(StarLoc);
Diag(FD.D.getIdentifierLoc(), diag::err_statically_allocated_object)
<< FixItHint::CreateInsertion(StarLoc, "*");
@@ -2235,7 +2235,7 @@ void Sema::DiagnoseOwningPropertyGetterSynthesis(const ObjCImplementationDecl *D
if (getterRedecl->getDeclContext() != PD->getDeclContext())
continue;
noteLoc = getterRedecl->getLocation();
- fixItLoc = getterRedecl->getLocEnd();
+ fixItLoc = getterRedecl->getEndLoc();
}
Preprocessor &PP = getPreprocessor();
diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp
index 34fb69c152..b455d4fb43 100644
--- a/lib/Sema/SemaOpenMP.cpp
+++ b/lib/Sema/SemaOpenMP.cpp
@@ -2706,13 +2706,13 @@ StmtResult Sema::ActOnOpenMPRegionEnd(StmtResult S,
? SC->getFirstScheduleModifierLoc()
: SC->getSecondScheduleModifierLoc(),
diag::err_omp_schedule_nonmonotonic_ordered)
- << SourceRange(OC->getBeginLoc(), OC->getLocEnd());
+ << SourceRange(OC->getBeginLoc(), OC->getEndLoc());
ErrorFound = true;
}
if (!LCs.empty() && OC && OC->getNumForLoops()) {
for (const OMPLinearClause *C : LCs) {
Diag(C->getBeginLoc(), diag::err_omp_linear_ordered)
- << SourceRange(OC->getBeginLoc(), OC->getLocEnd());
+ << SourceRange(OC->getBeginLoc(), OC->getEndLoc());
}
ErrorFound = true;
}
@@ -6135,7 +6135,7 @@ StmtResult Sema::ActOnOpenMPAtomicDirective(ArrayRef<OMPClause *> Clauses,
C->getClauseKind() == OMPC_capture) {
if (AtomicKind != OMPC_unknown) {
Diag(C->getBeginLoc(), diag::err_omp_atomic_several_clauses)
- << SourceRange(C->getBeginLoc(), C->getLocEnd());
+ << SourceRange(C->getBeginLoc(), C->getEndLoc());
Diag(AtomicKindLoc, diag::note_omp_atomic_previous_clause)
<< getOpenMPClauseName(AtomicKind);
} else {
@@ -6938,7 +6938,7 @@ static bool checkReductionClauseWithNogroup(Sema &S,
if (ReductionClause && NogroupClause) {
S.Diag(ReductionClause->getBeginLoc(), diag::err_omp_reduction_with_nogroup)
<< SourceRange(NogroupClause->getBeginLoc(),
- NogroupClause->getLocEnd());
+ NogroupClause->getEndLoc());
return true;
}
return false;
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index aad77da2ed..cb80a6946b 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -5584,7 +5584,7 @@ diagnoseNoViableConversion(Sema &SemaRef, SourceLocation Loc, Expr *&From,
<< FixItHint::CreateInsertion(From->getBeginLoc(),
"static_cast<" + TypeStr + ">(")
<< FixItHint::CreateInsertion(
- SemaRef.getLocForEndOfToken(From->getLocEnd()), ")");
+ SemaRef.getLocForEndOfToken(From->getEndLoc()), ")");
Converter.noteExplicitConv(SemaRef, Conversion, ConvTy);
// If we aren't in a SFINAE context, build a call to the
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index c170d74ca5..8d620a79d3 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -556,7 +556,7 @@ Sema::ActOnIfStmt(SourceLocation IfLoc, bool IsConstexpr, Stmt *InitStmt,
CommaVisitor(*this).Visit(CondExpr);
if (!elseStmt)
- DiagnoseEmptyStmtBody(CondExpr->getLocEnd(), thenStmt,
+ DiagnoseEmptyStmtBody(CondExpr->getEndLoc(), thenStmt,
diag::warn_empty_if_body);
return BuildIfStmt(IfLoc, IsConstexpr, InitStmt, Cond, thenStmt, ElseLoc,
@@ -1027,7 +1027,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch,
// If the low value is bigger than the high value, the case is empty.
if (LoVal > HiVal) {
Diag(CR->getLHS()->getBeginLoc(), diag::warn_case_empty_range)
- << SourceRange(CR->getLHS()->getBeginLoc(), Hi->getLocEnd());
+ << SourceRange(CR->getLHS()->getBeginLoc(), Hi->getEndLoc());
CaseRanges.erase(CaseRanges.begin()+i);
--i;
--e;
@@ -1208,7 +1208,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch,
}
if (BodyStmt)
- DiagnoseEmptyStmtBody(CondExpr->getLocEnd(), BodyStmt,
+ DiagnoseEmptyStmtBody(CondExpr->getEndLoc(), BodyStmt,
diag::warn_empty_switch_body);
// FIXME: If the case list was broken is some way, we don't have a good system
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 24e183447f..45ce11874d 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -1762,7 +1762,7 @@ struct ConvertConstructorToDeductionGuideTransform {
return buildDeductionGuide(TemplateParams, CD->isExplicit(), NewTInfo,
CD->getBeginLoc(), CD->getLocation(),
- CD->getLocEnd());
+ CD->getEndLoc());
}
/// Build a deduction guide with the specified parameter types.
@@ -5625,7 +5625,7 @@ isNullPointerValueTemplateArgument(Sema &S, NonTypeTemplateParmDecl *Param,
std::string Code = "static_cast<" + ParamType.getAsString() + ">(";
S.Diag(Arg->getExprLoc(), diag::err_template_arg_untyped_null_constant)
<< ParamType << FixItHint::CreateInsertion(Arg->getBeginLoc(), Code)
- << FixItHint::CreateInsertion(S.getLocForEndOfToken(Arg->getLocEnd()),
+ << FixItHint::CreateInsertion(S.getLocForEndOfToken(Arg->getEndLoc()),
")");
S.Diag(Param->getLocation(), diag::note_template_param_here);
return NPV_NullPointer;
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index 536f0b7919..9a5879e675 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/lib/Sema/SemaTemplateInstantiate.cpp
@@ -1708,7 +1708,7 @@ void Sema::SubstExceptionSpec(FunctionDecl *New, const FunctionProtoType *Proto,
Proto->getExtProtoInfo().ExceptionSpec;
SmallVector<QualType, 4> ExceptionStorage;
- if (SubstExceptionSpec(New->getTypeSourceInfo()->getTypeLoc().getLocEnd(),
+ if (SubstExceptionSpec(New->getTypeSourceInfo()->getTypeLoc().getEndLoc(),
ESI, ExceptionStorage, Args))
// On error, recover by dropping the exception specification.
ESI.Type = EST_None;
@@ -2303,7 +2303,7 @@ bool Sema::InstantiateInClassInitializer(
Diag(PointOfInstantiation,
diag::err_in_class_initializer_not_yet_parsed)
<< OutermostClass << Pattern;
- Diag(Pattern->getLocEnd(), diag::note_in_class_initializer_not_yet_parsed);
+ Diag(Pattern->getEndLoc(), diag::note_in_class_initializer_not_yet_parsed);
Instantiation->setInvalidDecl();
return true;
}
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 21c946a628..4c1d56b831 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -1943,26 +1943,23 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D,
Constructor->isExplicit(),
Constructor->isInlineSpecified(),
false, Constructor->isConstexpr());
- Method->setRangeEnd(Constructor->getLocEnd());
+ Method->setRangeEnd(Constructor->getEndLoc());
} else if (CXXDestructorDecl *Destructor = dyn_cast<CXXDestructorDecl>(D)) {
Method = CXXDestructorDecl::Create(SemaRef.Context, Record,
StartLoc, NameInfo, T, TInfo,
Destructor->isInlineSpecified(),
false);
- Method->setRangeEnd(Destructor->getLocEnd());
+ Method->setRangeEnd(Destructor->getEndLoc());
} else if (CXXConversionDecl *Conversion = dyn_cast<CXXConversionDecl>(D)) {
- Method = CXXConversionDecl::Create(SemaRef.Context, Record,
- StartLoc, NameInfo, T, TInfo,
- Conversion->isInlineSpecified(),
- Conversion->isExplicit(),
- Conversion->isConstexpr(),
- Conversion->getLocEnd());
+ Method = CXXConversionDecl::Create(
+ SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo,
+ Conversion->isInlineSpecified(), Conversion->isExplicit(),
+ Conversion->isConstexpr(), Conversion->getEndLoc());
} else {
StorageClass SC = D->isStatic() ? SC_Static : SC_None;
- Method = CXXMethodDecl::Create(SemaRef.Context, Record,
- StartLoc, NameInfo, T, TInfo,
- SC, D->isInlineSpecified(),
- D->isConstexpr(), D->getLocEnd());
+ Method = CXXMethodDecl::Create(SemaRef.Context, Record, StartLoc, NameInfo,
+ T, TInfo, SC, D->isInlineSpecified(),
+ D->isConstexpr(), D->getEndLoc());
}
if (D->isInlined())
diff --git a/lib/Sema/SemaTemplateVariadic.cpp b/lib/Sema/SemaTemplateVariadic.cpp
index b95a139155..7d1d4c5d7e 100644
--- a/lib/Sema/SemaTemplateVariadic.cpp
+++ b/lib/Sema/SemaTemplateVariadic.cpp
@@ -1126,7 +1126,7 @@ static void CheckFoldOperand(Sema &S, Expr *E) {
S.Diag(E->getExprLoc(), diag::err_fold_expression_bad_operand)
<< E->getSourceRange()
<< FixItHint::CreateInsertion(E->getBeginLoc(), "(")
- << FixItHint::CreateInsertion(E->getLocEnd(), ")");
+ << FixItHint::CreateInsertion(E->getEndLoc(), ")");
}
}
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 9e80541709..486d8ac4ed 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -3302,7 +3302,7 @@ static void warnAboutRedundantParens(Sema &S, Declarator &D, QualType T) {
// valid (when there is no initializer and we're not in a condition).
S.Diag(D.getBeginLoc(), diag::note_function_style_cast_add_parentheses)
<< FixItHint::CreateInsertion(D.getBeginLoc(), "(")
- << FixItHint::CreateInsertion(S.getLocForEndOfToken(D.getLocEnd()), ")");
+ << FixItHint::CreateInsertion(S.getLocForEndOfToken(D.getEndLoc()), ")");
S.Diag(Paren.Loc, diag::note_remove_parens_for_variable_declaration)
<< FixItHint::CreateRemoval(Paren.Loc)
<< FixItHint::CreateRemoval(Paren.EndLoc);
@@ -4182,7 +4182,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
if (auto *attr = inferPointerNullability(
pointerKind, D.getDeclSpec().getTypeSpecTypeLoc(),
- D.getDeclSpec().getLocEnd(),
+ D.getDeclSpec().getEndLoc(),
D.getMutableDeclSpec().getAttributes())) {
T = Context.getAttributedType(
AttributedType::getNullabilityAttrKind(*inferNullability),T,T);
@@ -4473,10 +4473,10 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
SourceLocation DiagLoc, FixitLoc;
if (TInfo) {
DiagLoc = TInfo->getTypeLoc().getBeginLoc();
- FixitLoc = S.getLocForEndOfToken(TInfo->getTypeLoc().getLocEnd());
+ FixitLoc = S.getLocForEndOfToken(TInfo->getTypeLoc().getEndLoc());
} else {
DiagLoc = D.getDeclSpec().getTypeSpecTypeLoc();
- FixitLoc = S.getLocForEndOfToken(D.getDeclSpec().getLocEnd());
+ FixitLoc = S.getLocForEndOfToken(D.getDeclSpec().getEndLoc());
}
S.Diag(DiagLoc, diag::err_object_cannot_be_passed_returned_by_value)
<< 0 << T
@@ -5298,7 +5298,7 @@ namespace {
// FIXME. We should have DS.getTypeSpecTypeEndLoc(). But, it requires
// addition field. What we have is good enough for dispay of location
// of 'fixit' on interface name.
- TL.setNameEndLoc(DS.getLocEnd());
+ TL.setNameEndLoc(DS.getEndLoc());
}
void VisitObjCObjectTypeLoc(ObjCObjectTypeLoc TL) {
TypeSourceInfo *RepTInfo = nullptr;
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h
index bf7ff9152a..d680e6be6d 100644
--- a/lib/Sema/TreeTransform.h
+++ b/lib/Sema/TreeTransform.h
@@ -3395,7 +3395,7 @@ ExprResult TreeTransform<Derived>::TransformInitializer(Expr *Init,
// If this was list initialization, revert to syntactic list form.
if (Construct->isListInitialization())
return getDerived().RebuildInitList(Construct->getBeginLoc(), NewArgs,
- Construct->getLocEnd());
+ Construct->getEndLoc());
// Build a ParenListExpr to represent anything else.
SourceRange Parens = Construct->getParenOrBraceRange();
@@ -7702,7 +7702,7 @@ StmtResult TreeTransform<Derived>::TransformOMPExecutableDirective(
return getDerived().RebuildOMPExecutableDirective(
D->getDirectiveKind(), DirName, CancelRegion, TClauses,
- AssociatedStmt.get(), D->getBeginLoc(), D->getLocEnd());
+ AssociatedStmt.get(), D->getBeginLoc(), D->getEndLoc());
}
template <typename Derived>
@@ -8239,7 +8239,7 @@ OMPClause *TreeTransform<Derived>::TransformOMPIfClause(OMPIfClause *C) {
return nullptr;
return getDerived().RebuildOMPIfClause(
C->getNameModifier(), Cond.get(), C->getBeginLoc(), C->getLParenLoc(),
- C->getNameModifierLoc(), C->getColonLoc(), C->getLocEnd());
+ C->getNameModifierLoc(), C->getColonLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8248,7 +8248,7 @@ OMPClause *TreeTransform<Derived>::TransformOMPFinalClause(OMPFinalClause *C) {
if (Cond.isInvalid())
return nullptr;
return getDerived().RebuildOMPFinalClause(Cond.get(), C->getBeginLoc(),
- C->getLParenLoc(), C->getLocEnd());
+ C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8258,7 +8258,7 @@ TreeTransform<Derived>::TransformOMPNumThreadsClause(OMPNumThreadsClause *C) {
if (NumThreads.isInvalid())
return nullptr;
return getDerived().RebuildOMPNumThreadsClause(
- NumThreads.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ NumThreads.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8268,7 +8268,7 @@ TreeTransform<Derived>::TransformOMPSafelenClause(OMPSafelenClause *C) {
if (E.isInvalid())
return nullptr;
return getDerived().RebuildOMPSafelenClause(
- E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8278,7 +8278,7 @@ TreeTransform<Derived>::TransformOMPSimdlenClause(OMPSimdlenClause *C) {
if (E.isInvalid())
return nullptr;
return getDerived().RebuildOMPSimdlenClause(
- E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8288,7 +8288,7 @@ TreeTransform<Derived>::TransformOMPCollapseClause(OMPCollapseClause *C) {
if (E.isInvalid())
return nullptr;
return getDerived().RebuildOMPCollapseClause(
- E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8296,7 +8296,7 @@ OMPClause *
TreeTransform<Derived>::TransformOMPDefaultClause(OMPDefaultClause *C) {
return getDerived().RebuildOMPDefaultClause(
C->getDefaultKind(), C->getDefaultKindKwLoc(), C->getBeginLoc(),
- C->getLParenLoc(), C->getLocEnd());
+ C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8304,7 +8304,7 @@ OMPClause *
TreeTransform<Derived>::TransformOMPProcBindClause(OMPProcBindClause *C) {
return getDerived().RebuildOMPProcBindClause(
C->getProcBindKind(), C->getProcBindKindKwLoc(), C->getBeginLoc(),
- C->getLParenLoc(), C->getLocEnd());
+ C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8317,7 +8317,7 @@ TreeTransform<Derived>::TransformOMPScheduleClause(OMPScheduleClause *C) {
C->getFirstScheduleModifier(), C->getSecondScheduleModifier(),
C->getScheduleKind(), E.get(), C->getBeginLoc(), C->getLParenLoc(),
C->getFirstScheduleModifierLoc(), C->getSecondScheduleModifierLoc(),
- C->getScheduleKindLoc(), C->getCommaLoc(), C->getLocEnd());
+ C->getScheduleKindLoc(), C->getCommaLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8329,7 +8329,7 @@ TreeTransform<Derived>::TransformOMPOrderedClause(OMPOrderedClause *C) {
if (E.isInvalid())
return nullptr;
}
- return getDerived().RebuildOMPOrderedClause(C->getBeginLoc(), C->getLocEnd(),
+ return getDerived().RebuildOMPOrderedClause(C->getBeginLoc(), C->getEndLoc(),
C->getLParenLoc(), E.get());
}
@@ -8419,7 +8419,7 @@ TreeTransform<Derived>::TransformOMPPrivateClause(OMPPrivateClause *C) {
Vars.push_back(EVar.get());
}
return getDerived().RebuildOMPPrivateClause(
- Vars, C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8434,7 +8434,7 @@ OMPClause *TreeTransform<Derived>::TransformOMPFirstprivateClause(
Vars.push_back(EVar.get());
}
return getDerived().RebuildOMPFirstprivateClause(
- Vars, C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8449,7 +8449,7 @@ TreeTransform<Derived>::TransformOMPLastprivateClause(OMPLastprivateClause *C) {
Vars.push_back(EVar.get());
}
return getDerived().RebuildOMPLastprivateClause(
- Vars, C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8464,7 +8464,7 @@ TreeTransform<Derived>::TransformOMPSharedClause(OMPSharedClause *C) {
Vars.push_back(EVar.get());
}
return getDerived().RebuildOMPSharedClause(Vars, C->getBeginLoc(),
- C->getLParenLoc(), C->getLocEnd());
+ C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8511,7 +8511,7 @@ TreeTransform<Derived>::TransformOMPReductionClause(OMPReductionClause *C) {
}
return getDerived().RebuildOMPReductionClause(
Vars, C->getBeginLoc(), C->getLParenLoc(), C->getColonLoc(),
- C->getLocEnd(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
+ C->getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
}
template <typename Derived>
@@ -8556,7 +8556,7 @@ OMPClause *TreeTransform<Derived>::TransformOMPTaskReductionClause(
}
return getDerived().RebuildOMPTaskReductionClause(
Vars, C->getBeginLoc(), C->getLParenLoc(), C->getColonLoc(),
- C->getLocEnd(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
+ C->getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
}
template <typename Derived>
@@ -8601,7 +8601,7 @@ TreeTransform<Derived>::TransformOMPInReductionClause(OMPInReductionClause *C) {
}
return getDerived().RebuildOMPInReductionClause(
Vars, C->getBeginLoc(), C->getLParenLoc(), C->getColonLoc(),
- C->getLocEnd(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
+ C->getEndLoc(), ReductionIdScopeSpec, NameInfo, UnresolvedReductions);
}
template <typename Derived>
@@ -8620,7 +8620,7 @@ TreeTransform<Derived>::TransformOMPLinearClause(OMPLinearClause *C) {
return nullptr;
return getDerived().RebuildOMPLinearClause(
Vars, Step.get(), C->getBeginLoc(), C->getLParenLoc(), C->getModifier(),
- C->getModifierLoc(), C->getColonLoc(), C->getLocEnd());
+ C->getModifierLoc(), C->getColonLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8639,7 +8639,7 @@ TreeTransform<Derived>::TransformOMPAlignedClause(OMPAlignedClause *C) {
return nullptr;
return getDerived().RebuildOMPAlignedClause(
Vars, Alignment.get(), C->getBeginLoc(), C->getLParenLoc(),
- C->getColonLoc(), C->getLocEnd());
+ C->getColonLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8654,7 +8654,7 @@ TreeTransform<Derived>::TransformOMPCopyinClause(OMPCopyinClause *C) {
Vars.push_back(EVar.get());
}
return getDerived().RebuildOMPCopyinClause(Vars, C->getBeginLoc(),
- C->getLParenLoc(), C->getLocEnd());
+ C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8669,7 +8669,7 @@ TreeTransform<Derived>::TransformOMPCopyprivateClause(OMPCopyprivateClause *C) {
Vars.push_back(EVar.get());
}
return getDerived().RebuildOMPCopyprivateClause(
- Vars, C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8683,7 +8683,7 @@ OMPClause *TreeTransform<Derived>::TransformOMPFlushClause(OMPFlushClause *C) {
Vars.push_back(EVar.get());
}
return getDerived().RebuildOMPFlushClause(Vars, C->getBeginLoc(),
- C->getLParenLoc(), C->getLocEnd());
+ C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8699,7 +8699,7 @@ TreeTransform<Derived>::TransformOMPDependClause(OMPDependClause *C) {
}
return getDerived().RebuildOMPDependClause(
C->getDependencyKind(), C->getDependencyLoc(), C->getColonLoc(), Vars,
- C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8709,7 +8709,7 @@ TreeTransform<Derived>::TransformOMPDeviceClause(OMPDeviceClause *C) {
if (E.isInvalid())
return nullptr;
return getDerived().RebuildOMPDeviceClause(E.get(), C->getBeginLoc(),
- C->getLParenLoc(), C->getLocEnd());
+ C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8725,7 +8725,7 @@ OMPClause *TreeTransform<Derived>::TransformOMPMapClause(OMPMapClause *C) {
return getDerived().RebuildOMPMapClause(
C->getMapTypeModifier(), C->getMapType(), C->isImplicitMapType(),
C->getMapLoc(), C->getColonLoc(), Vars, C->getBeginLoc(),
- C->getLParenLoc(), C->getLocEnd());
+ C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8735,7 +8735,7 @@ TreeTransform<Derived>::TransformOMPNumTeamsClause(OMPNumTeamsClause *C) {
if (E.isInvalid())
return nullptr;
return getDerived().RebuildOMPNumTeamsClause(
- E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8745,7 +8745,7 @@ TreeTransform<Derived>::TransformOMPThreadLimitClause(OMPThreadLimitClause *C) {
if (E.isInvalid())
return nullptr;
return getDerived().RebuildOMPThreadLimitClause(
- E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8755,7 +8755,7 @@ TreeTransform<Derived>::TransformOMPPriorityClause(OMPPriorityClause *C) {
if (E.isInvalid())
return nullptr;
return getDerived().RebuildOMPPriorityClause(
- E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8765,7 +8765,7 @@ TreeTransform<Derived>::TransformOMPGrainsizeClause(OMPGrainsizeClause *C) {
if (E.isInvalid())
return nullptr;
return getDerived().RebuildOMPGrainsizeClause(
- E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8775,7 +8775,7 @@ TreeTransform<Derived>::TransformOMPNumTasksClause(OMPNumTasksClause *C) {
if (E.isInvalid())
return nullptr;
return getDerived().RebuildOMPNumTasksClause(
- E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ E.get(), C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8784,7 +8784,7 @@ OMPClause *TreeTransform<Derived>::TransformOMPHintClause(OMPHintClause *C) {
if (E.isInvalid())
return nullptr;
return getDerived().RebuildOMPHintClause(E.get(), C->getBeginLoc(),
- C->getLParenLoc(), C->getLocEnd());
+ C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8795,7 +8795,7 @@ OMPClause *TreeTransform<Derived>::TransformOMPDistScheduleClause(
return nullptr;
return getDerived().RebuildOMPDistScheduleClause(
C->getDistScheduleKind(), E.get(), C->getBeginLoc(), C->getLParenLoc(),
- C->getDistScheduleKindLoc(), C->getCommaLoc(), C->getLocEnd());
+ C->getDistScheduleKindLoc(), C->getCommaLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8815,7 +8815,7 @@ OMPClause *TreeTransform<Derived>::TransformOMPToClause(OMPToClause *C) {
Vars.push_back(EVar.get());
}
return getDerived().RebuildOMPToClause(Vars, C->getBeginLoc(),
- C->getLParenLoc(), C->getLocEnd());
+ C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8829,7 +8829,7 @@ OMPClause *TreeTransform<Derived>::TransformOMPFromClause(OMPFromClause *C) {
Vars.push_back(EVar.get());
}
return getDerived().RebuildOMPFromClause(Vars, C->getBeginLoc(),
- C->getLParenLoc(), C->getLocEnd());
+ C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8844,7 +8844,7 @@ OMPClause *TreeTransform<Derived>::TransformOMPUseDevicePtrClause(
Vars.push_back(EVar.get());
}
return getDerived().RebuildOMPUseDevicePtrClause(
- Vars, C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
@@ -8859,7 +8859,7 @@ TreeTransform<Derived>::TransformOMPIsDevicePtrClause(OMPIsDevicePtrClause *C) {
Vars.push_back(EVar.get());
}
return getDerived().RebuildOMPIsDevicePtrClause(
- Vars, C->getBeginLoc(), C->getLParenLoc(), C->getLocEnd());
+ Vars, C->getBeginLoc(), C->getLParenLoc(), C->getEndLoc());
}
//===----------------------------------------------------------------------===//
@@ -9252,7 +9252,7 @@ TreeTransform<Derived>::TransformOMPArraySectionExpr(OMPArraySectionExpr *E) {
return E;
return getDerived().RebuildOMPArraySectionExpr(
- Base.get(), E->getBase()->getLocEnd(), LowerBound.get(), E->getColonLoc(),
+ Base.get(), E->getBase()->getEndLoc(), LowerBound.get(), E->getColonLoc(),
Length.get(), E->getRBracketLoc());
}
@@ -9505,9 +9505,9 @@ TreeTransform<Derived>::TransformCompoundLiteralExpr(CompoundLiteralExpr *E) {
// type-as-written, but that's okay, because it should always be
// derivable from the initializer.
- return getDerived().RebuildCompoundLiteralExpr(E->getLParenLoc(), NewT,
- /*FIXME:*/E->getInitializer()->getLocEnd(),
- Init.get());
+ return getDerived().RebuildCompoundLiteralExpr(
+ E->getLParenLoc(), NewT,
+ /*FIXME:*/ E->getInitializer()->getEndLoc(), Init.get());
}
template<typename Derived>
@@ -9523,7 +9523,7 @@ TreeTransform<Derived>::TransformExtVectorElementExpr(ExtVectorElementExpr *E) {
// FIXME: Bad source location
SourceLocation FakeOperatorLoc =
- SemaRef.getLocForEndOfToken(E->getBase()->getLocEnd());
+ SemaRef.getLocForEndOfToken(E->getBase()->getEndLoc());
return getDerived().RebuildExtVectorElementExpr(Base.get(), FakeOperatorLoc,
E->getAccessorLoc(),
E->getAccessor());
@@ -9811,7 +9811,7 @@ TreeTransform<Derived>::TransformCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
// FIXME: Poor location information
SourceLocation FakeLParenLoc = SemaRef.getLocForEndOfToken(
- static_cast<Expr *>(Object.get())->getLocEnd());
+ static_cast<Expr *>(Object.get())->getEndLoc());
// Transform the call arguments.
SmallVector<Expr*, 8> Args;
@@ -9819,9 +9819,8 @@ TreeTransform<Derived>::TransformCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
Args))
return ExprError();
- return getDerived().RebuildCallExpr(Object.get(), FakeLParenLoc,
- Args,
- E->getLocEnd());
+ return getDerived().RebuildCallExpr(Object.get(), FakeLParenLoc, Args,
+ E->getEndLoc());
}
#define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) \
@@ -10002,7 +10001,7 @@ TreeTransform<Derived>::TransformCXXTypeidExpr(CXXTypeidExpr *E) {
return E;
return getDerived().RebuildCXXTypeidExpr(E->getType(), E->getBeginLoc(),
- TInfo, E->getLocEnd());
+ TInfo, E->getEndLoc());
}
// We don't know whether the subexpression is potentially evaluated until
@@ -10022,7 +10021,7 @@ TreeTransform<Derived>::TransformCXXTypeidExpr(CXXTypeidExpr *E) {
return E;
return getDerived().RebuildCXXTypeidExpr(E->getType(), E->getBeginLoc(),
- SubExpr.get(), E->getLocEnd());
+ SubExpr.get(), E->getEndLoc());
}
template<typename Derived>
@@ -10039,7 +10038,7 @@ TreeTransform<Derived>::TransformCXXUuidofExpr(CXXUuidofExpr *E) {
return E;
return getDerived().RebuildCXXUuidofExpr(E->getType(), E->getBeginLoc(),
- TInfo, E->getLocEnd());
+ TInfo, E->getEndLoc());
}
EnterExpressionEvaluationContext Unevaluated(
@@ -10054,7 +10053,7 @@ TreeTransform<Derived>::TransformCXXUuidofExpr(CXXUuidofExpr *E) {
return E;
return getDerived().RebuildCXXUuidofExpr(E->getType(), E->getBeginLoc(),
- SubExpr.get(), E->getLocEnd());
+ SubExpr.get(), E->getEndLoc());
}
template<typename Derived>
@@ -10624,7 +10623,7 @@ TreeTransform<Derived>::TransformTypeTraitExpr(TypeTraitExpr *E) {
return E;
return getDerived().RebuildTypeTrait(E->getTrait(), E->getBeginLoc(), Args,
- E->getLocEnd());
+ E->getEndLoc());
}
template<typename Derived>
@@ -10651,7 +10650,7 @@ TreeTransform<Derived>::TransformArrayTypeTraitExpr(ArrayTypeTraitExpr *E) {
}
return getDerived().RebuildArrayTypeTrait(E->getTrait(), E->getBeginLoc(), T,
- SubExpr.get(), E->getLocEnd());
+ SubExpr.get(), E->getEndLoc());
}
template<typename Derived>
@@ -10670,7 +10669,7 @@ TreeTransform<Derived>::TransformExpressionTraitExpr(ExpressionTraitExpr *E) {
}
return getDerived().RebuildExpressionTrait(E->getTrait(), E->getBeginLoc(),
- SubExpr.get(), E->getLocEnd());
+ SubExpr.get(), E->getEndLoc());
}
template <typename Derived>
@@ -10871,7 +10870,7 @@ TreeTransform<Derived>::TransformCXXTemporaryObjectExpr(
// prepared to handle list-initialization without a child InitListExpr.
SourceLocation LParenLoc = T->getTypeLoc().getEndLoc();
return getDerived().RebuildCXXTemporaryObjectExpr(
- T, LParenLoc, Args, E->getLocEnd(),
+ T, LParenLoc, Args, E->getEndLoc(),
/*ListInitialization=*/LParenLoc.isInvalid());
}
@@ -10955,7 +10954,7 @@ TreeTransform<Derived>::TransformLambdaExpr(LambdaExpr *E) {
// Build the call operator.
CXXMethodDecl *NewCallOperator = getSema().startLambdaDefinition(
Class, E->getIntroducerRange(), NewCallOpTSI,
- E->getCallOperator()->getLocEnd(),
+ E->getCallOperator()->getEndLoc(),
NewCallOpTSI->getTypeLoc().castAs<FunctionProtoTypeLoc>().getParams(),
E->getCallOperator()->isConstexpr());
@@ -11132,7 +11131,7 @@ TreeTransform<Derived>::TransformLambdaExpr(LambdaExpr *E) {
/*IsInstantiation*/ true);
SavedContext.pop();
- return getSema().BuildLambdaExpr(E->getBeginLoc(), Body.get()->getLocEnd(),
+ return getSema().BuildLambdaExpr(E->getBeginLoc(), Body.get()->getEndLoc(),
&LSICopy);
}
@@ -11580,7 +11579,7 @@ TreeTransform<Derived>::TransformCXXFoldExpr(CXXFoldExpr *E) {
return getDerived().RebuildCXXFoldExpr(
E->getBeginLoc(), LHS.get(), E->getOperator(), E->getEllipsisLoc(),
- RHS.get(), E->getLocEnd());
+ RHS.get(), E->getEndLoc());
}
// The transform has determined that we should perform an elementwise
@@ -11601,7 +11600,7 @@ TreeTransform<Derived>::TransformCXXFoldExpr(CXXFoldExpr *E) {
Result = getDerived().RebuildCXXFoldExpr(
E->getBeginLoc(), Out.get(), E->getOperator(), E->getEllipsisLoc(),
- Result.get(), E->getLocEnd());
+ Result.get(), E->getEndLoc());
if (Result.isInvalid())
return true;
}
@@ -11618,7 +11617,7 @@ TreeTransform<Derived>::TransformCXXFoldExpr(CXXFoldExpr *E) {
Result = getDerived().RebuildCXXFoldExpr(
E->getBeginLoc(), LeftFold ? Result.get() : Out.get(),
E->getOperator(), E->getEllipsisLoc(),
- LeftFold ? Out.get() : Result.get(), E->getLocEnd());
+ LeftFold ? Out.get() : Result.get(), E->getEndLoc());
} else if (Result.isUsable()) {
// We've got down to a single element; build a binary operator.
Result = getDerived().RebuildBinaryOperator(
@@ -11643,7 +11642,7 @@ TreeTransform<Derived>::TransformCXXFoldExpr(CXXFoldExpr *E) {
Result = getDerived().RebuildCXXFoldExpr(
E->getBeginLoc(), Result.get(), E->getOperator(), E->getEllipsisLoc(),
- Out.get(), E->getLocEnd());
+ Out.get(), E->getEndLoc());
if (Result.isInvalid())
return true;
}
@@ -11732,7 +11731,7 @@ TreeTransform<Derived>::TransformObjCDictionaryLiteral(
Optional<unsigned> OrigNumExpansions = OrigElement.NumExpansions;
Optional<unsigned> NumExpansions = OrigNumExpansions;
SourceRange PatternRange(OrigElement.Key->getBeginLoc(),
- OrigElement.Value->getLocEnd());
+ OrigElement.Value->getEndLoc());
if (getDerived().TryExpandParameterPacks(OrigElement.EllipsisLoc,
PatternRange, Unexpanded, Expand,
RetainExpansion, NumExpansions))