1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

add a method to remove a line # record.

llvm-svn: 31025
This commit is contained in:
Chris Lattner 2006-10-17 23:16:42 +00:00
parent 7353b07275
commit 22e311fe77
2 changed files with 19 additions and 0 deletions

View File

@ -1029,6 +1029,11 @@ public:
/// provide correspondence to the source line list.
unsigned RecordLabel(unsigned Line, unsigned Column, unsigned Source);
/// RemoveLabelInfo - Remove the specified label # from MachineDebugInfo, for
/// example because the code was deleted.
void RemoveLabelInfo(unsigned LabelUID);
/// RecordSource - Register a source file with debug info. Returns an source
/// ID.
unsigned RecordSource(const std::string &Directory,

View File

@ -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,