This is an archive of the discontinued LLVM Phabricator instance.

[HLSL] add -D option for dxc mode.
ClosedPublic

Authored by python3kgae on May 10 2022, 2:23 PM.

Details

Summary

Create dxc_D as alias to option D which Define <macro> to <value> (or 1 if <value> omitted).

Diff Detail

Event Timeline

python3kgae created this revision.May 10 2022, 2:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2022, 2:23 PM
python3kgae requested review of this revision.May 10 2022, 2:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2022, 2:23 PM
aaron.ballman accepted this revision.May 11 2022, 4:40 AM

LGTM aside from a testing suggestion.

clang/test/Driver/dxc_D.hlsl
6

Maybe we should also test that the macro is actually defined?

This revision is now accepted and ready to land.May 11 2022, 4:40 AM

Add check for macro.

aaron.ballman accepted this revision.May 11 2022, 9:54 AM

LGTM aside from a super minor nit with the test.

clang/test/Driver/dxc_D.hlsl
14

You should add the newline back to the end of the test file. (Feel free to do that when you land the patch.)

This revision was landed with ongoing or failed builds.May 11 2022, 11:26 AM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.May 11 2022, 12:30 PM

Looks like this breaks tests on Mac: http://45.33.8.238/macm1/35103/step_7.txt

Please take a look and revert for now if it takes a while to fix.

Looks like this breaks tests on Mac: http://45.33.8.238/macm1/35103/step_7.txt

Please take a look and revert for now if it takes a while to fix.

I'll revert it. Thanks.

python3kgae reopened this revision.May 31 2022, 1:58 PM

Reopen to recover the change after fix Mac/arm test fail.

This revision is now accepted and ready to land.May 31 2022, 1:58 PM

Recover after fixed Mac/arm test fail.

This revision was automatically updated to reflect the committed changes.