diff options
author | Daniel Dunbar <daniel@zuster.org> | 2012-03-09 18:34:54 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2012-03-09 18:34:54 +0000 |
commit | 3d4144f32ea4c24aaf48cbff4f476c1446ba2641 (patch) | |
tree | 62aa074d4e1032f1494129638c507ef30fd4964c | |
parent | 8fbc6d23d61213750ba1fdcb0b4b9d3d54bbc32f (diff) |
[AST/Sema] Add {CXXBaseSpecifier,Declarator,DeclSpec,TypeLoc,UnqualifiedId}::getLoc{Start,End}.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152418 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/DeclCXX.h | 2 | ||||
-rw-r--r-- | include/clang/AST/TypeLoc.h | 2 | ||||
-rw-r--r-- | include/clang/Sema/DeclSpec.h | 7 |
3 files changed, 11 insertions, 0 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index edecc779a3..838912d49e 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -209,6 +209,8 @@ public: /// 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). diff --git a/include/clang/AST/TypeLoc.h b/include/clang/AST/TypeLoc.h index bdb0b9b438..c0a77d48b3 100644 --- a/include/clang/AST/TypeLoc.h +++ b/include/clang/AST/TypeLoc.h @@ -96,6 +96,8 @@ public: 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 { diff --git a/include/clang/Sema/DeclSpec.h b/include/clang/Sema/DeclSpec.h index f5c2999616..4f8417a8ea 100644 --- a/include/clang/Sema/DeclSpec.h +++ b/include/clang/Sema/DeclSpec.h @@ -447,6 +447,9 @@ public: 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 @@ public: 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 @@ public: /// 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 |