@@ -871,9 +871,11 @@ void SPIRVProducerPass::outputHeader() {
871
871
case SPIRVVersion::SPIRV_1_6:
872
872
minor = 6 ;
873
873
break ;
874
+ #if !defined(__clang__)
874
875
default :
875
876
llvm_unreachable (" unhandled spir-v version" );
876
877
break ;
878
+ #endif
877
879
}
878
880
uint32_t version = (1 << 16 ) | (minor << 8 );
879
881
binaryOut->write (reinterpret_cast <const char *>(&version), sizeof (version));
@@ -1216,6 +1218,7 @@ void SPIRVProducerPass::FindTypesForResourceVars() {
1216
1218
for (auto *elem_ty : cast<StructType>(type)->elements ()) {
1217
1219
work_list.push_back (elem_ty);
1218
1220
}
1221
+ break ;
1219
1222
default :
1220
1223
// This type and its contained types don't get layout.
1221
1224
break ;
@@ -1330,8 +1333,10 @@ SPIRVProducerPass::GetStorageClassForArgKind(clspv::ArgKind arg_kind) const {
1330
1333
case clspv::ArgKind::StorageImage:
1331
1334
case clspv::ArgKind::Sampler:
1332
1335
return spv::StorageClassUniformConstant;
1336
+ #if !defined(__clang__)
1333
1337
default :
1334
1338
llvm_unreachable (" Unsupported storage class for argument kind" );
1339
+ #endif
1335
1340
}
1336
1341
}
1337
1342
@@ -3323,8 +3328,8 @@ SPIRVProducerPass::GenerateImageInstruction(CallInst *Call,
3323
3328
const FunctionInfo &FuncInfo) {
3324
3329
SPIRVID RID;
3325
3330
3326
- auto GetExtendMask = [this ](Type *sample_type,
3327
- bool is_int_image) -> uint32_t {
3331
+ auto GetExtendMask = [](Type *sample_type,
3332
+ bool is_int_image) -> uint32_t {
3328
3333
if (SpvVersion () >= SPIRVVersion::SPIRV_1_4 &&
3329
3334
sample_type->getScalarType ()->isIntegerTy ()) {
3330
3335
if (is_int_image)
@@ -4010,7 +4015,7 @@ SPIRVID SPIRVProducerPass::GenerateInstructionFromCall(CallInst *Call) {
4010
4015
// Generate one more instruction that uses the result of the extended
4011
4016
// instruction. Its result id is one more than the id of the
4012
4017
// extended instruction.
4013
- auto generate_extra_inst = [this , &Context, & Call,
4018
+ auto generate_extra_inst = [this , &Call,
4014
4019
&RID](spv::Op opcode, Constant *constant) {
4015
4020
//
4016
4021
// Generate instruction like:
@@ -4974,7 +4979,7 @@ void SPIRVProducerPass::HandleDeferredInstruction() {
4974
4979
SPIRVInstruction *Placeholder = DeferredInsts[i].second ;
4975
4980
SPIRVOperandVec Operands;
4976
4981
4977
- auto nextDeferred = [&i, &Inst, & DeferredInsts, &Placeholder]() {
4982
+ auto nextDeferred = [&i, &DeferredInsts, &Placeholder]() {
4978
4983
++i;
4979
4984
assert (DeferredInsts.size () > i);
4980
4985
assert (Inst == DeferredInsts[i].first );
@@ -5456,10 +5461,12 @@ void SPIRVProducerPass::WriteWordCountAndOpcode(const SPIRVInstruction &Inst) {
5456
5461
void SPIRVProducerPass::WriteOperand (const SPIRVOperand &Op) {
5457
5462
SPIRVOperandType OpTy = Op.getType ();
5458
5463
switch (OpTy) {
5464
+ #if !defined(__clang__)
5459
5465
default : {
5460
5466
llvm_unreachable (" Unsupported SPIRV Operand Type???" );
5461
5467
break ;
5462
5468
}
5469
+ #endif
5463
5470
case SPIRVOperandType::NUMBERID: {
5464
5471
WriteOneWord (Op.getNumID ());
5465
5472
break ;
@@ -6501,9 +6508,11 @@ void SPIRVProducerPass::AddArgumentReflection(
6501
6508
case clspv::ArgKind::Sampler:
6502
6509
ext_inst = reflection::ExtInstArgumentSampler;
6503
6510
break ;
6511
+ #if !defined(__clang__)
6504
6512
default :
6505
6513
llvm_unreachable (" Unhandled argument reflection" );
6506
6514
break ;
6515
+ #endif
6507
6516
}
6508
6517
Ops << ext_inst << kernel_decl << getSPIRVInt32Constant (ordinal);
6509
6518
0 commit comments