summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-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