class FunctionType;
class GVMaterializer;
class LLVMContext;
-class MDSymbolTable;
template<> struct ilist_traits<Function>
: public SymbolTableListTraits<Function, Module> {
};
template<> struct ilist_traits<NamedMDNode>
- : public SymbolTableListTraits<NamedMDNode, Module> {
+ : public ilist_default_traits<NamedMDNode> {
// createSentinel is used to get hold of a node that marks the end of
// the list...
NamedMDNode *createSentinel() const {
NamedMDNode *provideInitialHead() const { return createSentinel(); }
NamedMDNode *ensureHead(NamedMDNode*) const { return createSentinel(); }
static void noteHead(NamedMDNode*, NamedMDNode*) {}
- void addNodeToList(NamedMDNode *N);
- void removeNodeFromList(NamedMDNode *N);
+ void addNodeToList(NamedMDNode *) {}
+ void removeNodeFromList(NamedMDNode *) {}
private:
mutable ilist_node<NamedMDNode> Sentinel;
};
/// The type for the list of aliases.
typedef iplist<GlobalAlias> AliasListType;
/// The type for the list of named metadata.
- typedef iplist<NamedMDNode> NamedMDListType;
+ typedef ilist<NamedMDNode> NamedMDListType;
/// The type for the list of dependent libraries.
typedef std::vector<std::string> LibraryListType;
std::string ModuleID; ///< Human readable identifier for the module
std::string TargetTriple; ///< Platform target triple Module compiled on
std::string DataLayout; ///< Target data description
- MDSymbolTable *NamedMDSymTab; ///< NamedMDNode names.
+ void *NamedMDSymTab; ///< NamedMDNode names.
friend class Constant;
/// NamedMDNode with the specified name is not found.
NamedMDNode *getOrInsertNamedMetadata(StringRef Name);
+ /// eraseNamedMetadata - Remove the given NamedMDNode from this module
+ /// and delete it.
+ void eraseNamedMetadata(NamedMDNode *NMD);
+
/// @}
/// @name Type Accessors
/// @{
static iplist<GlobalAlias> Module::*getSublistAccess(GlobalAlias*) {
return &Module::AliasList;
}
- /// Get the Module's list of named metadata (constant).
- const NamedMDListType &getNamedMDList() const { return NamedMDList; }
- /// Get the Module's list of named metadata.
- NamedMDListType &getNamedMDList() { return NamedMDList; }
- static iplist<NamedMDNode> Module::*getSublistAccess(NamedMDNode *) {
- return &Module::NamedMDList;
- }
/// Get the symbol table of global variable and function identifiers
const ValueSymbolTable &getValueSymbolTable() const { return *ValSymTab; }
/// Get the Module's symbol table of global variable and function identifiers.
const TypeSymbolTable &getTypeSymbolTable() const { return *TypeSymTab; }
/// Get the Module's symbol table of types
TypeSymbolTable &getTypeSymbolTable() { return *TypeSymTab; }
- /// Get the symbol table of named metadata
- const MDSymbolTable &getMDSymbolTable() const { return *NamedMDSymTab; }
- /// Get the Module's symbol table of named metadata
- MDSymbolTable &getMDSymbolTable() { return *NamedMDSymTab; }
/// @}
/// @name Global Variable Iteration