Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions llvm/include/llvm/IR/ModuleSummaryIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -1399,8 +1399,8 @@ class ModuleSummaryIndex {
/// True if some of the FunctionSummary contains a ParamAccess.
bool HasParamAccess = false;

std::set<std::string> CfiFunctionDefs;
std::set<std::string> CfiFunctionDecls;
std::set<std::string, std::less<>> CfiFunctionDefs;
std::set<std::string, std::less<>> CfiFunctionDecls;

// 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).
Expand Down Expand Up @@ -1647,11 +1647,19 @@ class ModuleSummaryIndex {
return I == OidGuidMap.end() ? 0 : I->second;
}

std::set<std::string> &cfiFunctionDefs() { return CfiFunctionDefs; }
const std::set<std::string> &cfiFunctionDefs() const { return CfiFunctionDefs; }
std::set<std::string, std::less<>> &cfiFunctionDefs() {
return CfiFunctionDefs;
}
const std::set<std::string, std::less<>> &cfiFunctionDefs() const {
return CfiFunctionDefs;
}

std::set<std::string> &cfiFunctionDecls() { return CfiFunctionDecls; }
const std::set<std::string> &cfiFunctionDecls() const { return CfiFunctionDecls; }
std::set<std::string, std::less<>> &cfiFunctionDecls() {
return CfiFunctionDecls;
}
const std::set<std::string, std::less<>> &cfiFunctionDecls() const {
return CfiFunctionDecls;
}

/// Add a global value summary for a value.
void addGlobalValueSummary(const GlobalValue &GV,
Expand Down
6 changes: 4 additions & 2 deletions llvm/lib/Bitcode/Reader/BitcodeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7959,15 +7959,17 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) {
break;

case bitc::FS_CFI_FUNCTION_DEFS: {
std::set<std::string> &CfiFunctionDefs = TheIndex.cfiFunctionDefs();
std::set<std::string, std::less<>> &CfiFunctionDefs =
TheIndex.cfiFunctionDefs();
for (unsigned I = 0; I != Record.size(); I += 2)
CfiFunctionDefs.insert(
{Strtab.data() + Record[I], static_cast<size_t>(Record[I + 1])});
break;
}

case bitc::FS_CFI_FUNCTION_DECLS: {
std::set<std::string> &CfiFunctionDecls = TheIndex.cfiFunctionDecls();
std::set<std::string, std::less<>> &CfiFunctionDecls =
TheIndex.cfiFunctionDecls();
for (unsigned I = 0; I != Record.size(); I += 2)
CfiFunctionDecls.insert(
{Strtab.data() + Record[I], static_cast<size_t>(Record[I + 1])});
Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/Transforms/IPO/LowerTypeTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2037,10 +2037,9 @@ bool LowerTypeTestsModule::lower() {
// have the same name, but it's not the one we are looking for.
if (F.hasLocalLinkage())
continue;
if (ImportSummary->cfiFunctionDefs().count(std::string(F.getName())))
if (ImportSummary->cfiFunctionDefs().count(F.getName()))
Defs.push_back(&F);
else if (ImportSummary->cfiFunctionDecls().count(
std::string(F.getName())))
else if (ImportSummary->cfiFunctionDecls().count(F.getName()))
Decls.push_back(&F);
}

Expand Down
Loading