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 | f7bcc81213df95129407dc8d83065d28ce2bfff4 (patch) | |
| tree | c074e59910cfa8ad2edcd4f33a69d8ce3c2003d9 /clang/lib/AST/Decl.cpp | |
| parent | cc2efe11db5e72edce78a58b97bb7472633e3fb4 (diff) | |
| download | bcm5719-llvm-f7bcc81213df95129407dc8d83065d28ce2bfff4.tar.gz bcm5719-llvm-f7bcc81213df95129407dc8d83065d28ce2bfff4.zip | |
Copy source information for the inner type of an elaborated type; fixes some
valgrind problems.
llvm-svn: 105062
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index ffdcb471d08..4d13f7f3abb 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/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(); } |

