#ifndef LLVM_MODULE_H
#define LLVM_MODULE_H
+#include "llvm/ADT/OwningPtr.h"
#include "llvm/Function.h"
-#include "llvm/GlobalVariable.h"
#include "llvm/GlobalAlias.h"
+#include "llvm/GlobalVariable.h"
#include "llvm/Metadata.h"
-#include "llvm/ADT/OwningPtr.h"
#include "llvm/Support/DataTypes.h"
-#include <vector>
namespace llvm {
/// The type for the list of named metadata.
typedef ilist<NamedMDNode> NamedMDListType;
- /// The type for the list of dependent libraries.
- typedef std::vector<std::string> LibraryListType;
-
/// The Global Variable iterator.
typedef GlobalListType::iterator global_iterator;
/// The Global Variable constant iterator.
typedef NamedMDListType::iterator named_metadata_iterator;
/// The named metadata constant interators.
typedef NamedMDListType::const_iterator const_named_metadata_iterator;
- /// The Library list iterator.
- typedef LibraryListType::const_iterator lib_iterator;
/// An enumeration for describing the endianess of the target machine.
enum Endianness { AnyEndianness, LittleEndian, BigEndian };
GlobalListType GlobalList; ///< The Global Variables in the module
FunctionListType FunctionList; ///< The Functions in the module
AliasListType AliasList; ///< The Aliases in the module
- LibraryListType LibraryList; ///< The Libraries needed by the module
NamedMDListType NamedMDList; ///< The named metadata in the module
std::string GlobalScopeAsm; ///< Inline Asm at global scope.
ValueSymbolTable *ValSymTab; ///< Symbol table for values
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;
/// 4. Finally, the function exists but has the wrong prototype: return the
/// function with a constantexpr cast to the right prototype.
Constant *getOrInsertFunction(StringRef Name, FunctionType *T,
- AttrListPtr AttributeList);
+ AttributeSet AttributeList);
Constant *getOrInsertFunction(StringRef Name, FunctionType *T);
/// null terminated list of function arguments, which makes it easier for
/// clients to use.
Constant *getOrInsertFunction(StringRef Name,
- AttrListPtr AttributeList,
+ AttributeSet AttributeList,
Type *RetTy, ...) END_WITH_NULL;
/// getOrInsertFunction - Same as above, but without the attributes.
Constant *getOrInsertTargetIntrinsic(StringRef Name,
FunctionType *Ty,
- AttrListPtr AttributeList);
+ AttributeSet AttributeList);
/// getFunction - Look up the specified function in the module symbol table.
/// If it does not exist, return null.
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.
size_t size() const { return FunctionList.size(); }
bool empty() const { return FunctionList.empty(); }
-/// @}
-/// @name Dependent Library Iteration
-/// @{
-
- /// @brief Get a constant iterator to beginning of dependent library list.
- inline lib_iterator lib_begin() const { return LibraryList.begin(); }
- /// @brief Get a constant iterator to end of dependent library list.
- inline lib_iterator lib_end() const { return LibraryList.end(); }
- /// @brief Returns the number of items in the list of libraries.
- inline size_t lib_size() const { return LibraryList.size(); }
- /// @brief Add a library to the list of dependent libraries
- void addLibrary(StringRef Lib);
- /// @brief Remove a library from the list of dependent libraries
- void removeLibrary(StringRef Lib);
- /// @brief Get all the libraries
- inline const LibraryListType& getLibraries() const { return LibraryList; }
-
/// @}
/// @name Alias Iteration
/// @{