[llvm-commits] CVS: llvm/lib/CodeGen/MachineDebugInfo.cpp

Chris Lattner sabre at nondot.org
Tue Oct 17 16:16:59 PDT 2006



Changes in directory llvm/lib/CodeGen:

MachineDebugInfo.cpp updated: 1.49 -> 1.50
---
Log message:

add a method to remove a line # record.


---
Diffs of the changes:  (+14 -0)

 MachineDebugInfo.cpp |   14 ++++++++++++++
 1 files changed, 14 insertions(+)


Index: llvm/lib/CodeGen/MachineDebugInfo.cpp
diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.49 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.50
--- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.49	Tue Oct 17 17:06:46 2006
+++ llvm/lib/CodeGen/MachineDebugInfo.cpp	Tue Oct 17 18:16:42 2006
@@ -1542,6 +1542,20 @@
   return ID;
 }
 
+static bool LabelUIDComparison(const SourceLineInfo &LI, unsigned UID) {
+  return LI.getLabelID() < UID;
+}
+
+/// RemoveLabelInfo - Remove the specified label # from MachineDebugInfo, for
+/// example because the code was deleted.
+void MachineDebugInfo::RemoveLabelInfo(unsigned LabelUID) {
+  std::vector<SourceLineInfo>::iterator I =
+    std::lower_bound(Lines.begin(), Lines.end(), LabelUID, LabelUIDComparison);
+  assert(I != Lines.end() && "Didn't find label UID in MachineDebugInfo!");
+  Lines.erase(I);
+}
+
+
 /// RecordSource - Register a source file with debug info. Returns an source
 /// ID.
 unsigned MachineDebugInfo::RecordSource(const std::string &Directory,






More information about the llvm-commits mailing list