diff options
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Bytecode/BytecodeHandler.h | 1 | ||||
-rw-r--r-- | include/llvm/GlobalValue.h | 13 |
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; } |