Add getEndLoc API to replace getLocEnd
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D50348
llvm-svn: 339374
diff --git a/clang/include/clang/AST/Comment.h b/clang/include/clang/AST/Comment.h
index 7584c68..030a5a8 100644
--- a/clang/include/clang/AST/Comment.h
+++ b/clang/include/clang/AST/Comment.h
@@ -218,9 +218,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
- SourceLocation getLocEnd() const LLVM_READONLY {
- return Range.getEnd();
- }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
SourceLocation getLocation() const LLVM_READONLY { return Loc; }
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index ffb3a77..e49de5a 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -4195,7 +4195,8 @@
SourceLocation getRBraceLoc() const { return RBraceLoc; }
void setRBraceLoc(SourceLocation L) { RBraceLoc = L; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
if (RBraceLoc.isValid())
return RBraceLoc;
// No braces: get the end location of the (only) declaration in context
diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h
index 2be7c09..da9e4c5 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -411,7 +411,8 @@
return getSourceRange().getBegin();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getSourceRange().getEnd();
}
diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h
index 5cd9370..fe730ef 100644
--- a/clang/include/clang/AST/DeclCXX.h
+++ b/clang/include/clang/AST/DeclCXX.h
@@ -235,7 +235,8 @@
SourceRange getSourceRange() const LLVM_READONLY { return Range; }
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
/// Get the location at which the base class type was written.
SourceLocation getBaseTypeLoc() const LLVM_READONLY {
@@ -2871,7 +2872,8 @@
LinkageSpecDeclBits.HasBraces = RBraceLoc.isValid();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
if (hasBraces())
return getRBraceLoc();
// No braces: get the end location of the (only) declaration in context
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h
index 726d93a..b645b4a 100644
--- a/clang/include/clang/AST/DeclObjC.h
+++ b/clang/include/clang/AST/DeclObjC.h
@@ -282,7 +282,8 @@
// Location information, modeled after the Stmt API.
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return getLocation(); }
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
SourceRange getSourceRange() const override LLVM_READONLY {
return SourceRange(getLocation(), getLocEnd());
}
diff --git a/clang/include/clang/AST/DeclarationName.h b/clang/include/clang/AST/DeclarationName.h
index 8d217ba..3b68718 100644
--- a/clang/include/clang/AST/DeclarationName.h
+++ b/clang/include/clang/AST/DeclarationName.h
@@ -637,9 +637,6 @@
/// getBeginLoc - Retrieve the location of the first token.
SourceLocation getBeginLoc() const { return NameLoc; }
- /// getEndLoc - Retrieve the location of the last token.
- SourceLocation getEndLoc() const { return getLocEnd(); }
-
/// getSourceRange - The range of the declaration name.
SourceRange getSourceRange() const LLVM_READONLY {
return SourceRange(getLocStart(), getLocEnd());
@@ -647,10 +644,12 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
SourceLocation EndLoc = getEndLocPrivate();
return EndLoc.isValid() ? EndLoc : getLocStart();
}
+
private:
SourceLocation getEndLocPrivate() const;
};
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 75741ab..e7e32b9 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -908,7 +908,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return SourceExpr ? SourceExpr->getLocStart() : Loc;
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return SourceExpr ? SourceExpr->getLocEnd() : Loc;
}
SourceLocation getExprLoc() const LLVM_READONLY {
@@ -1067,7 +1068,8 @@
void setLocation(SourceLocation L) { Loc = L; }
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY;
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
/// Determine whether this declaration reference was preceded by a
/// C++ nested-name-specifier, e.g., \c N::foo.
@@ -1246,7 +1248,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == PredefinedExprClass;
@@ -1336,7 +1339,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
/// Retrieve the location of the literal.
SourceLocation getLocation() const { return Loc; }
@@ -1376,7 +1380,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
/// \brief Retrieve the location of the literal.
SourceLocation getLocation() const { return Loc; }
@@ -1431,7 +1436,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
unsigned getValue() const { return Value; }
@@ -1505,7 +1511,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == FloatingLiteralClass;
@@ -1545,7 +1552,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return Val->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return Val->getLocEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Val->getLocEnd(); }
static bool classof(const Stmt *T) {
return T->getStmtClass() == ImaginaryLiteralClass;
@@ -1720,7 +1728,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return TokLocs[0]; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return TokLocs[NumConcatenated - 1];
}
@@ -1761,7 +1770,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return L; }
- SourceLocation getLocEnd() const LLVM_READONLY { return R; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return R; }
/// Get the location of the left parentheses '('.
SourceLocation getLParen() const { return L; }
@@ -1888,7 +1898,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return isPostfix() ? Val->getLocStart() : Loc;
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return isPostfix() ? Loc : Val->getLocEnd();
}
SourceLocation getExprLoc() const LLVM_READONLY { return Loc; }
@@ -1995,7 +2006,8 @@
SourceRange getSourceRange() const LLVM_READONLY { return Range; }
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
};
/// OffsetOfExpr - [C99 7.17] - This represents an expression of the form
@@ -2096,7 +2108,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return OperatorLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == OffsetOfExprClass;
@@ -2193,7 +2206,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return OpLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == UnaryExprOrTypeTraitExprClass;
@@ -2270,7 +2284,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return getLHS()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return RBracketLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RBracketLoc; }
SourceLocation getRBracketLoc() const { return RBracketLoc; }
void setRBracketLoc(SourceLocation L) { RBracketLoc = L; }
@@ -2439,7 +2454,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY;
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
/// Return true if this is a call to __assume() or __builtin_assume() with
/// a non-value-dependent constant parameter evaluating as false.
@@ -2686,7 +2702,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY;
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
SourceLocation getExprLoc() const LLVM_READONLY { return MemberLoc; }
@@ -2784,7 +2801,8 @@
return Init->getLocStart();
return LParenLoc;
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
// FIXME: Init should never be null.
if (!Init)
return SourceLocation();
@@ -2982,7 +3000,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return getSubExpr()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getSubExpr()->getLocEnd();
}
@@ -3090,7 +3109,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return LPLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getSubExpr()->getLocEnd();
}
@@ -3173,7 +3193,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return getLHS()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getRHS()->getLocEnd();
}
@@ -3457,7 +3478,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return getCond()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getRHS()->getLocEnd();
}
@@ -3546,7 +3568,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return getCommon()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getFalseExpr()->getLocEnd();
}
@@ -3603,7 +3626,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AmpAmpLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return LabelLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return LabelLoc; }
LabelDecl *getLabel() const { return Label; }
void setLabel(LabelDecl *L) { Label = L; }
@@ -3649,7 +3673,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
SourceLocation getLParenLoc() const { return LParenLoc; }
void setLParenLoc(SourceLocation L) { LParenLoc = L; }
@@ -3699,7 +3724,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == ShuffleVectorExprClass;
@@ -3784,7 +3810,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == ConvertVectorExprClass;
@@ -3866,7 +3893,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == ChooseExprClass;
@@ -3906,7 +3934,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return TokenLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return TokenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return TokenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == GNUNullExprClass;
@@ -3959,7 +3988,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == VAArgExprClass;
@@ -4194,7 +4224,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY;
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
static bool classof(const Stmt *T) {
return T->getStmtClass() == InitListExprClass;
@@ -4435,7 +4466,8 @@
else
return getLBracketLoc();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return Kind == FieldDesignator ? getFieldLoc() : getRBracketLoc();
}
SourceRange getSourceRange() const LLVM_READONLY {
@@ -4520,7 +4552,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY;
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
static bool classof(const Stmt *T) {
return T->getStmtClass() == DesignatedInitExprClass;
@@ -4563,7 +4596,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return SourceLocation(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); }
// Iterators
child_range children() {
@@ -4599,7 +4633,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY;
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
static bool classof(const Stmt *T) {
return T->getStmtClass() == DesignatedInitUpdateExprClass;
@@ -4677,7 +4712,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return getCommonExpr()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getCommonExpr()->getLocEnd();
}
@@ -4711,7 +4747,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return SourceLocation(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); }
child_range children() {
return child_range(child_iterator(), child_iterator());
@@ -4748,7 +4785,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return SourceLocation(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); }
// Iterators
child_range children() {
@@ -4794,7 +4832,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == ParenListExprClass;
@@ -4919,7 +4958,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return GenericLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == GenericSelectionExprClass;
@@ -4988,7 +5028,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return getBase()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return AccessorLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return AccessorLoc; }
/// isArrow - Return true if the base expression is a pointer to vector,
/// return false if the base expression is a vector.
@@ -5034,7 +5075,10 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return getCaretLocation();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return getBody()->getLocEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
+ return getBody()->getLocEnd();
+ }
/// getFunctionType - Return the underlying function type for this block.
const FunctionProtoType *getFunctionType() const;
@@ -5088,7 +5132,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == AsTypeExprClass;
@@ -5233,7 +5278,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return getSyntacticForm()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getSyntacticForm()->getLocEnd();
}
@@ -5359,7 +5405,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == AtomicExprClass;
@@ -5414,7 +5461,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return SourceLocation(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); }
static bool classof(const Stmt *T) {
return T->getStmtClass() == TypoExprClass;
diff --git a/clang/include/clang/AST/ExprCXX.h b/clang/include/clang/AST/ExprCXX.h
index 89ae5f1..5ce55bde 100644
--- a/clang/include/clang/AST/ExprCXX.h
+++ b/clang/include/clang/AST/ExprCXX.h
@@ -134,7 +134,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
SourceRange getSourceRange() const { return Range; }
static bool classof(const Stmt *T) {
@@ -281,7 +282,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
SourceRange getAngleBrackets() const LLVM_READONLY { return AngleBrackets; }
static bool classof(const Stmt *T) {
@@ -533,7 +535,8 @@
return getArg(0)->getLocStart();
}
- SourceLocation getLocEnd() const { return getRParenLoc(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const { return getRParenLoc(); }
/// Returns the location of a ud-suffix in the expression.
///
@@ -568,7 +571,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
SourceLocation getLocation() const { return Loc; }
void setLocation(SourceLocation L) { Loc = L; }
@@ -600,7 +604,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
SourceLocation getLocation() const { return Loc; }
void setLocation(SourceLocation L) { Loc = L; }
@@ -641,7 +646,8 @@
return SubExpr->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return SubExpr->getLocEnd();
}
@@ -731,7 +737,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
SourceRange getSourceRange() const LLVM_READONLY { return Range; }
void setSourceRange(SourceRange R) { Range = R; }
@@ -795,7 +802,8 @@
return MemberLoc;
}
- SourceLocation getLocEnd() const { return getMemberLoc(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const { return getMemberLoc(); }
child_range children() {
return child_range((Stmt**)&BaseExpr, (Stmt**)&BaseExpr + 1);
@@ -860,7 +868,8 @@
return getBase()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return RBracketLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RBracketLoc; }
SourceLocation getRBracketLoc() const { return RBracketLoc; }
void setRBracketLoc(SourceLocation L) { RBracketLoc = L; }
@@ -944,7 +953,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
SourceRange getSourceRange() const LLVM_READONLY { return Range; }
void setSourceRange(SourceRange R) { Range = R; }
@@ -994,7 +1004,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
bool isImplicit() const { return Implicit; }
void setImplicit(bool I) { Implicit = I; }
@@ -1051,7 +1062,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return ThrowLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
if (!getSubExpr())
return ThrowLoc;
return getSubExpr()->getLocEnd();
@@ -1122,7 +1134,8 @@
/// source, so they have an empty source range.
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return SourceLocation(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); }
SourceLocation getExprLoc() const LLVM_READONLY { return Loc; }
@@ -1183,7 +1196,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == CXXDefaultInitExprClass;
@@ -1260,7 +1274,10 @@
return SubExpr->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return SubExpr->getLocEnd();}
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
+ return SubExpr->getLocEnd();
+ }
// Implement isa/cast/dyncast/etc.
static bool classof(const Stmt *T) {
@@ -1415,7 +1432,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY;
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
SourceRange getParenOrBraceRange() const { return ParenOrBraceRange; }
void setParenOrBraceRange(SourceRange Range) { ParenOrBraceRange = Range; }
@@ -1488,7 +1506,8 @@
SourceLocation getLocation() const LLVM_READONLY { return Loc; }
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == CXXInheritedCtorInitExprClass;
@@ -1552,7 +1571,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY;
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
static bool classof(const Stmt *T) {
return T->getStmtClass() == CXXFunctionalCastExprClass;
@@ -1597,7 +1617,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY;
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
static bool classof(const Stmt *T) {
return T->getStmtClass() == CXXTemporaryObjectExprClass;
@@ -1838,7 +1859,8 @@
return IntroducerRange.getBegin();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return ClosingBrace; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return ClosingBrace; }
child_range children() {
// Includes initialization exprs plus body stmt
@@ -1875,7 +1897,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY;
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == CXXScalarValueInitExprClass;
@@ -2184,7 +2207,10 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY {return Argument->getLocEnd();}
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
+ return Argument->getLocEnd();
+ }
static bool classof(const Stmt *T) {
return T->getStmtClass() == CXXDeleteExprClass;
@@ -2373,7 +2399,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return Base->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
static bool classof(const Stmt *T) {
return T->getStmtClass() == CXXPseudoDestructorExprClass;
@@ -2456,7 +2483,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == TypeTraitExprClass;
@@ -2518,7 +2546,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParen; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParen; }
ArrayTypeTrait getTrait() const { return static_cast<ArrayTypeTrait>(ATT); }
@@ -2583,7 +2612,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParen; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParen; }
ExpressionTrait getTrait() const { return static_cast<ExpressionTrait>(ET); }
@@ -2881,7 +2911,8 @@
return getNameInfo().getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
if (hasExplicitTemplateArgs())
return getRAngleLoc();
return getNameInfo().getLocEnd();
@@ -3032,7 +3063,8 @@
return QualifierLoc.getBeginLoc();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
if (hasExplicitTemplateArgs())
return getRAngleLoc();
return getLocation();
@@ -3113,7 +3145,10 @@
return SubExpr->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return SubExpr->getLocEnd();}
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
+ return SubExpr->getLocEnd();
+ }
// Implement isa/cast/dyncast/etc.
static bool classof(const Stmt *T) {
@@ -3237,7 +3272,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY;
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
if (!RParenLoc.isValid() && NumArgs > 0)
return getArg(NumArgs - 1)->getLocEnd();
return RParenLoc;
@@ -3466,7 +3502,8 @@
return MemberNameInfo.getBeginLoc();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
if (hasExplicitTemplateArgs())
return getRAngleLoc();
return MemberNameInfo.getEndLoc();
@@ -3617,7 +3654,8 @@
return getMemberNameInfo().getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
if (hasExplicitTemplateArgs())
return getRAngleLoc();
return getMemberNameInfo().getLocEnd();
@@ -3684,7 +3722,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
SourceRange getSourceRange() const LLVM_READONLY { return Range; }
bool getValue() const { return Value; }
@@ -3766,7 +3805,8 @@
return Pattern->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return EllipsisLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return EllipsisLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == PackExpansionExprClass;
@@ -3888,7 +3928,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return OperatorLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == SizeOfPackExprClass;
@@ -3933,7 +3974,8 @@
SourceLocation getNameLoc() const { return NameLoc; }
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return NameLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return NameLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return NameLoc; }
Expr *getReplacement() const { return cast<Expr>(Replacement); }
@@ -3998,7 +4040,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return NameLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return NameLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return NameLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == SubstNonTypeTemplateParmPackExprClass;
@@ -4072,7 +4115,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return NameLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return NameLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return NameLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == FunctionParmPackExprClass;
@@ -4188,7 +4232,8 @@
return getTemporary()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getTemporary()->getLocEnd();
}
@@ -4262,9 +4307,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
- return RParenLoc;
- }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == CXXFoldExprClass;
@@ -4356,7 +4400,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getCommonExpr()->getLocEnd();
}
@@ -4443,7 +4488,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getOperand()->getLocEnd();
}
diff --git a/clang/include/clang/AST/ExprObjC.h b/clang/include/clang/AST/ExprObjC.h
index aeb5770..d02b003 100644
--- a/clang/include/clang/AST/ExprObjC.h
+++ b/clang/include/clang/AST/ExprObjC.h
@@ -69,7 +69,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return String->getLocEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return String->getLocEnd(); }
// Iterators
child_range children() { return child_range(&String, &String+1); }
@@ -97,7 +98,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
SourceLocation getLocation() const { return Loc; }
void setLocation(SourceLocation L) { Loc = L; }
@@ -145,7 +147,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
SourceRange getSourceRange() const LLVM_READONLY {
return Range;
@@ -199,7 +202,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
SourceRange getSourceRange() const LLVM_READONLY { return Range; }
/// Retrieve elements of array of literals.
@@ -365,7 +369,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
SourceRange getSourceRange() const LLVM_READONLY { return Range; }
// Iterators
@@ -419,7 +424,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
// Iterators
child_range children() {
@@ -455,7 +461,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
/// getNumArgs - Return the number of actual arguments to this call.
unsigned getNumArgs() const { return SelName.getNumArgs(); }
@@ -505,7 +512,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
// Iterators
child_range children() {
@@ -568,7 +576,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return isFreeIvar() ? Loc : getBase()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
SourceLocation getOpLoc() const { return OpLoc; }
void setOpLoc(SourceLocation L) { OpLoc = L; }
@@ -756,7 +765,8 @@
return isObjectReceiver() ? getBase()->getLocStart() :getReceiverLocation();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return IdLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return IdLoc; }
// Iterators
child_range children() {
@@ -853,7 +863,8 @@
return SubExprs[BASE]->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return RBracket; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RBracket; }
Expr *getBaseExpr() const { return cast<Expr>(SubExprs[BASE]); }
void setBaseExpr(Stmt *S) { SubExprs[BASE] = S; }
@@ -1408,7 +1419,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return LBracLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RBracLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RBracLoc; }
// Iterators
child_range children();
@@ -1493,7 +1505,8 @@
return getBase()->getLocEnd();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return IsaMemberLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return IsaMemberLoc; }
SourceLocation getExprLoc() const LLVM_READONLY { return IsaMemberLoc; }
@@ -1566,7 +1579,10 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return Operand->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return Operand->getLocEnd();}
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
+ return Operand->getLocEnd();
+ }
SourceLocation getExprLoc() const LLVM_READONLY {
return getSubExpr()->getExprLoc();
@@ -1628,7 +1644,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getSubExpr()->getLocEnd();
}
@@ -1668,7 +1685,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const { return AtLoc; }
- SourceLocation getLocEnd() const { return RParen; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const { return RParen; }
SourceRange getSourceRange() const { return {AtLoc, RParen}; }
/// This may be '*', in which case this should fold to true.
diff --git a/clang/include/clang/AST/ExprOpenMP.h b/clang/include/clang/AST/ExprOpenMP.h
index a52af4c..c8b0fff 100644
--- a/clang/include/clang/AST/ExprOpenMP.h
+++ b/clang/include/clang/AST/ExprOpenMP.h
@@ -105,7 +105,8 @@
SourceLocation getBeginLoc() const LLVM_READONLY {
return getBase()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY { return RBracketLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RBracketLoc; }
SourceLocation getColonLoc() const { return ColonLoc; }
void setColonLoc(SourceLocation L) { ColonLoc = L; }
diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h
index 1012a62..56f17e0 100644
--- a/clang/include/clang/AST/OpenMPClause.h
+++ b/clang/include/clang/AST/OpenMPClause.h
@@ -68,7 +68,8 @@
SourceLocation getBeginLoc() const { return StartLoc; }
/// Returns the ending location of the clause.
- SourceLocation getLocEnd() const { return EndLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const { return EndLoc; }
/// Sets the starting location of the clause.
void setLocStart(SourceLocation Loc) { StartLoc = Loc; }
diff --git a/clang/include/clang/AST/RawCommentList.h b/clang/include/clang/AST/RawCommentList.h
index 2f1d24e..0ab592e 100644
--- a/clang/include/clang/AST/RawCommentList.h
+++ b/clang/include/clang/AST/RawCommentList.h
@@ -103,7 +103,8 @@
SourceRange getSourceRange() const LLVM_READONLY { return Range; }
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
const char *getBriefText(const ASTContext &Context) const {
if (BriefTextValid)
diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h
index 0b78de9..c957ccc 100644
--- a/clang/include/clang/AST/Stmt.h
+++ b/clang/include/clang/AST/Stmt.h
@@ -400,7 +400,8 @@
SourceRange getSourceRange() const LLVM_READONLY;
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY;
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
// global temp stats (until we have a per-module visitor)
static void addStmtClass(const StmtClass s);
@@ -599,7 +600,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return SemiLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return SemiLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return SemiLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == NullStmtClass;
@@ -700,7 +702,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return LBraceLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RBraceLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RBraceLoc; }
SourceLocation getLBracLoc() const { return LBraceLoc; }
SourceLocation getRBracLoc() const { return RBraceLoc; }
@@ -750,7 +753,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
static bool classof(const Stmt *T) {
return T->getStmtClass() == CaseStmtClass ||
@@ -805,7 +809,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
// Handle deeply nested case statements with iteration instead of recursion.
const CaseStmt *CS = this;
while (const auto *CS2 = dyn_cast<CaseStmt>(CS->getSubStmt()))
@@ -846,7 +851,10 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return SubStmt->getLocEnd();}
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
+ return SubStmt->getLocEnd();
+ }
static bool classof(const Stmt *T) {
return T->getStmtClass() == DefaultStmtClass;
@@ -856,7 +864,7 @@
child_range children() { return child_range(&SubStmt, &SubStmt+1); }
};
-inline SourceLocation SwitchCase::getLocEnd() const {
+inline SourceLocation SwitchCase::getEndLoc() const {
if (const auto *CS = dyn_cast<CaseStmt>(this))
return CS->getLocEnd();
return cast<DefaultStmt>(this)->getLocEnd();
@@ -891,7 +899,10 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return IdentLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return SubStmt->getLocEnd();}
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
+ return SubStmt->getLocEnd();
+ }
child_range children() { return child_range(&SubStmt, &SubStmt+1); }
@@ -947,7 +958,10 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AttrLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return SubStmt->getLocEnd();}
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
+ return SubStmt->getLocEnd();
+ }
child_range children() { return child_range(&SubStmt, &SubStmt + 1); }
@@ -1017,7 +1031,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return IfLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
if (SubExprs[ELSE])
return SubExprs[ELSE]->getLocEnd();
else
@@ -1113,7 +1128,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return SwitchLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return SubExprs[BODY] ? SubExprs[BODY]->getLocEnd() : SubExprs[COND]->getLocEnd();
}
@@ -1170,7 +1186,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return WhileLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return SubExprs[BODY]->getLocEnd();
}
@@ -1220,7 +1237,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return DoLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == DoStmtClass;
@@ -1292,7 +1310,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return ForLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return SubExprs[BODY]->getLocEnd();
}
@@ -1329,7 +1348,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return GotoLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return LabelLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return LabelLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == GotoStmtClass;
@@ -1375,7 +1395,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return GotoLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return Target->getLocEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Target->getLocEnd(); }
static bool classof(const Stmt *T) {
return T->getStmtClass() == IndirectGotoStmtClass;
@@ -1400,7 +1421,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return ContinueLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return ContinueLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return ContinueLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == ContinueStmtClass;
@@ -1430,7 +1452,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return BreakLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return BreakLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return BreakLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == BreakStmtClass;
@@ -1483,7 +1506,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return RetLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return RetExpr ? RetExpr->getLocEnd() : RetLoc;
}
@@ -1540,7 +1564,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return {}; }
- SourceLocation getLocEnd() const LLVM_READONLY { return {}; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return {}; }
//===--- Asm String Analysis ---===//
@@ -1823,7 +1848,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AsmLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == GCCAsmStmtClass;
@@ -1922,7 +1948,7 @@
public:
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AsmLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return EndLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
static bool classof(const Stmt *T) {
return T->getStmtClass() == MSAsmStmtClass;
@@ -2074,7 +2100,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return LeaveLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return LeaveLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return LeaveLoc; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == SEHLeaveStmtClass;
@@ -2292,7 +2319,8 @@
return getCapturedStmt()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getCapturedStmt()->getLocEnd();
}
diff --git a/clang/include/clang/AST/StmtCXX.h b/clang/include/clang/AST/StmtCXX.h
index 920d408..e53203b 100644
--- a/clang/include/clang/AST/StmtCXX.h
+++ b/clang/include/clang/AST/StmtCXX.h
@@ -43,7 +43,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return CatchLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return HandlerBlock->getLocEnd();
}
@@ -198,7 +199,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return ForLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return SubExprs[BODY]->getLocEnd();
}
@@ -285,7 +287,10 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return SubStmt->getLocEnd();}
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
+ return SubStmt->getLocEnd();
+ }
child_range children() {
return child_range(&SubStmt, &SubStmt+1);
@@ -408,7 +413,8 @@
return getBody() ? getBody()->getLocStart()
: getPromiseDecl()->getLocStart();
}
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getBody() ? getBody()->getLocEnd() : getPromiseDecl()->getLocEnd();
}
@@ -471,7 +477,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return CoreturnLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getOperand() ? getOperand()->getLocEnd() : getLocStart();
}
diff --git a/clang/include/clang/AST/StmtObjC.h b/clang/include/clang/AST/StmtObjC.h
index d9d02ee..8cb06a5 100644
--- a/clang/include/clang/AST/StmtObjC.h
+++ b/clang/include/clang/AST/StmtObjC.h
@@ -57,7 +57,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return ForLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return SubExprs[BODY]->getLocEnd();
}
@@ -107,7 +108,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AtCatchLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return Body->getLocEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Body->getLocEnd(); }
bool hasEllipsis() const { return getCatchParamDecl() == nullptr; }
@@ -137,7 +139,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AtFinallyLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return AtFinallyStmt->getLocEnd();
}
@@ -243,7 +246,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AtTryLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY;
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY;
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCAtTryStmtClass;
@@ -301,7 +305,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AtSynchronizedLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return getSynchBody()->getLocEnd();
}
@@ -336,7 +341,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AtThrowLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY {
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
return Throw ? Throw->getLocEnd() : AtThrowLoc;
}
@@ -365,7 +371,10 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
- SourceLocation getLocEnd() const LLVM_READONLY { return SubStmt->getLocEnd();}
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY {
+ return SubStmt->getLocEnd();
+ }
SourceLocation getAtLoc() const { return AtLoc; }
void setAtLoc(SourceLocation Loc) { AtLoc = Loc; }
diff --git a/clang/include/clang/AST/StmtOpenMP.h b/clang/include/clang/AST/StmtOpenMP.h
index 56125bf..21a26b8 100644
--- a/clang/include/clang/AST/StmtOpenMP.h
+++ b/clang/include/clang/AST/StmtOpenMP.h
@@ -168,7 +168,8 @@
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const { return StartLoc; }
/// Returns ending location of directive.
- SourceLocation getLocEnd() const { return EndLoc; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const { return EndLoc; }
/// Set starting location of directive kind.
///
diff --git a/clang/include/clang/Sema/DeclSpec.h b/clang/include/clang/Sema/DeclSpec.h
index 81fb5c5..67fb98a 100644
--- a/clang/include/clang/Sema/DeclSpec.h
+++ b/clang/include/clang/Sema/DeclSpec.h
@@ -507,7 +507,8 @@
SourceRange getSourceRange() const LLVM_READONLY { return Range; }
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
SourceLocation getTypeSpecWidthLoc() const { return TSWRange.getBegin(); }
SourceRange getTypeSpecWidthRange() const { return TSWRange; }
@@ -1123,7 +1124,8 @@
}
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return StartLocation; }
- SourceLocation getLocEnd() const LLVM_READONLY { return EndLocation; }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return EndLocation; }
};
/// A set of tokens that has been cached for later parsing.
@@ -1874,7 +1876,8 @@
SourceRange getSourceRange() const LLVM_READONLY { return Range; }
SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
- SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
void SetSourceRange(SourceRange R) { Range = R; }
/// SetRangeBegin - Set the start of the source range to Loc, unless it's
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index b262950..c335961 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -969,7 +969,7 @@
return this;
}
-SourceLocation ObjCMethodDecl::getLocEnd() const {
+SourceLocation ObjCMethodDecl::getEndLoc() const {
if (Stmt *Body = getBody())
return Body->getLocEnd();
return DeclEndLoc;
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index b90953c..4413d72 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -452,7 +452,7 @@
return getQualifierLoc().getBeginLoc();
return getNameInfo().getLocStart();
}
-SourceLocation DeclRefExpr::getLocEnd() const {
+SourceLocation DeclRefExpr::getEndLoc() const {
if (hasExplicitTemplateArgs())
return getRAngleLoc();
return getNameInfo().getLocEnd();
@@ -1367,7 +1367,7 @@
begin = getArg(0)->getLocStart();
return begin;
}
-SourceLocation CallExpr::getLocEnd() const {
+SourceLocation CallExpr::getEndLoc() const {
if (isa<CXXOperatorCallExpr>(this))
return cast<CXXOperatorCallExpr>(this)->getLocEnd();
@@ -1543,7 +1543,7 @@
return BaseStartLoc;
return MemberLoc;
}
-SourceLocation MemberExpr::getLocEnd() const {
+SourceLocation MemberExpr::getEndLoc() const {
SourceLocation EndLoc = getMemberNameInfo().getEndLoc();
if (hasExplicitTemplateArgs())
EndLoc = getRAngleLoc();
@@ -2057,7 +2057,7 @@
return Beg;
}
-SourceLocation InitListExpr::getLocEnd() const {
+SourceLocation InitListExpr::getEndLoc() const {
if (InitListExpr *SyntacticForm = getSyntacticForm())
return SyntacticForm->getLocEnd();
SourceLocation End = RBraceLoc;
@@ -3885,7 +3885,7 @@
return StartLoc;
}
-SourceLocation DesignatedInitExpr::getLocEnd() const {
+SourceLocation DesignatedInitExpr::getEndLoc() const {
return getInit()->getLocEnd();
}
@@ -3948,7 +3948,7 @@
return getBase()->getLocStart();
}
-SourceLocation DesignatedInitUpdateExpr::getLocEnd() const {
+SourceLocation DesignatedInitUpdateExpr::getEndLoc() const {
return getBase()->getLocEnd();
}
diff --git a/clang/lib/AST/ExprCXX.cpp b/clang/lib/AST/ExprCXX.cpp
index 04619df..cc4c631 100644
--- a/clang/lib/AST/ExprCXX.cpp
+++ b/clang/lib/AST/ExprCXX.cpp
@@ -250,7 +250,7 @@
return QualType();
}
-SourceLocation CXXPseudoDestructorExpr::getLocEnd() const {
+SourceLocation CXXPseudoDestructorExpr::getEndLoc() const {
SourceLocation End = DestroyedType.getLocation();
if (TypeSourceInfo *TInfo = DestroyedType.getTypeSourceInfo())
End = TInfo->getTypeLoc().getLocalSourceRange().getEnd();
@@ -456,7 +456,7 @@
return Loc;
}
-SourceLocation CXXConstructExpr::getLocEnd() const {
+SourceLocation CXXConstructExpr::getEndLoc() const {
if (isa<CXXTemporaryObjectExpr>(this))
return cast<CXXTemporaryObjectExpr>(this)->getLocEnd();
@@ -711,7 +711,7 @@
return getTypeInfoAsWritten()->getTypeLoc().getLocStart();
}
-SourceLocation CXXFunctionalCastExpr::getLocEnd() const {
+SourceLocation CXXFunctionalCastExpr::getEndLoc() const {
return RParenLoc.isValid() ? RParenLoc : getSubExpr()->getLocEnd();
}
@@ -796,7 +796,7 @@
return Type->getTypeLoc().getBeginLoc();
}
-SourceLocation CXXTemporaryObjectExpr::getLocEnd() const {
+SourceLocation CXXTemporaryObjectExpr::getEndLoc() const {
SourceLocation Loc = getParenOrBraceRange().getEnd();
if (Loc.isInvalid() && getNumArgs())
Loc = getArg(getNumArgs()-1)->getLocEnd();
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp
index b1f540d..64a7a19 100644
--- a/clang/lib/AST/Stmt.cpp
+++ b/clang/lib/AST/Stmt.cpp
@@ -288,7 +288,7 @@
llvm_unreachable("unknown statement kind");
}
-SourceLocation Stmt::getLocEnd() const {
+SourceLocation Stmt::getEndLoc() const {
switch (getStmtClass()) {
case Stmt::NoStmtClass: llvm_unreachable("statement without class");
#define ABSTRACT_STMT(type)
diff --git a/clang/lib/AST/StmtObjC.cpp b/clang/lib/AST/StmtObjC.cpp
index eea03f6..cc4b230 100644
--- a/clang/lib/AST/StmtObjC.cpp
+++ b/clang/lib/AST/StmtObjC.cpp
@@ -64,7 +64,7 @@
return new (Mem) ObjCAtTryStmt(EmptyShell(), NumCatchStmts, HasFinally);
}
-SourceLocation ObjCAtTryStmt::getLocEnd() const {
+SourceLocation ObjCAtTryStmt::getEndLoc() const {
if (HasFinally)
return getFinallyStmt()->getLocEnd();
if (NumCatchStmts)
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 88e0a64..8af2c07 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -6126,7 +6126,8 @@
return FExpr->getLocStart().getLocWithOffset(Offset);
}
- SourceLocation getLocEnd() const LLVM_READONLY { return FExpr->getLocEnd(); }
+ SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
+ SourceLocation getEndLoc() const LLVM_READONLY { return FExpr->getLocEnd(); }
};
} // namespace