aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/TypeLoc.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-03-01 03:11:17 +0000
committerDouglas Gregor <dgregor@apple.com>2011-03-01 03:11:17 +0000
commit239cbb023c8da689e7722f7146914eed9755e368 (patch)
tree119dfea89042d2de2b6306fd98bb4c10f51f177e /lib/AST/TypeLoc.cpp
parent4ba48c43410a8ad4f32d1d3f684c7d297513e0a1 (diff)
Push nested-name-specifier source location information into elaborated
name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind". Aside from the normal changes, this also required some tweaks to the parser. Essentially, when we're looking at a type name (via getTypeName()) specifically for the purpose of creating an annotation token, we pass down the flag that asks for full type-source location information to be stored within the returned type. That way, we retain source-location information involving nested-name-specifiers rather than trying to reconstruct that information later, long after it's been lost in the parser. With this change, test/Index/recursive-cxx-member-calls.cpp is showing much improved results again, since that code has lots of nested-name-specifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TypeLoc.cpp')
-rw-r--r--lib/AST/TypeLoc.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/AST/TypeLoc.cpp b/lib/AST/TypeLoc.cpp
index 4b38dbac7b..98c46621f0 100644
--- a/lib/AST/TypeLoc.cpp
+++ b/lib/AST/TypeLoc.cpp
@@ -229,6 +229,14 @@ TypeLoc TypeLoc::IgnoreParensImpl(TypeLoc TL) {
return TL;
}
+void ElaboratedTypeLoc::initializeLocal(ASTContext &Context,
+ SourceLocation Loc) {
+ setKeywordLoc(Loc);
+ NestedNameSpecifierLocBuilder Builder;
+ Builder.MakeTrivial(Context, getTypePtr()->getQualifier(), Loc);
+ setQualifierLoc(Builder.getWithLocInContext(Context));
+}
+
void DependentNameTypeLoc::initializeLocal(ASTContext &Context,
SourceLocation Loc) {
setKeywordLoc(Loc);