[cfe-commits] r152418 - in /cfe/trunk/include/clang: AST/DeclCXX.h AST/TypeLoc.h Sema/DeclSpec.h

Daniel Dunbar daniel at zuster.org
Fri Mar 9 10:34:54 PST 2012


Author: ddunbar
Date: Fri Mar  9 12:34:54 2012
New Revision: 152418

URL: http://llvm.org/viewvc/llvm-project?rev=152418&view=rev
Log:
[AST/Sema] Add {CXXBaseSpecifier,Declarator,DeclSpec,TypeLoc,UnqualifiedId}::getLoc{Start,End}.

Modified:
    cfe/trunk/include/clang/AST/DeclCXX.h
    cfe/trunk/include/clang/AST/TypeLoc.h
    cfe/trunk/include/clang/Sema/DeclSpec.h

Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=152418&r1=152417&r2=152418&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Fri Mar  9 12:34:54 2012
@@ -209,6 +209,8 @@
   /// getSourceRange - Retrieves the source range that contains the
   /// entire base specifier.
   SourceRange getSourceRange() const { return Range; }
+  SourceLocation getLocStart() const { return Range.getBegin(); }
+  SourceLocation getLocEnd() const { return Range.getEnd(); }
 
   /// isVirtual - Determines whether the base class is a virtual base
   /// class (or not).

Modified: cfe/trunk/include/clang/AST/TypeLoc.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeLoc.h?rev=152418&r1=152417&r2=152418&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/TypeLoc.h (original)
+++ cfe/trunk/include/clang/AST/TypeLoc.h Fri Mar  9 12:34:54 2012
@@ -96,6 +96,8 @@
   SourceRange getSourceRange() const {
     return SourceRange(getBeginLoc(), getEndLoc());
   }
+  SourceLocation getLocStart() const { return getBeginLoc(); }
+  SourceLocation getLocEnd() const { return getEndLoc(); }
 
   /// \brief Get the local source range.
   SourceRange getLocalSourceRange() const {

Modified: cfe/trunk/include/clang/Sema/DeclSpec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/DeclSpec.h?rev=152418&r1=152417&r2=152418&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/DeclSpec.h (original)
+++ cfe/trunk/include/clang/Sema/DeclSpec.h Fri Mar  9 12:34:54 2012
@@ -447,6 +447,9 @@
   const CXXScopeSpec &getTypeSpecScope() const { return TypeScope; }
 
   const SourceRange &getSourceRange() const { return Range; }
+  SourceLocation getLocStart() const { return Range.getBegin(); }
+  SourceLocation getLocEnd() const { return Range.getEnd(); }
+
   SourceLocation getTypeSpecWidthLoc() const { return TSWLoc; }
   SourceLocation getTypeSpecComplexLoc() const { return TSCLoc; }
   SourceLocation getTypeSpecSignLoc() const { return TSSLoc; }
@@ -966,6 +969,8 @@
   SourceRange getSourceRange() const { 
     return SourceRange(StartLocation, EndLocation); 
   }
+  SourceLocation getLocStart() const { return StartLocation; }
+  SourceLocation getLocEnd() const { return EndLocation; }
 };
   
 /// CachedTokens - A set of tokens that has been cached for later
@@ -1525,6 +1530,8 @@
 
   /// getSourceRange - Get the source range that spans this declarator.
   const SourceRange &getSourceRange() const { return Range; }
+  SourceLocation getLocStart() const { return Range.getBegin(); }
+  SourceLocation getLocEnd() const { return Range.getEnd(); }
 
   void SetSourceRange(SourceRange R) { Range = R; }
   /// SetRangeBegin - Set the start of the source range to Loc, unless it's





More information about the cfe-commits mailing list