diff options
Diffstat (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp')
-rw-r--r-- | llvm/lib/IR/ModuleSummaryIndex.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp index 2d1440756a95..15fe342969d6 100644 --- a/llvm/lib/IR/ModuleSummaryIndex.cpp +++ b/llvm/lib/IR/ModuleSummaryIndex.cpp @@ -107,11 +107,15 @@ uint64_t ModuleSummaryIndex::getFlags() const { Flags |= 0x40; if (withWholeProgramVisibility()) Flags |= 0x80; + if (withSupportsHotColdNew()) + Flags |= 0x100; + if (hasUnifiedLTO()) + Flags |= 0x200; return Flags; } void ModuleSummaryIndex::setFlags(uint64_t Flags) { - assert(Flags <= 0xff && "Unexpected bits in flag"); + assert(Flags <= 0x2ff && "Unexpected bits in flag"); // 1 bit: WithGlobalValueDeadStripping flag. // Set on combined index only. if (Flags & 0x1) @@ -145,6 +149,14 @@ void ModuleSummaryIndex::setFlags(uint64_t Flags) { // Set on combined index only. if (Flags & 0x80) setWithWholeProgramVisibility(); + // 1 bit: WithSupportsHotColdNew flag. + // Set on combined index only. + if (Flags & 0x100) + setWithSupportsHotColdNew(); + // 1 bit: WithUnifiedLTO flag. + // Set on combined index only. + if (Flags & 0x200) + setUnifiedLTO(); } // Collect for the given module the list of function it defines @@ -317,7 +329,7 @@ void ModuleSummaryIndex::propagateAttributes( } } -bool ModuleSummaryIndex::canImportGlobalVar(GlobalValueSummary *S, +bool ModuleSummaryIndex::canImportGlobalVar(const GlobalValueSummary *S, bool AnalyzeRefs) const { auto HasRefsPreventingImport = [this](const GlobalVarSummary *GVS) { // We don't analyze GV references during attribute propagation, so |