From: Daniel Dunbar Date: Fri, 9 Mar 2012 20:02:51 +0000 (+0000) Subject: [AST] Mark Expr::getExprLoc() as LLVM_READONLY. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f311183be3d923da9fbe8702c453688b4c426a9;p=clang [AST] Mark Expr::getExprLoc() as LLVM_READONLY. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152429 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index 59f84853de..2d0b4aa4b7 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -176,7 +176,7 @@ public: /// getExprLoc - Return the preferred location for the arrow when diagnosing /// a problem with a generic expression. - SourceLocation getExprLoc() const; + SourceLocation getExprLoc() const LLVM_READONLY; /// isUnusedResultAWarning - Return true if this immediate expression should /// be warned about if the result is unused. If so, fill in Loc and Ranges @@ -721,7 +721,7 @@ public: if (SourceExpr) return SourceExpr->getSourceRange(); return Loc; } - SourceLocation getExprLoc() const { + SourceLocation getExprLoc() const LLVM_READONLY { if (SourceExpr) return SourceExpr->getExprLoc(); return Loc; } @@ -1608,7 +1608,7 @@ public: else return SourceRange(Loc, Val->getLocEnd()); } - SourceLocation getExprLoc() const { return Loc; } + SourceLocation getExprLoc() const LLVM_READONLY { return Loc; } static bool classof(const Stmt *T) { return T->getStmtClass() == UnaryOperatorClass; @@ -1994,7 +1994,7 @@ public: SourceLocation getRBracketLoc() const { return RBracketLoc; } void setRBracketLoc(SourceLocation L) { RBracketLoc = L; } - SourceLocation getExprLoc() const { return getBase()->getExprLoc(); } + SourceLocation getExprLoc() const LLVM_READONLY { return getBase()->getExprLoc(); } static bool classof(const Stmt *T) { return T->getStmtClass() == ArraySubscriptExprClass; @@ -2400,7 +2400,7 @@ public: SourceLocation getLocStart() const LLVM_READONLY; SourceLocation getLocEnd() const LLVM_READONLY; - SourceLocation getExprLoc() const { return MemberLoc; } + SourceLocation getExprLoc() const LLVM_READONLY { return MemberLoc; } /// \brief Determine whether the base of this explicit is implicit. bool isImplicitAccess() const { @@ -2793,7 +2793,7 @@ public: explicit BinaryOperator(EmptyShell Empty) : Expr(BinaryOperatorClass, Empty), Opc(BO_Comma) { } - SourceLocation getExprLoc() const { return OpLoc; } + SourceLocation getExprLoc() const LLVM_READONLY { return OpLoc; } SourceLocation getOperatorLoc() const { return OpLoc; } void setOperatorLoc(SourceLocation L) { OpLoc = L; } @@ -4476,7 +4476,7 @@ public: return const_cast(this)->getSemanticExpr(index); } - SourceLocation getExprLoc() const { + SourceLocation getExprLoc() const LLVM_READONLY { return getSyntacticForm()->getExprLoc(); } SourceRange getSourceRange() const LLVM_READONLY { diff --git a/include/clang/AST/ExprObjC.h b/include/clang/AST/ExprObjC.h index 302262a497..6e4e5b9a32 100644 --- a/include/clang/AST/ExprObjC.h +++ b/include/clang/AST/ExprObjC.h @@ -1358,7 +1358,7 @@ public: return SourceRange(getBase()->getLocStart(), IsaMemberLoc); } - SourceLocation getExprLoc() const { return IsaMemberLoc; } + SourceLocation getExprLoc() const LLVM_READONLY { return IsaMemberLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == ObjCIsaExprClass; @@ -1427,8 +1427,12 @@ public: child_range children() { return child_range(&Operand, &Operand+1); } // Source locations are determined by the subexpression. - SourceRange getSourceRange() const LLVM_READONLY { return Operand->getSourceRange(); } - SourceLocation getExprLoc() const { return getSubExpr()->getExprLoc(); } + SourceRange getSourceRange() const LLVM_READONLY { + return Operand->getSourceRange(); + } + SourceLocation getExprLoc() const LLVM_READONLY { + return getSubExpr()->getExprLoc(); + } static bool classof(const Stmt *s) { return s->getStmtClass() == ObjCIndirectCopyRestoreExprClass;