[PATCH] D128462: [HLSL] add -I option for dxc mode.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 12:27:21 PDT 2022


kadircet added a comment.

BTW, I am not sure when the new DXC driver mode was introduced but ATM it isn't properly handled by clang-tooling APIs, especially clangd. As the logic there wasn't updated accordingly, and it also resulted in regressions for clang-cl mode. I've sent out https://reviews.llvm.org/D133962 to remedy the regressions at least (which needs to be cherry-picked into next minor release I am afraid).
This is actually probably causing bigger troubles at the moment as a file that starts with `/I` will actually be treated as an include search path, rather than the input of the compilation, in places where CLDXC flags aren't excluded.

It would be nice to monitor new driver mode introductions to make sure they're not making the logic more complicated, as parsing needs to happen in other places as well (clangd, lld, lldb and a bunch of other tools parse compile flags themselves) and this logic gets duplicated into those places because driver doesn't have a public interface that exposes this (mostly because `getIncludeExcludeOptionFlagMasks` is complicated, and it's more complicated after this new driver mode).
Not supporting new driver modes in those tools, unless explicitly implemented, is probably OK, but it's really unfortunate that they'll break silently (due to changes similar to this). Because even if we were to test for all of the existing flags in those tools, we can't really test for possible flags that might be added in the future, which might all of a sudden change a filename to a command line option as seen here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128462



More information about the cfe-commits mailing list