aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Module.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-06-25 16:12:52 +0000
committerChris Lattner <sabre@nondot.org>2002-06-25 16:12:52 +0000
commit18961504fc2b299578dba817900a0696cf3ccc4d (patch)
treec34853ffc064b841932d0897e25305c81c3a7338 /include/llvm/Module.h
parenta2204e1ff25265a1da00ecbb3ebb22c05acf7194 (diff)
downloadexternal_llvm-18961504fc2b299578dba817900a0696cf3ccc4d.zip
external_llvm-18961504fc2b299578dba817900a0696cf3ccc4d.tar.gz
external_llvm-18961504fc2b299578dba817900a0696cf3ccc4d.tar.bz2
*** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Module.h')
-rw-r--r--include/llvm/Module.h37
1 files changed, 25 insertions, 12 deletions
diff --git a/include/llvm/Module.h b/include/llvm/Module.h
index 3f142cb..8e527d0 100644
--- a/include/llvm/Module.h
+++ b/include/llvm/Module.h
@@ -12,18 +12,31 @@
#ifndef LLVM_MODULE_H
#define LLVM_MODULE_H
-#include "llvm/Value.h"
-#include "llvm/ValueHolder.h"
+#include "llvm/Function.h"
+#include "llvm/GlobalVariable.h"
class GlobalVariable;
class GlobalValueRefMap; // Used by ConstantVals.cpp
class ConstantPointerRef;
class FunctionType;
class SymbolTable;
+template<> struct ilist_traits<Function>
+ : public SymbolTableListTraits<Function, Module, Module> {
+ // createNode is used to create a node that marks the end of the list...
+ static Function *createNode();
+ static iplist<Function> &getList(Module *M);
+};
+template<> struct ilist_traits<GlobalVariable>
+ : public SymbolTableListTraits<GlobalVariable, Module, Module> {
+ // createNode is used to create a node that marks the end of the list...
+ static GlobalVariable *createNode();
+ static iplist<GlobalVariable> &getList(Module *M);
+};
+
class Module : public Annotable {
public:
- typedef ValueHolder<GlobalVariable, Module, Module> GlobalListType;
- typedef ValueHolder<Function, Module, Module> FunctionListType;
+ typedef iplist<GlobalVariable> GlobalListType;
+ typedef iplist<Function> FunctionListType;
// Global Variable iterators...
typedef GlobalListType::iterator giterator;
@@ -119,10 +132,10 @@ public:
inline unsigned gsize() const { return GlobalList.size(); }
inline bool gempty() const { return GlobalList.empty(); }
- inline const GlobalVariable *gfront() const { return GlobalList.front(); }
- inline GlobalVariable *gfront() { return GlobalList.front(); }
- inline const GlobalVariable *gback() const { return GlobalList.back(); }
- inline GlobalVariable *gback() { return GlobalList.back(); }
+ inline const GlobalVariable &gfront() const { return GlobalList.front(); }
+ inline GlobalVariable &gfront() { return GlobalList.front(); }
+ inline const GlobalVariable &gback() const { return GlobalList.back(); }
+ inline GlobalVariable &gback() { return GlobalList.back(); }
@@ -138,10 +151,10 @@ public:
inline unsigned size() const { return FunctionList.size(); }
inline bool empty() const { return FunctionList.empty(); }
- inline const Function *front() const { return FunctionList.front(); }
- inline Function *front() { return FunctionList.front(); }
- inline const Function *back() const { return FunctionList.back(); }
- inline Function *back() { return FunctionList.back(); }
+ inline const Function &front() const { return FunctionList.front(); }
+ inline Function &front() { return FunctionList.front(); }
+ inline const Function &back() const { return FunctionList.back(); }
+ inline Function &back() { return FunctionList.back(); }
void print(std::ostream &OS) const;