================
@@ -568,15 +588,21 @@ void createHostLayoutStructForBuffer(Sema &S,
HLSLBufferDecl *BufDecl) {
VD->getType().getAddressSpace() == LangAS::hlsl_groupshared)
continue;
const Type *Ty = VD->getType()->getUnqualifiedDesugaredType();
+
+ QualType NewTy;
if (FieldDecl *FD =
createFieldForHostLayoutStruct(S, Ty, VD->getIdentifier(), LS)) {
// add the field decl to the layout struct
LS->addDecl(FD);
// update address space of the original decl to hlsl_constant
- QualType NewTy =
- AST.getAddrSpaceQualType(VD->getType(), LangAS::hlsl_constant);
- VD->setType(NewTy);
+ NewTy = AST.getAddrSpaceQualType(VD->getType(), LangAS::hlsl_constant);
+ } else {
+ // Declarations in default cbuffer $Globals had the address space set to
----------------
bob80905 wrote:
Just curious, is there an argument to be made here that such declarations
should never have had their address space set to hlsl_constant? Should this
kind of validation be moved earlier? Or is it impossible to know before this
point? Seems odd to me we're removing something that was added invalidly before.
https://github.com/llvm/llvm-project/pull/184276
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits