Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions clang/lib/Sema/SemaHLSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1908,9 +1908,11 @@ void SemaHLSL::diagnoseSystemSemanticAttr(Decl *D, const ParsedAttr &AL,
}

void SemaHLSL::handleSemanticAttr(Decl *D, const ParsedAttr &AL) {
uint32_t IndexValue, ExplicitIndex;
SemaRef.checkUInt32Argument(AL, AL.getArgAsExpr(0), IndexValue);
SemaRef.checkUInt32Argument(AL, AL.getArgAsExpr(1), ExplicitIndex);
uint32_t IndexValue(0), ExplicitIndex(0);
if (!SemaRef.checkUInt32Argument(AL, AL.getArgAsExpr(0), IndexValue) ||
!SemaRef.checkUInt32Argument(AL, AL.getArgAsExpr(1), ExplicitIndex)) {
assert(0 && "HLSLUnparsedSemantic is expected to have 2 int arguments.");
}
assert(IndexValue > 0 ? ExplicitIndex : true);
std::optional<unsigned> Index =
ExplicitIndex ? std::optional<unsigned>(IndexValue) : std::nullopt;
Expand Down