Vector types in hlsl is using clang ext_vector_type.
Declaration of vector types is in builtin header hlsl.h.
hlsl.h will be included by default for hlsl shader.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Basic/LangOptions.cpp | ||
---|---|---|
121 | Is this header expected to be large? You might want to flag up in the description of the review and the comments in the header itself what content is expected to be there. If the file is expected to be large it might make sense to add a flag that would disable this include. You can then for example use bare clang without this header for all the tests that don't require functionality from the header to reduce the testing time. | |
clang/test/CodeGenHLSL/basic_types.hlsl | ||
2 | Technically mapping into IR types might be target specific, so passing the triple is necessary for this test to work correctly. Alternatively you can switch to AST dump checking, however even that might be target specific in some cases. |
clang/lib/Basic/LangOptions.cpp | ||
---|---|---|
121 | It might be large when more things are added. | |
clang/test/CodeGenHLSL/basic_types.hlsl | ||
2 | The option -T lib_6_7 decides the triple. "-Tlib_6_7 -Fo -" will be translated into |
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
3490 | Sharing command line options is great, let's just update the help message straight away that this flag now also applies to HLSL: https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Driver/Options.td#L6053 |
LGTM! Thanks
Please make sure to reflect in your commit message that you are adding the clang internal headers too.
Looks like this breaks tests on Mac/arm: http://45.33.8.238/macm1/36297/step_7.txt
Please take a look and revert for now if it takes a while to fix. (Maybe the test just needs an explicit triple?)
Hi thakis,
The issue could be fixed by https://reviews.llvm.org/D125585
Could you take a look?
Thanks
Hi, this patch causes an issue with the CMake Xcode build configuration, if I try to use xcode as the generator with CMake, using the build command:
xcrun cmake -G Xcode -DCMAKE_BUILD_TYPE:STRING=Debug -DLLVM_ENABLE_ASSERTIONS:BOOL=TRUE -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DLLVM_ENABLE_PROJECTS='clang;' -DCMAKE_IGNORE_PATH="/usr/lib;/usr/local/lib;/lib" -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" ../llvm
I get:
CMake Error in /Users/shubham/Development/llvm-project/clang/lib/Headers/CMakeLists.txt: The custom command generating /Users/shubham/Development/llvm-project/build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/lib/clang/15.0.0/include/hlsl.h is attached to multiple targets: hlsl-resource-headers clang-resource-headers but none of these is a common dependency of the other(s). This is not allowed by the Xcode "new build system". CMake Error in /Users/shubham/Development/llvm-project/third-party/benchmark/CMakeLists.txt: The custom command generating /Users/shubham/Development/llvm-project/build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/lib/clang/15.0.0/include/hlsl.h is attached to multiple targets: hlsl-resource-headers clang-resource-headers but none of these is a common dependency of the other(s). This is not allowed by the Xcode "new build system". CMake Generate step failed. Build files cannot be regenerated correctly.
This is similar to the issue that was found in this patch: https://reviews.llvm.org/D123498
Hi Xiang,
I would be more than happy to test the fix for you :). Though it is 11:45 pm for me now and I am going to bed. But I can take a look tomorrow.
Thanks,
Shubham
Is this header expected to be large? You might want to flag up in the description of the review and the comments in the header itself what content is expected to be there.
If the file is expected to be large it might make sense to add a flag that would disable this include. You can then for example use bare clang without this header for all the tests that don't require functionality from the header to reduce the testing time.