aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineDebugInfo.cpp
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
commita97906b6e6e85934d6cb71ddf3ca9bb72fe66695 (patch)
tree1c0f8451d130af8e6cd6e73818222c810e8e8896 /lib/CodeGen/MachineDebugInfo.cpp
parentae1dc403274d3a64bcee31f15e2d25e4b7178811 (diff)
downloadexternal_llvm-a97906b6e6e85934d6cb71ddf3ca9bb72fe66695.zip
external_llvm-a97906b6e6e85934d6cb71ddf3ca9bb72fe66695.tar.gz
external_llvm-a97906b6e6e85934d6cb71ddf3ca9bb72fe66695.tar.bz2
add a method to remove a line # record.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31025 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineDebugInfo.cpp')
-rw-r--r--lib/CodeGen/MachineDebugInfo.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp
index a227589..7ca63b0 100644
--- a/lib/CodeGen/MachineDebugInfo.cpp
+++ b/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,