mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Move DebugInfo checks into EmitComments and remove them from
target-specific AsmPrinters. Not all comments need DebugInfo. Re-enable the line numbers comment test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88697 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c4c550c758
commit
1924aabf99
@ -18,6 +18,7 @@
|
|||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/CodeGen/GCMetadataPrinter.h"
|
#include "llvm/CodeGen/GCMetadataPrinter.h"
|
||||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||||
|
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||||
#include "llvm/CodeGen/MachineFunction.h"
|
#include "llvm/CodeGen/MachineFunction.h"
|
||||||
#include "llvm/CodeGen/MachineJumpTableInfo.h"
|
#include "llvm/CodeGen/MachineJumpTableInfo.h"
|
||||||
#include "llvm/CodeGen/MachineLoopInfo.h"
|
#include "llvm/CodeGen/MachineLoopInfo.h"
|
||||||
@ -35,6 +36,7 @@
|
|||||||
#include "llvm/Support/Mangler.h"
|
#include "llvm/Support/Mangler.h"
|
||||||
#include "llvm/MC/MCAsmInfo.h"
|
#include "llvm/MC/MCAsmInfo.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
|
#include "llvm/Target/TargetInstrInfo.h"
|
||||||
#include "llvm/Target/TargetLowering.h"
|
#include "llvm/Target/TargetLowering.h"
|
||||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||||
#include "llvm/Target/TargetOptions.h"
|
#include "llvm/Target/TargetOptions.h"
|
||||||
@ -1822,21 +1824,28 @@ GCMetadataPrinter *AsmPrinter::GetOrCreateGCPrinter(GCStrategy *S) {
|
|||||||
|
|
||||||
/// EmitComments - Pretty-print comments for instructions
|
/// EmitComments - Pretty-print comments for instructions
|
||||||
void AsmPrinter::EmitComments(const MachineInstr &MI) const {
|
void AsmPrinter::EmitComments(const MachineInstr &MI) const {
|
||||||
assert(VerboseAsm && !MI.getDebugLoc().isUnknown());
|
if (!VerboseAsm)
|
||||||
|
return;
|
||||||
|
|
||||||
DebugLocTuple DLT = MF->getDebugLocTuple(MI.getDebugLoc());
|
bool Newline = false;
|
||||||
|
|
||||||
// Print source line info.
|
if (!MI.getDebugLoc().isUnknown()) {
|
||||||
O.PadToColumn(MAI->getCommentColumn());
|
DebugLocTuple DLT = MF->getDebugLocTuple(MI.getDebugLoc());
|
||||||
O << MAI->getCommentString() << " SrcLine ";
|
|
||||||
if (DLT.Scope) {
|
// Print source line info.
|
||||||
DICompileUnit CU(DLT.Scope);
|
O.PadToColumn(MAI->getCommentColumn());
|
||||||
if (!CU.isNull())
|
O << MAI->getCommentString() << " SrcLine ";
|
||||||
O << CU.getFilename() << " ";
|
if (DLT.Scope) {
|
||||||
|
DICompileUnit CU(DLT.Scope);
|
||||||
|
if (!CU.isNull())
|
||||||
|
O << CU.getFilename() << " ";
|
||||||
|
}
|
||||||
|
O << DLT.Line;
|
||||||
|
if (DLT.Col != 0)
|
||||||
|
O << ":" << DLT.Col;
|
||||||
|
Newline = true;
|
||||||
}
|
}
|
||||||
O << DLT.Line;
|
|
||||||
if (DLT.Col != 0)
|
|
||||||
O << ":" << DLT.Col;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// PrintChildLoopComment - Print comments about child loops within
|
/// PrintChildLoopComment - Print comments about child loops within
|
||||||
@ -1867,8 +1876,7 @@ static void PrintChildLoopComment(formatted_raw_ostream &O,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// EmitComments - Pretty-print comments for basic blocks
|
/// EmitComments - Pretty-print comments for basic blocks
|
||||||
void AsmPrinter::EmitComments(const MachineBasicBlock &MBB) const
|
void AsmPrinter::EmitComments(const MachineBasicBlock &MBB) const {
|
||||||
{
|
|
||||||
if (VerboseAsm) {
|
if (VerboseAsm) {
|
||||||
// Add loop depth information
|
// Add loop depth information
|
||||||
const MachineLoop *loop = LI->getLoopFor(&MBB);
|
const MachineLoop *loop = LI->getLoopFor(&MBB);
|
||||||
|
@ -1086,7 +1086,7 @@ void ARMAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
|||||||
printInstruction(MI);
|
printInstruction(MI);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VerboseAsm && !MI->getDebugLoc().isUnknown())
|
if (VerboseAsm)
|
||||||
EmitComments(*MI);
|
EmitComments(*MI);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
processDebugLoc(MI, false);
|
processDebugLoc(MI, false);
|
||||||
|
@ -178,7 +178,7 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
processDebugLoc(II, true);
|
processDebugLoc(II, true);
|
||||||
printInstruction(II);
|
printInstruction(II);
|
||||||
|
|
||||||
if (VerboseAsm && !II->getDebugLoc().isUnknown())
|
if (VerboseAsm)
|
||||||
EmitComments(*II);
|
EmitComments(*II);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
processDebugLoc(II, false);
|
processDebugLoc(II, false);
|
||||||
|
@ -143,7 +143,7 @@ bool BlackfinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
processDebugLoc(II, true);
|
processDebugLoc(II, true);
|
||||||
|
|
||||||
printInstruction(II);
|
printInstruction(II);
|
||||||
if (VerboseAsm && !II->getDebugLoc().isUnknown())
|
if (VerboseAsm)
|
||||||
EmitComments(*II);
|
EmitComments(*II);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
|
|
||||||
|
@ -406,7 +406,7 @@ void SPUAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
|||||||
++EmittedInsts;
|
++EmittedInsts;
|
||||||
processDebugLoc(MI, true);
|
processDebugLoc(MI, true);
|
||||||
printInstruction(MI);
|
printInstruction(MI);
|
||||||
if (VerboseAsm && !MI->getDebugLoc().isUnknown())
|
if (VerboseAsm)
|
||||||
EmitComments(*MI);
|
EmitComments(*MI);
|
||||||
processDebugLoc(MI, false);
|
processDebugLoc(MI, false);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
|
@ -239,7 +239,7 @@ void MSP430AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
|||||||
|
|
||||||
printInstructionThroughMCStreamer(MI);
|
printInstructionThroughMCStreamer(MI);
|
||||||
|
|
||||||
if (VerboseAsm && !MI->getDebugLoc().isUnknown())
|
if (VerboseAsm)
|
||||||
EmitComments(*MI);
|
EmitComments(*MI);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ bool MipsAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// Print the assembly for the instruction.
|
// Print the assembly for the instruction.
|
||||||
printInstruction(II);
|
printInstruction(II);
|
||||||
|
|
||||||
if (VerboseAsm && !II->getDebugLoc().isUnknown())
|
if (VerboseAsm)
|
||||||
EmitComments(*II);
|
EmitComments(*II);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ PIC16AsmPrinter::PIC16AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
|
|||||||
bool PIC16AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
bool PIC16AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
||||||
processDebugLoc(MI, true);
|
processDebugLoc(MI, true);
|
||||||
printInstruction(MI);
|
printInstruction(MI);
|
||||||
if (VerboseAsm && !MI->getDebugLoc().isUnknown())
|
if (VerboseAsm)
|
||||||
EmitComments(*MI);
|
EmitComments(*MI);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
processDebugLoc(MI, false);
|
processDebugLoc(MI, false);
|
||||||
|
@ -594,7 +594,7 @@ void PPCAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
|||||||
|
|
||||||
printInstruction(MI);
|
printInstruction(MI);
|
||||||
|
|
||||||
if (VerboseAsm && !MI->getDebugLoc().isUnknown())
|
if (VerboseAsm)
|
||||||
EmitComments(*MI);
|
EmitComments(*MI);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
processDebugLoc(II, true);
|
processDebugLoc(II, true);
|
||||||
printInstruction(II);
|
printInstruction(II);
|
||||||
|
|
||||||
if (VerboseAsm && !II->getDebugLoc().isUnknown())
|
if (VerboseAsm)
|
||||||
EmitComments(*II);
|
EmitComments(*II);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
processDebugLoc(II, false);
|
processDebugLoc(II, false);
|
||||||
|
@ -155,7 +155,7 @@ void SystemZAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
|||||||
// Call the autogenerated instruction printer routines.
|
// Call the autogenerated instruction printer routines.
|
||||||
printInstruction(MI);
|
printInstruction(MI);
|
||||||
|
|
||||||
if (VerboseAsm && !MI->getDebugLoc().isUnknown())
|
if (VerboseAsm)
|
||||||
EmitComments(*MI);
|
EmitComments(*MI);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
|
|
||||||
|
@ -651,7 +651,7 @@ void X86AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
|||||||
|
|
||||||
printInstructionThroughMCStreamer(MI);
|
printInstructionThroughMCStreamer(MI);
|
||||||
|
|
||||||
if (VerboseAsm && !MI->getDebugLoc().isUnknown())
|
if (VerboseAsm)
|
||||||
EmitComments(*MI);
|
EmitComments(*MI);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ void XCoreAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printInstruction(MI);
|
printInstruction(MI);
|
||||||
if (VerboseAsm && !MI->getDebugLoc().isUnknown())
|
if (VerboseAsm)
|
||||||
EmitComments(*MI);
|
EmitComments(*MI);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// print line numbers in asm.
|
// print line numbers in asm.
|
||||||
// RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | \
|
// RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | \
|
||||||
// RUN: llc --disable-fp-elim -O0 -relocation-model=pic | grep {# SrcLine 25}
|
// RUN: llc --disable-fp-elim -O0 -relocation-model=pic | grep {# SrcLine 25}
|
||||||
// XFAIL: *
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user