[PATCH] D25610: [clang-move] Add header guard for the new header.

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 14 05:32:55 PDT 2016


ioeric accepted this revision.
ioeric added a comment.
This revision is now accepted and ready to land.

Lg



================
Comment at: clang-move/ClangMove.cpp:264
+    HeaderGuard += "#define " + GuardName + "\n";
+    clang::tooling::Replacement HeaderGuardInclude(FileName, 0, 0,
+                                                   HeaderGuard);
----------------
Might not quite related to this patch:

Considering how `tooling::Replacements::add(...)` is implemented now, it's quite inefficient to use `addOrMergeReplacement` in you case since almost all replacements will conflict, which would require expensive conflict-resolving merge. I think it would be cleaner and easier if you just concatenate all `Decl`s and create a single insertion replacement instead of keeping merging replacements at offset 0.


https://reviews.llvm.org/D25610





More information about the cfe-commits mailing list