mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 22:04:55 +00:00
Put code that generates debug labels into TableGen so that it can be used by
everyone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64978 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f570e621ab
commit
cb819f13d7
@ -51,17 +51,17 @@ namespace llvm {
|
||||
///
|
||||
unsigned FunctionNumber;
|
||||
|
||||
/// DW -This is needed because printDeclare() has to insert
|
||||
/// DbgVariable entries into the dwarf table. This is a short term hack
|
||||
/// that ought be fixed soon.
|
||||
DwarfWriter *DW;
|
||||
|
||||
// GCMetadataPrinters - The garbage collection metadata printer table.
|
||||
typedef DenseMap<GCStrategy*,GCMetadataPrinter*> gcp_map_type;
|
||||
typedef gcp_map_type::iterator gcp_iterator;
|
||||
gcp_map_type GCMetadataPrinters;
|
||||
|
||||
protected:
|
||||
/// DW -This is needed because printDeclare() has to insert
|
||||
/// DbgVariable entries into the dwarf table. This is a short term hack
|
||||
/// that ought be fixed soon.
|
||||
DwarfWriter *DW;
|
||||
|
||||
// Necessary for external weak linkage support
|
||||
std::set<const GlobalValue*> ExtWeakSymbols;
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "llvm/Type.h"
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
#include "llvm/CodeGen/AsmPrinter.h"
|
||||
#include "llvm/CodeGen/DwarfWriter.h"
|
||||
#include "llvm/Target/TargetAsmInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Type.h"
|
||||
#include "llvm/CodeGen/AsmPrinter.h"
|
||||
#include "llvm/CodeGen/DwarfWriter.h"
|
||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||
#include "llvm/Target/TargetAsmInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "llvm/DerivedTypes.h"
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/CodeGen/AsmPrinter.h"
|
||||
#include "llvm/CodeGen/DwarfWriter.h"
|
||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
|
@ -14,12 +14,13 @@
|
||||
|
||||
#include "PIC16AsmPrinter.h"
|
||||
#include "PIC16TargetAsmInfo.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Support/Mangler.h"
|
||||
#include "llvm/DerivedTypes.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/CodeGen/DwarfWriter.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
#include "llvm/DerivedTypes.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Support/Mangler.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "llvm/DerivedTypes.h"
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/CodeGen/AsmPrinter.h"
|
||||
#include "llvm/CodeGen/DwarfWriter.h"
|
||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "llvm/Type.h"
|
||||
#include "llvm/ADT/Statistic.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/CodeGen/DwarfWriter.h"
|
||||
#include "llvm/CodeGen/MachineJumpTableInfo.h"
|
||||
#include "llvm/Support/Mangler.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
@ -725,23 +726,6 @@ bool X86ATTAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
|
||||
void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
||||
++EmittedInsts;
|
||||
|
||||
if (TAI->doesSupportDebugInformation()) {
|
||||
const Function *F = MF->getFunction();
|
||||
|
||||
// FIXME: Support more than '-Os'.
|
||||
if (F->hasFnAttr(Attribute::OptimizeForSize)) {
|
||||
static DebugLoc PrevDL = DebugLoc::getUnknownLoc();
|
||||
DebugLoc CurDL = MI->getDebugLoc();
|
||||
|
||||
if (!CurDL.isUnknown() && PrevDL != CurDL) {
|
||||
DebugLocTuple DLT = MF->getDebugLocTuple(CurDL);
|
||||
printLabel(DW->RecordSourceLine(DLT.Line, DLT.Col, DLT.Src));
|
||||
}
|
||||
|
||||
PrevDL = CurDL;
|
||||
}
|
||||
}
|
||||
|
||||
// Call the autogenerated instruction printer routines.
|
||||
printInstruction(MI);
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "llvm/ADT/Statistic.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
#include "llvm/CodeGen/DwarfWriter.h"
|
||||
#include "llvm/Support/Mangler.h"
|
||||
#include "llvm/Target/TargetAsmInfo.h"
|
||||
#include "llvm/Target/TargetOptions.h"
|
||||
|
@ -640,6 +640,17 @@ void AsmWriterEmitter::run(std::ostream &O) {
|
||||
}
|
||||
O << "\";\n\n";
|
||||
|
||||
O << " {\n"
|
||||
<< " const MachineFunction *MF = MI->getParent()->getParent();\n"
|
||||
<< " static DebugLoc PrevDL = DebugLoc::getUnknownLoc();\n"
|
||||
<< " DebugLoc CurDL = MI->getDebugLoc();\n\n"
|
||||
<< " if (!CurDL.isUnknown() && PrevDL != CurDL) {\n"
|
||||
<< " DebugLocTuple DLT = MF->getDebugLocTuple(CurDL);\n"
|
||||
<< " printLabel(DW->RecordSourceLine(DLT.Line, DLT.Col, DLT.Src));\n"
|
||||
<< " }\n\n"
|
||||
<< " PrevDL = CurDL;\n"
|
||||
<< " }\n";
|
||||
|
||||
O << " if (MI->getOpcode() == TargetInstrInfo::INLINEASM) {\n"
|
||||
<< " O << \"\\t\";\n"
|
||||
<< " printInlineAsm(MI);\n"
|
||||
|
Loading…
Reference in New Issue
Block a user