summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2019-10-15 11:24:36 +0000
committerGuillaume Chatelet <gchatelet@google.com>2019-10-15 11:24:36 +0000
commit0e62011df891d0e7ad904524edf705d07d12d5d4 (patch)
tree382bb15747d33686e71e748a0a5508997f006803 /llvm/lib/AsmParser/LLParser.cpp
parent284827f32bd8d06ca1ab8a949bf96088612b1504 (diff)
downloadbcm5719-llvm-0e62011df891d0e7ad904524edf705d07d12d5d4.tar.gz
bcm5719-llvm-0e62011df891d0e7ad904524edf705d07d12d5d4.zip
[Alignment][NFC] Remove dependency on GlobalObject::setAlignment(unsigned)
Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Subscribers: arsenm, mehdi_amini, jvesely, nhaehnle, hiraditya, steven_wu, dexonsmith, dang, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68944 llvm-svn: 374880
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 9bb3ca145c2..7a269efec75 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -140,7 +140,7 @@ bool LLParser::ValidateEndOfModule() {
// If the alignment was parsed as an attribute, move to the alignment
// field.
if (FnAttrs.hasAlignmentAttr()) {
- Fn->setAlignment(FnAttrs.getAlignment());
+ Fn->setAlignment(MaybeAlign(FnAttrs.getAlignment()));
FnAttrs.removeAttribute(Attribute::Alignment);
}
@@ -1124,7 +1124,7 @@ bool LLParser::ParseGlobal(const std::string &Name, LocTy NameLoc,
} else if (Lex.getKind() == lltok::kw_align) {
unsigned Alignment;
if (ParseOptionalAlignment(Alignment)) return true;
- GV->setAlignment(Alignment);
+ GV->setAlignment(MaybeAlign(Alignment));
} else if (Lex.getKind() == lltok::MetadataVar) {
if (ParseGlobalObjectMetadataAttachment(*GV))
return true;
@@ -5487,7 +5487,7 @@ bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) {
Fn->setCallingConv(CC);
Fn->setAttributes(PAL);
Fn->setUnnamedAddr(UnnamedAddr);
- Fn->setAlignment(Alignment);
+ Fn->setAlignment(MaybeAlign(Alignment));
Fn->setSection(Section);
Fn->setPartition(Partition);
Fn->setComdat(C);
OpenPOWER on IntegriCloud