@@ -174,19 +174,17 @@ class SemaHLSL : public SemaBase {
174
174
bool handleResourceTypeAttr (QualType T, const ParsedAttr &AL);
175
175
176
176
template <typename T>
177
- T *createSemanticAttr (const AttributeCommonInfo &ACI, Decl *TargetDecl,
177
+ T *createSemanticAttr (const AttributeCommonInfo &ACI, NamedDecl *TargetDecl,
178
178
std::optional<unsigned > Location) {
179
- T *Attr = ::new (getASTContext ()) T (getASTContext (), ACI);
179
+ T *Attr =
180
+ ::new (getASTContext ()) T (getASTContext (), ACI, TargetDecl,
181
+ Location.value_or (0 ), Location.has_value ());
180
182
181
- if (Attr->isSemanticIndexable ())
182
- Attr->setSemanticIndex (Location ? *Location : 0 );
183
- else if (Location.has_value ()) {
183
+ if (!Attr->isSemanticIndexable () && Location.has_value ()) {
184
184
Diag (Attr->getLocation (), diag::err_hlsl_semantic_indexing_not_supported)
185
185
<< Attr->getAttrName ()->getName ();
186
186
return nullptr ;
187
187
}
188
-
189
- Attr->setTargetDecl (TargetDecl);
190
188
return Attr;
191
189
}
192
190
@@ -258,7 +256,7 @@ class SemaHLSL : public SemaBase {
258
256
void checkSemanticAnnotation (FunctionDecl *EntryPoint, const Decl *Param,
259
257
const HLSLSemanticAttr *SemanticAttr);
260
258
HLSLSemanticAttr *createSemantic (const SemanticInfo &Semantic,
261
- Decl *TargetDecl);
259
+ DeclaratorDecl *TargetDecl);
262
260
bool determineActiveSemanticOnScalar (FunctionDecl *FD, DeclaratorDecl *D,
263
261
SemanticInfo &ActiveSemantic);
264
262
bool determineActiveSemantic (FunctionDecl *FD, DeclaratorDecl *D,
0 commit comments