diff options
| author | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-02 05:07:53 +0000 |
|---|---|---|
| committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-02 05:07:53 +0000 |
| commit | ad5741b075518e840d4ef55bffe3e3cbf41c370b (patch) | |
| tree | e9790c9f5f0f440bcc79fc8e5fcc9fc13ce143b6 /llvm/lib/Transforms | |
| parent | 2cd609482d0e5c8b4bd6cc32d3fd40cb2bfb6d91 (diff) | |
| download | bcm5719-llvm-ad5741b075518e840d4ef55bffe3e3cbf41c370b.tar.gz bcm5719-llvm-ad5741b075518e840d4ef55bffe3e3cbf41c370b.zip | |
Create a typedef GlobalValue::GUID for uint64_t and RAUW (NFC)
Summary: This should make the code more readable, especially all the map declarations.
Reviewers: tejohnson
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D18721
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 265215
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/IPO/FunctionImport.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp index b5f1ffb046f..f69bc1dba59 100644 --- a/llvm/lib/Transforms/IPO/FunctionImport.cpp +++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp @@ -103,7 +103,8 @@ selectCallee(const GlobalValueInfoList &CalleeInfoList, unsigned Threshold) { /// Return the summary for the function \p GUID that fits the \p Threshold, or /// null if there's no match. -static const FunctionSummary *selectCallee(uint64_t GUID, unsigned Threshold, +static const FunctionSummary *selectCallee(GlobalValue::GUID GUID, + unsigned Threshold, const ModuleSummaryIndex &Index) { auto CalleeInfoList = Index.findGlobalValueInfoList(GUID); if (CalleeInfoList == Index.end()) { @@ -114,7 +115,8 @@ static const FunctionSummary *selectCallee(uint64_t GUID, unsigned Threshold, /// Return true if the global \p GUID is exported by module \p ExportModulePath. static bool isGlobalExported(const ModuleSummaryIndex &Index, - StringRef ExportModulePath, uint64_t GUID) { + StringRef ExportModulePath, + GlobalValue::GUID GUID) { auto CalleeInfoList = Index.findGlobalValueInfoList(GUID); if (CalleeInfoList == Index.end()) // This global does not have a summary, it is not part of the ThinLTO @@ -138,7 +140,7 @@ using EdgeInfo = std::pair<const FunctionSummary *, unsigned /* Threshold */>; static void computeImportForFunction( StringRef ModulePath, const FunctionSummary &Summary, const ModuleSummaryIndex &Index, unsigned Threshold, - const std::map<uint64_t, FunctionSummary *> &DefinedFunctions, + const std::map<GlobalValue::GUID, FunctionSummary *> &DefinedFunctions, SmallVectorImpl<EdgeInfo> &Worklist, FunctionImporter::ImportMapTy &ImportsForModule, StringMap<FunctionImporter::ExportSetTy> &ExportLists) { @@ -198,7 +200,7 @@ static void computeImportForFunction( /// another module (that may require promotion). static void ComputeImportForModule( StringRef ModulePath, - const std::map<uint64_t, FunctionSummary *> &DefinedFunctions, + const std::map<GlobalValue::GUID, FunctionSummary *> &DefinedFunctions, const ModuleSummaryIndex &Index, FunctionImporter::ImportMapTy &ImportsForModule, StringMap<FunctionImporter::ExportSetTy> &ExportLists) { @@ -242,8 +244,8 @@ void llvm::ComputeCrossModuleImport( // Collect for each module the list of function it defines. // GUID -> Summary - StringMap<std::map<uint64_t, FunctionSummary *>> Module2FunctionInfoMap( - ModuleCount); + StringMap<std::map<GlobalValue::GUID, FunctionSummary *>> + Module2FunctionInfoMap(ModuleCount); for (auto &GlobalList : Index) { auto GUID = GlobalList.first; |

