Skip to content

Commit 6280cab

Browse files
committed
[NFC] Use GlobalObject::setAlignment that takes an Align in LLParser
1 parent d8153ae commit 6280cab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,8 @@ bool LLParser::parseGlobal(const std::string &Name, LocTy NameLoc,
13061306
MaybeAlign Alignment;
13071307
if (parseOptionalAlignment(Alignment))
13081308
return true;
1309-
GV->setAlignment(Alignment);
1309+
if (Alignment)
1310+
GV->setAlignment(*Alignment);
13101311
} else if (Lex.getKind() == lltok::MetadataVar) {
13111312
if (parseGlobalObjectMetadataAttachment(*GV))
13121313
return true;
@@ -6047,7 +6048,8 @@ bool LLParser::parseFunctionHeader(Function *&Fn, bool IsDefine) {
60476048
Fn->setCallingConv(CC);
60486049
Fn->setAttributes(PAL);
60496050
Fn->setUnnamedAddr(UnnamedAddr);
6050-
Fn->setAlignment(Alignment);
6051+
if (Alignment)
6052+
Fn->setAlignment(*Alignment);
60516053
Fn->setSection(Section);
60526054
Fn->setPartition(Partition);
60536055
Fn->setComdat(C);

0 commit comments

Comments
 (0)