]> granicus.if.org Git - clang/commitdiff
[AST] Mark Expr::getExprLoc() as LLVM_READONLY.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 9 Mar 2012 20:02:51 +0000 (20:02 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 9 Mar 2012 20:02:51 +0000 (20:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152429 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Expr.h
include/clang/AST/ExprObjC.h

index 59f84853dea32bc9fef9e86fc551cb1c15dba46b..2d0b4aa4b79579c1ae5006bcee310b9586c76192 100644 (file)
@@ -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 {
index 302262a497ca0b239e33113cc8b4400ece7baf19..6e4e5b9a325657ecb0e2d842db62b0ada7655808 100644 (file)
@@ -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;