diff options
| author | Dale Johannesen <dalej@apple.com> | 2010-04-25 21:33:54 +0000 |
|---|---|---|
| committer | Dale Johannesen <dalej@apple.com> | 2010-04-25 21:33:54 +0000 |
| commit | 582565e991c76daa7fbb9d2364dcba0840ce1932 (patch) | |
| tree | 46a4c8b99071538306be94fd8dd22caef5339c39 /llvm/lib/Target | |
| parent | 60084b176ed5cd164aedc70d7509696a2b719926 (diff) | |
| download | bcm5719-llvm-582565e991c76daa7fbb9d2364dcba0840ce1932.tar.gz bcm5719-llvm-582565e991c76daa7fbb9d2364dcba0840ce1932.zip | |
Stop abusing EmitInstrWithCustomInserter for target-dependent
form of DEBUG_VALUE, as it doesn't have reasonable default
behavior for unsupported targets. Add a new hook instead.
No functional change.
llvm-svn: 102320
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 28 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.h | 5 |
2 files changed, 18 insertions, 15 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 2060dbf312f..6a14fda5b4d 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -8622,6 +8622,19 @@ X86TargetLowering::EmitLoweredMingwAlloca(MachineInstr *MI, return BB; } +void +X86TargetLowering::EmitTargetCodeForFrameDebugValue(MachineBasicBlock* BB, + unsigned FrameIx, uint64_t Offset, + MDNode *MDPtr, DebugLoc DL) const { + // Target dependent DBG_VALUE. Only the frame index case is done here. + const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); + X86AddressMode AM; + AM.BaseType = X86AddressMode::FrameIndexBase; + AM.Base.FrameIndex = FrameIx; + addFullAddress(BuildMI(BB, DL, TII->get(X86::DBG_VALUE)), AM). + addImm(Offset).addMetadata(MDPtr); +} + MachineBasicBlock * X86TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *BB, @@ -8724,21 +8737,6 @@ X86TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } - // DBG_VALUE. Only the frame index case is done here. - case X86::DBG_VALUE: { - const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); - DebugLoc DL = MI->getDebugLoc(); - X86AddressMode AM; - MachineFunction *F = BB->getParent(); - AM.BaseType = X86AddressMode::FrameIndexBase; - AM.Base.FrameIndex = MI->getOperand(0).getImm(); - addFullAddress(BuildMI(BB, DL, TII->get(X86::DBG_VALUE)), AM). - addImm(MI->getOperand(1).getImm()). - addMetadata(MI->getOperand(2).getMetadata()); - F->DeleteMachineInstr(MI); // Remove pseudo. - return BB; - } - // String/text processing lowering. case X86::PCMPISTRM128REG: return EmitPCMP(MI, BB, 3, false /* in-mem */); diff --git a/llvm/lib/Target/X86/X86ISelLowering.h b/llvm/lib/Target/X86/X86ISelLowering.h index 7996184f33f..79cd08bdc79 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.h +++ b/llvm/lib/Target/X86/X86ISelLowering.h @@ -453,6 +453,11 @@ namespace llvm { /// and some i16 instructions are slow. virtual bool IsDesirableToPromoteOp(SDValue Op, EVT &PVT) const; + virtual void + EmitTargetCodeForFrameDebugValue(MachineBasicBlock* BB, + unsigned FrameIx, uint64_t Offset, + MDNode *MDPtr, DebugLoc DL) const; + virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB, DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const; |

