Skip to content

Commit fff2aa6

Browse files
author
z1_cciauto
authored
merge main into amd-staging (llvm#3714)
2 parents aa3672e + c72ae4a commit fff2aa6

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

clang/lib/CodeGen/CGRecordLayoutBuilder.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,8 +1027,11 @@ void CGRecordLowering::fillOutputFields() {
10271027
if (Member.FD)
10281028
Fields[Member.FD->getCanonicalDecl()] = FieldTypes.size() - 1;
10291029
// A field without storage must be a bitfield.
1030-
if (!Member.Data)
1030+
if (!Member.Data) {
1031+
assert(Member.FD &&
1032+
"Member.Data is a nullptr so Member.FD should not be");
10311033
setBitFieldInfo(Member.FD, Member.Offset, FieldTypes.back());
1034+
}
10321035
} else if (Member.Kind == MemberInfo::Base)
10331036
NonVirtualBases[Member.RD] = FieldTypes.size() - 1;
10341037
else if (Member.Kind == MemberInfo::VBase)

llvm/lib/MC/MCAssembler.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,9 @@ const MCSymbol *MCAssembler::getBaseSymbol(const MCSymbol &Symbol) const {
353353
}
354354

355355
uint64_t MCAssembler::getSectionAddressSize(const MCSection &Sec) const {
356-
assert(HasLayout);
357-
// The size is the last fragment's end offset.
358356
const MCFragment &F = *Sec.curFragList()->Tail;
359-
return getFragmentOffset(F) + computeFragmentSize(F);
357+
assert(HasLayout && F.getKind() == MCFragment::FT_Data);
358+
return getFragmentOffset(F) + F.getSize();
360359
}
361360

362361
uint64_t MCAssembler::getSectionFileSize(const MCSection &Sec) const {

llvm/lib/ProfileData/SampleProfReader.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,16 +375,23 @@ std::error_code SampleProfileReaderText::readImpl() {
375375
StringRef FName;
376376
DenseMap<StringRef, uint64_t> TargetCountMap;
377377
uint32_t Depth, LineOffset, Discriminator;
378-
LineType LineTy;
378+
LineType LineTy = LineType::BodyProfile;
379379
uint64_t FunctionHash = 0;
380380
uint32_t Attributes = 0;
381381
bool IsFlat = false;
382382
if (!ParseLine(*LineIt, LineTy, Depth, NumSamples, LineOffset,
383383
Discriminator, FName, TargetCountMap, FunctionHash,
384384
Attributes, IsFlat)) {
385-
reportError(LineIt.line_number(),
386-
"Expected 'NUM[.NUM]: NUM[ mangled_name:NUM]*', found " +
387-
*LineIt);
385+
switch (LineTy) {
386+
case LineType::Metadata:
387+
reportError(LineIt.line_number(),
388+
"Cannot parse metadata: " + *LineIt);
389+
break;
390+
default:
391+
reportError(LineIt.line_number(),
392+
"Expected 'NUM[.NUM]: NUM[ mangled_name:NUM]*', found " +
393+
*LineIt);
394+
}
388395
return sampleprof_error::malformed;
389396
}
390397
if (LineTy != LineType::Metadata && Depth == DepthMetadata) {

mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ static bool hasAtMostOneResultFunctionOfDim(AffineMap map, int64_t dim) {
8989
}
9090
return true;
9191
}
92+
#endif // NDEBUG
9293

9394
static std::string stringifyReassocIndices(ReassociationIndicesRef ri) {
9495
return llvm::interleaved(ri, ", ", /*Prefix=*/"|", /*Suffix=*/"");
9596
}
96-
#endif // NDEBUG
9797

9898
/// Return the index of the first result of `map` that is a function of
9999
/// AffineDimExpr(dim), std::nullopt otherwise.

0 commit comments

Comments
 (0)