[PATCH] D124751: [HLSL] Support -E option for HLSL.
Xiang Li via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 24 16:40:27 PDT 2022
python3kgae added a comment.
In D124751#3529652 <https://reviews.llvm.org/D124751#3529652>, @MaskRay wrote:
> In D124751#3513513 <https://reviews.llvm.org/D124751#3513513>, @python3kgae wrote:
>
>> In D124751#3513283 <https://reviews.llvm.org/D124751#3513283>, @MaskRay wrote:
>>
>>> Is there a specification or reference implementation stating that -E is used?
>>>
>>>> Option<["--", "/", "-"], "E",
>>>
>>> Do you need the prefix `--`? You may define something like `CLFlag`. I have missed previous patches, but if `/` options are not necessary, removing them will be the best to avoid collision with filenames starting with `/`.
>>
>> Unfortunately, '/' is necessary. dxc allow both '-' and '/' like 'CLFlag'.
>> Remove '/' means existing customers may need to change their command line to compile hlsl.
>> And add '--' feels not hurt anyone, that's why I choose to add '--' to work-around the conflict.
>
> OK. I guess you have a pre-existing implementation using `-E` and the upstreaming implementation wants to be compatible.
> I wonder why the new tool needs to reuse `clang/include/clang/Driver/Options.td`. ISTM it would be cleaner to use a new .td file.
I tried to create a DxcOptions.td which only have dxc options and core options. Then create OptTable from DxcOptions.td and use the Dxc OptTable when ParseArgs in Driver::ParseArgStrings. It works fine.
But after ParseArgs, there're lots of code in Driver::BuildCompilation use options::OPT_* enum which depends on Options.td. Cannot find a clean solution to switch to DxcOptions while share code about core options in Driver::BuildCompilation. Do you have any suggestions about how to update options::OPT_* enum after switch to new .td file?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124751/new/
https://reviews.llvm.org/D124751
More information about the cfe-commits
mailing list