[PATCH] D24800: Merge conflicting replacements when they are order-independent.
Eric Liu via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 27 06:26:26 PDT 2016
ioeric added inline comments.
================
Comment at: lib/Tooling/Core/Replacement.cpp:179-181
@@ +178,5 @@
+Replacements::mergeIfOrderIndependent(const Replacement &R) const {
+ Replacements Rs(R);
+ Replacements ShiftedRs(getReplacementInChangedCode(R));
+ Replacements ShiftedReplaces;
+ for (const auto &Replace : Replaces)
----------------
klimek wrote:
> These names are confusing me...
>
Trying to make names less confusing... any better now?
================
Comment at: lib/Tooling/Core/Replacement.cpp:184
@@ +183,3 @@
+ ShiftedReplaces.Replaces.insert(Rs.getReplacementInChangedCode(Replace));
+ auto MergeRs = merge(ShiftedRs);
+ auto MergeReplaces = Rs.merge(ShiftedReplaces);
----------------
klimek wrote:
> This comes from a single replacement - why do we need to call merge?
Because it refers to code after `Replaces` are applied?
https://reviews.llvm.org/D24800
More information about the cfe-commits
mailing list