diff options
author | Charles Saternos <charles.saternos@gmail.com> | 2018-02-19 15:14:50 +0000 |
---|---|---|
committer | Charles Saternos <charles.saternos@gmail.com> | 2018-02-19 15:14:50 +0000 |
commit | b040fcc693447c3d43dfb4623976a921cb1fa0b8 (patch) | |
tree | bae9e0a8758cc041cea8b73c2de416215144642b /llvm/lib/LTO/LTO.cpp | |
parent | 68ced40a235e15c4b9fabd29866f867e097e82ed (diff) | |
download | llvm-b040fcc693447c3d43dfb4623976a921cb1fa0b8.zip llvm-b040fcc693447c3d43dfb4623976a921cb1fa0b8.tar.gz llvm-b040fcc693447c3d43dfb4623976a921cb1fa0b8.tar.bz2 |
[ThinLTO] Add GraphTraits for FunctionSummaries
Add GraphTraits definitions to the FunctionSummary and ModuleSummaryIndex classes. These GraphTraits will be used to construct find SCC's in ThinLTO analysis passes.
Third attempt - moved function from lambda to static function due to build failures.
llvm-svn: 325506
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r-- | llvm/lib/LTO/LTO.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index 1047b8d..94baee6 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -50,6 +50,10 @@ using namespace object; #define DEBUG_TYPE "lto" +static cl::opt<bool> + DumpThinCGSCCs("dump-thin-cg-sccs", cl::init(false), cl::Hidden, + cl::desc("Dump the SCCs in the ThinLTO index's callgraph")); + // The values are (type identifier, summary) pairs. typedef DenseMap< GlobalValue::GUID, @@ -1141,6 +1145,9 @@ Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache) { ThinLTO.ModuleMap.size()); StringMap<std::map<GlobalValue::GUID, GlobalValue::LinkageTypes>> ResolvedODR; + if (DumpThinCGSCCs) + ThinLTO.CombinedIndex.dumpSCCs(outs()); + if (Conf.OptLevel > 0) ComputeCrossModuleImport(ThinLTO.CombinedIndex, ModuleToDefinedGVSummaries, ImportLists, ExportLists); |