summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-10-17 23:16:42 +0000
committerChris Lattner <sabre@nondot.org>2006-10-17 23:16:42 +0000
commit34136d0cc18cef93bb03b4f186f94790b362d3a7 (patch)
tree6e6b46d5b7654aa135218e185839e31e9312ec8c /llvm/lib
parent0408e5b7ce4cd1678d6e784706adc150240fa328 (diff)
downloadbcm5719-llvm-34136d0cc18cef93bb03b4f186f94790b362d3a7.tar.gz
bcm5719-llvm-34136d0cc18cef93bb03b4f186f94790b362d3a7.zip
add a method to remove a line # record.
llvm-svn: 31025
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineDebugInfo.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineDebugInfo.cpp b/llvm/lib/CodeGen/MachineDebugInfo.cpp
index a227589e1e8..7ca63b0ba48 100644
--- a/llvm/lib/CodeGen/MachineDebugInfo.cpp
+++ b/llvm/lib/CodeGen/MachineDebugInfo.cpp
@@ -1542,6 +1542,20 @@ unsigned MachineDebugInfo::RecordLabel(unsigned Line, unsigned Column,
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,
OpenPOWER on IntegriCloud