Don't fill eh frames even though these are text sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47765 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2008-02-29 19:36:59 +00:00
parent 84e5f77880
commit 05548eb174
3 changed files with 15 additions and 10 deletions

View File

@ -273,7 +273,10 @@ namespace llvm {
/// 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 @@ namespace llvm {
/// 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.

View File

@ -684,7 +684,8 @@ void AsmPrinter::EmitFile(unsigned Number, const std::string &Name) const {
// 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 @@ void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV,
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";
}

View File

@ -2379,7 +2379,7 @@ private:
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 @@ private:
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 @@ private:
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 @@ private:
// 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 @@ private:
// 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 @@ private:
Asm->EOL("Filter TypeInfo index");
}
Asm->EmitAlignment(2);
Asm->EmitAlignment(2, 0, 0, false);
}
public: