diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-01-26 23:47:30 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-01-26 23:47:30 +0000 |
commit | b9f66cfadf6b1551192ee4a6e9b70f564c5ed8be (patch) | |
tree | c51e825ce7e4351b6a0c8e22610ced618db3359d | |
parent | 8bca3b76646ab19a69d8d50d3dcad9f2c82159bd (diff) | |
download | external_llvm-b9f66cfadf6b1551192ee4a6e9b70f564c5ed8be.zip external_llvm-b9f66cfadf6b1551192ee4a6e9b70f564c5ed8be.tar.gz external_llvm-b9f66cfadf6b1551192ee4a6e9b70f564c5ed8be.tar.bz2 |
No need to keep size of DebugLocations vector separately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63070 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/CodeGen/DebugLoc.h | 5 | ||||
-rw-r--r-- | lib/CodeGen/MachineFunction.cpp | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/include/llvm/CodeGen/DebugLoc.h b/include/llvm/CodeGen/DebugLoc.h index b6097af..baf6583 100644 --- a/include/llvm/CodeGen/DebugLoc.h +++ b/include/llvm/CodeGen/DebugLoc.h @@ -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(); diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index c1ab9af..abd84ec 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -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; } //===----------------------------------------------------------------------===// |