diff options
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstrInfo.td | 9 | ||||
| -rw-r--r-- | llvm/lib/Target/TargetSelectionDAG.td | 10 |
3 files changed, 27 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp index 83e3b0519a9..cb27e1f3888 100644 --- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -25,6 +25,7 @@ #include "llvm/Module.h" #include "llvm/Assembly/Writer.h" #include "llvm/CodeGen/AsmPrinter.h" +#include "llvm/CodeGen/MachineDebugInfo.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/Support/Mangler.h" @@ -375,6 +376,13 @@ void PPCAsmPrinter::printMachineInstruction(const MachineInstr *MI) { bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) { SetupMachineFunction(MF); O << "\n\n"; + + // Print out dwarf file info + MachineDebugInfo &DebugInfo = MF.getDebugInfo(); + std::vector<std::string> Sources = DebugInfo.getSourceFiles(); + for (unsigned i = 0, N = Sources.size(); i < N; i++) { + O << "\t; .file\t" << (i + 1) << "," << "\"" << Sources[i] << "\"" << "\n"; + } // Print out constants referenced by the function EmitConstantPool(MF.getConstantPool()); diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/llvm/lib/Target/PowerPC/PPCInstrInfo.td index 225017cea78..af7560b648c 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.td +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.td @@ -922,6 +922,15 @@ def V_SET0 : VXForm_setzero<1220, (ops VRRC:$vD), //===----------------------------------------------------------------------===// +// DWARF Pseudo Instructions +// + +def DWARF_LOC : Pseudo<(ops i32imm:$line, i32imm:$col, i32imm:$file), + "; .loc $file, $line, $col", + [(dwarf_loc (i32 imm:$line), (i32 imm:$col), + (i32 imm:$file))]>; + +//===----------------------------------------------------------------------===// // PowerPC Instruction Patterns // diff --git a/llvm/lib/Target/TargetSelectionDAG.td b/llvm/lib/Target/TargetSelectionDAG.td index 36f83c168f0..0da445d5d14 100644 --- a/llvm/lib/Target/TargetSelectionDAG.td +++ b/llvm/lib/Target/TargetSelectionDAG.td @@ -415,3 +415,13 @@ class ComplexPattern<ValueType ty, int numops, string fn, list<SDNode> roots = [ string SelectFunc = fn; list<SDNode> RootNodes = roots; } + +//===----------------------------------------------------------------------===// +// Dwarf support. +// +def SDT_dwarf_loc : SDTypeProfile<0, 3, + [SDTCisInt<0>, SDTCisInt<1>, SDTCisInt<2>]>; +def dwarf_loc : SDNode<"ISD::DEBUG_LOC", SDT_dwarf_loc,[SDNPHasChain]>; + + + |

