[cfe-commits] r49890 - /cfe/trunk/include/clang/AST/Expr.h

Ted Kremenek kremenek at apple.com
Thu Apr 17 21:18:16 PDT 2008


Author: kremenek
Date: Thu Apr 17 23:18:16 2008
New Revision: 49890

URL: http://llvm.org/viewvc/llvm-project?rev=49890&view=rev
Log:
Several Expr subclasses did not mark "getSourceRange()" virtual.  Fixed.

Modified:
    cfe/trunk/include/clang/AST/Expr.h

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=49890&r1=49889&r2=49890&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Thu Apr 17 23:18:16 2008
@@ -372,7 +372,7 @@
   
   const Expr *getSubExpr() const { return Val; }
   Expr *getSubExpr() { return Val; }
-  SourceRange getSourceRange() const { return SourceRange(L, R); }
+  virtual SourceRange getSourceRange() const { return SourceRange(L, R); }
 
   static bool classof(const Stmt *T) { 
     return T->getStmtClass() == ParenExprClass; 
@@ -484,7 +484,10 @@
   QualType getArgumentType() const { return Ty; }
   
   SourceLocation getOperatorLoc() const { return OpLoc; }
-  SourceRange getSourceRange() const { return SourceRange(OpLoc, RParenLoc); }
+
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(OpLoc, RParenLoc);
+  }
 
   static bool classof(const Stmt *T) { 
     return T->getStmtClass() == SizeOfAlignOfTypeExprClass; 
@@ -546,11 +549,11 @@
   const Expr *getIdx() const {
     return (getRHS()->getType()->isIntegerType()) ? getRHS() : getLHS(); 
   }  
-
   
-  SourceRange getSourceRange() const { 
+  virtual SourceRange getSourceRange() const { 
     return SourceRange(getLHS()->getLocStart(), RBracketLoc);
   }
+  
   virtual SourceLocation getExprLoc() const { return RBracketLoc; }
 
   static bool classof(const Stmt *T) { 
@@ -634,7 +637,8 @@
   bool isBuiltinConstantExpr() const;
   
   SourceLocation getRParenLoc() const { return RParenLoc; }
-  SourceRange getSourceRange() const { 
+
+  virtual SourceRange getSourceRange() const { 
     return SourceRange(getCallee()->getLocStart(), RParenLoc);
   }
   
@@ -671,6 +675,7 @@
   virtual SourceRange getSourceRange() const {
     return SourceRange(getBase()->getLocStart(), MemberLoc);
   }
+  
   virtual SourceLocation getExprLoc() const { return MemberLoc; }
 
   static bool classof(const Stmt *T) { 
@@ -736,6 +741,7 @@
   virtual SourceRange getSourceRange() const {
     return SourceRange(getBase()->getLocStart(), AccessorLoc);
   }
+  
   static bool classof(const Stmt *T) { 
     return T->getStmtClass() == OCUVectorElementExprClass; 
   }
@@ -1366,7 +1372,9 @@
   SourceLocation getAtLoc() const { return AtLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
   
-  SourceRange getSourceRange() const { return SourceRange(AtLoc, RParenLoc); }
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(AtLoc, RParenLoc);
+  }
 
   QualType getEncodedType() const { return EncType; }
 
@@ -1397,7 +1405,10 @@
   
   SourceLocation getAtLoc() const { return AtLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
-  SourceRange getSourceRange() const { return SourceRange(AtLoc, RParenLoc); }
+
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(AtLoc, RParenLoc);
+  }
   
   /// getNumArgs - Return the number of actual arguments to this call.
   unsigned getNumArgs() const { return SelName.getNumArgs(); }
@@ -1429,7 +1440,10 @@
     
   SourceLocation getAtLoc() const { return AtLoc; }
   SourceLocation getRParenLoc() const { return RParenLoc; }
-  SourceRange getSourceRange() const { return SourceRange(AtLoc, RParenLoc); }
+
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(AtLoc, RParenLoc);
+  }
         
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == ObjCProtocolExprClass;
@@ -1541,7 +1555,10 @@
     assert(Arg < NumArgs && "Arg access out of range!");
     SubExprs[Arg+ARGS_START] = ArgExpr;
   }
-  SourceRange getSourceRange() const { return SourceRange(LBracloc, RBracloc); }
+
+  virtual SourceRange getSourceRange() const {
+    return SourceRange(LBracloc, RBracloc);
+  }
 
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == ObjCMessageExprClass;





More information about the cfe-commits mailing list