No need to keep size of DebugLocations vector separately.

llvm-svn: 63070
This commit is contained in:
Evan Cheng 2009-01-26 23:47:30 +00:00
parent 7a88d1fcc4
commit b8c79bdc31
2 changed files with 4 additions and 6 deletions

View File

@ -69,9 +69,6 @@ namespace llvm {
/// DebugLocTracker - This class tracks debug location information.
///
struct DebugLocTracker {
// NumDebugLocations - Size of the DebugLocations vector.
unsigned NumDebugLocations;
// DebugLocations - A vector of unique DebugLocTuple's.
//
std::vector<DebugLocTuple> DebugLocations;
@ -80,7 +77,7 @@ namespace llvm {
// DebugLocations vector.
DebugIdMapType DebugIdMap;
DebugLocTracker() : NumDebugLocations(0) {}
DebugLocTracker() {}
~DebugLocTracker() {
DebugLocations.clear();

View File

@ -388,9 +388,10 @@ unsigned MachineFunction::lookUpDebugLocId(unsigned Src, unsigned Line,
if (II != DebugLocInfo.DebugIdMap.end())
return II->second;
// Add a new tuple.
unsigned Id = DebugLocInfo.DebugLocations.size();
DebugLocInfo.DebugLocations.push_back(Tuple);
DebugLocInfo.DebugIdMap[Tuple] = DebugLocInfo.NumDebugLocations;
return DebugLocInfo.NumDebugLocations++;
DebugLocInfo.DebugIdMap[Tuple] = Id;
return Id;
}
//===----------------------------------------------------------------------===//