Skip to content

Commit 7113cd1

Browse files
committed
review: move version def from DXILABI to DXContainer
- funny how you can agree to do it one way in a meeting and then you type out the complete other way in practice. whoops
1 parent 0159366 commit 7113cd1

File tree

8 files changed

+21
-20
lines changed

8 files changed

+21
-20
lines changed

clang/include/clang/AST/Decl.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "llvm/ADT/PointerUnion.h"
4242
#include "llvm/ADT/StringRef.h"
4343
#include "llvm/ADT/iterator_range.h"
44+
#include "llvm/BinaryFormat/DXContainer.h"
4445
#include "llvm/Frontend/HLSL/HLSLRootSignature.h"
4546
#include "llvm/Support/Casting.h"
4647
#include "llvm/Support/Compiler.h"
@@ -5179,7 +5180,7 @@ class HLSLRootSignatureDecl final
51795180
llvm::hlsl::rootsig::RootElement> {
51805181
friend TrailingObjects;
51815182

5182-
llvm::dxil::RootSignatureVersion RootSigVer;
5183+
llvm::dxbc::RootSignatureVersion RootSigVer;
51835184

51845185
unsigned NumElems;
51855186

@@ -5190,19 +5191,19 @@ class HLSLRootSignatureDecl final
51905191
}
51915192

51925193
HLSLRootSignatureDecl(DeclContext *DC, SourceLocation Loc, IdentifierInfo *ID,
5193-
llvm::dxil::RootSignatureVersion RootSigVer,
5194+
llvm::dxbc::RootSignatureVersion RootSigVer,
51945195
unsigned NumElems);
51955196

51965197
public:
51975198
static HLSLRootSignatureDecl *
51985199
Create(ASTContext &C, DeclContext *DC, SourceLocation Loc, IdentifierInfo *ID,
5199-
llvm::dxil::RootSignatureVersion RootSigVer,
5200+
llvm::dxbc::RootSignatureVersion RootSigVer,
52005201
ArrayRef<llvm::hlsl::rootsig::RootElement> RootElements);
52015202

52025203
static HLSLRootSignatureDecl *CreateDeserialized(ASTContext &C,
52035204
GlobalDeclID ID);
52045205

5205-
llvm::dxil::RootSignatureVersion getVersion() const { return RootSigVer; }
5206+
llvm::dxbc::RootSignatureVersion getVersion() const { return RootSigVer; }
52065207

52075208
ArrayRef<llvm::hlsl::rootsig::RootElement> getRootElements() const {
52085209
return {getElems(), NumElems};

clang/include/clang/Basic/LangOptions.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "clang/Basic/Visibility.h"
2525
#include "llvm/ADT/FloatingPointMode.h"
2626
#include "llvm/ADT/StringRef.h"
27-
#include "llvm/Support/DXILABI.h"
27+
#include "llvm/BinaryFormat/DXContainer.h"
2828
#include "llvm/TargetParser/Triple.h"
2929
#include <optional>
3030
#include <string>
@@ -625,8 +625,8 @@ class LangOptions : public LangOptionsBase {
625625
std::string OpenACCMacroOverride;
626626

627627
/// The HLSL root signature version for dxil.
628-
llvm::dxil::RootSignatureVersion HLSLRootSigVer =
629-
llvm::dxil::RootSignatureVersion::rootsig_1_1;
628+
llvm::dxbc::RootSignatureVersion HLSLRootSigVer =
629+
llvm::dxbc::RootSignatureVersion::rootsig_1_1;
630630

631631
// Indicates if the wasm-opt binary must be ignored in the case of a
632632
// WebAssembly target.

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9294,7 +9294,7 @@ def hlsl_rootsig_ver :
92949294
Visibility<[ClangOption, CC1Option, DXCOption]>,
92959295
HelpText<"Root Signature Version">,
92969296
Values<"rootsig_1_0,rootsig_1_1">,
9297-
NormalizedValuesScope<"llvm::dxil::RootSignatureVersion">,
9297+
NormalizedValuesScope<"llvm::dxbc::RootSignatureVersion">,
92989298
NormalizedValues<["rootsig_1_0", "rootsig_1_1"]>,
92999299
MarshallingInfoEnum<LangOpts<"HLSLRootSigVer">, "rootsig_1_1">;
93009300
def hlsl_entrypoint : Option<["-"], "hlsl-entry", KIND_SEPARATE>,

clang/lib/AST/Decl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5855,13 +5855,13 @@ bool HLSLBufferDecl::buffer_decls_empty() {
58555855

58565856
HLSLRootSignatureDecl::HLSLRootSignatureDecl(
58575857
DeclContext *DC, SourceLocation Loc, IdentifierInfo *ID,
5858-
llvm::dxil::RootSignatureVersion RootSigVer, unsigned NumElems)
5858+
llvm::dxbc::RootSignatureVersion RootSigVer, unsigned NumElems)
58595859
: NamedDecl(Decl::Kind::HLSLRootSignature, DC, Loc, DeclarationName(ID)),
58605860
RootSigVer(RootSigVer), NumElems(NumElems) {}
58615861

58625862
HLSLRootSignatureDecl *HLSLRootSignatureDecl::Create(
58635863
ASTContext &C, DeclContext *DC, SourceLocation Loc, IdentifierInfo *ID,
5864-
llvm::dxil::RootSignatureVersion RootSigVer,
5864+
llvm::dxbc::RootSignatureVersion RootSigVer,
58655865
ArrayRef<llvm::hlsl::rootsig::RootElement> RootElements) {
58665866
HLSLRootSignatureDecl *RSDecl =
58675867
new (C, DC,
@@ -5878,7 +5878,7 @@ HLSLRootSignatureDecl *
58785878
HLSLRootSignatureDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {
58795879
HLSLRootSignatureDecl *Result = new (C, ID) HLSLRootSignatureDecl(
58805880
nullptr, SourceLocation(), nullptr,
5881-
/*RootSigVer*/ llvm::dxil::RootSignatureVersion::rootsig_1_0,
5881+
/*RootSigVer*/ llvm::dxbc::RootSignatureVersion::rootsig_1_0,
58825882
/*NumElems=*/0);
58835883
return Result;
58845884
}

clang/lib/AST/TextNodeDumper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,10 +3043,10 @@ void TextNodeDumper::VisitHLSLRootSignatureDecl(
30433043
dumpName(D);
30443044
OS << " version: ";
30453045
switch (D->getVersion()) {
3046-
case llvm::dxil::RootSignatureVersion::rootsig_1_0:
3046+
case llvm::dxbc::RootSignatureVersion::rootsig_1_0:
30473047
OS << "1.0";
30483048
break;
3049-
case llvm::dxil::RootSignatureVersion::rootsig_1_1:
3049+
case llvm::dxbc::RootSignatureVersion::rootsig_1_1:
30503050
OS << "1.1";
30513051
break;
30523052
}

clang/lib/CodeGen/CGHLSLRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void addDxilValVersion(StringRef ValVersionStr, llvm::Module &M) {
6666
DXILValMD->addOperand(Val);
6767
}
6868

69-
void addRootSignature(llvm::dxil::RootSignatureVersion RootSigVer,
69+
void addRootSignature(llvm::dxbc::RootSignatureVersion RootSigVer,
7070
ArrayRef<llvm::hlsl::rootsig::RootElement> Elements,
7171
llvm::Function *Fn, llvm::Module &M) {
7272
auto &Ctx = M.getContext();

llvm/include/llvm/BinaryFormat/DXContainer.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,12 @@ struct DescriptorRange : public v1::DescriptorRange {
745745
} // namespace v2
746746
} // namespace RTS0
747747

748+
// D3D_ROOT_SIGNATURE_VERSION
749+
enum class RootSignatureVersion {
750+
rootsig_1_0 = 0x1,
751+
rootsig_1_1 = 0x2,
752+
};
753+
748754
} // namespace dxbc
749755
} // namespace llvm
750756

llvm/include/llvm/Support/DXILABI.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ enum class SamplerFeedbackType : uint32_t {
9999
const unsigned MinWaveSize = 4;
100100
const unsigned MaxWaveSize = 128;
101101

102-
// D3D_ROOT_SIGNATURE_VERSION
103-
enum class RootSignatureVersion {
104-
rootsig_1_0 = 0x1,
105-
rootsig_1_1 = 0x2,
106-
};
107-
108102
} // namespace dxil
109103
} // namespace llvm
110104

0 commit comments

Comments
 (0)