diff options
author | John McCall <rjmccall@apple.com> | 2010-05-28 23:32:21 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-05-28 23:32:21 +0000 |
commit | 4e449836c0deee9cfd92d32cb7d843759fa6452b (patch) | |
tree | c02ce5f4abaf483faa6aa1f2d4be6ac5da2e5221 /lib/AST/Decl.cpp | |
parent | f88f63f346aed8f5fa1d1552c925d54eee65b7e4 (diff) |
Copy source information for the inner type of an elaborated type; fixes some
valgrind problems.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105062 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index ffdcb471d0..4d13f7f3ab 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -531,15 +531,8 @@ void DeclaratorDecl::Destroy(ASTContext &C) { } SourceLocation DeclaratorDecl::getTypeSpecStartLoc() const { - if (DeclInfo) { - TypeLoc TL = getTypeSourceInfo()->getTypeLoc(); - while (true) { - TypeLoc NextTL = TL.getNextTypeLoc(); - if (!NextTL) - return TL.getLocalSourceRange().getBegin(); - TL = NextTL; - } - } + TypeSourceInfo *TSI = getTypeSourceInfo(); + if (TSI) return TSI->getTypeLoc().getBeginLoc(); return SourceLocation(); } |