aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/TemplateBase.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-10-29 18:45:58 +0000
committerJohn McCall <rjmccall@apple.com>2009-10-29 18:45:58 +0000
commit828bff2079b6a91ecd7ed5b842c59527d7682789 (patch)
tree8a8388f7b4d1b260e6b197d49b5fb5d39e19549a /lib/AST/TemplateBase.cpp
parentfd2300e1ee0eab6c51862a92d3f3c72540b36b23 (diff)
A few TemplateArgumentLoc clean-ups. Try to remember the Expr for a declaration.
Provide an API for getting the SourceRange of a TAL and use it judiciously. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TemplateBase.cpp')
-rw-r--r--lib/AST/TemplateBase.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/AST/TemplateBase.cpp b/lib/AST/TemplateBase.cpp
index b136fe0d38..94e1ca1e06 100644
--- a/lib/AST/TemplateBase.cpp
+++ b/lib/AST/TemplateBase.cpp
@@ -78,20 +78,20 @@ void TemplateArgument::Profile(llvm::FoldingSetNodeID &ID,
// TemplateArgumentLoc Implementation
//===----------------------------------------------------------------------===//
-SourceLocation TemplateArgumentLoc::getLocation() const {
+SourceRange TemplateArgumentLoc::getSourceRange() const {
switch (Argument.getKind()) {
case TemplateArgument::Expression:
- return getSourceExpression()->getExprLoc();
- case TemplateArgument::Type:
- return getSourceDeclaratorInfo()->
- getTypeLoc().getFullSourceRange().getBegin();
+ return getSourceExpression()->getSourceRange();
case TemplateArgument::Declaration:
+ return getSourceDeclExpression()->getSourceRange();
+ case TemplateArgument::Type:
+ return getSourceDeclaratorInfo()->getTypeLoc().getFullSourceRange();
case TemplateArgument::Integral:
case TemplateArgument::Pack:
case TemplateArgument::Null:
- return SourceLocation();
+ return SourceRange();
}
// Silence bonus gcc warning.
- return SourceLocation();
+ return SourceRange();
}