[PATCH] D84186: [clang][cli] Convert Analyzer option string based options to new option parsing system

Jan Svoboda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 01:31:24 PST 2020


jansvoboda11 added inline comments.


================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:287
+static void
+denormalizeString(SmallVectorImpl<const char *> &Args, const char *Spelling,
+                  CompilerInvocation::StringAllocator SA, unsigned, T &&Value) {
----------------
dexonsmith wrote:
> jansvoboda11 wrote:
> > We should keep an eye on the number of instantiations of this function template (and `normalizeStringIntegral`).
> > 
> > If it grows, we can employ the SFINAE trick used for `makeFlagToValueNormalizer`.
> Does it work to take the parameter as a `Twine` to avoid the template?
> ```
> static void
> denormalizeString(SmallVectorImpl<const char *> &Args, const char *Spelling,
>                   CompilerInvocation::StringAllocator SA, unsigned, Twine Value) {
>   Args.push_back(Spelling);
>   Args.push_back(SA(Value));
> }
> ```
In general no. The `Twine` constructor is `explicit` for some types (integers, chars, etc.).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84186/new/

https://reviews.llvm.org/D84186



More information about the llvm-commits mailing list