aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/Mips
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-09-30 22:06:26 +0000
committerBob Wilson <bob.wilson@apple.com>2009-09-30 22:06:26 +0000
commit812209a58c5520c604bc9279aa069e5ae066e860 (patch)
treed57f4a8be52b4d6df644ea8d1a2d6e4efd7c9b28 /lib/Target/Mips
parentc4c39faa054eade47f84496ebea3a6842c03ab64 (diff)
downloadexternal_llvm-812209a58c5520c604bc9279aa069e5ae066e860.zip
external_llvm-812209a58c5520c604bc9279aa069e5ae066e860.tar.gz
external_llvm-812209a58c5520c604bc9279aa069e5ae066e860.tar.bz2
Add a new virtual EmitStartOfAsmFile method to the AsmPrinter and use this
to emit target-specific things at the beginning of the asm output. This fixes a problem for PPC, where the text sections are not being kept together as expected. The base class doInitialization code calls DW->BeginModule() which emits a bunch of DWARF section directives. The PPC doInitialization code then emits all the TEXT section directives, with the intention that they will be kept together. But as I understand it, the Darwin assembler treats the default TEXT section as a special case and moves it to the beginning of the file, which means that all those DWARF sections are in the middle of the text. With this change, the EmitStartOfAsmFile hook is called before the DWARF section directives are emitted, so that all the PPC text section directives come out right at the beginning of the file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83176 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips')
-rw-r--r--lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
index 4962603..fb5e5fc 100644
--- a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
+++ b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
@@ -85,7 +85,7 @@ namespace {
static const char *getRegisterName(unsigned RegNo);
bool runOnMachineFunction(MachineFunction &F);
- bool doInitialization(Module &M);
+ void EmitStartOfAsmFile(Module &M);
};
} // end of anonymous namespace
@@ -408,7 +408,7 @@ printFCCOperand(const MachineInstr *MI, int opNum, const char *Modifier) {
O << Mips::MipsFCCToString((Mips::CondCode)MO.getImm());
}
-bool MipsAsmPrinter::doInitialization(Module &M) {
+void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
// FIXME: Use SwitchSection.
// Tell the assembler which ABI we are using
@@ -421,8 +421,6 @@ bool MipsAsmPrinter::doInitialization(Module &M) {
// return to previous section
O << "\t.previous" << '\n';
-
- return AsmPrinter::doInitialization(M);
}
void MipsAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) {