diff options
Diffstat (limited to 'include/llvm/IR/ValueSymbolTable.h')
-rw-r--r-- | include/llvm/IR/ValueSymbolTable.h | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/include/llvm/IR/ValueSymbolTable.h b/include/llvm/IR/ValueSymbolTable.h index 61a12db403ea..9e86751dae6f 100644 --- a/include/llvm/IR/ValueSymbolTable.h +++ b/include/llvm/IR/ValueSymbolTable.h @@ -1,4 +1,4 @@ -//===-- llvm/ValueSymbolTable.h - Implement a Value Symtab ------*- C++ -*-===// +//===- llvm/ValueSymbolTable.h - Implement a Value Symtab -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -15,31 +15,36 @@ #define LLVM_IR_VALUESYMBOLTABLE_H #include "llvm/ADT/StringMap.h" +#include "llvm/ADT/StringRef.h" #include "llvm/IR/Value.h" -#include "llvm/Support/DataTypes.h" +#include <cstdint> namespace llvm { - template <typename ValueSubClass> class SymbolTableListTraits; - template <unsigned InternalLen> class SmallString; - class BasicBlock; - class Function; - class NamedMDNode; - class Module; - class StringRef; + +class Argument; +class BasicBlock; +class Function; +class GlobalAlias; +class GlobalIFunc; +class GlobalVariable; +class Instruction; +template <unsigned InternalLen> class SmallString; +template <typename ValueSubClass> class SymbolTableListTraits; /// This class provides a symbol table of name/value pairs. It is essentially /// a std::map<std::string,Value*> but has a controlled interface provided by /// LLVM as well as ensuring uniqueness of names. /// class ValueSymbolTable { - friend class Value; friend class SymbolTableListTraits<Argument>; friend class SymbolTableListTraits<BasicBlock>; - friend class SymbolTableListTraits<Instruction>; friend class SymbolTableListTraits<Function>; - friend class SymbolTableListTraits<GlobalVariable>; friend class SymbolTableListTraits<GlobalAlias>; friend class SymbolTableListTraits<GlobalIFunc>; + friend class SymbolTableListTraits<GlobalVariable>; + friend class SymbolTableListTraits<Instruction>; + friend class Value; + /// @name Types /// @{ public: @@ -55,14 +60,14 @@ public: /// @} /// @name Constructors /// @{ -public: - ValueSymbolTable() : vmap(0), LastUnique(0) {} + + ValueSymbolTable() : vmap(0) {} ~ValueSymbolTable(); /// @} /// @name Accessors /// @{ -public: + /// This method finds the value with the given \p Name in the /// the symbol table. /// @returns the value associated with the \p Name @@ -84,7 +89,7 @@ public: /// @} /// @name Iteration /// @{ -public: + /// @brief Get an iterator that from the beginning of the symbol table. inline iterator begin() { return vmap.begin(); } @@ -122,13 +127,13 @@ private: /// @} /// @name Internal Data /// @{ -private: + ValueMap vmap; ///< The map that holds the symbol table. - mutable uint32_t LastUnique; ///< Counter for tracking unique names + mutable uint32_t LastUnique = 0; ///< Counter for tracking unique names /// @} }; -} // End llvm namespace +} // end namespace llvm -#endif +#endif // LLVM_IR_VALUESYMBOLTABLE_H |