[llvm-commits] [llvm] r102484 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
Chris Lattner
sabre at nondot.org
Tue Apr 27 18:08:40 PDT 2010
Author: lattner
Date: Tue Apr 27 20:08:40 2010
New Revision: 102484
URL: http://llvm.org/viewvc/llvm-project?rev=102484&view=rev
Log:
further simplify EmitAlignment by eliminating the
ForcedAlignBits argument, tweaking the single client of it.
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=102484&r1=102483&r2=102484&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Tue Apr 27 20:08:40 2010
@@ -204,17 +204,13 @@
/// 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 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.
+ /// alignment request.
///
/// The algorithm is:
/// Align = NumBits;
- /// if (GV && GV->hasalignment) Align = GV->getalignment();
- /// Align = std::max(Align, ForcedAlignBits);
+ /// if (GV && GV->hasalignment) Align = GV->getAlignment();
///
- void EmitAlignment(unsigned NumBits, const GlobalValue *GV = 0,
- unsigned ForcedAlignBits = 0) const;
+ void EmitAlignment(unsigned NumBits, const GlobalValue *GV = 0) const;
/// EmitBasicBlockStart - This method prints the label for the specified
/// MachineBasicBlock, an alignment (if present) and a comment describing
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=102484&r1=102483&r2=102484&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Apr 27 20:08:40 2010
@@ -1154,14 +1154,11 @@
//
// The algorithm is:
// Align = NumBits;
-// if (GV && GV->hasalignment) Align = GV->getalignment();
-// Align = std::max(Align, ForcedAlignBits);
+// if (GV && GV->hasalignment) Align = GV->getAlignment();
//
-void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV,
- unsigned ForcedAlignBits) const {
+void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV) const {
if (GV && GV->getAlignment())
NumBits = Log2_32(GV->getAlignment());
- NumBits = std::max(NumBits, ForcedAlignBits);
if (NumBits == 0) return; // No need to emit alignment.
Modified: llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp?rev=102484&r1=102483&r2=102484&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp Tue Apr 27 20:08:40 2010
@@ -148,7 +148,7 @@
llvm_unreachable("Unknown linkage type!");
}
- EmitAlignment(Align, GV, 2);
+ EmitAlignment(Align > 2 ? Align : 2, GV);
unsigned Size = TD->getTypeAllocSize(C->getType());
if (GV->isThreadLocal()) {
More information about the llvm-commits
mailing list