diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2012-03-09 20:02:51 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2012-03-09 20:02:51 +0000 |
| commit | 0fbc2bd499e6eabe774e93df3f0ae8225e1a7ec6 (patch) | |
| tree | ced7ecde63ca8d104cb086ce7b929df822745eaf | |
| parent | eda65572bb30ae19c81ffe413701af4fa7441dc3 (diff) | |
| download | bcm5719-llvm-0fbc2bd499e6eabe774e93df3f0ae8225e1a7ec6.tar.gz bcm5719-llvm-0fbc2bd499e6eabe774e93df3f0ae8225e1a7ec6.zip | |
[AST] Mark Expr::getExprLoc() as LLVM_READONLY.
llvm-svn: 152429
| -rw-r--r-- | clang/include/clang/AST/Expr.h | 14 | ||||
| -rw-r--r-- | clang/include/clang/AST/ExprObjC.h | 10 |
2 files changed, 14 insertions, 10 deletions
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h index 59f84853dea..2d0b4aa4b79 100644 --- a/clang/include/clang/AST/Expr.h +++ b/clang/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<PseudoObjectExpr*>(this)->getSemanticExpr(index); } - SourceLocation getExprLoc() const { + SourceLocation getExprLoc() const LLVM_READONLY { return getSyntacticForm()->getExprLoc(); } SourceRange getSourceRange() const LLVM_READONLY { diff --git a/clang/include/clang/AST/ExprObjC.h b/clang/include/clang/AST/ExprObjC.h index 302262a497c..6e4e5b9a325 100644 --- a/clang/include/clang/AST/ExprObjC.h +++ b/clang/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; |

