mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 10:06:05 +00:00
Revert D142708 "[NFC] Transition GlobalObject alignment from MaybeAlign to Align"
This is breaking the build bots. e.g., https://lab.llvm.org/buildbot/#/builders/121/builds/27549 This reverts commit 6717efe74da825214cb4d307ad35e5fbda353301.
This commit is contained in:
parent
6717efe74d
commit
e098ee726e
@ -82,12 +82,6 @@ public:
|
||||
return decodeMaybeAlign(AlignmentData);
|
||||
}
|
||||
|
||||
/// Sets the alignment attribute of the GlobalObject.
|
||||
void setAlignment(Align Align);
|
||||
|
||||
/// Sets the alignment attribute of the GlobalObject.
|
||||
/// This method will be deprecated as the alignment property should always be
|
||||
/// defined.
|
||||
void setAlignment(MaybeAlign Align);
|
||||
|
||||
unsigned getGlobalObjectSubClassData() const {
|
||||
|
@ -289,7 +289,7 @@ private:
|
||||
const Config &Conf);
|
||||
struct CommonResolution {
|
||||
uint64_t Size = 0;
|
||||
Align Align;
|
||||
MaybeAlign Align;
|
||||
/// Record if at least one instance of the common was marked as prevailing
|
||||
bool Prevailing = false;
|
||||
};
|
||||
|
@ -150,7 +150,7 @@ bool LLParser::validateEndOfModule(bool UpgradeDebugInfo) {
|
||||
// If the alignment was parsed as an attribute, move to the alignment
|
||||
// field.
|
||||
if (MaybeAlign A = FnAttrs.getAlignment()) {
|
||||
Fn->setAlignment(*A);
|
||||
Fn->setAlignment(A);
|
||||
FnAttrs.removeAttribute(Attribute::Alignment);
|
||||
}
|
||||
|
||||
@ -6047,7 +6047,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);
|
||||
|
@ -127,16 +127,6 @@ void GlobalObject::setAlignment(MaybeAlign Align) {
|
||||
assert(getAlign() == Align && "Alignment representation error!");
|
||||
}
|
||||
|
||||
void GlobalObject::setAlignment(Align Align) {
|
||||
assert(Align <= MaximumAlignment &&
|
||||
"Alignment is greater than MaximumAlignment!");
|
||||
unsigned AlignmentData = encode(Align);
|
||||
unsigned OldData = getGlobalValueSubClassData();
|
||||
setGlobalValueSubClassData((OldData & ~AlignmentMask) | AlignmentData);
|
||||
assert(getAlign() && *getAlign() == Align &&
|
||||
"Alignment representation error!");
|
||||
}
|
||||
|
||||
void GlobalObject::copyAttributesFrom(const GlobalObject *Src) {
|
||||
GlobalValue::copyAttributesFrom(Src);
|
||||
setAlignment(Src->getAlign());
|
||||
|
@ -839,7 +839,8 @@ LTO::addRegularLTO(BitcodeModule BM, ArrayRef<InputFile::Symbol> Syms,
|
||||
auto &CommonRes = RegularLTO.Commons[std::string(Sym.getIRName())];
|
||||
CommonRes.Size = std::max(CommonRes.Size, Sym.getCommonSize());
|
||||
if (uint32_t SymAlignValue = Sym.getCommonAlignment()) {
|
||||
CommonRes.Align = std::max(Align(SymAlignValue), CommonRes.Align);
|
||||
const Align SymAlign(SymAlignValue);
|
||||
CommonRes.Align = std::max(SymAlign, CommonRes.Align.valueOrOne());
|
||||
}
|
||||
CommonRes.Prevailing |= Res.Prevailing;
|
||||
}
|
||||
|
@ -3300,7 +3300,7 @@ struct AAHeapToSharedFunction : public AAHeapToShared {
|
||||
MaybeAlign Alignment = CB->getRetAlign();
|
||||
assert(Alignment &&
|
||||
"HeapToShared on allocation without alignment attribute");
|
||||
SharedMem->setAlignment(*Alignment);
|
||||
SharedMem->setAlignment(MaybeAlign(Alignment));
|
||||
|
||||
A.changeAfterManifest(IRPosition::callsite_returned(*CB), *NewBuffer);
|
||||
A.deleteAfterManifest(*CB);
|
||||
|
@ -2306,7 +2306,7 @@ bool ModuleAddressSanitizer::InstrumentGlobals(IRBuilder<> &IRB, Module &M,
|
||||
G->getThreadLocalMode(), G->getAddressSpace());
|
||||
NewGlobal->copyAttributesFrom(G);
|
||||
NewGlobal->setComdat(G->getComdat());
|
||||
NewGlobal->setAlignment(Align(getMinRedzoneSizeForGlobal()));
|
||||
NewGlobal->setAlignment(MaybeAlign(getMinRedzoneSizeForGlobal()));
|
||||
// Don't fold globals with redzones. ODR violation detector and redzone
|
||||
// poisoning implicitly creates a dependence on the global's address, so it
|
||||
// is no longer valid for it to be marked unnamed_addr.
|
||||
|
Loading…
x
Reference in New Issue
Block a user