diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-09 23:11:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-09 23:11:33 +0000 |
commit | 4bbd839d10b14cd9028896800faa892e9d8ce3a3 (patch) | |
tree | 23ed99be35c45d537182f4c8d3793080f8b069ae /include/llvm | |
parent | e3dcf2ea7041246148ccceb87522f876dbc18554 (diff) | |
download | external_llvm-4bbd839d10b14cd9028896800faa892e9d8ce3a3.zip external_llvm-4bbd839d10b14cd9028896800faa892e9d8ce3a3.tar.gz external_llvm-4bbd839d10b14cd9028896800faa892e9d8ce3a3.tar.bz2 |
Make isExtern() be a virtual function inherited from GlobalValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4101 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Function.h | 2 | ||||
-rw-r--r-- | include/llvm/GlobalValue.h | 11 | ||||
-rw-r--r-- | include/llvm/GlobalVariable.h | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h index 4c0e0ec..87e6bad 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -85,7 +85,7 @@ public: /// is empty if so) this is true for external functions, defined as forward /// "declare"ations /// - bool isExternal() const { return BasicBlocks.empty(); } + virtual bool isExternal() const { return BasicBlocks.empty(); } // getNext/Prev - Return the next or previous function in the list. These // methods should never be used directly, and are only used to implement the diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index 56e4a3e..af2ff23 100644 --- a/include/llvm/GlobalValue.h +++ b/include/llvm/GlobalValue.h @@ -26,17 +26,22 @@ protected: public: ~GlobalValue() {} - // getType - Global values are always pointers. + /// getType - Global values are always pointers. inline const PointerType *getType() const { return (const PointerType*)User::getType(); } - // Internal Linkage - True if the global value is inaccessible to + /// Internal Linkage - True if the global value is inaccessible to bool hasInternalLinkage() const { return HasInternalLinkage; } bool hasExternalLinkage() const { return !HasInternalLinkage; } void setInternalLinkage(bool HIL) { HasInternalLinkage = HIL; } - // Get the module that this global value is contained inside of... + /// isExternal - Return true if the primary definition of this global value is + /// outside of the current translation unit... + virtual bool isExternal() const = 0; + + /// getParent - Get the module that this global value is contained inside + /// of... inline Module *getParent() { return Parent; } inline const Module *getParent() const { return Parent; } diff --git a/include/llvm/GlobalVariable.h b/include/llvm/GlobalVariable.h index 12862cc..372b7a2 100644 --- a/include/llvm/GlobalVariable.h +++ b/include/llvm/GlobalVariable.h @@ -46,7 +46,7 @@ public: /// global variable is defined in some other translation unit, and is thus /// externally defined here. /// - bool isExternal() const { return Operands.empty(); } + virtual bool isExternal() const { return Operands.empty(); } /// hasInitializer - Unless a global variable isExternal(), it has an /// initializer. The initializer for the global variable/constant is held by |