allow functions and modules to have an explicit alignment
authorChris Lattner <sabre@nondot.org>
Sun, 6 Nov 2005 06:44:42 +0000 (06:44 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 Nov 2005 06:44:42 +0000 (06:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24209 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/GlobalValue.h

index ca92b21c7fb58181d6c6898c3b5c8413f940d392..a6db31dc9b1e61032b11183387fbd80755315c45 100644 (file)
@@ -42,11 +42,18 @@ protected:
 
   LinkageTypes Linkage;   // The linkage of this global
   Module *Parent;
+  unsigned Alignment;
 public:
   ~GlobalValue() {
     removeDeadConstantUsers();   // remove any dead constants using this.
   }
 
+  unsigned getAlignment() const { return Alignment; }
+  void setAlignment(unsigned Align) {
+    assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!");
+    Alignment = Align;
+  }
+  
   /// If the usage is empty (except transitively dead constants), then this
   /// global value can can be safely deleted since the destructor will
   /// delete the dead constants as well.