This is an archive of the discontinued LLVM Phabricator instance.

[NFC] [DirectX backend] move ResourceClass into llvm.
ClosedPublic

Authored by python3kgae on Oct 17 2022, 11:33 PM.

Details

Summary

Move ResourceClass into llvm/Frontend/HLSL/HLSLResource.h so it could be shared between clang and DirectX backend.

Diff Detail

Event Timeline

python3kgae created this revision.Oct 17 2022, 11:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 17 2022, 11:33 PM
Herald added a subscriber: Anastasia. · View Herald Transcript
python3kgae requested review of this revision.Oct 17 2022, 11:33 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 17 2022, 11:33 PM
beanz added inline comments.Oct 20 2022, 9:31 AM
clang/lib/Sema/HLSLExternalSemaSource.cpp
20

You need to add FrontendHLSL to the Sema/CMakeLists.txt file too.

python3kgae marked an inline comment as done.Oct 20 2022, 10:19 AM
python3kgae added inline comments.
clang/lib/Sema/HLSLExternalSemaSource.cpp
20

Good catch.
Not sure why both local build and the pre-commit check cannot hit it. :(

python3kgae marked an inline comment as done.Oct 20 2022, 10:56 AM
python3kgae added inline comments.
clang/lib/Sema/HLSLExternalSemaSource.cpp
20

I think the reason it works is that it only used the enum decl in the header, not anything which needs to link.
Do we need to add FrontendHLSL to CMakeLists in this case?

beanz added inline comments.Oct 20 2022, 11:03 AM
clang/lib/Sema/HLSLExternalSemaSource.cpp
20

The first header include added to a component should add the linkage dependency (even if it isn't strictly needed).

It is too easy to add a linkage dependency later without realizing it isn't already specified. Because of how static archive linking works you don't necessarily notice the missing dependency because many of our tools link both Sema and CodeGen where there is already a dependency.

python3kgae marked an inline comment as done.

Add FrontendHLSL to Sema link

clang/lib/Sema/HLSLExternalSemaSource.cpp
20

Got it.
Updated.

beanz accepted this revision.Oct 20 2022, 11:18 AM
This revision is now accepted and ready to land.Oct 20 2022, 11:18 AM
This revision was landed with ongoing or failed builds.Oct 20 2022, 1:27 PM
This revision was automatically updated to reflect the committed changes.