class LLVMContext;
class StructType;
template<typename T> struct DenseMapInfo;
-template<typename KeyT, typename ValueT,
- typename KeyInfoT, typename ValueInfoT> class DenseMap;
+template<typename KeyT, typename ValueT, typename KeyInfoT> class DenseMap;
template<> struct ilist_traits<Function>
: public SymbolTableListTraits<Function, Module> {
/// is an error for two (or more) llvm.module.flags with the
/// same ID to have the Override behavior but different
/// values.
- enum ModAttrBehavior { Error = 1, Warning = 2, Require = 3, Override = 4 };
+ enum ModFlagBehavior { Error = 1, Warning = 2, Require = 3, Override = 4 };
struct ModuleFlagEntry {
- ModAttrBehavior Behavior;
+ ModFlagBehavior Behavior;
MDString *Key;
Value *Val;
- ModuleFlagEntry(ModAttrBehavior B, MDString *K, Value *V)
+ ModuleFlagEntry(ModFlagBehavior B, MDString *K, Value *V)
: Behavior(B), Key(K), Val(V) {}
};
void getMDKindNames(SmallVectorImpl<StringRef> &Result) const;
- typedef DenseMap<StructType*, unsigned, DenseMapInfo<StructType*>,
- DenseMapInfo<unsigned> > NumeredTypesMapTy;
+ typedef DenseMap<StructType*, unsigned, DenseMapInfo<StructType*> >
+ NumeredTypesMapTy;
- /// findUsedStructTypes - Walk the entire module and find all of the
- /// struct types that are in use, returning them in a vector.
- void findUsedStructTypes(std::vector<StructType*> &StructTypes) const;
-
/// getTypeByName - Return the type with the specified name, or null if there
/// is none by that name.
StructType *getTypeByName(StringRef Name) const;
/// addModuleFlag - Add a module-level flag to the module-level flags
/// metadata. It will create the module-level flags named metadata if it
/// doesn't already exist.
- void addModuleFlag(ModAttrBehavior Behavior, StringRef Key, Value *Val);
- void addModuleFlag(ModAttrBehavior Behavior, StringRef Key, uint32_t Val);
+ void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, Value *Val);
+ void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, uint32_t Val);
void addModuleFlag(MDNode *Node);
/// @}
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 ilist<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.