mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 23:32:27 +00:00
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
This commit is contained in:
parent
c5d1d20e28
commit
6197b0fe54
@ -42,7 +42,7 @@ private:
|
|||||||
void setParent(Module *parent);
|
void setParent(Module *parent);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Method(const MethodType *Ty, const string &Name = "");
|
Method(const MethodType *Ty, bool isInternal, const string &Name = "");
|
||||||
~Method();
|
~Method();
|
||||||
|
|
||||||
// Specialize setName to handle symbol table majik...
|
// Specialize setName to handle symbol table majik...
|
||||||
|
@ -16,9 +16,11 @@ class PointerType;
|
|||||||
class GlobalValue : public User {
|
class GlobalValue : public User {
|
||||||
GlobalValue(const GlobalValue &); // do not implement
|
GlobalValue(const GlobalValue &); // do not implement
|
||||||
protected:
|
protected:
|
||||||
GlobalValue(const Type *Ty, ValueTy vty, const string &name = "")
|
GlobalValue(const Type *Ty, ValueTy vty, bool hasInternalLinkage,
|
||||||
: User(Ty, vty, name) { Parent = 0; }
|
const string &name = "")
|
||||||
|
: User(Ty, vty, name), HasInternalLinkage(hasInternalLinkage), Parent(0) {}
|
||||||
|
|
||||||
|
bool HasInternalLinkage; // Is this value accessable externally?
|
||||||
Module *Parent;
|
Module *Parent;
|
||||||
public:
|
public:
|
||||||
~GlobalValue() {}
|
~GlobalValue() {}
|
||||||
@ -28,6 +30,11 @@ public:
|
|||||||
return (const PointerType*)User::getType();
|
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...
|
// Get the module that this global value is contained inside of...
|
||||||
inline Module *getParent() { return Parent; }
|
inline Module *getParent() { return Parent; }
|
||||||
inline const Module *getParent() const { return Parent; }
|
inline const Module *getParent() const { return Parent; }
|
||||||
|
@ -24,8 +24,8 @@ class GlobalVariable : public GlobalValue {
|
|||||||
|
|
||||||
bool Constant; // Is this a global constant?
|
bool Constant; // Is this a global constant?
|
||||||
public:
|
public:
|
||||||
GlobalVariable(const Type *Ty, bool isConstant, ConstPoolVal *Initializer = 0,
|
GlobalVariable(const Type *Ty, bool isConstant, bool isInternal,
|
||||||
const string &Name = "");
|
ConstPoolVal *Initializer = 0, const string &Name = "");
|
||||||
~GlobalVariable() {}
|
~GlobalVariable() {}
|
||||||
|
|
||||||
// Specialize setName to handle symbol table majik...
|
// Specialize setName to handle symbol table majik...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user