summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-01-05 01:25:28 +0000
committerJim Laskey <jlaskey@mac.com>2006-01-05 01:25:28 +0000
commit762e9ec06c62131bd5967b5fe855c543c7d1af67 (patch)
tree14ff31f5a1f97299d4dac2e56bdcc1e0080d044d /llvm/lib/Target/PowerPC
parent45e19098a6a723bd4b5d66ef56f32798f0fafa95 (diff)
downloadbcm5719-llvm-762e9ec06c62131bd5967b5fe855c543c7d1af67.tar.gz
bcm5719-llvm-762e9ec06c62131bd5967b5fe855c543c7d1af67.zip
Added initial support for DEBUG_LABEL allowing debug specific labels to be
inserted in the code. llvm-svn: 25104
Diffstat (limited to 'llvm/lib/Target/PowerPC')
-rw-r--r--llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp6
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelLowering.cpp5
-rw-r--r--llvm/lib/Target/PowerPC/PPCInstrInfo.td11
3 files changed, 16 insertions, 6 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index abbe95a852e..de865db69bd 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -252,7 +252,9 @@ namespace {
bool doFinalization(Module &M);
void getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.setPreservesAll();
AU.addRequired<MachineDebugInfo>();
+ PPCAsmPrinter::getAnalysisUsage(AU);
}
};
@@ -418,6 +420,9 @@ void PPCAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
/// method to print assembly for each instruction.
///
bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ // FIXME - is this the earliest this can be set.
+ DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
+
SetupMachineFunction(MF);
O << "\n\n";
@@ -486,7 +491,6 @@ bool DarwinAsmPrinter::doInitialization(Module &M) {
Mang->setUseQuotes(true);
// Emit initial debug information.
- DW.SetDebugInfo(getAnalysisToUpdate<MachineDebugInfo>());
DW.BeginModule();
return false;
}
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 01d8f075b7b..8eb4ac303a7 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -94,8 +94,11 @@ PPCTargetLowering::PPCTargetLowering(TargetMachine &TM)
// PowerPC does not have truncstore for i1.
setOperationAction(ISD::TRUNCSTORE, MVT::i1, Promote);
- // PowerPC doesn't have line number support yet.
+ // Support label based line numbers.
setOperationAction(ISD::LOCATION, MVT::Other, Expand);
+ // FIXME - use subtarget debug flags
+ if (TM.getSubtarget<PPCSubtarget>().isDarwin())
+ setOperationAction(ISD::DEBUG_LABEL, MVT::Other, Expand);
// We want to legalize GlobalAddress and ConstantPool nodes into the
// appropriate instructions to materialize the address.
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/llvm/lib/Target/PowerPC/PPCInstrInfo.td
index 3d3424d17bc..66b1bad4b0d 100644
--- a/llvm/lib/Target/PowerPC/PPCInstrInfo.td
+++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.td
@@ -955,11 +955,14 @@ def V_SET0 : VXForm_setzero<1220, (ops VRRC:$vD),
// DWARF Pseudo Instructions
//
-def DWARF_LOC : Pseudo<(ops i32imm:$line, i32imm:$col, i32imm:$file,
- i32imm:$id),
- "; .loc $file, $line, $col\nLdebug_loc$id:",
+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), (i32 imm:$id))]>;
+ (i32 imm:$file))]>;
+
+def DWARF_LABEL : Pseudo<(ops i32imm:$id),
+ "\nLdebug_loc$id:",
+ [(dwarf_label (i32 imm:$id))]>;
//===----------------------------------------------------------------------===//
// PowerPC Instruction Patterns
OpenPOWER on IntegriCloud