[llvm-commits] CVS: llvm/include/llvm/CodeGen/AsmPrinter.h

Chris Lattner sabre at nondot.org
Thu May 31 11:58:09 PDT 2007



Changes in directory llvm/include/llvm/CodeGen:

AsmPrinter.h updated: 1.66 -> 1.67
---
Log message:

Fix the asmprinter so that a globalvalue can specify an explicit alignment
smaller than the preferred alignment, but so that the target can actually
specify a minimum alignment if needed.  This fixes some objc protocol 
failures Devang tracked down.


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

 AsmPrinter.h |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/CodeGen/AsmPrinter.h
diff -u llvm/include/llvm/CodeGen/AsmPrinter.h:1.66 llvm/include/llvm/CodeGen/AsmPrinter.h:1.67
--- llvm/include/llvm/CodeGen/AsmPrinter.h:1.66	Wed May  2 20:11:53 2007
+++ llvm/include/llvm/CodeGen/AsmPrinter.h	Thu May 31 13:57:45 2007
@@ -248,8 +248,18 @@
     /// EmitAlignment - Emit an alignment directive to the specified power of
     /// two boundary.  For example, if you pass in 3 here, you will get an 8
     /// byte alignment.  If a global value is specified, and if that global has
-    /// an explicit alignment requested, it will override the alignment request.
-    void EmitAlignment(unsigned NumBits, const GlobalValue *GV = 0) const;
+    /// an explicit alignment requested, it will unconditionally override the
+    /// alignment request.  However, if ForcedAlignBits is specified, this value
+    /// has final say: the ultimate alignment will be the max of ForcedAlignBits
+    /// and the alignment computed with NumBits and the global.
+    ///
+    /// The algorithm is:
+    ///     Align = NumBits;
+    ///     if (GV && GV->hasalignment) Align = GV->getalignment();
+    ///     Align = std::max(Align, ForcedAlignBits);
+    ///
+    void EmitAlignment(unsigned NumBits, const GlobalValue *GV = 0,
+                       unsigned ForcedAlignBits = 0) const;
 
   protected:
     /// EmitZeros - Emit a block of zeros.






More information about the llvm-commits mailing list