Skip to content

Commit 6e9d9e1

Browse files
committed
ClangImporter: Conservatively handle new clang::HLSLInlineSpirvType type
See llvm/llvm-project#134034
1 parent 7094873 commit 6e9d9e1

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,16 @@ namespace {
429429
return Type();
430430
}
431431

432+
ImportResult
433+
VisitHLSLInlineSpirvType(const clang::HLSLInlineSpirvType *type) {
434+
Impl.addImportDiagnostic(
435+
type,
436+
Diagnostic(diag::unsupported_builtin_type, type->getTypeClassName()),
437+
clang::SourceLocation());
438+
// FIXME: (?) HLSL types are not supported in Swift.
439+
return Type();
440+
}
441+
432442
ImportResult
433443
VisitCountAttributedType(const clang::CountAttributedType *type) {
434444
return Visit(type->desugar());

lib/ClangImporter/Serializability.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ namespace {
330330
void writeTypeCoupledDeclRefInfo(clang::TypeCoupledDeclRefInfo info) {
331331
llvm_unreachable("TypeCoupledDeclRefInfo shouldn't be reached from swift");
332332
}
333+
void writeHLSLSpirvOperand(clang::SpirvOperand) {
334+
llvm_unreachable("SpirvOperand shouldn't be reached from swift");
335+
}
333336
};
334337
}
335338

lib/IRGen/GenCall.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,7 @@ namespace {
12141214

12151215
case clang::Type::ArrayParameter:
12161216
case clang::Type::HLSLAttributedResource:
1217+
case clang::Type::HLSLInlineSpirv:
12171218
llvm_unreachable("HLSL type in ABI lowering");
12181219

12191220

lib/Serialization/Deserialization.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8478,6 +8478,9 @@ class SwiftToClangBasicReader :
84788478
clang::TypeCoupledDeclRefInfo readTypeCoupledDeclRefInfo() {
84798479
llvm_unreachable("TypeCoupledDeclRefInfo shouldn't be reached from swift");
84808480
}
8481+
clang::SpirvOperand readHLSLSpirvOperand() {
8482+
llvm_unreachable("SpirvOperand shouldn't be reached from swift");
8483+
}
84818484
};
84828485

84838486
} // end anonymous namespace

lib/Serialization/Serialization.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6286,6 +6286,9 @@ class ClangToSwiftBasicWriter :
62866286
void writeTypeCoupledDeclRefInfo(clang::TypeCoupledDeclRefInfo info) {
62876287
llvm_unreachable("TypeCoupledDeclRefInfo shouldn't be reached from swift");
62886288
}
6289+
void writeHLSLSpirvOperand(clang::SpirvOperand) {
6290+
llvm_unreachable("SpirvOperand shouldn't be reached from swift");
6291+
}
62896292
};
62906293

62916294
}

0 commit comments

Comments
 (0)