[PATCH] D23298: [clang-rename] nit: use isWritten

Alexander Shaposhnikov via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 9 01:39:01 PDT 2016


alexshap created this revision.
alexshap added reviewers: omtcyfz, alexfh.
alexshap added a subscriber: cfe-commits.
alexshap changed the visibility of this Differential Revision from "Public (No Login Required)" to "All Users".

nit: use isWritten and const auto *Initializer in 
NamedDeclFindingASTVisitor::VisitCXXConstructorDecl method.
Test plan: make -j8 check-clang-tools (passed)

https://reviews.llvm.org/D23298

Files:
  clang-rename/USRFinder.cpp

Index: clang-rename/USRFinder.cpp
===================================================================
--- clang-rename/USRFinder.cpp
+++ clang-rename/USRFinder.cpp
@@ -91,8 +91,8 @@
   }
 
   bool VisitCXXConstructorDecl(clang::CXXConstructorDecl *ConstructorDecl) {
-    for (auto &Initializer : ConstructorDecl->inits()) {
-      if (Initializer->getSourceOrder() == -1) {
+    for (const auto *Initializer : ConstructorDecl->inits()) {
+      if (!Initializer->isWritten()) {
         // Ignore implicit initializers.
         continue;
       }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23298.67295.patch
Type: text/x-patch
Size: 549 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160809/e4665149/attachment.bin>


More information about the cfe-commits mailing list