summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2012-03-09 18:34:54 +0000
committerDaniel Dunbar <daniel@zuster.org>2012-03-09 18:34:54 +0000
commitddb83c71946dde29e4f99016c9885b9c8f70c608 (patch)
tree56456796f2ffafbf488caf4c6a49bbfcb24659b2
parent3bfc622bdb8e8d827b0e79f7d50557e279cbe3e5 (diff)
downloadbcm5719-llvm-ddb83c71946dde29e4f99016c9885b9c8f70c608.tar.gz
bcm5719-llvm-ddb83c71946dde29e4f99016c9885b9c8f70c608.zip
[AST/Sema] Add {CXXBaseSpecifier,Declarator,DeclSpec,TypeLoc,UnqualifiedId}::getLoc{Start,End}.
llvm-svn: 152418
-rw-r--r--clang/include/clang/AST/DeclCXX.h2
-rw-r--r--clang/include/clang/AST/TypeLoc.h2
-rw-r--r--clang/include/clang/Sema/DeclSpec.h7
3 files changed, 11 insertions, 0 deletions
diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h
index edecc779a38..838912d49ea 100644
--- a/clang/include/clang/AST/DeclCXX.h
+++ b/clang/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/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h
index bdb0b9b438a..c0a77d48b3f 100644
--- a/clang/include/clang/AST/TypeLoc.h
+++ b/clang/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/clang/include/clang/Sema/DeclSpec.h b/clang/include/clang/Sema/DeclSpec.h
index f5c2999616a..4f8417a8ead 100644
--- a/clang/include/clang/Sema/DeclSpec.h
+++ b/clang/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
OpenPOWER on IntegriCloud