[NFC] Use GlobalObject::setAlignment that takes an Align in BitcodeReader

This commit is contained in:
Guillaume Chatelet
2023-02-01 09:34:46 +00:00
parent f559e781b2
commit 9e845fe44f

View File

@@ -3868,7 +3868,8 @@ Error BitcodeReader::parseGlobalVarRecord(ArrayRef<uint64_t> Record) {
GlobalVariable *NewGV =
new GlobalVariable(*TheModule, Ty, isConstant, Linkage, nullptr, Name,
nullptr, TLM, AddressSpace, ExternallyInitialized);
NewGV->setAlignment(Alignment);
if (Alignment)
NewGV->setAlignment(*Alignment);
if (!Section.empty())
NewGV->setSection(Section);
NewGV->setVisibility(Visibility);
@@ -4027,7 +4028,8 @@ Error BitcodeReader::parseFunctionRecord(ArrayRef<uint64_t> Record) {
MaybeAlign Alignment;
if (Error Err = parseAlignmentValue(Record[5], Alignment))
return Err;
Func->setAlignment(Alignment);
if (Alignment)
Func->setAlignment(*Alignment);
if (Record[6]) {
if (Record[6] - 1 >= SectionTable.size())
return error("Invalid ID");