]> granicus.if.org Git - clang/commitdiff
[AST] Add DeclaratioName::getLoc{Start,End} for consistency.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 9 Mar 2012 15:39:11 +0000 (15:39 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 9 Mar 2012 15:39:11 +0000 (15:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152409 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclarationName.h

index 83594fb0c87dcd56f80deda5e0ac62a614ff598f..eb7d39b0ba1a4e17b5c943444a5c189fe1e528b7 100644 (file)
@@ -515,6 +515,13 @@ public:
     SourceLocation EndLoc = getEndLoc();
     return SourceRange(BeginLoc, EndLoc.isValid() ? EndLoc : BeginLoc);
   }
+  SourceLocation getLocStart() const {
+    return getBeginLoc();
+  }
+  SourceLocation getLocEnd() const {
+    SourceLocation EndLoc = getEndLoc();
+    return EndLoc.isValid() ? EndLoc : getLocStart();
+  }
 };
 
 /// Insertion operator for diagnostics.  This allows sending DeclarationName's