diff options
Diffstat (limited to 'llvm/include/llvm/IR/Comdat.h')
-rw-r--r-- | llvm/include/llvm/IR/Comdat.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/Comdat.h b/llvm/include/llvm/IR/Comdat.h index 01a047d36455..1701802e6977 100644 --- a/llvm/include/llvm/IR/Comdat.h +++ b/llvm/include/llvm/IR/Comdat.h @@ -16,10 +16,12 @@ #define LLVM_IR_COMDAT_H #include "llvm-c/Types.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/Support/CBindingWrapping.h" namespace llvm { +class GlobalObject; class raw_ostream; class StringRef; template <typename ValueTy> class StringMapEntry; @@ -46,15 +48,21 @@ public: StringRef getName() const; void print(raw_ostream &OS, bool IsForDebug = false) const; void dump() const; + const SmallPtrSetImpl<GlobalObject *> &getUsers() const { return Users; } private: friend class Module; + friend class GlobalObject; Comdat(); + void addUser(GlobalObject *GO); + void removeUser(GlobalObject *GO); // Points to the map in Module. StringMapEntry<Comdat> *Name = nullptr; SelectionKind SK = Any; + // Globals using this comdat. + SmallPtrSet<GlobalObject *, 2> Users; }; // Create wrappers for C Binding types (see CBindingWrapping.h). |