diff options
Diffstat (limited to 'include/llvm/IR/ModuleSummaryIndex.h')
-rw-r--r-- | include/llvm/IR/ModuleSummaryIndex.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/include/llvm/IR/ModuleSummaryIndex.h b/include/llvm/IR/ModuleSummaryIndex.h index 144e45f18d2c..b43d58865862 100644 --- a/include/llvm/IR/ModuleSummaryIndex.h +++ b/include/llvm/IR/ModuleSummaryIndex.h @@ -32,6 +32,7 @@ #include <cstdint> #include <map> #include <memory> +#include <set> #include <string> #include <utility> #include <vector> @@ -542,6 +543,9 @@ private: /// considered live. bool WithGlobalValueDeadStripping = false; + std::set<std::string> CfiFunctionDefs; + std::set<std::string> CfiFunctionDecls; + // YAML I/O support. friend yaml::MappingTraits<ModuleSummaryIndex>; @@ -567,6 +571,7 @@ public: bool isGlobalValueLive(const GlobalValueSummary *GVS) const { return !WithGlobalValueDeadStripping || GVS->isLive(); } + bool isGUIDLive(GlobalValue::GUID GUID) const; /// Return a ValueInfo for GUID if it exists, otherwise return ValueInfo(). ValueInfo getValueInfo(GlobalValue::GUID GUID) const { @@ -592,6 +597,12 @@ public: 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> &cfiFunctionDecls() { return CfiFunctionDecls; } + const std::set<std::string> &cfiFunctionDecls() const { return CfiFunctionDecls; } + /// Add a global value summary for a value of the given name. void addGlobalValueSummary(StringRef ValueName, std::unique_ptr<GlobalValueSummary> Summary) { @@ -691,14 +702,13 @@ public: return Pair.first; } - /// Add a new module path with the given \p Hash, mapped to the given \p - /// ModID, and return an iterator to the entry in the index. - ModulePathStringTableTy::iterator - addModulePath(StringRef ModPath, uint64_t ModId, - ModuleHash Hash = ModuleHash{{0}}) { - return ModulePathStringTable.insert(std::make_pair( - ModPath, - std::make_pair(ModId, Hash))).first; + typedef ModulePathStringTableTy::value_type ModuleInfo; + + /// Add a new module with the given \p Hash, mapped to the given \p + /// ModID, and return a reference to the module. + ModuleInfo *addModule(StringRef ModPath, uint64_t ModId, + ModuleHash Hash = ModuleHash{{0}}) { + return &*ModulePathStringTable.insert({ModPath, {ModId, Hash}}).first; } /// Check if the given Module has any functions available for exporting |