summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/Transforms/IPO/GlobalDCE.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/Transforms/IPO/GlobalDCE.h')
-rw-r--r--llvm/include/llvm/Transforms/IPO/GlobalDCE.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/include/llvm/Transforms/IPO/GlobalDCE.h b/llvm/include/llvm/Transforms/IPO/GlobalDCE.h
index c434484d1ae..0a6851849e7 100644
--- a/llvm/include/llvm/Transforms/IPO/GlobalDCE.h
+++ b/llvm/include/llvm/Transforms/IPO/GlobalDCE.h
@@ -43,11 +43,25 @@ private:
/// Comdat -> Globals in that Comdat section.
std::unordered_multimap<Comdat *, GlobalValue *> ComdatMembers;
+ /// !type metadata -> set of (vtable, offset) pairs
+ DenseMap<Metadata *, SmallSet<std::pair<GlobalVariable *, uint64_t>, 4>>
+ TypeIdMap;
+
+ // Global variables which are vtables, and which we have enough information
+ // about to safely do dead virtual function elimination.
+ SmallPtrSet<GlobalValue *, 32> VFESafeVTables;
+
void UpdateGVDependencies(GlobalValue &GV);
void MarkLive(GlobalValue &GV,
SmallVectorImpl<GlobalValue *> *Updates = nullptr);
bool RemoveUnusedGlobalValue(GlobalValue &GV);
+ // Dead virtual function elimination.
+ void AddVirtualFunctionDependencies(Module &M);
+ void ScanVTables(Module &M);
+ void ScanTypeCheckedLoadIntrinsics(Module &M);
+ void ScanVTableLoad(Function *Caller, Metadata *TypeId, uint64_t CallOffset);
+
void ComputeDependencies(Value *V, SmallPtrSetImpl<GlobalValue *> &U);
};
OpenPOWER on IntegriCloud