[PATCH] D133072: [clang] fix profiling of template arguments of template and declaration kind

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 6 09:28:16 PDT 2022


mizvekov added inline comments.


================
Comment at: clang/lib/Sema/SemaTemplate.cpp:5817
           // fall back to just producing individual arguments.
-          Converted.insert(Converted.end(),
-                           ArgumentPack.begin(), ArgumentPack.end());
+          for (const TemplateArgument &I : ArgumentPack)
+            Converted.push_back(Context.getCanonicalTemplateArgument(I));
----------------
mizvekov wrote:
> erichkeane wrote:
> > mizvekov wrote:
> > > erichkeane wrote:
> > > > Ooh, thats a transform!  
> > > > 
> > > > `llvm::transform(ArgumentPack, std::back_inserter(Converted), [](const auto &I) { return Context.getCanonicalTemplateArgument(I));`
> > > That is true, though unless we can come up with a clearer spelling for that, it looks less readable to me.
> > But I like transform :(
> I will think of something, even if we have to add a new helper :)
I'll try to address this concern, about having a helper which returns a transformed copy of a container, in a way that reads better than the pure transform as suggested, in a follow up patch. Meanwhile I'll offload this patch, as my stack is too big right now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133072



More information about the cfe-commits mailing list