diff options
Diffstat (limited to 'llvm/include/llvm/IR/ModuleSummaryIndex.h')
| -rw-r--r-- | llvm/include/llvm/IR/ModuleSummaryIndex.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h index b4240e7aee9..681ebd4dc60 100644 --- a/llvm/include/llvm/IR/ModuleSummaryIndex.h +++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h @@ -309,6 +309,20 @@ public: GlobalValueMap[ValueGUID].push_back(std::move(Info)); } + /// Returns the first GlobalValueInfo for \p GV, asserting that there + /// is only one if \p PerModuleIndex. + GlobalValueInfo *getGlobalValueInfo(const GlobalValue &GV, + bool PerModuleIndex = true) const { + assert(GV.hasName() && "Can't get GlobalValueInfo for GV with no name"); + return getGlobalValueInfo(GlobalValue::getGUID(GV.getName()), + PerModuleIndex); + } + + /// Returns the first GlobalValueInfo for \p ValueGUID, asserting that there + /// is only one if \p PerModuleIndex. + GlobalValueInfo *getGlobalValueInfo(GlobalValue::GUID ValueGUID, + bool PerModuleIndex = true) const; + /// Table of modules, containing module hash and id. const StringMap<std::pair<uint64_t, ModuleHash>> &modulePaths() const { return ModulePathStringTable; |

