summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-01-12 19:20:47 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-01-12 19:20:47 +0000
commit7f70559bc47877bafc6dfa92b7df6b64650445fb (patch)
tree35e2a9f532175fdf23d0253f970ff2132448e5d9 /include
parentab7752c1496c2913793305ba4b989a551c5617e1 (diff)
downloadllvm-7f70559bc47877bafc6dfa92b7df6b64650445fb.tar.gz
llvm-7f70559bc47877bafc6dfa92b7df6b64650445fb.tar.bz2
llvm-7f70559bc47877bafc6dfa92b7df6b64650445fb.tar.xz
* PIC codegen for X86/Linux has been implemented
* PIC-aware internal structures in X86 Codegen have been refactored * Visibility (default/weak) has been added * Docs fixes (external weak linkage, visibility, formatting) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33136 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Bytecode/BytecodeHandler.h1
-rw-r--r--include/llvm/GlobalValue.h13
2 files changed, 12 insertions, 2 deletions
diff --git a/include/llvm/Bytecode/BytecodeHandler.h b/include/llvm/Bytecode/BytecodeHandler.h
index c693380e1d..1d95db5daf 100644
--- a/include/llvm/Bytecode/BytecodeHandler.h
+++ b/include/llvm/Bytecode/BytecodeHandler.h
@@ -112,6 +112,7 @@ public:
const Type* ElemType, ///< The type of the global variable
bool isConstant, ///< Whether the GV is constant or not
GlobalValue::LinkageTypes,///< The linkage type of the GV
+ GlobalValue::VisibilityTypes,///< The visibility style of the GV
unsigned SlotNum, ///< Slot number of GV
unsigned initSlot ///< Slot number of GV's initializer (0 if none)
) {}
diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h
index c3b96f2ea7..2fbbbc0437 100644
--- a/include/llvm/GlobalValue.h
+++ b/include/llvm/GlobalValue.h
@@ -38,14 +38,19 @@ public:
ExternalWeakLinkage, /// ExternalWeak linkage description
GhostLinkage /// Stand-in functions for streaming fns from BC files
};
+ enum VisibilityTypes {
+ DefaultVisibility,
+ HiddenVisibility
+ };
protected:
GlobalValue(const Type *Ty, ValueTy vty, Use *Ops, unsigned NumOps,
LinkageTypes linkage, const std::string &name = "")
- : Constant(Ty, vty, Ops, NumOps, name),
- Parent(0), Linkage(linkage), Alignment(0) { }
+ : Constant(Ty, vty, Ops, NumOps, name), Parent(0),
+ Linkage(linkage), Visibility(DefaultVisibility), Alignment(0) { }
Module *Parent;
LinkageTypes Linkage; // The linkage of this global
+ VisibilityTypes Visibility; // The visibility style of this global
unsigned Alignment; // Alignment of this symbol, must be power of two
std::string Section; // Section to emit this into, empty mean default
public:
@@ -58,6 +63,10 @@ public:
assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!");
Alignment = Align;
}
+
+ VisibilityTypes getVisibility() const { return Visibility; }
+ bool hasHiddenVisibility() const { return Visibility == HiddenVisibility; }
+ void setVisibility(VisibilityTypes V) { Visibility = V; }
bool hasSection() const { return !Section.empty(); }
const std::string &getSection() const { return Section; }