From aaeea9e64f7c0f45380d323a32501c4da59a2c4d Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 27 Jan 2009 21:15:07 +0000 Subject: Refine DebugLoc per review comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63132 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineFunction.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/CodeGen/MachineFunction.cpp') diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index abd84ecbd5..b303b1b58c 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -378,13 +378,14 @@ MachineFunction& MachineFunction::get(const Function *F) return *mc; } -/// lookUpDebugLocId - Look up the DebugLocTuple index with the given -/// source file, line, and column. It may add a new filename and / or -/// a new DebugLocTuple. -unsigned MachineFunction::lookUpDebugLocId(unsigned Src, unsigned Line, - unsigned Col) { +/// getOrCreateDebugLocID - Look up the DebugLocTuple index with the given +/// source file, line, and column. If none currently exists, create add a new +/// new DebugLocTuple and insert it into the DebugIdMap. +unsigned MachineFunction::getOrCreateDebugLocID(unsigned Src, unsigned Line, + unsigned Col) { struct DebugLocTuple Tuple(Src, Line, Col); - DebugIdMapType::iterator II = DebugLocInfo.DebugIdMap.find(Tuple); + DenseMap::iterator II + = DebugLocInfo.DebugIdMap.find(Tuple); if (II != DebugLocInfo.DebugIdMap.end()) return II->second; // Add a new tuple. -- cgit v1.2.3-18-g5258