[PATCH] D11169: Avoid passing objects with __declspec(align) members by value (PR24113) - clang-tools-extra part

Hans Wennborg hans at chromium.org
Mon Jul 13 17:09:36 PDT 2015


hans created this revision.
hans added reviewers: rnk, Bigcheese.
hans added a subscriber: cfe-commits.

This is the clang-tools-extra part of http://reviews.llvm.org/D11167

http://reviews.llvm.org/D11169

Files:
  clang-modernize/UseNullptr/NullptrActions.cpp

Index: clang-modernize/UseNullptr/NullptrActions.cpp
===================================================================
--- clang-modernize/UseNullptr/NullptrActions.cpp
+++ clang-modernize/UseNullptr/NullptrActions.cpp
@@ -372,7 +372,7 @@
   ///
   /// \pre MacroLoc.isFileID()
   /// \returns true if such an ancestor was found, false otherwise.
-  bool findContainingAncestor(ast_type_traits::DynTypedNode Start,
+  bool findContainingAncestor(const ast_type_traits::DynTypedNode &Start,
                               SourceLocation MacroLoc,
                               ast_type_traits::DynTypedNode &Result) {
     // Below we're only following the first parent back up the AST. This should
@@ -382,8 +382,10 @@
 
     assert(MacroLoc.isFileID());
 
+    ast_type_traits::DynTypedNode Node = Start;
+
     do {
-      const auto &Parents = Context.getParents(Start);
+      const auto &Parents = Context.getParents(Node);
       if (Parents.empty())
         return false;
       assert(Parents.size() == 1 &&
@@ -403,7 +405,7 @@
         Result = Parent;
         return true;
       }
-      Start = Parent;
+      Node = Parent;
     } while (1);
 
     llvm_unreachable("findContainingAncestor");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11169.29630.patch
Type: text/x-patch
Size: 1211 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150714/1743be68/attachment.bin>


More information about the cfe-commits mailing list