[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)
Finn Plummer via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Feb 12 15:29:03 PST 2025
================
@@ -647,6 +648,40 @@ void SemaHLSL::emitLogicalOperatorFixIt(Expr *LHS, Expr *RHS,
<< NewFnName << FixItHint::CreateReplacement(FullRange, OS.str());
}
+void SemaHLSL::handleRootSignatureAttr(Decl *D, const ParsedAttr &AL) {
+ if (AL.getNumArgs() != 1)
+ return;
+
+ StringRef Signature;
+ if (!SemaRef.checkStringLiteralArgumentAttr(AL, 0, Signature))
+ return;
+
+ SourceLocation Loc = AL.getArgAsExpr(0)->getExprLoc();
+ // FIXME: pass down below to lexer when fp is supported
+ // llvm::RoundingMode RM = SemaRef.CurFPFeatures.getRoundingMode();
+ SmallVector<hlsl::RootSignatureToken> Tokens;
+ hlsl::RootSignatureLexer Lexer(Signature, Loc, SemaRef.getPreprocessor());
+ if (Lexer.Lex(Tokens))
----------------
inbelic wrote:
Correct. We will have already produced the required error messages here.
https://github.com/llvm/llvm-project/pull/123985
More information about the llvm-branch-commits
mailing list