diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ConstPoolVals.h | 5 | ||||
-rw-r--r-- | include/llvm/Function.h | 6 | ||||
-rw-r--r-- | include/llvm/GlobalValue.h | 11 | ||||
-rw-r--r-- | include/llvm/GlobalVariable.h | 5 | ||||
-rw-r--r-- | include/llvm/SymbolTable.h | 2 |
5 files changed, 12 insertions, 17 deletions
diff --git a/include/llvm/ConstPoolVals.h b/include/llvm/ConstPoolVals.h index 235ab12..3fe8e09 100644 --- a/include/llvm/ConstPoolVals.h +++ b/include/llvm/ConstPoolVals.h @@ -232,10 +232,7 @@ protected: ConstPoolPointerReference(GlobalValue *GV); ~ConstPoolPointerReference() {} public: - static ConstPoolPointerReference *get(GlobalValue *GV) { - // FIXME: These should all be shared! - return new ConstPoolPointerReference(GV); - } + static ConstPoolPointerReference *get(GlobalValue *GV); virtual string getStrValue() const; diff --git a/include/llvm/Function.h b/include/llvm/Function.h index d7c35b3..fe878bf 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -38,8 +38,6 @@ private: BasicBlocksType BasicBlocks; // The basic blocks ArgumentListType ArgumentList; // The formal arguments - Module *Parent; // The module that contains this method - friend class ValueHolder<Method, Module, Module>; void setParent(Module *parent); @@ -58,10 +56,6 @@ public: bool isExternal() const { return BasicBlocks.empty(); } - // Get the class structure that this method is contained inside of... - inline Module *getParent() { return Parent; } - inline const Module *getParent() const { return Parent; } - // Get the underlying elements of the Method... inline const ArgumentListType &getArgumentList() const{ return ArgumentList; } inline ArgumentListType &getArgumentList() { return ArgumentList; } diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index 394e2a2..baee0bf 100644 --- a/include/llvm/GlobalValue.h +++ b/include/llvm/GlobalValue.h @@ -17,14 +17,21 @@ class GlobalValue : public User { GlobalValue(const GlobalValue &); // do not implement protected: GlobalValue(const Type *Ty, ValueTy vty, const string &name = "") - : User(Ty, vty, name) {} + : User(Ty, vty, name) { Parent = 0; } + + Module *Parent; public: + ~GlobalValue() {} - // getType - Global values are always pointers (FIXME, methods should be ptrs too!) + // getType - Global values are always pointers. inline const PointerType *getType() const { return (const PointerType*)User::getType(); } + // Get the module that this global value is contained inside of... + inline Module *getParent() { return Parent; } + inline const Module *getParent() const { return Parent; } + // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const GlobalValue *T) { return true; } static inline bool classof(const Value *V) { diff --git a/include/llvm/GlobalVariable.h b/include/llvm/GlobalVariable.h index 6d6de14..2e29805 100644 --- a/include/llvm/GlobalVariable.h +++ b/include/llvm/GlobalVariable.h @@ -19,8 +19,6 @@ class ConstPoolVal; class PointerType; class GlobalVariable : public GlobalValue { - Module *Parent; // The module that contains this method - friend class ValueHolder<GlobalVariable, Module, Module>; void setParent(Module *parent) { Parent = parent; } @@ -33,9 +31,6 @@ public: // Specialize setName to handle symbol table majik... virtual void setName(const string &name, SymbolTable *ST = 0); - inline Module *getParent() { return Parent; } - inline const Module *getParent() const { return Parent; } - // The initializer for the global variable/constant is held by Operands[0] if // an initializer is specified. // diff --git a/include/llvm/SymbolTable.h b/include/llvm/SymbolTable.h index bae9eb1..69ff3dd 100644 --- a/include/llvm/SymbolTable.h +++ b/include/llvm/SymbolTable.h @@ -103,6 +103,8 @@ public: return find(TypeID)->second.end(); } + void dump() const; // Debug method, print out symbol table + private: // insertEntry - Insert a value into the symbol table with the specified // name... |