================
@@ -1832,6 +1832,48 @@ ExpectedType 
clang::ASTNodeImporter::VisitHLSLAttributedResourceType(
       ToWrappedType, ToContainedType, ToAttrs);
 }
 
+ExpectedType clang::ASTNodeImporter::VisitHLSLInlineSpirvType(
+    const clang::HLSLInlineSpirvType *T) {
+  Error Err = Error::success();
+
+  uint32_t ToOpcode = T->getOpcode();
+  uint32_t ToSize = T->getSize();
+  uint32_t ToAlignment = T->getAlignment();
+
+  size_t NumOperands = T->getOperands().size();
+
+  llvm::SmallVector<SpirvOperand> ToOperands;
+
+  size_t I = 0;
+  for (auto &Operand : T->getOperands()) {
+    using SpirvOperandKind = SpirvOperand::SpirvOperandKind;
+
+    switch (Operand.getKind()) {
+    case SpirvOperandKind::kConstantId:
+      ToOperands.push_back(SpirvOperand::createConstant(
+          importChecked(Err, Operand.getResultType()), Operand.getValue()));
+      break;
+    case SpirvOperandKind::kLiteral:
+      ToOperands.push_back(SpirvOperand::createLiteral(Operand.getValue()));
+      break;
+    case SpirvOperandKind::kTypeId:
+      ToOperands.push_back(SpirvOperand::createType(
+          importChecked(Err, Operand.getResultType())));
+      break;
+    default:
+      llvm_unreachable("Invalid SpirvOperand kind");
+    }
+
+    if (Err)
+      return std::move(Err);
+  }
+
+  assert(I == NumOperands);
----------------
cassiebeckley wrote:

No, it is not. This is a remnant of an older approach that I was using, which 
was replaced. I'll remove the assert; I'm not sure why it wasn't already 
failing.

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