summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GCStrategy.cpp
diff options
context:
space:
mode:
authorNicolas Geoffray <nicolas.geoffray@lip6.fr>2009-09-08 07:39:27 +0000
committerNicolas Geoffray <nicolas.geoffray@lip6.fr>2009-09-08 07:39:27 +0000
commit51ae4a23dacd5e93d25bf307b528c197fb5572a1 (patch)
tree56ce7072f9cd0700d7adbcbda894b331138694b4 /llvm/lib/CodeGen/GCStrategy.cpp
parent8ab546ddca430c89e73b88101b06f9f9d8fcfb06 (diff)
downloadbcm5719-llvm-51ae4a23dacd5e93d25bf307b528c197fb5572a1.tar.gz
bcm5719-llvm-51ae4a23dacd5e93d25bf307b528c197fb5572a1.zip
When emitting a label for a PostCall safe point, the machine
instruction to insert before can be end(). getDebugLoc on end() returns an invalid value, therefore use the debug loc of the call instruction, and give it to InsertLabel. llvm-svn: 81207
Diffstat (limited to 'llvm/lib/CodeGen/GCStrategy.cpp')
-rw-r--r--llvm/lib/CodeGen/GCStrategy.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/GCStrategy.cpp b/llvm/lib/CodeGen/GCStrategy.cpp
index 2529e4f1f3d..6d0de41e2c3 100644
--- a/llvm/lib/CodeGen/GCStrategy.cpp
+++ b/llvm/lib/CodeGen/GCStrategy.cpp
@@ -72,7 +72,8 @@ namespace {
void FindSafePoints(MachineFunction &MF);
void VisitCallPoint(MachineBasicBlock::iterator MI);
unsigned InsertLabel(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const;
+ MachineBasicBlock::iterator MI,
+ DebugLoc DL) const;
void FindStackOffsets(MachineFunction &MF);
@@ -329,11 +330,13 @@ void MachineCodeAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
}
unsigned MachineCodeAnalysis::InsertLabel(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI) const {
+ MachineBasicBlock::iterator MI,
+ DebugLoc DL) const {
unsigned Label = MMI->NextLabelID();
- // N.B. we assume that MI is *not* equal to the "end()" iterator.
- BuildMI(MBB, MI, MI->getDebugLoc(),
+
+ BuildMI(MBB, MI, DL,
TII->get(TargetInstrInfo::GC_LABEL)).addImm(Label);
+
return Label;
}
@@ -344,10 +347,12 @@ void MachineCodeAnalysis::VisitCallPoint(MachineBasicBlock::iterator CI) {
++RAI;
if (FI->getStrategy().needsSafePoint(GC::PreCall))
- FI->addSafePoint(GC::PreCall, InsertLabel(*CI->getParent(), CI));
+ FI->addSafePoint(GC::PreCall, InsertLabel(*CI->getParent(), CI,
+ CI->getDebugLoc()));
if (FI->getStrategy().needsSafePoint(GC::PostCall))
- FI->addSafePoint(GC::PostCall, InsertLabel(*CI->getParent(), RAI));
+ FI->addSafePoint(GC::PostCall, InsertLabel(*CI->getParent(), RAI,
+ CI->getDebugLoc()));
}
void MachineCodeAnalysis::FindSafePoints(MachineFunction &MF) {
OpenPOWER on IntegriCloud