Index: cfe/trunk/include/clang/AST/Comment.h =================================================================== --- cfe/trunk/include/clang/AST/Comment.h +++ cfe/trunk/include/clang/AST/Comment.h @@ -215,10 +215,16 @@ SourceRange getSourceRange() const LLVM_READONLY { return Range; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } SourceLocation getLocation() const LLVM_READONLY { return Loc; } Index: cfe/trunk/include/clang/AST/Decl.h =================================================================== --- cfe/trunk/include/clang/AST/Decl.h +++ cfe/trunk/include/clang/AST/Decl.h @@ -614,7 +614,10 @@ return SourceRange(LocStart, RBraceLoc); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return LocStart; } SourceLocation getRBraceLoc() const { return RBraceLoc; } void setLocStart(SourceLocation L) { LocStart = L; } @@ -736,7 +739,10 @@ SourceRange getSourceRange() const override LLVM_READONLY; - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getOuterLocStart(); } @@ -2867,7 +2873,10 @@ const Type *getTypeForDecl() const { return TypeForDecl; } void setTypeForDecl(const Type *TD) { TypeForDecl = TD; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return LocStart; } void setLocStart(SourceLocation L) { LocStart = L; } SourceRange getSourceRange() const override LLVM_READONLY { @@ -4195,7 +4204,10 @@ SourceLocation getRBraceLoc() const { return RBraceLoc; } void setRBraceLoc(SourceLocation L) { RBraceLoc = L; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { if (RBraceLoc.isValid()) return RBraceLoc; Index: cfe/trunk/include/clang/AST/DeclBase.h =================================================================== --- cfe/trunk/include/clang/AST/DeclBase.h +++ cfe/trunk/include/clang/AST/DeclBase.h @@ -406,12 +406,18 @@ return SourceRange(getLocation(), getLocation()); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getSourceRange().getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getSourceRange().getEnd(); } Index: cfe/trunk/include/clang/AST/DeclCXX.h =================================================================== --- cfe/trunk/include/clang/AST/DeclCXX.h +++ cfe/trunk/include/clang/AST/DeclCXX.h @@ -233,9 +233,15 @@ /// Retrieves the source range that contains the entire base specifier. SourceRange getSourceRange() const LLVM_READONLY { return Range; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } /// Get the location at which the base class type was written. @@ -2872,7 +2878,10 @@ LinkageSpecDeclBits.HasBraces = RBraceLoc.isValid(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { if (hasBraces()) return getRBraceLoc(); Index: cfe/trunk/include/clang/AST/DeclObjC.h =================================================================== --- cfe/trunk/include/clang/AST/DeclObjC.h +++ cfe/trunk/include/clang/AST/DeclObjC.h @@ -280,9 +280,15 @@ SourceLocation getDeclaratorEndLoc() const { return DeclEndLoc; } // Location information, modeled after the Stmt API. - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; SourceRange getSourceRange() const override LLVM_READONLY { return SourceRange(getLocation(), getEndLoc()); @@ -2803,7 +2809,10 @@ SourceRange getSourceRange() const override LLVM_READONLY; - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } void setAtLoc(SourceLocation Loc) { AtLoc = Loc; } Index: cfe/trunk/include/clang/AST/DeclarationName.h =================================================================== --- cfe/trunk/include/clang/AST/DeclarationName.h +++ cfe/trunk/include/clang/AST/DeclarationName.h @@ -642,9 +642,15 @@ return SourceRange(getBeginLoc(), getEndLoc()); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { SourceLocation EndLoc = getEndLocPrivate(); return EndLoc.isValid() ? EndLoc : getBeginLoc(); Index: cfe/trunk/include/clang/AST/Expr.h =================================================================== --- cfe/trunk/include/clang/AST/Expr.h +++ cfe/trunk/include/clang/AST/Expr.h @@ -904,11 +904,17 @@ /// Retrieve the location of this expression. SourceLocation getLocation() const { return Loc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return SourceExpr ? SourceExpr->getBeginLoc() : Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SourceExpr ? SourceExpr->getEndLoc() : Loc; } @@ -1066,9 +1072,15 @@ SourceLocation getLocation() const { return Loc; } void setLocation(SourceLocation L) { Loc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; /// Determine whether this declaration reference was preceded by a @@ -1246,9 +1258,15 @@ static StringRef getIdentTypeName(IdentType IT); static std::string ComputeName(IdentType IT, const Decl *CurrentDecl); - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } static bool classof(const Stmt *T) { @@ -1337,9 +1355,15 @@ /// Returns a new empty integer literal. static IntegerLiteral *Create(const ASTContext &C, EmptyShell Empty); - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } /// Retrieve the location of the literal. @@ -1378,9 +1402,15 @@ QualType type, SourceLocation l, unsigned Scale); - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } /// \brief Retrieve the location of the literal. @@ -1434,9 +1464,15 @@ return static_cast(CharacterLiteralBits.Kind); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } unsigned getValue() const { return Value; } @@ -1509,9 +1545,15 @@ SourceLocation getLocation() const { return Loc; } void setLocation(SourceLocation L) { Loc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } static bool classof(const Stmt *T) { @@ -1548,11 +1590,17 @@ Expr *getSubExpr() { return cast(Val); } void setSubExpr(Expr *E) { Val = E; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Val->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Val->getEndLoc(); } static bool classof(const Stmt *T) { @@ -1726,9 +1774,15 @@ tokloc_iterator tokloc_begin() const { return TokLocs; } tokloc_iterator tokloc_end() const { return TokLocs + NumConcatenated; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return TokLocs[0]; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return TokLocs[NumConcatenated - 1]; } @@ -1768,9 +1822,15 @@ Expr *getSubExpr() { return cast(Val); } void setSubExpr(Expr *E) { Val = E; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return L; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return R; } /// Get the location of the left parentheses '('. @@ -1894,11 +1954,17 @@ /// the given unary opcode. static OverloadedOperatorKind getOverloadedOperator(Opcode Opc); - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return isPostfix() ? Val->getBeginLoc() : Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return isPostfix() ? Loc : Val->getEndLoc(); } @@ -2004,9 +2070,15 @@ /// contains the location of the period (if there is one) and the /// identifier. SourceRange getSourceRange() const LLVM_READONLY { return Range; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } }; @@ -2106,9 +2178,15 @@ return NumExprs; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return OperatorLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -2204,9 +2282,15 @@ SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return OpLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -2280,11 +2364,17 @@ return getRHS()->getType()->isIntegerType() ? getRHS() : getLHS(); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getLHS()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RBracketLoc; } SourceLocation getRBracketLoc() const { return RBracketLoc; } @@ -2452,9 +2542,15 @@ SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; /// Return true if this is a call to __assume() or __builtin_assume() with @@ -2700,9 +2796,15 @@ SourceLocation getMemberLoc() const { return MemberLoc; } void setMemberLoc(SourceLocation L) { MemberLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; SourceLocation getExprLoc() const LLVM_READONLY { return MemberLoc; } @@ -2792,7 +2894,10 @@ TInfoAndScope.setPointer(tinfo); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { // FIXME: Init should never be null. if (!Init) @@ -2801,7 +2906,10 @@ return Init->getBeginLoc(); return LParenLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { // FIXME: Init should never be null. if (!Init) @@ -2996,11 +3104,17 @@ static ImplicitCastExpr *CreateEmpty(const ASTContext &Context, unsigned PathSize); - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getSubExpr()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getSubExpr()->getEndLoc(); } @@ -3107,9 +3221,15 @@ SourceLocation getRParenLoc() const { return RPLoc; } void setRParenLoc(SourceLocation L) { RPLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return LPLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getSubExpr()->getEndLoc(); } @@ -3189,11 +3309,17 @@ Expr *getRHS() const { return cast(SubExprs[RHS]); } void setRHS(Expr *E) { SubExprs[RHS] = E; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getLHS()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getRHS()->getEndLoc(); } @@ -3474,11 +3600,17 @@ Expr *getLHS() const { return cast(SubExprs[LHS]); } Expr *getRHS() const { return cast(SubExprs[RHS]); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getCond()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getRHS()->getEndLoc(); } @@ -3564,11 +3696,17 @@ return cast(SubExprs[RHS]); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getCommon()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getFalseExpr()->getEndLoc(); } @@ -3624,9 +3762,15 @@ SourceLocation getLabelLoc() const { return LabelLoc; } void setLabelLoc(SourceLocation L) { LabelLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AmpAmpLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return LabelLoc; } LabelDecl *getLabel() const { return Label; } @@ -3671,9 +3815,15 @@ const CompoundStmt *getSubStmt() const { return cast(SubStmt); } void setSubStmt(CompoundStmt *S) { SubStmt = S; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } SourceLocation getLParenLoc() const { return LParenLoc; } @@ -3722,9 +3872,15 @@ SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -3808,9 +3964,15 @@ /// getRParenLoc - Return the location of final right parenthesis. SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -3891,9 +4053,15 @@ SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -3932,9 +4100,15 @@ SourceLocation getTokenLocation() const { return TokenLoc; } void setTokenLocation(SourceLocation L) { TokenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return TokenLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return TokenLoc; } static bool classof(const Stmt *T) { @@ -3986,9 +4160,15 @@ SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -4222,9 +4402,15 @@ InitListExprBits.HadArrayRangeDesignator = ARD; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { @@ -4459,14 +4645,20 @@ return ArrayOrRange.Index; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { if (Kind == FieldDesignator) return getDotLoc().isInvalid()? getFieldLoc() : getDotLoc(); else return getLBracketLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Kind == FieldDesignator ? getFieldLoc() : getRBracketLoc(); } @@ -4550,9 +4742,15 @@ SourceRange getDesignatorsSourceRange() const; - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { @@ -4594,9 +4792,15 @@ return T->getStmtClass() == NoInitExprClass; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); } // Iterators @@ -4631,9 +4835,15 @@ explicit DesignatedInitUpdateExpr(EmptyShell Empty) : Expr(DesignatedInitUpdateExprClass, Empty) { } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { @@ -4708,11 +4918,17 @@ return S->getStmtClass() == ArrayInitLoopExprClass; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getCommonExpr()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getCommonExpr()->getEndLoc(); } @@ -4745,9 +4961,15 @@ return S->getStmtClass() == ArrayInitIndexExprClass; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); } child_range children() { @@ -4783,9 +5005,15 @@ return T->getStmtClass() == ImplicitValueInitExprClass; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); } // Iterators @@ -4830,9 +5058,15 @@ SourceLocation getLParenLoc() const { return LParenLoc; } SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -4956,9 +5190,15 @@ const Expr *getResultExpr() const { return getAssocExpr(getResultIndex()); } Expr *getResultExpr() { return getAssocExpr(getResultIndex()); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return GenericLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -5024,11 +5264,17 @@ /// aggregate Constant of ConstantInt(s). void getEncodedElementAccess(SmallVectorImpl &Elts) const; - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getBase()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return AccessorLoc; } /// isArrow - Return true if the base expression is a pointer to vector, @@ -5071,11 +5317,17 @@ const Stmt *getBody() const; Stmt *getBody(); - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getCaretLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getBody()->getEndLoc(); } @@ -5130,9 +5382,15 @@ /// getRParenLoc - Return the location of final right parenthesis. SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -5274,11 +5532,17 @@ return getSyntacticForm()->getExprLoc(); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getSyntacticForm()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getSyntacticForm()->getEndLoc(); } @@ -5403,9 +5667,15 @@ SourceLocation getBuiltinLoc() const { return BuiltinLoc; } SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -5459,9 +5729,15 @@ return const_child_range(const_child_iterator(), const_child_iterator()); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); } static bool classof(const Stmt *T) { Index: cfe/trunk/include/clang/AST/ExprCXX.h =================================================================== --- cfe/trunk/include/clang/AST/ExprCXX.h +++ cfe/trunk/include/clang/AST/ExprCXX.h @@ -132,9 +132,15 @@ : getOperatorLoc(); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } SourceRange getSourceRange() const { return Range; } @@ -280,9 +286,15 @@ /// Retrieve the location of the closing parenthesis. SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } SourceRange getAngleBrackets() const LLVM_READONLY { return AngleBrackets; } @@ -528,14 +540,20 @@ return const_cast(this)->getCookedLiteral(); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const { if (getLiteralOperatorKind() == LOK_Template) return getRParenLoc(); return getArg(0)->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const { return getRParenLoc(); } /// Returns the location of a ud-suffix in the expression. @@ -569,9 +587,15 @@ bool getValue() const { return Value; } void setValue(bool V) { Value = V; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } SourceLocation getLocation() const { return Loc; } @@ -602,9 +626,15 @@ explicit CXXNullPtrLiteralExpr(EmptyShell Empty) : Expr(CXXNullPtrLiteralExprClass, Empty) {} - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } SourceLocation getLocation() const { return Loc; } @@ -641,12 +671,18 @@ Expr *getSubExpr() { return static_cast(SubExpr); } const Expr *getSubExpr() const { return static_cast(SubExpr); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return SubExpr->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SubExpr->getEndLoc(); } @@ -735,9 +771,15 @@ Operand = E; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } SourceRange getSourceRange() const LLVM_READONLY { return Range; } void setSourceRange(SourceRange R) { Range = R; } @@ -792,7 +834,10 @@ return getBaseExpr() && getBaseExpr()->isImplicitCXXThis(); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const { if (!isImplicitAccess()) return BaseExpr->getBeginLoc(); @@ -802,7 +847,10 @@ return MemberLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const { return getMemberLoc(); } child_range children() { @@ -863,12 +911,18 @@ Expr *getIdx() { return cast(SubExprs[IDX_EXPR]); } const Expr *getIdx() const { return cast(SubExprs[IDX_EXPR]); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getBase()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RBracketLoc; } SourceLocation getRBracketLoc() const { return RBracketLoc; } @@ -951,9 +1005,15 @@ void setUuidStr(StringRef US) { UuidStr = US; } StringRef getUuidStr() const { return UuidStr; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } SourceRange getSourceRange() const LLVM_READONLY { return Range; } void setSourceRange(SourceRange R) { Range = R; } @@ -1002,9 +1062,15 @@ SourceLocation getLocation() const { return Loc; } void setLocation(SourceLocation L) { Loc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } bool isImplicit() const { return Implicit; } @@ -1059,10 +1125,16 @@ /// this variable. bool isThrownVariableInScope() const { return IsThrownVariableInScope; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return ThrowLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { if (!getSubExpr()) return ThrowLoc; @@ -1132,9 +1204,15 @@ /// Default argument expressions have no representation in the /// source, so they have an empty source range. - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); } SourceLocation getExprLoc() const LLVM_READONLY { return Loc; } @@ -1194,9 +1272,15 @@ return Field->getInClassInitializer(); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } static bool classof(const Stmt *T) { @@ -1269,12 +1353,18 @@ Expr *getSubExpr() { return cast(SubExpr); } void setSubExpr(Expr *E) { SubExpr = E; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return SubExpr->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SubExpr->getEndLoc(); } @@ -1430,9 +1520,15 @@ Args[Arg] = ArgExpr; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; SourceRange getParenOrBraceRange() const { return ParenOrBraceRange; } void setParenOrBraceRange(SourceRange Range) { ParenOrBraceRange = Range; } @@ -1504,9 +1600,15 @@ bool inheritedFromVBase() const { return InheritedFromVirtualBase; } SourceLocation getLocation() const LLVM_READONLY { return Loc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } static bool classof(const Stmt *T) { @@ -1569,9 +1671,15 @@ /// Determine whether this expression models list-initialization. bool isListInitialization() const { return LParenLoc.isInvalid(); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { @@ -1615,9 +1723,15 @@ TypeSourceInfo *getTypeSourceInfo() const { return Type; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { @@ -1854,12 +1968,18 @@ return T->getStmtClass() == LambdaExprClass; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return IntroducerRange.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return ClosingBrace; } child_range children() { @@ -1895,9 +2015,15 @@ SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -2117,7 +2243,10 @@ return SubExprs + Array + hasInitializer() + getNumPlacementArgs(); } - SourceLocation getStartLoc() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getStartLoc() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const { return Range.getBegin(); } SourceLocation getEndLoc() const { return Range.getEnd(); } @@ -2127,8 +2256,14 @@ return Range; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } static bool classof(const Stmt *T) { return T->getStmtClass() == CXXNewExprClass; @@ -2205,9 +2340,15 @@ /// be a pointer, return an invalid type. QualType getDestroyedType() const; - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Argument->getEndLoc(); } @@ -2395,11 +2536,17 @@ DestroyedType = PseudoDestructorTypeStorage(Info); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Base->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { @@ -2481,9 +2628,15 @@ getNumArgs()); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -2544,9 +2697,15 @@ virtual ~ArrayTypeTraitExpr() = default; - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParen; } ArrayTypeTrait getTrait() const { return static_cast(ATT); } @@ -2610,9 +2769,15 @@ explicit ExpressionTraitExpr(EmptyShell Empty) : Expr(ExpressionTraitExprClass, Empty), ET(0), Value(false) {} - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParen; } ExpressionTrait getTrait() const { return static_cast(ET); } @@ -2904,14 +3069,20 @@ /// that was looked in to find these results. CXXRecordDecl *getNamingClass() const { return NamingClass; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { if (NestedNameSpecifierLoc l = getQualifierLoc()) return l.getBeginLoc(); return getNameInfo().getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { if (hasExplicitTemplateArgs()) return getRAngleLoc(); @@ -3058,12 +3229,18 @@ /// Note: getBeginLoc() is the start of the whole DependentScopeDeclRefExpr, /// and differs from getLocation().getStart(). - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return QualifierLoc.getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { if (hasExplicitTemplateArgs()) return getRAngleLoc(); @@ -3140,12 +3317,18 @@ /// when modifying an existing AST to preserve its invariants. void setSubExpr(Expr *E) { SubExpr = E; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return SubExpr->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SubExpr->getEndLoc(); } @@ -3269,10 +3452,16 @@ *(arg_begin() + I) = E; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { if (!RParenLoc.isValid() && NumArgs > 0) return getArg(NumArgs - 1)->getEndLoc(); @@ -3493,7 +3682,10 @@ return {getTemplateArgs(), getNumTemplateArgs()}; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { if (!isImplicitAccess()) return Base->getBeginLoc(); @@ -3502,7 +3694,10 @@ return MemberNameInfo.getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { if (hasExplicitTemplateArgs()) return getRAngleLoc(); @@ -3645,7 +3840,10 @@ // diagnosing a problem with this expression. SourceLocation getExprLoc() const LLVM_READONLY { return getMemberLoc(); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { if (!isImplicitAccess()) return Base->getBeginLoc(); @@ -3654,7 +3852,10 @@ return getMemberNameInfo().getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { if (hasExplicitTemplateArgs()) return getRAngleLoc(); @@ -3720,9 +3921,15 @@ Expr *getOperand() const { return static_cast(Operand); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } SourceRange getSourceRange() const LLVM_READONLY { return Range; } @@ -3800,12 +4007,18 @@ return None; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Pattern->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return EllipsisLoc; } static bool classof(const Stmt *T) { @@ -3926,9 +4139,15 @@ return llvm::makeArrayRef(Args, Args + Length); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return OperatorLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -3972,9 +4191,15 @@ Param(param), Replacement(replacement), NameLoc(loc) {} SourceLocation getNameLoc() const { return NameLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return NameLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return NameLoc; } Expr *getReplacement() const { return cast(Replacement); } @@ -4038,9 +4263,15 @@ /// template arguments. TemplateArgument getArgumentPack() const; - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return NameLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return NameLoc; } static bool classof(const Stmt *T) { @@ -4113,9 +4344,15 @@ /// Get an expansion of the parameter pack by index. ParmVarDecl *getExpansion(unsigned I) const { return begin()[I]; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return NameLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return NameLoc; } static bool classof(const Stmt *T) { @@ -4227,12 +4464,18 @@ return getValueKind() == VK_LValue; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getTemporary()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getTemporary()->getEndLoc(); } @@ -4304,10 +4547,16 @@ SourceLocation getEllipsisLoc() const { return EllipsisLoc; } BinaryOperatorKind getOperator() const { return Opcode; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -4397,10 +4646,16 @@ return static_cast(SubExprs[SubExpr::Resume]); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getCommonExpr()->getEndLoc(); } @@ -4485,10 +4740,16 @@ SourceLocation getKeywordLoc() const { return KeywordLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getOperand()->getEndLoc(); } Index: cfe/trunk/include/clang/AST/ExprObjC.h =================================================================== --- cfe/trunk/include/clang/AST/ExprObjC.h +++ cfe/trunk/include/clang/AST/ExprObjC.h @@ -67,9 +67,15 @@ SourceLocation getAtLoc() const { return AtLoc; } void setAtLoc(SourceLocation L) { AtLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return String->getEndLoc(); } // Iterators @@ -96,9 +102,15 @@ bool getValue() const { return Value; } void setValue(bool V) { Value = V; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } SourceLocation getLocation() const { return Loc; } @@ -145,9 +157,15 @@ SourceLocation getAtLoc() const { return Range.getBegin(); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } SourceRange getSourceRange() const LLVM_READONLY { @@ -200,9 +218,15 @@ static ObjCArrayLiteral *CreateEmpty(const ASTContext &C, unsigned NumElements); - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } SourceRange getSourceRange() const LLVM_READONLY { return Range; } @@ -367,9 +391,15 @@ return DictWithObjectsMethod; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } SourceRange getSourceRange() const LLVM_READONLY { return Range; } @@ -422,9 +452,15 @@ EncodedType = EncType; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } // Iterators @@ -459,9 +495,15 @@ void setAtLoc(SourceLocation L) { AtLoc = L; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } /// getNumArgs - Return the number of actual arguments to this call. @@ -510,9 +552,15 @@ void setAtLoc(SourceLocation L) { AtLoc = L; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } // Iterators @@ -572,11 +620,17 @@ SourceLocation getLocation() const { return Loc; } void setLocation(SourceLocation L) { Loc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return isFreeIvar() ? Loc : getBase()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } SourceLocation getOpLoc() const { return OpLoc; } @@ -760,13 +814,19 @@ /// Determine the type of the base, regardless of the kind of receiver. QualType getReceiverType(const ASTContext &ctx) const; - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return isObjectReceiver() ? getBase()->getBeginLoc() : getReceiverLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return IdLoc; } // Iterators @@ -859,12 +919,18 @@ SourceLocation getRBracket() const { return RBracket; } void setRBracket(SourceLocation RB) { RBracket = RB; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return SubExprs[BASE]->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RBracket; } Expr *getBaseExpr() const { return cast(SubExprs[BASE]); } @@ -1418,9 +1484,15 @@ RBracLoc = R.getEnd(); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return LBracLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RBracLoc; } // Iterators @@ -1497,7 +1569,10 @@ SourceLocation getOpLoc() const { return OpLoc; } void setOpLoc(SourceLocation L) { OpLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getBase()->getBeginLoc(); } @@ -1506,7 +1581,10 @@ return getBase()->getEndLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return IsaMemberLoc; } SourceLocation getExprLoc() const LLVM_READONLY { return IsaMemberLoc; } @@ -1576,11 +1654,17 @@ child_range children() { return child_range(&Operand, &Operand+1); } // Source locations are determined by the subexpression. - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Operand->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Operand->getEndLoc(); } @@ -1642,10 +1726,16 @@ /// The location of the bridge keyword. SourceLocation getBridgeKeywordLoc() const { return BridgeKeywordLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getSubExpr()->getEndLoc(); } @@ -1684,9 +1774,15 @@ explicit ObjCAvailabilityCheckExpr(EmptyShell Shell) : Expr(ObjCAvailabilityCheckExprClass, Shell) {} - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const { return AtLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const { return RParen; } SourceRange getSourceRange() const { return {AtLoc, RParen}; } Index: cfe/trunk/include/clang/AST/ExprOpenMP.h =================================================================== --- cfe/trunk/include/clang/AST/ExprOpenMP.h +++ cfe/trunk/include/clang/AST/ExprOpenMP.h @@ -101,11 +101,17 @@ /// Set length of the array section. void setLength(Expr *E) { SubExprs[LENGTH] = E; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getBase()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RBracketLoc; } SourceLocation getColonLoc() const { return ColonLoc; } Index: cfe/trunk/include/clang/AST/OpenMPClause.h =================================================================== --- cfe/trunk/include/clang/AST/OpenMPClause.h +++ cfe/trunk/include/clang/AST/OpenMPClause.h @@ -64,11 +64,17 @@ public: /// Returns the starting location of the clause. - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const { return StartLoc; } /// Returns the ending location of the clause. - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const { return EndLoc; } /// Sets the starting location of the clause. Index: cfe/trunk/include/clang/AST/RawCommentList.h =================================================================== --- cfe/trunk/include/clang/AST/RawCommentList.h +++ cfe/trunk/include/clang/AST/RawCommentList.h @@ -101,9 +101,15 @@ } SourceRange getSourceRange() const LLVM_READONLY { return Range; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } const char *getBriefText(const ASTContext &Context) const { Index: cfe/trunk/include/clang/AST/Stmt.h =================================================================== --- cfe/trunk/include/clang/AST/Stmt.h +++ cfe/trunk/include/clang/AST/Stmt.h @@ -398,9 +398,15 @@ /// 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 { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; // global temp stats (until we have a per-module visitor) @@ -524,14 +530,23 @@ DeclGroupRef getDeclGroup() { return DG; } void setDeclGroup(DeclGroupRef DGR) { DG = DGR; } - SourceLocation getStartLoc() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getStartLoc() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } void setStartLoc(SourceLocation L) { StartLoc = L; } SourceLocation getEndLoc() const { return EndLoc; } void setEndLoc(SourceLocation L) { EndLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return StartLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return EndLoc; } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return EndLoc; + } static bool classof(const Stmt *T) { return T->getStmtClass() == DeclStmtClass; @@ -598,9 +613,15 @@ bool hasLeadingEmptyMacro() const { return HasLeadingEmptyMacro; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return SemiLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SemiLoc; } static bool classof(const Stmt *T) { @@ -700,9 +721,15 @@ return const_reverse_body_iterator(body_begin()); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return LBraceLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RBraceLoc; } SourceLocation getLBracLoc() const { return LBraceLoc; } @@ -751,9 +778,15 @@ return const_cast(this)->getSubStmt(); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { @@ -806,10 +839,16 @@ void setLHS(Expr *Val) { SubExprs[LHS] = reinterpret_cast(Val); } void setRHS(Expr *Val) { SubExprs[RHS] = reinterpret_cast(Val); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { // Handle deeply nested case statements with iteration instead of recursion. const CaseStmt *CS = this; @@ -849,9 +888,15 @@ SourceLocation getColonLoc() const { return ColonLoc; } void setColonLoc(SourceLocation L) { ColonLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getEndLoc(); } @@ -897,9 +942,15 @@ void setIdentLoc(SourceLocation L) { IdentLoc = L; } void setSubStmt(Stmt *SS) { SubStmt = SS; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return IdentLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getEndLoc(); } @@ -956,9 +1007,15 @@ Stmt *getSubStmt() { return SubStmt; } const Stmt *getSubStmt() const { return SubStmt; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AttrLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getEndLoc(); } @@ -1028,10 +1085,16 @@ bool isObjCAvailabilityCheck() const; - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return IfLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { if (SubExprs[ELSE]) return SubExprs[ELSE]->getEndLoc(); @@ -1125,10 +1188,16 @@ /// have been explicitly covered. bool isAllEnumCasesCovered() const { return FirstCase.getInt(); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return SwitchLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SubExprs[BODY] ? SubExprs[BODY]->getEndLoc() : SubExprs[COND]->getEndLoc(); @@ -1184,10 +1253,16 @@ SourceLocation getWhileLoc() const { return WhileLoc; } void setWhileLoc(SourceLocation L) { WhileLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return WhileLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SubExprs[BODY]->getEndLoc(); } @@ -1236,9 +1311,15 @@ SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return DoLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -1308,10 +1389,16 @@ SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return ForLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SubExprs[BODY]->getEndLoc(); } @@ -1347,9 +1434,15 @@ SourceLocation getLabelLoc() const { return LabelLoc; } void setLabelLoc(SourceLocation L) { LabelLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return GotoLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return LabelLoc; } static bool classof(const Stmt *T) { @@ -1394,9 +1487,15 @@ return const_cast(this)->getConstantTarget(); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return GotoLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Target->getEndLoc(); } static bool classof(const Stmt *T) { @@ -1420,9 +1519,15 @@ SourceLocation getContinueLoc() const { return ContinueLoc; } void setContinueLoc(SourceLocation L) { ContinueLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return ContinueLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return ContinueLoc; } static bool classof(const Stmt *T) { @@ -1451,9 +1556,15 @@ SourceLocation getBreakLoc() const { return BreakLoc; } void setBreakLoc(SourceLocation L) { BreakLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return BreakLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return BreakLoc; } static bool classof(const Stmt *T) { @@ -1504,10 +1615,16 @@ const VarDecl *getNRVOCandidate() const { return NRVOCandidate; } void setNRVOCandidate(const VarDecl *Var) { NRVOCandidate = Var; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return RetLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RetExpr ? RetExpr->getEndLoc() : RetLoc; } @@ -1563,9 +1680,15 @@ bool isVolatile() const { return IsVolatile; } void setVolatile(bool V) { IsVolatile = V; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return {}; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return {}; } //===--- Asm String Analysis ---===// @@ -1847,9 +1970,15 @@ return Clobbers[i]; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AsmLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { @@ -1947,9 +2076,15 @@ ArrayRef Exprs, ArrayRef Clobbers); public: - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AsmLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } static bool classof(const Stmt *T) { return T->getStmtClass() == MSAsmStmtClass; @@ -1978,9 +2113,15 @@ Expr *FilterExpr, Stmt *Block); - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getExceptLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getExceptLoc() const { return Loc; } SourceLocation getEndLoc() const { return getBlock()->getEndLoc(); } @@ -2017,9 +2158,15 @@ SourceLocation FinallyLoc, Stmt *Block); - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getFinallyLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getFinallyLoc() const { return Loc; } SourceLocation getEndLoc() const { return Block->getEndLoc(); } @@ -2057,9 +2204,15 @@ SourceLocation TryLoc, Stmt *TryBlock, Stmt *Handler); - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getTryLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getTryLoc() const { return TryLoc; } SourceLocation getEndLoc() const { return Children[HANDLER]->getEndLoc(); } @@ -2099,9 +2252,15 @@ SourceLocation getLeaveLoc() const { return LeaveLoc; } void setLeaveLoc(SourceLocation L) { LeaveLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return LeaveLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return LeaveLoc; } static bool classof(const Stmt *T) { @@ -2315,12 +2474,18 @@ return capture_init_begin() + NumCaptures; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getCapturedStmt()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getCapturedStmt()->getEndLoc(); } Index: cfe/trunk/include/clang/AST/StmtCXX.h =================================================================== --- cfe/trunk/include/clang/AST/StmtCXX.h +++ cfe/trunk/include/clang/AST/StmtCXX.h @@ -41,9 +41,15 @@ CXXCatchStmt(EmptyShell Empty) : Stmt(CXXCatchStmtClass), ExceptionDecl(nullptr), HandlerBlock(nullptr) {} - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return CatchLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return HandlerBlock->getEndLoc(); } @@ -88,9 +94,15 @@ static CXXTryStmt *Create(const ASTContext &C, EmptyShell Empty, unsigned numHandlers); - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getTryLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getTryLoc() const { return TryLoc; } SourceLocation getEndLoc() const { @@ -197,9 +209,15 @@ SourceLocation getColonLoc() const { return ColonLoc; } SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return ForLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SubExprs[BODY]->getEndLoc(); } @@ -285,9 +303,15 @@ return reinterpret_cast(SubStmt); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getEndLoc(); } @@ -408,12 +432,18 @@ return {getStoredStmts() + SubStmt::FirstParamMove, NumParams}; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return getBody() ? getBody()->getBeginLoc() : getPromiseDecl()->getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getBody() ? getBody()->getEndLoc() : getPromiseDecl()->getEndLoc(); } @@ -475,9 +505,15 @@ bool isImplicit() const { return IsImplicit; } void setIsImplicit(bool value = true) { IsImplicit = value; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return CoreturnLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getOperand() ? getOperand()->getEndLoc() : getBeginLoc(); } Index: cfe/trunk/include/clang/AST/StmtObjC.h =================================================================== --- cfe/trunk/include/clang/AST/StmtObjC.h +++ cfe/trunk/include/clang/AST/StmtObjC.h @@ -55,9 +55,15 @@ SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation Loc) { RParenLoc = Loc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return ForLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SubExprs[BODY]->getEndLoc(); } @@ -106,9 +112,15 @@ SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation Loc) { RParenLoc = Loc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AtCatchLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Body->getEndLoc(); } bool hasEllipsis() const { return getCatchParamDecl() == nullptr; } @@ -137,9 +149,15 @@ Stmt *getFinallyBody() { return AtFinallyStmt; } void setFinallyBody(Stmt *S) { AtFinallyStmt = S; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AtFinallyLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return AtFinallyStmt->getEndLoc(); } @@ -244,9 +262,15 @@ getStmts()[1 + NumCatchStmts] = S; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AtTryLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { @@ -303,9 +327,15 @@ } void setSynchExpr(Stmt *S) { SubStmts[SYNC_EXPR] = S; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AtSynchronizedLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return getSynchBody()->getEndLoc(); } @@ -339,9 +369,15 @@ SourceLocation getThrowLoc() const LLVM_READONLY { return AtThrowLoc; } void setThrowLoc(SourceLocation Loc) { AtThrowLoc = Loc; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AtThrowLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Throw ? Throw->getEndLoc() : AtThrowLoc; } @@ -369,9 +405,15 @@ Stmt *getSubStmt() { return SubStmt; } void setSubStmt(Stmt *S) { SubStmt = S; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return SubStmt->getEndLoc(); } Index: cfe/trunk/include/clang/AST/StmtOpenMP.h =================================================================== --- cfe/trunk/include/clang/AST/StmtOpenMP.h +++ cfe/trunk/include/clang/AST/StmtOpenMP.h @@ -165,10 +165,16 @@ } /// Returns starting location of directive kind. - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const { return StartLoc; } /// Returns ending location of directive. - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const { return EndLoc; } /// Set starting location of directive kind. Index: cfe/trunk/include/clang/AST/TypeLoc.h =================================================================== --- cfe/trunk/include/clang/AST/TypeLoc.h +++ cfe/trunk/include/clang/AST/TypeLoc.h @@ -151,8 +151,14 @@ return SourceRange(getBeginLoc(), getEndLoc()); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } /// Get the local source range. SourceRange getLocalSourceRange() const { Index: cfe/trunk/include/clang/Analysis/CloneDetection.h =================================================================== --- cfe/trunk/include/clang/Analysis/CloneDetection.h +++ cfe/trunk/include/clang/Analysis/CloneDetection.h @@ -122,7 +122,10 @@ /// Returns the start sourcelocation of the first statement in this sequence. /// /// This method should only be called on a non-empty StmtSequence object. - SourceLocation getStartLoc() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getStartLoc() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const; /// Returns the end sourcelocation of the last statement in this sequence. Index: cfe/trunk/include/clang/Sema/DeclSpec.h =================================================================== --- cfe/trunk/include/clang/Sema/DeclSpec.h +++ cfe/trunk/include/clang/Sema/DeclSpec.h @@ -505,9 +505,15 @@ const CXXScopeSpec &getTypeSpecScope() const { return TypeScope; } SourceRange getSourceRange() const LLVM_READONLY { return Range; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } SourceLocation getTypeSpecWidthLoc() const { return TSWRange.getBegin(); } @@ -1122,9 +1128,15 @@ SourceRange getSourceRange() const LLVM_READONLY { return SourceRange(StartLocation, EndLocation); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return StartLocation; } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return EndLocation; } }; @@ -1874,9 +1886,15 @@ /// Get the source range that spans this declarator. SourceRange getSourceRange() const LLVM_READONLY { return Range; } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } void SetSourceRange(SourceRange R) { Range = R; } Index: cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp =================================================================== --- cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp +++ cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp @@ -67,7 +67,10 @@ void setStartLoc(SourceLocation Loc) { LocStart = Loc; } - SourceLocation getStartLoc() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getStartLoc() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const { assert(LocStart && "Region has no start location"); return *LocStart; Index: cfe/trunk/lib/Sema/SemaChecking.cpp =================================================================== --- cfe/trunk/lib/Sema/SemaChecking.cpp +++ cfe/trunk/lib/Sema/SemaChecking.cpp @@ -6111,12 +6111,18 @@ StartToken, StartTokenByteOffset); } - SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocStart() const LLVM_READONLY, + "Use getBeginLoc instead") { + return getBeginLoc(); + } SourceLocation getBeginLoc() const LLVM_READONLY { return FExpr->getBeginLoc().getLocWithOffset(Offset); } - SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + LLVM_ATTRIBUTE_DEPRECATED(SourceLocation getLocEnd() const LLVM_READONLY, + "Use getEndLoc instead") { + return getEndLoc(); + } SourceLocation getEndLoc() const LLVM_READONLY { return FExpr->getEndLoc(); } };