Remove getFunctionAlignment from TargetELFInfo and use new MachineFunction alignment method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74686 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bruno Cardoso Lopes
2009-07-02 02:13:13 +00:00
parent 2c3f00cd94
commit 3d62a412fb
5 changed files with 5 additions and 34 deletions

View File

@@ -40,10 +40,11 @@ void ELFCodeEmitter::startFunction(MachineFunction &MF) {
BufferBegin = &BD[0];
BufferEnd = BufferBegin + BD.capacity();
// Align the output buffer with function alignment, and
// upgrade the section alignment if required
unsigned Align =
TM.getELFWriterInfo()->getFunctionAlignment(MF.getFunction());
// Get the function alignment in bytes
unsigned Align = (1 << MF.getAlignment());
// Align the section size with the function alignment, so the function can
// start in a aligned offset, also update the section alignment if needed.
if (ES->Align < Align) ES->Align = Align;
ES->Size = (ES->Size + (Align-1)) & (-Align);