[llvm-commits] [llvm] r47765 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter.cpp lib/CodeGen/DwarfWriter.cpp
Evan Cheng
evan.cheng at apple.com
Fri Feb 29 11:36:59 PST 2008
Author: evancheng
Date: Fri Feb 29 13:36:59 2008
New Revision: 47765
URL: http://llvm.org/viewvc/llvm-project?rev=47765&view=rev
Log:
Don't fill eh frames even though these are text sections.
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/CodeGen/AsmPrinter.cpp
llvm/trunk/lib/CodeGen/DwarfWriter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=47765&r1=47764&r2=47765&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Fri Feb 29 13:36:59 2008
@@ -273,7 +273,10 @@
/// 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
+ /// and the alignment computed with NumBits and the global. If UseFillExpr
+ /// is true, it also emits an optional second value FillValue which the
+ /// assembler uses to fill gaps to match alignment for text sections if the
+ /// has specified a non-zero fill value.
///
/// The algorithm is:
/// Align = NumBits;
@@ -281,7 +284,8 @@
/// Align = std::max(Align, ForcedAlignBits);
///
void EmitAlignment(unsigned NumBits, const GlobalValue *GV = 0,
- unsigned ForcedAlignBits = 0) const;
+ unsigned ForcedAlignBits = 0,
+ bool UseFillExpr = true) const;
/// printLabel - This method prints a local label used by debug and
/// exception handling tables.
Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=47765&r1=47764&r2=47765&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Fri Feb 29 13:36:59 2008
@@ -684,7 +684,8 @@
// Align = std::max(Align, ForcedAlignBits);
//
void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV,
- unsigned ForcedAlignBits) const {
+ unsigned ForcedAlignBits,
+ bool UseFillExpr) const {
if (GV && GV->getAlignment())
NumBits = Log2_32(GV->getAlignment());
NumBits = std::max(NumBits, ForcedAlignBits);
@@ -694,7 +695,7 @@
O << TAI->getAlignDirective() << NumBits;
unsigned FillValue = TAI->getTextAlignFillValue();
- bool UseFillExpr = IsInTextSection && FillValue;
+ UseFillExpr &= IsInTextSection && FillValue;
if (UseFillExpr) O << ",0x" << std::hex << FillValue << std::dec;
O << "\n";
}
Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfWriter.cpp?rev=47765&r1=47764&r2=47765&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Fri Feb 29 13:36:59 2008
@@ -2379,7 +2379,7 @@
EmitFrameMoves(NULL, 0, Moves, false);
- Asm->EmitAlignment(2);
+ Asm->EmitAlignment(2, 0, 0, false);
EmitLabel("debug_frame_common_end", 0);
Asm->EOL();
@@ -2412,7 +2412,7 @@
EmitFrameMoves("func_begin", DebugFrameInfo.Number, DebugFrameInfo.Moves, false);
- Asm->EmitAlignment(2);
+ Asm->EmitAlignment(2, 0, 0, false);
EmitLabel("debug_frame_end", DebugFrameInfo.Number);
Asm->EOL();
@@ -2865,7 +2865,7 @@
RI->getInitialFrameState(Moves);
EmitFrameMoves(NULL, 0, Moves, true);
- Asm->EmitAlignment(2);
+ Asm->EmitAlignment(2, 0, 0, false);
EmitLabel("eh_frame_common_end", Index);
Asm->EOL();
@@ -2951,7 +2951,7 @@
// frame.
EmitFrameMoves("eh_func_begin", EHFrameInfo.Number, EHFrameInfo.Moves, true);
- Asm->EmitAlignment(2);
+ Asm->EmitAlignment(2, 0, 0, false);
EmitLabel("eh_frame_end", EHFrameInfo.Number);
// If the function is marked used, this table should be also. We cannot
@@ -3270,7 +3270,7 @@
// Begin the exception table.
Asm->SwitchToDataSection(TAI->getDwarfExceptionSection());
O << "GCC_except_table" << SubprogramCount << ":\n";
- Asm->EmitAlignment(2);
+ Asm->EmitAlignment(2, 0, 0, false);
for (unsigned i = 0; i != SizeAlign; ++i) {
Asm->EmitInt8(0);
Asm->EOL("Padding");
@@ -3362,7 +3362,7 @@
Asm->EOL("Filter TypeInfo index");
}
- Asm->EmitAlignment(2);
+ Asm->EmitAlignment(2, 0, 0, false);
}
public:
More information about the llvm-commits
mailing list