From 6280cab0fe21682acd048e817f6b3d7c0590944a Mon Sep 17 00:00:00 2001 From: Guillaume Chatelet Date: Wed, 1 Feb 2023 09:13:57 +0000 Subject: [PATCH] [NFC] Use GlobalObject::setAlignment that takes an Align in LLParser --- llvm/lib/AsmParser/LLParser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 65b5825..f23e5f4 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -1306,7 +1306,8 @@ bool LLParser::parseGlobal(const std::string &Name, LocTy NameLoc, MaybeAlign Alignment; if (parseOptionalAlignment(Alignment)) return true; - GV->setAlignment(Alignment); + if (Alignment) + GV->setAlignment(*Alignment); } else if (Lex.getKind() == lltok::MetadataVar) { if (parseGlobalObjectMetadataAttachment(*GV)) return true; @@ -6047,7 +6048,8 @@ bool LLParser::parseFunctionHeader(Function *&Fn, bool IsDefine) { Fn->setCallingConv(CC); Fn->setAttributes(PAL); Fn->setUnnamedAddr(UnnamedAddr); - Fn->setAlignment(Alignment); + if (Alignment) + Fn->setAlignment(*Alignment); Fn->setSection(Section); Fn->setPartition(Partition); Fn->setComdat(C); -- 2.7.4