Expand Up
@@ -398,7 +398,8 @@ class alignas(void *) Stmt {
// / value objects created/interpreted by SourceManager. We assume AST
// / clients will have a pointer to the respective SourceManager.
SourceRange getSourceRange () const LLVM_READONLY;
SourceLocation getLocStart () const LLVM_READONLY;
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY;
SourceLocation getLocEnd () const LLVM_READONLY;
// global temp stats (until we have a per-module visitor)
Expand Down
Expand Up
@@ -527,7 +528,8 @@ class DeclStmt : public Stmt {
SourceLocation getEndLoc () const { return EndLoc; }
void setEndLoc (SourceLocation L) { EndLoc = L; }
SourceLocation getLocStart () const LLVM_READONLY { return StartLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return StartLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return EndLoc; }
static bool classof (const Stmt *T) {
Expand Down
Expand Up
@@ -595,7 +597,8 @@ class NullStmt : public Stmt {
bool hasLeadingEmptyMacro () const { return HasLeadingEmptyMacro; }
SourceLocation getLocStart () const LLVM_READONLY { return SemiLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return SemiLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return SemiLoc; }
static bool classof (const Stmt *T) {
Expand Down
Expand Up
@@ -695,7 +698,8 @@ class CompoundStmt final : public Stmt,
return const_reverse_body_iterator (body_begin ());
}
SourceLocation getLocStart () const LLVM_READONLY { return LBraceLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return LBraceLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return RBraceLoc; }
SourceLocation getLBracLoc () const { return LBraceLoc; }
Expand Down
Expand Up
@@ -744,7 +748,8 @@ class SwitchCase : public Stmt {
return const_cast <SwitchCase*>(this )->getSubStmt ();
}
SourceLocation getLocStart () const LLVM_READONLY { return KeywordLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return KeywordLoc; }
SourceLocation getLocEnd () const LLVM_READONLY;
static bool classof (const Stmt *T) {
Expand Down
Expand Up
@@ -797,7 +802,8 @@ class CaseStmt : public SwitchCase {
void setLHS (Expr *Val) { SubExprs[LHS] = reinterpret_cast <Stmt*>(Val); }
void setRHS (Expr *Val) { SubExprs[RHS] = reinterpret_cast <Stmt*>(Val); }
SourceLocation getLocStart () const LLVM_READONLY { return KeywordLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return KeywordLoc; }
SourceLocation getLocEnd () const LLVM_READONLY {
// Handle deeply nested case statements with iteration instead of recursion.
Expand Down
Expand Up
@@ -838,7 +844,8 @@ class DefaultStmt : public SwitchCase {
SourceLocation getColonLoc () const { return ColonLoc; }
void setColonLoc (SourceLocation L) { ColonLoc = L; }
SourceLocation getLocStart () const LLVM_READONLY { return KeywordLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return KeywordLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return SubStmt->getLocEnd ();}
static bool classof (const Stmt *T) {
Expand Down
Expand Up
@@ -882,7 +889,8 @@ class LabelStmt : public Stmt {
void setIdentLoc (SourceLocation L) { IdentLoc = L; }
void setSubStmt (Stmt *SS) { SubStmt = SS; }
SourceLocation getLocStart () const LLVM_READONLY { return IdentLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return IdentLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return SubStmt->getLocEnd ();}
child_range children () { return child_range (&SubStmt, &SubStmt+1 ); }
Expand Down
Expand Up
@@ -937,7 +945,8 @@ class AttributedStmt final
Stmt *getSubStmt () { return SubStmt; }
const Stmt *getSubStmt () const { return SubStmt; }
SourceLocation getLocStart () const LLVM_READONLY { return AttrLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return AttrLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return SubStmt->getLocEnd ();}
child_range children () { return child_range (&SubStmt, &SubStmt + 1 ); }
Expand Down
Expand Up
@@ -1005,7 +1014,8 @@ class IfStmt : public Stmt {
bool isObjCAvailabilityCheck () const ;
SourceLocation getLocStart () const LLVM_READONLY { return IfLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return IfLoc; }
SourceLocation getLocEnd () const LLVM_READONLY {
if (SubExprs[ELSE])
Expand Down
Expand Up
@@ -1100,7 +1110,8 @@ class SwitchStmt : public Stmt {
// / have been explicitly covered.
bool isAllEnumCasesCovered () const { return FirstCase.getInt (); }
SourceLocation getLocStart () const LLVM_READONLY { return SwitchLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return SwitchLoc; }
SourceLocation getLocEnd () const LLVM_READONLY {
return SubExprs[BODY] ? SubExprs[BODY]->getLocEnd () : SubExprs[COND]->getLocEnd ();
Expand Down
Expand Up
@@ -1156,7 +1167,8 @@ class WhileStmt : public Stmt {
SourceLocation getWhileLoc () const { return WhileLoc; }
void setWhileLoc (SourceLocation L) { WhileLoc = L; }
SourceLocation getLocStart () const LLVM_READONLY { return WhileLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return WhileLoc; }
SourceLocation getLocEnd () const LLVM_READONLY {
return SubExprs[BODY]->getLocEnd ();
Expand Down
Expand Up
@@ -1206,7 +1218,8 @@ class DoStmt : public Stmt {
SourceLocation getRParenLoc () const { return RParenLoc; }
void setRParenLoc (SourceLocation L) { RParenLoc = L; }
SourceLocation getLocStart () const LLVM_READONLY { return DoLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return DoLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return RParenLoc; }
static bool classof (const Stmt *T) {
Expand Down
Expand Up
@@ -1276,7 +1289,8 @@ class ForStmt : public Stmt {
SourceLocation getRParenLoc () const { return RParenLoc; }
void setRParenLoc (SourceLocation L) { RParenLoc = L; }
SourceLocation getLocStart () const LLVM_READONLY { return ForLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return ForLoc; }
SourceLocation getLocEnd () const LLVM_READONLY {
return SubExprs[BODY]->getLocEnd ();
Expand Down
Expand Up
@@ -1313,7 +1327,8 @@ class GotoStmt : public Stmt {
SourceLocation getLabelLoc () const { return LabelLoc; }
void setLabelLoc (SourceLocation L) { LabelLoc = L; }
SourceLocation getLocStart () const LLVM_READONLY { return GotoLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return GotoLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return LabelLoc; }
static bool classof (const Stmt *T) {
Expand Down
Expand Up
@@ -1358,7 +1373,8 @@ class IndirectGotoStmt : public Stmt {
return const_cast <IndirectGotoStmt*>(this )->getConstantTarget ();
}
SourceLocation getLocStart () const LLVM_READONLY { return GotoLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return GotoLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return Target->getLocEnd (); }
static bool classof (const Stmt *T) {
Expand All
@@ -1382,7 +1398,8 @@ class ContinueStmt : public Stmt {
SourceLocation getContinueLoc () const { return ContinueLoc; }
void setContinueLoc (SourceLocation L) { ContinueLoc = L; }
SourceLocation getLocStart () const LLVM_READONLY { return ContinueLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return ContinueLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return ContinueLoc; }
static bool classof (const Stmt *T) {
Expand Down
Expand Up
@@ -1411,7 +1428,8 @@ class BreakStmt : public Stmt {
SourceLocation getBreakLoc () const { return BreakLoc; }
void setBreakLoc (SourceLocation L) { BreakLoc = L; }
SourceLocation getLocStart () const LLVM_READONLY { return BreakLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return BreakLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return BreakLoc; }
static bool classof (const Stmt *T) {
Expand Down
Expand Up
@@ -1462,7 +1480,8 @@ class ReturnStmt : public Stmt {
const VarDecl *getNRVOCandidate () const { return NRVOCandidate; }
void setNRVOCandidate (const VarDecl *Var) { NRVOCandidate = Var; }
SourceLocation getLocStart () const LLVM_READONLY { return RetLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return RetLoc; }
SourceLocation getLocEnd () const LLVM_READONLY {
return RetExpr ? RetExpr->getLocEnd () : RetLoc;
Expand Down
Expand Up
@@ -1519,7 +1538,8 @@ class AsmStmt : public Stmt {
bool isVolatile () const { return IsVolatile; }
void setVolatile (bool V) { IsVolatile = V; }
SourceLocation getLocStart () const LLVM_READONLY { return {}; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return {}; }
SourceLocation getLocEnd () const LLVM_READONLY { return {}; }
// ===--- Asm String Analysis ---===//
Expand Down
Expand Up
@@ -1801,7 +1821,8 @@ class GCCAsmStmt : public AsmStmt {
return Clobbers[i];
}
SourceLocation getLocStart () const LLVM_READONLY { return AsmLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return AsmLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return RParenLoc; }
static bool classof (const Stmt *T) {
Expand Down
Expand Up
@@ -1899,7 +1920,8 @@ class MSAsmStmt : public AsmStmt {
ArrayRef<Expr*> Exprs, ArrayRef<StringRef> Clobbers);
public:
SourceLocation getLocStart () const LLVM_READONLY { return AsmLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return AsmLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return EndLoc; }
static bool classof (const Stmt *T) {
Expand Down
Expand Up
@@ -1929,7 +1951,8 @@ class SEHExceptStmt : public Stmt {
Expr *FilterExpr,
Stmt *Block);
SourceLocation getLocStart () const LLVM_READONLY { return getExceptLoc (); }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return getExceptLoc (); }
SourceLocation getLocEnd () const LLVM_READONLY { return getEndLoc (); }
SourceLocation getExceptLoc () const { return Loc; }
Expand Down
Expand Up
@@ -1967,7 +1990,8 @@ class SEHFinallyStmt : public Stmt {
SourceLocation FinallyLoc,
Stmt *Block);
SourceLocation getLocStart () const LLVM_READONLY { return getFinallyLoc (); }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return getFinallyLoc (); }
SourceLocation getLocEnd () const LLVM_READONLY { return getEndLoc (); }
SourceLocation getFinallyLoc () const { return Loc; }
Expand Down
Expand Up
@@ -2006,7 +2030,8 @@ class SEHTryStmt : public Stmt {
SourceLocation TryLoc, Stmt *TryBlock,
Stmt *Handler);
SourceLocation getLocStart () const LLVM_READONLY { return getTryLoc (); }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return getTryLoc (); }
SourceLocation getLocEnd () const LLVM_READONLY { return getEndLoc (); }
SourceLocation getTryLoc () const { return TryLoc; }
Expand Down
Expand Up
@@ -2047,7 +2072,8 @@ class SEHLeaveStmt : public Stmt {
SourceLocation getLeaveLoc () const { return LeaveLoc; }
void setLeaveLoc (SourceLocation L) { LeaveLoc = L; }
SourceLocation getLocStart () const LLVM_READONLY { return LeaveLoc; }
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY { return LeaveLoc; }
SourceLocation getLocEnd () const LLVM_READONLY { return LeaveLoc; }
static bool classof (const Stmt *T) {
Expand Down
Expand Up
@@ -2261,7 +2287,8 @@ class CapturedStmt : public Stmt {
return capture_init_begin () + NumCaptures;
}
SourceLocation getLocStart () const LLVM_READONLY {
SourceLocation getLocStart () const LLVM_READONLY { return getBeginLoc (); }
SourceLocation getBeginLoc () const LLVM_READONLY {
return getCapturedStmt ()->getLocStart ();
}
Expand Down