Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/lib/LTO/LTO.cpp
Show First 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | Hasher.update( | ||||
ArrayRef<uint8_t>((const uint8_t *)&Linkage, sizeof(Linkage))); | ArrayRef<uint8_t>((const uint8_t *)&Linkage, sizeof(Linkage))); | ||||
AddUsedCfiGlobal(GS.first); | AddUsedCfiGlobal(GS.first); | ||||
AddUsedThings(GS.second); | AddUsedThings(GS.second); | ||||
} | } | ||||
// Imported functions may introduce new uses of type identifier resolutions, | // Imported functions may introduce new uses of type identifier resolutions, | ||||
// so we need to collect their used resolutions as well. | // so we need to collect their used resolutions as well. | ||||
for (auto &ImpM : ImportList) | for (auto &ImpM : ImportList) | ||||
for (auto &ImpF : ImpM.second) | for (auto &ImpF : ImpM.second) { | ||||
AddUsedThings(Index.findSummaryInModule(ImpF, ImpM.first())); | GlobalValueSummary *S = Index.findSummaryInModule(ImpF, ImpM.first()); | ||||
AddUsedThings(S); | |||||
// If this is an alias, we also care about any types/etc. that the aliasee | |||||
// may reference. | |||||
if (auto *AS = dyn_cast_or_null<AliasSummary>(S)) | |||||
AddUsedThings(AS->getBaseObject()); | |||||
} | |||||
auto AddTypeIdSummary = [&](StringRef TId, const TypeIdSummary &S) { | auto AddTypeIdSummary = [&](StringRef TId, const TypeIdSummary &S) { | ||||
AddString(TId); | AddString(TId); | ||||
AddUnsigned(S.TTRes.TheKind); | AddUnsigned(S.TTRes.TheKind); | ||||
AddUnsigned(S.TTRes.SizeM1BitWidth); | AddUnsigned(S.TTRes.SizeM1BitWidth); | ||||
AddUint64(S.TTRes.AlignLog2); | AddUint64(S.TTRes.AlignLog2); | ||||
▲ Show 20 Lines • Show All 1,028 Lines • Show Last 20 Lines |