Changeset View
Changeset View
Standalone View
Standalone View
include/llvm/IR/ModuleSummaryIndex.h
Show First 20 Lines • Show All 831 Lines • ▼ Show 20 Lines | private: | ||||
// True if the index was created for a module compiled with -fsplit-lto-unit. | // True if the index was created for a module compiled with -fsplit-lto-unit. | ||||
bool EnableSplitLTOUnit; | bool EnableSplitLTOUnit; | ||||
// True if some of the modules were compiled with -fsplit-lto-unit and | // True if some of the modules were compiled with -fsplit-lto-unit and | ||||
// some were not. Set when the combined index is created during the thin link. | // some were not. Set when the combined index is created during the thin link. | ||||
bool PartiallySplitLTOUnits = false; | bool PartiallySplitLTOUnits = false; | ||||
// True if compiled with a flattened sample PGO profile. This is set in the | |||||
// per module index during module summary building. For the combined index | |||||
// it contains the OR of all input summary index flags. | |||||
bool FlattenedProfileUsed = false; | |||||
std::set<std::string> CfiFunctionDefs; | std::set<std::string> CfiFunctionDefs; | ||||
std::set<std::string> CfiFunctionDecls; | std::set<std::string> CfiFunctionDecls; | ||||
// Used in cases where we want to record the name of a global, but | // Used in cases where we want to record the name of a global, but | ||||
// don't have the string owned elsewhere (e.g. the Strtab on a module). | // don't have the string owned elsewhere (e.g. the Strtab on a module). | ||||
StringSaver Saver; | StringSaver Saver; | ||||
BumpPtrAllocator Alloc; | BumpPtrAllocator Alloc; | ||||
// YAML I/O support. | // YAML I/O support. | ||||
friend yaml::MappingTraits<ModuleSummaryIndex>; | friend yaml::MappingTraits<ModuleSummaryIndex>; | ||||
GlobalValueSummaryMapTy::value_type * | GlobalValueSummaryMapTy::value_type * | ||||
getOrInsertValuePtr(GlobalValue::GUID GUID) { | getOrInsertValuePtr(GlobalValue::GUID GUID) { | ||||
return &*GlobalValueMap.emplace(GUID, GlobalValueSummaryInfo(HaveGVs)) | return &*GlobalValueMap.emplace(GUID, GlobalValueSummaryInfo(HaveGVs)) | ||||
.first; | .first; | ||||
} | } | ||||
public: | public: | ||||
// See HaveGVs variable comment. | // See HaveGVs variable comment. | ||||
ModuleSummaryIndex(bool HaveGVs, bool EnableSplitLTOUnit = false) | ModuleSummaryIndex(bool HaveGVs, bool EnableSplitLTOUnit = false, | ||||
: HaveGVs(HaveGVs), EnableSplitLTOUnit(EnableSplitLTOUnit), Saver(Alloc) { | bool FlattenedProfileUsed = false) | ||||
} | : HaveGVs(HaveGVs), EnableSplitLTOUnit(EnableSplitLTOUnit), | ||||
FlattenedProfileUsed(FlattenedProfileUsed), Saver(Alloc) {} | |||||
bool haveGVs() const { return HaveGVs; } | bool haveGVs() const { return HaveGVs; } | ||||
gvsummary_iterator begin() { return GlobalValueMap.begin(); } | gvsummary_iterator begin() { return GlobalValueMap.begin(); } | ||||
const_gvsummary_iterator begin() const { return GlobalValueMap.begin(); } | const_gvsummary_iterator begin() const { return GlobalValueMap.begin(); } | ||||
gvsummary_iterator end() { return GlobalValueMap.end(); } | gvsummary_iterator end() { return GlobalValueMap.end(); } | ||||
const_gvsummary_iterator end() const { return GlobalValueMap.end(); } | const_gvsummary_iterator end() const { return GlobalValueMap.end(); } | ||||
size_t size() const { return GlobalValueMap.size(); } | size_t size() const { return GlobalValueMap.size(); } | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
bool enableSplitLTOUnit() const { return EnableSplitLTOUnit; } | bool enableSplitLTOUnit() const { return EnableSplitLTOUnit; } | ||||
void setEnableSplitLTOUnit() { EnableSplitLTOUnit = true; } | void setEnableSplitLTOUnit() { EnableSplitLTOUnit = true; } | ||||
bool partiallySplitLTOUnits() const { return PartiallySplitLTOUnits; } | bool partiallySplitLTOUnits() const { return PartiallySplitLTOUnits; } | ||||
void setPartiallySplitLTOUnits() { PartiallySplitLTOUnits = true; } | void setPartiallySplitLTOUnits() { PartiallySplitLTOUnits = true; } | ||||
bool flattenedProfileUsed() const { return FlattenedProfileUsed; } | |||||
void setFlattenedProfileUsed() { FlattenedProfileUsed = true; } | |||||
bool isGlobalValueLive(const GlobalValueSummary *GVS) const { | bool isGlobalValueLive(const GlobalValueSummary *GVS) const { | ||||
return !WithGlobalValueDeadStripping || GVS->isLive(); | return !WithGlobalValueDeadStripping || GVS->isLive(); | ||||
} | } | ||||
bool isGUIDLive(GlobalValue::GUID GUID) const; | bool isGUIDLive(GlobalValue::GUID GUID) const; | ||||
/// Return a ValueInfo for the index value_type (convenient when iterating | /// Return a ValueInfo for the index value_type (convenient when iterating | ||||
/// index). | /// index). | ||||
ValueInfo getValueInfo(const GlobalValueSummaryMapTy::value_type &R) const { | ValueInfo getValueInfo(const GlobalValueSummaryMapTy::value_type &R) const { | ||||
▲ Show 20 Lines • Show All 307 Lines • Show Last 20 Lines |