[llvm-commits] CVS: llvm/include/llvm/GlobalValue.h

Anton Korobeynikov asl at math.spbu.ru
Fri Jan 12 11:21:19 PST 2007



Changes in directory llvm/include/llvm:

GlobalValue.h updated: 1.29 -> 1.30
---
Log message:

* 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)


---
Diffs of the changes:  (+11 -2)

 GlobalValue.h |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/GlobalValue.h
diff -u llvm/include/llvm/GlobalValue.h:1.29 llvm/include/llvm/GlobalValue.h:1.30
--- llvm/include/llvm/GlobalValue.h:1.29	Wed Dec  6 14:28:46 2006
+++ llvm/include/llvm/GlobalValue.h	Fri Jan 12 13:20:46 2007
@@ -38,14 +38,19 @@
     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 @@
     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; }






More information about the llvm-commits mailing list