diff options
author | Chris Lattner <sabre@nondot.org> | 2001-11-26 18:46:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-11-26 18:46:40 +0000 |
commit | 6197b0fe5466f3df29946bdcd47bd2ad462ea007 (patch) | |
tree | 479a7400d4b26569d036e7cd2bff0cd659a92e7e /include | |
parent | c5d1d20e2859d631bc65160726e7a656d1da4277 (diff) | |
download | llvm-6197b0fe5466f3df29946bdcd47bd2ad462ea007.tar.gz llvm-6197b0fe5466f3df29946bdcd47bd2ad462ea007.tar.bz2 llvm-6197b0fe5466f3df29946bdcd47bd2ad462ea007.tar.xz |
Implement "internal vs external linkage" which corresponds to the C notion of static
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1362 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Function.h | 2 | ||||
-rw-r--r-- | include/llvm/GlobalValue.h | 11 | ||||
-rw-r--r-- | include/llvm/GlobalVariable.h | 4 |
3 files changed, 12 insertions, 5 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h index 11e823be9b..f2b0b48a74 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -42,7 +42,7 @@ private: void setParent(Module *parent); public: - Method(const MethodType *Ty, const string &Name = ""); + Method(const MethodType *Ty, bool isInternal, const string &Name = ""); ~Method(); // Specialize setName to handle symbol table majik... diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index baee0bf4e0..d6a977bd37 100644 --- a/include/llvm/GlobalValue.h +++ b/include/llvm/GlobalValue.h @@ -16,9 +16,11 @@ class PointerType; class GlobalValue : public User { GlobalValue(const GlobalValue &); // do not implement protected: - GlobalValue(const Type *Ty, ValueTy vty, const string &name = "") - : User(Ty, vty, name) { Parent = 0; } + GlobalValue(const Type *Ty, ValueTy vty, bool hasInternalLinkage, + const string &name = "") + : User(Ty, vty, name), HasInternalLinkage(hasInternalLinkage), Parent(0) {} + bool HasInternalLinkage; // Is this value accessable externally? Module *Parent; public: ~GlobalValue() {} @@ -28,6 +30,11 @@ public: return (const PointerType*)User::getType(); } + // 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... 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 cce4aaceae..2be424dbd5 100644 --- a/include/llvm/GlobalVariable.h +++ b/include/llvm/GlobalVariable.h @@ -24,8 +24,8 @@ class GlobalVariable : public GlobalValue { bool Constant; // Is this a global constant? public: - GlobalVariable(const Type *Ty, bool isConstant, ConstPoolVal *Initializer = 0, - const string &Name = ""); + GlobalVariable(const Type *Ty, bool isConstant, bool isInternal, + ConstPoolVal *Initializer = 0, const string &Name = ""); ~GlobalVariable() {} // Specialize setName to handle symbol table majik... |