Skip to content

Commit 2d72752

Browse files
committed
Revert "[HLSL][RootSignature] Define and integrate rootsig clang attr and decl"
Reverts llvm#137690 - there is a build warning (treated as erorr) that `SignatureDecl` is unused, which is correct as it was not removed from prototyping
1 parent dd3d7cf commit 2d72752

File tree

23 files changed

+0
-347
lines changed

23 files changed

+0
-347
lines changed

clang/include/clang/AST/Decl.h

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include "llvm/ADT/PointerUnion.h"
4242
#include "llvm/ADT/StringRef.h"
4343
#include "llvm/ADT/iterator_range.h"
44-
#include "llvm/Frontend/HLSL/HLSLRootSignature.h"
4544
#include "llvm/Support/Casting.h"
4645
#include "llvm/Support/Compiler.h"
4746
#include "llvm/Support/TrailingObjects.h"
@@ -5179,42 +5178,6 @@ class HLSLBufferDecl final : public NamedDecl, public DeclContext {
51795178
friend class ASTDeclWriter;
51805179
};
51815180

5182-
class HLSLRootSignatureDecl final
5183-
: public NamedDecl,
5184-
private llvm::TrailingObjects<HLSLRootSignatureDecl,
5185-
llvm::hlsl::rootsig::RootElement> {
5186-
friend TrailingObjects;
5187-
5188-
unsigned NumElems;
5189-
5190-
llvm::hlsl::rootsig::RootElement *getElems() {
5191-
return getTrailingObjects<llvm::hlsl::rootsig::RootElement>();
5192-
}
5193-
5194-
const llvm::hlsl::rootsig::RootElement *getElems() const {
5195-
return getTrailingObjects<llvm::hlsl::rootsig::RootElement>();
5196-
}
5197-
5198-
HLSLRootSignatureDecl(DeclContext *DC, SourceLocation Loc, IdentifierInfo *ID,
5199-
unsigned NumElems);
5200-
5201-
public:
5202-
static HLSLRootSignatureDecl *
5203-
Create(ASTContext &C, DeclContext *DC, SourceLocation Loc, IdentifierInfo *ID,
5204-
ArrayRef<llvm::hlsl::rootsig::RootElement> RootElements);
5205-
5206-
static HLSLRootSignatureDecl *CreateDeserialized(ASTContext &C,
5207-
GlobalDeclID ID);
5208-
5209-
ArrayRef<llvm::hlsl::rootsig::RootElement> getRootElements() const {
5210-
return {getElems(), NumElems};
5211-
}
5212-
5213-
// Implement isa/cast/dyncast/etc.
5214-
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
5215-
static bool classofKind(Kind K) { return K == HLSLRootSignature; }
5216-
};
5217-
52185181
/// Insertion operator for diagnostics. This allows sending NamedDecl's
52195182
/// into a diagnostic with <<.
52205183
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD,

clang/include/clang/AST/RecursiveASTVisitor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,8 +1599,6 @@ DEF_TRAVERSE_DECL(EmptyDecl, {})
15991599

16001600
DEF_TRAVERSE_DECL(HLSLBufferDecl, {})
16011601

1602-
DEF_TRAVERSE_DECL(HLSLRootSignatureDecl, {})
1603-
16041602
DEF_TRAVERSE_DECL(LifetimeExtendedTemporaryDecl, {
16051603
TRY_TO(TraverseStmt(D->getTemporaryExpr()));
16061604
})

clang/include/clang/AST/TextNodeDumper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,6 @@ class TextNodeDumper
408408
void
409409
VisitLifetimeExtendedTemporaryDecl(const LifetimeExtendedTemporaryDecl *D);
410410
void VisitHLSLBufferDecl(const HLSLBufferDecl *D);
411-
void VisitHLSLRootSignatureDecl(const HLSLRootSignatureDecl *D);
412411
void VisitHLSLOutArgExpr(const HLSLOutArgExpr *E);
413412
void VisitOpenACCConstructStmt(const OpenACCConstructStmt *S);
414413
void VisitOpenACCLoopConstruct(const OpenACCLoopConstruct *S);

clang/include/clang/Basic/Attr.td

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4735,17 +4735,6 @@ def Error : InheritableAttr {
47354735
let Documentation = [ErrorAttrDocs];
47364736
}
47374737

4738-
/// HLSL Root Signature Attribute
4739-
def RootSignature : Attr {
4740-
/// [RootSignature(Signature)]
4741-
let Spellings = [Microsoft<"RootSignature">];
4742-
let Args = [IdentifierArgument<"Signature">];
4743-
let Subjects = SubjectList<[Function],
4744-
ErrorDiag, "'function'">;
4745-
let LangOpts = [HLSL];
4746-
let Documentation = [RootSignatureDocs];
4747-
}
4748-
47494738
def HLSLNumThreads: InheritableAttr {
47504739
let Spellings = [Microsoft<"numthreads">];
47514740
let Args = [IntArgument<"X">, IntArgument<"Y">, IntArgument<"Z">];

clang/include/clang/Basic/AttrDocs.td

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8195,17 +8195,6 @@ and https://microsoft.github.io/hlsl-specs/proposals/0013-wave-size-range.html
81958195
}];
81968196
}
81978197

8198-
def RootSignatureDocs : Documentation {
8199-
let Category = DocCatFunction;
8200-
let Content = [{
8201-
The ``RootSignature`` attribute applies to HLSL entry functions to define what
8202-
types of resources are bound to the graphics pipeline.
8203-
8204-
For details about the use and specification of Root Signatures please see here:
8205-
https://learn.microsoft.com/en-us/windows/win32/direct3d12/root-signatures
8206-
}];
8207-
}
8208-
82098198
def NumThreadsDocs : Documentation {
82108199
let Category = DocCatFunction;
82118200
let Content = [{

clang/include/clang/Basic/DeclNodes.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,5 @@ def Empty : DeclNode<Decl>;
111111
def RequiresExprBody : DeclNode<Decl>, DeclContext;
112112
def LifetimeExtendedTemporary : DeclNode<Decl>;
113113
def HLSLBuffer : DeclNode<Named, "HLSLBuffer">, DeclContext;
114-
def HLSLRootSignature : DeclNode<Named, "HLSLRootSignature">;
115114
def OpenACCDeclare : DeclNode<Decl, "#pragma acc declare">;
116115
def OpenACCRoutine : DeclNode<Decl, "#pragma acc routine">;

clang/include/clang/Parse/Parser.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3093,7 +3093,6 @@ class Parser : public CodeCompletionHandler {
30933093
return AttrsParsed;
30943094
}
30953095
void ParseMicrosoftUuidAttributeArgs(ParsedAttributes &Attrs);
3096-
void ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs);
30973096
void ParseMicrosoftAttributes(ParsedAttributes &Attrs);
30983097
bool MaybeParseMicrosoftDeclSpecs(ParsedAttributes &Attrs) {
30993098
if (getLangOpts().DeclSpecKeyword && Tok.is(tok::kw___declspec)) {

clang/include/clang/Sema/SemaHLSL.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ class SemaHLSL : public SemaBase {
119119
bool IsCompAssign);
120120
void emitLogicalOperatorFixIt(Expr *LHS, Expr *RHS, BinaryOperatorKind Opc);
121121

122-
void handleRootSignatureAttr(Decl *D, const ParsedAttr &AL);
123122
void handleNumThreadsAttr(Decl *D, const ParsedAttr &AL);
124123
void handleWaveSizeAttr(Decl *D, const ParsedAttr &AL);
125124
void handleSV_DispatchThreadIDAttr(Decl *D, const ParsedAttr &AL);

clang/lib/AST/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ set(LLVM_LINK_COMPONENTS
22
BinaryFormat
33
Core
44
FrontendOpenMP
5-
FrontendHLSL
65
Support
76
TargetParser
87
)

clang/lib/AST/Decl.cpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5847,38 +5847,6 @@ bool HLSLBufferDecl::buffer_decls_empty() {
58475847
return DefaultBufferDecls.empty() && decls_empty();
58485848
}
58495849

5850-
//===----------------------------------------------------------------------===//
5851-
// HLSLRootSignatureDecl Implementation
5852-
//===----------------------------------------------------------------------===//
5853-
5854-
HLSLRootSignatureDecl::HLSLRootSignatureDecl(DeclContext *DC,
5855-
SourceLocation Loc,
5856-
IdentifierInfo *ID,
5857-
unsigned NumElems)
5858-
: NamedDecl(Decl::Kind::HLSLRootSignature, DC, Loc, DeclarationName(ID)),
5859-
NumElems(NumElems) {}
5860-
5861-
HLSLRootSignatureDecl *HLSLRootSignatureDecl::Create(
5862-
ASTContext &C, DeclContext *DC, SourceLocation Loc, IdentifierInfo *ID,
5863-
ArrayRef<llvm::hlsl::rootsig::RootElement> RootElements) {
5864-
HLSLRootSignatureDecl *RSDecl =
5865-
new (C, DC,
5866-
additionalSizeToAlloc<llvm::hlsl::rootsig::RootElement>(
5867-
RootElements.size()))
5868-
HLSLRootSignatureDecl(DC, Loc, ID, RootElements.size());
5869-
auto *StoredElems = RSDecl->getElems();
5870-
std::uninitialized_copy(RootElements.begin(), RootElements.end(),
5871-
StoredElems);
5872-
return RSDecl;
5873-
}
5874-
5875-
HLSLRootSignatureDecl *
5876-
HLSLRootSignatureDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {
5877-
HLSLRootSignatureDecl *Result = new (C, ID)
5878-
HLSLRootSignatureDecl(nullptr, SourceLocation(), nullptr, /*NumElems=*/0);
5879-
return Result;
5880-
}
5881-
58825850
//===----------------------------------------------------------------------===//
58835851
// ImportDecl Implementation
58845852
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)