diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-10-23 14:56:37 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-10-23 14:56:37 +0000 |
commit | 66ebf0973d717b4b2cdef731847aef3904fd04b2 (patch) | |
tree | 7c98ec2d36c9eb7c2c4deb9960a29f3819ce9eda /lib/CodeGen/MachineDebugInfo.cpp | |
parent | 978b35e5027208e707f642247643fb17de4af5f7 (diff) |
More complete solution to deleting blocks and debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31129 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/MachineDebugInfo.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp index a1f4f1338b..380b8a9656 100644 --- a/lib/CodeGen/MachineDebugInfo.cpp +++ b/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, |