[PATCH] D17852: Added formatAndApplyAllReplacements that works on multiple files in libTooling.

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 14 07:31:17 PDT 2016


Friendly PING.

@klimek
Hi Manuel, what do you think about the return type for
groupReplacementsByFile?
Daniel suggests that instead of "std::map<std::string, Replacements>", it
returns "std::vector<Replacements>".

On Sun, Mar 6, 2016 at 9:32 PM Eric Liu <ioeric at google.com> wrote:

> ioeric added inline comments.
>
> ================
> Comment at: include/clang/Tooling/Core/Replacement.h:230
> @@ +229,3 @@
> +
> +typedef std::map<const std::string, Replacements>
> +    FileToReplacementsMap;
> ----------------
> djasper wrote:
> > ioeric wrote:
> > > djasper wrote:
> > > > I think the key type in a map is always const, so no need for
> "const".
> > > I think "const" is needed since the `Entry` passed to map's `[]`
> operator is of type `const FileEntry *` in
> `FileToReplaces[Entry].push_back(Replace)`. The code didn't compile without
> the "const" qualifier.
> > Well, now it's a string and the strings are copied anyway. I am pretty
> sure it will compile after removing "const".
> Ooops! I was on another git branch! Yes, it definitely compiles for
> `string`. Sorry about that.
>
>
> http://reviews.llvm.org/D17852
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160314/d832f61b/attachment.html>


More information about the cfe-commits mailing list