[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Aug 17 12:14:40 PDT 2004



Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.6 -> 1.7
---
Log message:

Add support for alignment


---
Diffs of the changes:  (+6 -0)

Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.6 llvm/lib/CodeGen/AsmPrinter.cpp:1.7
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.6	Tue Aug 17 11:27:05 2004
+++ llvm/lib/CodeGen/AsmPrinter.cpp	Tue Aug 17 14:14:29 2004
@@ -33,6 +33,12 @@
   CurrentFnName = Mang->getValueName((Value*)MF.getFunction());
 }
 
+// emitAlignment - Emit an alignment directive to the specified power of two.
+void AsmPrinter::emitAlignment(unsigned NumBits) const {
+  if (AlignmentIsInBytes) NumBits = 1 << NumBits;
+  O << AlignDirective << NumBits << "\n";
+}
+
 // Print out the specified constant, without a storage class.  Only the
 // constants valid in constant expressions can occur here.
 void AsmPrinter::emitConstantValueOnly(const Constant *CV) {






More information about the llvm-commits mailing list