diff options
author | Chris Lattner <sabre@nondot.org> | 2001-10-03 19:28:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-10-03 19:28:15 +0000 |
commit | 4387370c1c6dd64ad01be0fc91836616d908e917 (patch) | |
tree | bb7a8e03db70bb1140ee30677acd097baa8c1a29 /include/llvm/GlobalValue.h | |
parent | 6a57baa295bb3dbd389581df968536f594709bdb (diff) |
Factor parentness out of Module & GlobalVariable into GlobalValue
Implement SymbolTable debug/dump utility
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@710 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/GlobalValue.h')
-rw-r--r-- | include/llvm/GlobalValue.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index 394e2a262a1..baee0bf4e08 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) { |