[llvm-commits] [llvm] r63070 - in /llvm/trunk: include/llvm/CodeGen/DebugLoc.h lib/CodeGen/MachineFunction.cpp
Evan Cheng
evan.cheng at apple.com
Mon Jan 26 15:47:31 PST 2009
Author: evancheng
Date: Mon Jan 26 17:47:30 2009
New Revision: 63070
URL: http://llvm.org/viewvc/llvm-project?rev=63070&view=rev
Log:
No need to keep size of DebugLocations vector separately.
Modified:
llvm/trunk/include/llvm/CodeGen/DebugLoc.h
llvm/trunk/lib/CodeGen/MachineFunction.cpp
Modified: llvm/trunk/include/llvm/CodeGen/DebugLoc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DebugLoc.h?rev=63070&r1=63069&r2=63070&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/DebugLoc.h (original)
+++ llvm/trunk/include/llvm/CodeGen/DebugLoc.h Mon Jan 26 17:47:30 2009
@@ -69,9 +69,6 @@
/// 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 @@
// DebugLocations vector.
DebugIdMapType DebugIdMap;
- DebugLocTracker() : NumDebugLocations(0) {}
+ DebugLocTracker() {}
~DebugLocTracker() {
DebugLocations.clear();
Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=63070&r1=63069&r2=63070&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Mon Jan 26 17:47:30 2009
@@ -388,9 +388,10 @@
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;
}
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list