From b9f66cfadf6b1551192ee4a6e9b70f564c5ed8be Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Mon, 26 Jan 2009 23:47:30 +0000 Subject: 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 --- lib/CodeGen/MachineFunction.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/MachineFunction.cpp') diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index c1ab9afe9f..abd84ecbd5 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; } //===----------------------------------------------------------------------===// -- cgit v1.2.3-18-g5258