jansvoboda11 added a comment.

In D96572#2561216 <https://reviews.llvm.org/D96572#2561216>, @delcypher wrote:

> @jansvoboda11 I noticed that the `Options.td` file is making use of some 
> fancy mixins that mean the option gets automatically marshalled by the 
> frontend into the codegen options :). I tried this out using the patch to 
> this patch and all my tests seem to pass. Should I be using these mixins (I 
> don't know how stable they are because this looks like a new feature). Am I 
> using them properly? It seems that the driver still has to parse the option 
> manually (which is actually what I want) but the frontend automagically 
> parses the option and modifies the right codegen option for me.

Hi, yes, this is a new feature. The option generation is not being enforced in 
any way yet, but the automatic marshalling should work. You can test it by 
running your `clang -cc1` commands with the `-round-trip-args` flag (or `clang` 
with `-Xclang -round-trip-args`). With this option, the original `cc1` command 
line is first parsed into a dummy `CompilerInvocation`, which is used to 
generate new command line. The new command line is what is then used to create 
the real `CompilerInvocation`.

As you've correctly discovered, this does not interact with the driver in any 
way.

I'll be sending an email to cfe-dev about this shortly. Your marshalling code 
seems correct to me. If something does not work, check out the patch with 
documentation D95790 <https://reviews.llvm.org/D95790> and feel free to let me 
know.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96572

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to