Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/LTO/LTO.cpp
Show First 20 Lines • Show All 833 Lines • ▼ Show 20 Lines | for (const InputFile::Symbol &Sym : Syms) { | ||||
// We also record if we see an instance of a common as prevailing, so that | // We also record if we see an instance of a common as prevailing, so that | ||||
// if none is prevailing we can ignore it later. | // if none is prevailing we can ignore it later. | ||||
if (Sym.isCommon()) { | if (Sym.isCommon()) { | ||||
// FIXME: We should figure out what to do about commons defined by asm. | // FIXME: We should figure out what to do about commons defined by asm. | ||||
// For now they aren't reported correctly by ModuleSymbolTable. | // For now they aren't reported correctly by ModuleSymbolTable. | ||||
auto &CommonRes = RegularLTO.Commons[std::string(Sym.getIRName())]; | auto &CommonRes = RegularLTO.Commons[std::string(Sym.getIRName())]; | ||||
CommonRes.Size = std::max(CommonRes.Size, Sym.getCommonSize()); | CommonRes.Size = std::max(CommonRes.Size, Sym.getCommonSize()); | ||||
if (uint32_t SymAlignValue = Sym.getCommonAlignment()) { | if (uint32_t SymAlignValue = Sym.getCommonAlignment()) { | ||||
const Align SymAlign(SymAlignValue); | CommonRes.Align = std::max(Align(SymAlignValue), CommonRes.Align); | ||||
CommonRes.Align = std::max(SymAlign, CommonRes.Align.valueOrOne()); | |||||
} | } | ||||
CommonRes.Prevailing |= Res.Prevailing; | CommonRes.Prevailing |= Res.Prevailing; | ||||
} | } | ||||
} | } | ||||
if (!M.getComdatSymbolTable().empty()) | if (!M.getComdatSymbolTable().empty()) | ||||
for (GlobalValue &GV : M.global_values()) | for (GlobalValue &GV : M.global_values()) | ||||
handleNonPrevailingComdat(GV, NonPrevailingComdats); | handleNonPrevailingComdat(GV, NonPrevailingComdats); | ||||
▲ Show 20 Lines • Show All 847 Lines • Show Last 20 Lines |