1. Clean up code due to changes in SwitchTo*Section(2)

2. Added partial debug support for mingw\cygwin targets (the same as
   Linux\ELF). Please note, that currently mingw\cygwin uses 'stabs' format
   for storing debug info by default, thus many (runtime) libraries has
   this information included. These formats shouldn't be mixed in one binary
   ('stabs' & 'DWARF'), otherwise binutils tools will be confused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31311 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov
2006-10-31 08:31:24 +00:00
parent d03f1581c8
commit ab4022f196
9 changed files with 80 additions and 52 deletions

View File

@@ -52,7 +52,9 @@ std::string X86ATTAsmPrinter::getSectionForFunction(const Function &F) const {
/// method to print assembly for each instruction.
///
bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
if (Subtarget->isTargetDarwin() || Subtarget->isTargetELF()) {
if (Subtarget->isTargetDarwin() ||
Subtarget->isTargetELF() ||
Subtarget->isTargetCygwin()) {
// Let PassManager know we need debug information and relay
// the MachineDebugInfo address on to DwarfWriter.
DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
@@ -111,7 +113,9 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
F->getLinkage() == Function::WeakLinkage))
O << "_llvm$workaround$fake$stub_" << CurrentFnName << ":\n";
if (Subtarget->isTargetDarwin() || Subtarget->isTargetELF()) {
if (Subtarget->isTargetDarwin() ||
Subtarget->isTargetELF() ||
Subtarget->isTargetCygwin()) {
// Emit pre-function debug information.
DW.BeginFunction(&MF);
}
@@ -141,7 +145,9 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
if (TAI->hasDotTypeDotSizeDirective())
O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n";
if (Subtarget->isTargetDarwin() || Subtarget->isTargetELF()) {
if (Subtarget->isTargetDarwin() ||
Subtarget->isTargetELF() ||
Subtarget->isTargetCygwin()) {
// Emit post-function debug information.
DW.EndFunction();
}