Skip to content

Commit

Permalink
Fix build failures
Browse files Browse the repository at this point in the history
  • Loading branch information
s-perron committed Jan 29, 2024
1 parent fdebb74 commit fcd05e7
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions tools/clang/lib/SPIRV/SpirvEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ void forEachSpirvField(
std::function<bool(size_t spirvFieldIndex, const QualType &fieldType,
const StructType::FieldInfo &field)>
operation,
bool includeMerged) {
bool includeMerged = false) {
const auto *cxxDecl = recordType->getAsCXXRecordDecl();
const auto *recordDecl = recordType->getDecl();

Expand Down Expand Up @@ -6625,8 +6625,7 @@ SpirvInstruction *SpirvEmitter::reconstructValue(SpirvInstruction *srcVal,
reconstructValue(subSrcVal, fieldType, dstLR, loc, range));

return true;
},
false);
});

auto *result = spvBuilder.createCompositeConstruct(
valType, elements, srcVal->getSourceLocation(), range);
Expand Down Expand Up @@ -7186,8 +7185,7 @@ SpirvInstruction *SpirvEmitter::convertVectorToStruct(QualType astStructType,

assert(false && "unhandled type");
return false;
},
false);
});

return spvBuilder.createCompositeConstruct(
astStructType, members, vector->getSourceLocation(), range);
Expand Down Expand Up @@ -14709,7 +14707,7 @@ SpirvEmitter::generateFromScalars(QualType type,
[this, &elements, &scalars, layoutRule](
size_t spirvFieldIndex, const QualType &fieldType,
const StructType::FieldInfo &fieldInfo) {
elements.push_back(GenerateFromScalars(
elements.push_back(generateFromScalars(
fieldType, scalars, layoutRule));
return true;
});
Expand All @@ -14725,7 +14723,7 @@ SpirvEmitter::generateFromScalars(QualType type,

SpirvInstruction *SpirvEmitter::splatScalarToGenerate(QualType type,
SpirvInstruction *scalar,
SpirvLayoutRule rule) {
SpirvLayoutRule layoutRule) {
QualType elementType;
uint32_t elementCount = 0;
uint32_t numOfRows = 0;
Expand All @@ -14734,7 +14732,7 @@ SpirvInstruction *SpirvEmitter::splatScalarToGenerate(QualType type,
if (isScalarType(type)) {
// If the type if bool with a non-void layout rule, then it should be
// treated as a uint.
assert(rule == SpirvLayoutRule::Void &&
assert(layoutRule == SpirvLayoutRule::Void &&
"If the layout type is not void, then we should cast to an int when "
"type is a boolean.");
QualType sourceType = scalar->getAstResultType();
Expand All @@ -14753,7 +14751,7 @@ SpirvInstruction *SpirvEmitter::splatScalarToGenerate(QualType type,
std::vector<SpirvInstruction *> elements(elementCount, element);
SpirvInstruction *result = spvBuilder.createCompositeConstruct(
type, elements, scalar->getSourceLocation());
result->setLayoutRule(rule);
result->setLayoutRule(layoutRule);
return result;
} else if (isMxNMatrix(type, &elementType, &numOfRows, &numOfCols)) {
SourceLocation loc = scalar->getSourceLocation();
Expand All @@ -14767,19 +14765,19 @@ SpirvInstruction *SpirvEmitter::splatScalarToGenerate(QualType type,
QualType rowType = astContext.getExtVectorType(elementType, numOfCols);
SpirvInstruction *r =
spvBuilder.createCompositeConstruct(rowType, row, loc);
r->setLayoutRule(rule);
r->setLayoutRule(layoutRule);
std::vector<SpirvInstruction *> rows(numOfRows, r);
SpirvInstruction *result =
spvBuilder.createCompositeConstruct(type, rows, loc);
result->setLayoutRule(rule);
result->setLayoutRule(layoutRule);
return result;
} else if (isArrayType(type, &elementType, &elementCount)) {
SpirvInstruction *element =
splatScalarToGenerate(elementType, scalar, rule);
splatScalarToGenerate(elementType, scalar, layoutRule);
std::vector<SpirvInstruction *> elements(elementCount, element);
SpirvInstruction *result = spvBuilder.createCompositeConstruct(
type, elements, scalar->getSourceLocation());
result->setLayoutRule(rule);
result->setLayoutRule(layoutRule);
return result;
} else if (const RecordType *recordType = dyn_cast<RecordType>(type)) {
SourceLocation loc = scalar->getSourceLocation();
Expand All @@ -14792,13 +14790,13 @@ SpirvInstruction *SpirvEmitter::splatScalarToGenerate(QualType type,
[this, &elements, &scalar, layoutRule](
size_t spirvFieldIndex, const QualType &fieldType,
const StructType::FieldInfo &fieldInfo) {
elements.push_back(SplatScalarToGenerate(
elements.push_back(splatScalarToGenerate(
fieldType, scalar, layoutRule));
return true;
});
SpirvInstruction *result =
spvBuilder.createCompositeConstruct(type, elements, loc);
result->setLayoutRule(rule);
result->setLayoutRule(layoutRule);
return result;
} else {
llvm_unreachable("Trying to generate a type that we cannot generate");
Expand Down

0 comments on commit fcd05e7

Please sign in to comment.