diff options
| author | Kirill Bobyrev <omtcyfz@gmail.com> | 2016-08-09 07:14:48 +0000 |
|---|---|---|
| committer | Kirill Bobyrev <omtcyfz@gmail.com> | 2016-08-09 07:14:48 +0000 |
| commit | 31fd7fb5e651432a4b554527098dba1f65527150 (patch) | |
| tree | 21a8571b0701509a866689fcfa9b5d1ddcce1572 /clang-tools-extra/clang-rename/USRLocFinder.cpp | |
| parent | a10549d3e9439349cd092ec1c8fa63270e34d7ae (diff) | |
| download | bcm5719-llvm-31fd7fb5e651432a4b554527098dba1f65527150.tar.gz bcm5719-llvm-31fd7fb5e651432a4b554527098dba1f65527150.zip | |
[clang-rename] fix bug with initializer lists
Clang-rename is currently not able to find a symbol in initializer list. This
patch fixes described issue.
Reviewers: alexfh
Differential Revision: https://reviews.llvm.org/D23193
llvm-svn: 278099
Diffstat (limited to 'clang-tools-extra/clang-rename/USRLocFinder.cpp')
| -rw-r--r-- | clang-tools-extra/clang-rename/USRLocFinder.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/clang-tools-extra/clang-rename/USRLocFinder.cpp b/clang-tools-extra/clang-rename/USRLocFinder.cpp index d3c64baf742..7a491d03fe0 100644 --- a/clang-tools-extra/clang-rename/USRLocFinder.cpp +++ b/clang-tools-extra/clang-rename/USRLocFinder.cpp @@ -48,18 +48,9 @@ public: // Ignore implicit initializers. continue; } - if (const clang::FieldDecl *FieldDecl = Initializer->getAnyMember()) { + if (const clang::FieldDecl *FieldDecl = Initializer->getMember()) { if (USRSet.find(getUSRForDecl(FieldDecl)) != USRSet.end()) { - // The initializer refers to a field that is to be renamed. - SourceLocation Location = Initializer->getSourceLocation(); - StringRef TokenName = Lexer::getSourceText( - CharSourceRange::getTokenRange(Location), - Context.getSourceManager(), Context.getLangOpts()); - if (TokenName == PrevName) { - // The token of the source location we find actually has the old - // name. - LocationsFound.push_back(Initializer->getSourceLocation()); - } + LocationsFound.push_back(Initializer->getSourceLocation()); } } } |

