hokein added inline comments.
================ Comment at: clang-move/ClangMove.cpp:264 + HeaderGuard += "#define " + GuardName + "\n"; + clang::tooling::Replacement HeaderGuardInclude(FileName, 0, 0, + HeaderGuard); ---------------- ioeric wrote: > 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. Good point. Yeah, the function only inserts new code to the new file. Make sense to only construct a single Replacement of the concatenated string. Will do in a follow-up. https://reviews.llvm.org/D25610 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits