Skip to content

Commit 73e8d67

Browse files
authored
Revert "[HLSL][RootSignature] Define and integrate HLSLRootSignatureAttr" (#134273)
Reverts #134124 The build is failing again to a linking error: [here](#134124 (comment)). Again the error was not present locally or any of the pre-merge builds and must have been transitively linked in these build environments...
1 parent 2190808 commit 73e8d67

File tree

8 files changed

+0
-103
lines changed

8 files changed

+0
-103
lines changed

clang/include/clang/AST/Attr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "clang/Basic/SourceLocation.h"
2727
#include "clang/Support/Compiler.h"
2828
#include "llvm/Frontend/HLSL/HLSLResource.h"
29-
#include "llvm/Frontend/HLSL/HLSLRootSignature.h"
3029
#include "llvm/Support/CodeGen.h"
3130
#include "llvm/Support/ErrorHandling.h"
3231
#include "llvm/Support/VersionTuple.h"

clang/include/clang/Basic/Attr.td

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4710,25 +4710,6 @@ def Error : InheritableAttr {
47104710
let Documentation = [ErrorAttrDocs];
47114711
}
47124712

4713-
def HLSLRootSignature : Attr {
4714-
/// [RootSignature(Signature)]
4715-
let Spellings = [Microsoft<"RootSignature">];
4716-
let Args = [StringArgument<"Signature">];
4717-
let Subjects = SubjectList<[Function],
4718-
ErrorDiag, "'function'">;
4719-
let LangOpts = [HLSL];
4720-
let Documentation = [HLSLRootSignatureDocs];
4721-
let AdditionalMembers = [{
4722-
private:
4723-
ArrayRef<llvm::hlsl::rootsig::RootElement> RootElements;
4724-
public:
4725-
void setElements(ArrayRef<llvm::hlsl::rootsig::RootElement> Elements) {
4726-
RootElements = Elements;
4727-
}
4728-
auto getElements() const { return RootElements; }
4729-
}];
4730-
}
4731-
47324713
def HLSLNumThreads: InheritableAttr {
47334714
let Spellings = [Microsoft<"numthreads">];
47344715
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
@@ -8145,17 +8145,6 @@ and https://microsoft.github.io/hlsl-specs/proposals/0013-wave-size-range.html
81458145
}];
81468146
}
81478147

8148-
def HLSLRootSignatureDocs : Documentation {
8149-
let Category = DocCatFunction;
8150-
let Content = [{
8151-
The ``RootSignature`` attribute applies to HLSL entry functions to define what
8152-
types of resources are bound to the graphics pipeline.
8153-
8154-
For details about the use and specification of Root Signatures please see here:
8155-
https://learn.microsoft.com/en-us/windows/win32/direct3d12/root-signatures
8156-
}];
8157-
}
8158-
81598148
def NumThreadsDocs : Documentation {
81608149
let Category = DocCatFunction;
81618150
let Content = [{

clang/include/clang/Sema/SemaHLSL.h

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

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

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7498,9 +7498,6 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL,
74987498
break;
74997499

75007500
// HLSL attributes:
7501-
case ParsedAttr::AT_HLSLRootSignature:
7502-
S.HLSL().handleRootSignatureAttr(D, AL);
7503-
break;
75047501
case ParsedAttr::AT_HLSLNumThreads:
75057502
S.HLSL().handleNumThreadsAttr(D, AL);
75067503
break;

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "clang/Basic/SourceLocation.h"
2929
#include "clang/Basic/Specifiers.h"
3030
#include "clang/Basic/TargetInfo.h"
31-
#include "clang/Parse/ParseHLSLRootSignature.h"
3231
#include "clang/Sema/Initialization.h"
3332
#include "clang/Sema/ParsedAttr.h"
3433
#include "clang/Sema/Sema.h"
@@ -942,40 +941,6 @@ void SemaHLSL::emitLogicalOperatorFixIt(Expr *LHS, Expr *RHS,
942941
<< NewFnName << FixItHint::CreateReplacement(FullRange, OS.str());
943942
}
944943

945-
void SemaHLSL::handleRootSignatureAttr(Decl *D, const ParsedAttr &AL) {
946-
if (AL.getNumArgs() != 1) {
947-
Diag(AL.getLoc(), diag::err_attribute_wrong_number_arguments) << AL << 1;
948-
return;
949-
}
950-
951-
StringRef Signature;
952-
if (!SemaRef.checkStringLiteralArgumentAttr(AL, 0, Signature))
953-
return;
954-
955-
SourceLocation Loc = AL.getArgAsExpr(0)->getExprLoc();
956-
// TODO(#126565): pass down below to lexer when fp is supported
957-
// llvm::RoundingMode RM = SemaRef.CurFPFeatures.getRoundingMode();
958-
hlsl::RootSignatureLexer Lexer(Signature, Loc);
959-
SmallVector<llvm::hlsl::rootsig::RootElement> Elements;
960-
hlsl::RootSignatureParser Parser(Elements, Lexer, SemaRef.getPreprocessor());
961-
962-
if (Parser.parse())
963-
return;
964-
965-
// Allocate elements onto AST context
966-
unsigned N = Elements.size();
967-
auto RootElements = MutableArrayRef<llvm::hlsl::rootsig::RootElement>(
968-
::new (getASTContext()) llvm::hlsl::rootsig::RootElement[N], N);
969-
for (unsigned I = 0; I < N; ++I)
970-
RootElements[I] = Elements[I];
971-
972-
// Set elements
973-
auto *Result = ::new (getASTContext())
974-
HLSLRootSignatureAttr(getASTContext(), AL, Signature);
975-
Result->setElements(ArrayRef<llvm::hlsl::rootsig::RootElement>(RootElements));
976-
D->addAttr(Result);
977-
}
978-
979944
void SemaHLSL::handleNumThreadsAttr(Decl *D, const ParsedAttr &AL) {
980945
llvm::VersionTuple SMVersion =
981946
getASTContext().getTargetInfo().getTriple().getOSVersion();

clang/test/AST/HLSL/RootSignatures-AST.hlsl

Lines changed: 0 additions & 24 deletions
This file was deleted.

clang/test/SemaHLSL/RootSignature-err.hlsl

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)