[PATCH] D34268: [clang] Fix format specifiers fixits for nested macros

Alexander Shaposhnikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 15 19:56:49 PDT 2017


alexshap created this revision.

ExpansionLoc was previously calculated incorrectly in the case of 
nested macros expansions. In this diff we build the stack of expansions where the last one
is the actual expansion (in the source code) which should be used for grouping together 
the edits. The definition of MacroArgUse is adjusted accordingly: now it's essentially the stack of expansions plus
the location of argument use inside the top-most macro. 
This diff fixes https://bugs.llvm.org/show_bug.cgi?id=33447 .

Test plan: make check-all


Repository:
  rL LLVM

https://reviews.llvm.org/D34268

Files:
  include/clang/Edit/EditedSource.h
  lib/Edit/EditedSource.cpp
  test/FixIt/fixit-format-darwin.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34268.102773.patch
Type: text/x-patch
Size: 5714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170616/791b0bff/attachment.bin>


More information about the cfe-commits mailing list