summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineDebugInfo.cpp
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-10-23 14:56:37 +0000
committerJim Laskey <jlaskey@mac.com>2006-10-23 14:56:37 +0000
commit5e1a34032b6298647b34b44cf19f330d9c49b6de (patch)
tree60f16f034de4ab7d0760c07026412382ae4919b9 /llvm/lib/CodeGen/MachineDebugInfo.cpp
parentbd7a1d2b4dddd41821c8d2143a7d22ebc855e712 (diff)
downloadbcm5719-llvm-5e1a34032b6298647b34b44cf19f330d9c49b6de.tar.gz
bcm5719-llvm-5e1a34032b6298647b34b44cf19f330d9c49b6de.zip
More complete solution to deleting blocks and debug info.
llvm-svn: 31129
Diffstat (limited to 'llvm/lib/CodeGen/MachineDebugInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineDebugInfo.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/MachineDebugInfo.cpp b/llvm/lib/CodeGen/MachineDebugInfo.cpp
index a1f4f1338b2..380b8a9656d 100644
--- a/llvm/lib/CodeGen/MachineDebugInfo.cpp
+++ b/llvm/lib/CodeGen/MachineDebugInfo.cpp
@@ -1451,6 +1451,7 @@ MachineDebugInfo::MachineDebugInfo()
, LabelID(0)
, ScopeMap()
, RootScope(NULL)
+, DeletedLabelIDs()
, FrameMoves()
{}
MachineDebugInfo::~MachineDebugInfo() {
@@ -1543,20 +1544,18 @@ unsigned MachineDebugInfo::RecordLabel(unsigned Line, unsigned Column,
return ID;
}
-static bool LabelUIDComparison(const SourceLineInfo &LI, unsigned UID) {
- return LI.getLabelID() < UID;
+/// InvalidateLabel - Inhibit use of the specified label # from
+/// MachineDebugInfo, for example because the code was deleted.
+void MachineDebugInfo::InvalidateLabel(unsigned LabelID) {
+ DeletedLabelIDs.insert(LabelID);
}
-/// 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);
+/// isLabelValid - Check to make sure the label is still valid before
+/// attempting to use.
+bool MachineDebugInfo::isLabelValid(unsigned LabelID) {
+ return DeletedLabelIDs.find(LabelID) == DeletedLabelIDs.end();
}
-
/// RecordSource - Register a source file with debug info. Returns an source
/// ID.
unsigned MachineDebugInfo::RecordSource(const std::string &Directory,
OpenPOWER on IntegriCloud