================
@@ -5444,6 +5459,31 @@ QualType ASTContext::getHLSLAttributedResourceType(
 
   return QualType(Ty, 0);
 }
+
+QualType ASTContext::getHLSLInlineSpirvType(uint32_t Opcode, uint32_t Size,
+                                            uint32_t Alignment,
+                                            ArrayRef<SpirvOperand> Operands) {
+  llvm::FoldingSetNodeID ID;
+  HLSLInlineSpirvType::Profile(ID, Opcode, Size, Alignment, Operands);
+
+  void *InsertPos = nullptr;
+  HLSLInlineSpirvType *Ty =
+      HLSLInlineSpirvTypes.FindNodeOrInsertPos(ID, InsertPos);
+  if (Ty)
+    return QualType(Ty, 0);
+
+  unsigned size = sizeof(HLSLInlineSpirvType);
+  size += Operands.size() * sizeof(SpirvOperand);
+  void *mem = Allocate(size, alignof(HLSLInlineSpirvType));
+
+  Ty = new (mem) HLSLInlineSpirvType(Opcode, Size, Alignment, Operands);
----------------
cassiebeckley wrote:

Done.

https://github.com/llvm/llvm-project/pull/134034
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to