jansvoboda11 added a comment. In D94472#2523053 <https://reviews.llvm.org/D94472#2523053>, @Bigcheese wrote:
> The only issue I have with this if always parsing twice has a noticeable > performance impact for any users of Clang. Can we measure the impact? If it's > small (< 100ms ?) then that's fine. I'm also concerned about users like cling > and clangd. I've created a micro-benchmark in D95516 <https://reviews.llvm.org/D95516>. I think we should be fine. In D94472#2523490 <https://reviews.llvm.org/D94472#2523490>, @dexonsmith wrote: > I think the idea is only to parse twice when `-round-trip-args` is on, which > the driver will only set by default in asserts mode. Good to measure the > impact nevertheless. I must've misunderstood you earlier. I've updated the patch so that we round-trip only when cc1 is given `-round-trip-args` (which happens automatically only in assert builds). We check that the once- and twice- generated arguments match, and we make sure the `CompilerInvocation` resulting from the second parse gets used in the rest of compilation. ================ Comment at: clang/lib/Frontend/CompilerInvocation.cpp:604 + GenArgs2Strs.end(), [](const char *A, const char *B) { + return StringRef(A) == StringRef(B); + }); ---------------- There must be a better way to do this... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94472/new/ https://reviews.llvm.org/D94472 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits