Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
Show First 20 Lines • Show All 616 Lines • ▼ Show 20 Lines | if (!Index.enableSplitLTOUnit()) { | ||||
} | } | ||||
} | } | ||||
// Don't mark variables we won't be able to internalize as read/write-only. | // Don't mark variables we won't be able to internalize as read/write-only. | ||||
bool CanBeInternalized = | bool CanBeInternalized = | ||||
!V.hasComdat() && !V.hasAppendingLinkage() && !V.isInterposable() && | !V.hasComdat() && !V.hasAppendingLinkage() && !V.isInterposable() && | ||||
!V.hasAvailableExternallyLinkage() && !V.hasDLLExportStorageClass(); | !V.hasAvailableExternallyLinkage() && !V.hasDLLExportStorageClass(); | ||||
bool Constant = V.isConstant(); | bool Constant = V.isConstant(); | ||||
GlobalObject::VCallVisibilityList List = V.getVCallVisibility(); | |||||
// Find the maximum visibility from all !vcall_visibility attachments. | |||||
GlobalObject::VCallVisibility TypeVis = | |||||
GlobalObject::VCallVisibilityTranslationUnit; | |||||
for (auto Entry : List) { | |||||
TypeVis = std::min(TypeVis, Entry.Visibility); | |||||
} | |||||
if (List.empty()) | |||||
TypeVis = GlobalObject::VCallVisibilityPublic; | |||||
GlobalVarSummary::GVarFlags VarFlags(CanBeInternalized, | GlobalVarSummary::GVarFlags VarFlags(CanBeInternalized, | ||||
Constant ? false : CanBeInternalized, | Constant ? false : CanBeInternalized, | ||||
Constant, V.getVCallVisibility()); | Constant, TypeVis); | ||||
auto GVarSummary = std::make_unique<GlobalVarSummary>(Flags, VarFlags, | auto GVarSummary = std::make_unique<GlobalVarSummary>(Flags, VarFlags, | ||||
RefEdges.takeVector()); | RefEdges.takeVector()); | ||||
if (NonRenamableLocal) | if (NonRenamableLocal) | ||||
CantBePromoted.insert(V.getGUID()); | CantBePromoted.insert(V.getGUID()); | ||||
if (HasBlockAddress) | if (HasBlockAddress) | ||||
GVarSummary->setNotEligibleToImport(); | GVarSummary->setNotEligibleToImport(); | ||||
if (!VTableFuncs.empty()) | if (!VTableFuncs.empty()) | ||||
GVarSummary->setVTableFuncs(VTableFuncs); | GVarSummary->setVTableFuncs(VTableFuncs); | ||||
▲ Show 20 Lines • Show All 321 Lines • Show Last 20 Lines |