aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorevancheng <evancheng@91177308-0d34-0410-b5e6-96231b3b80d8>2009-01-27 21:15:07 +0000
committerevancheng <evancheng@91177308-0d34-0410-b5e6-96231b3b80d8>2009-01-27 21:15:07 +0000
commitc611f1d881c25889d6343c0bd41ea73a5157ae66 (patch)
tree61bcbb8c4220806701cd15e0a356df90b78337b0 /lib/CodeGen/MachineFunction.cpp
parent51bef2e7f3b8bd4bafc8b4e4e6d42d0b2ede47ee (diff)
downloadexternal_llvm-c611f1d881c25889d6343c0bd41ea73a5157ae66.zip
external_llvm-c611f1d881c25889d6343c0bd41ea73a5157ae66.tar.gz
external_llvm-c611f1d881c25889d6343c0bd41ea73a5157ae66.tar.bz2
Refine DebugLoc per review comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineFunction.cpp')
-rw-r--r--lib/CodeGen/MachineFunction.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp
index abd84ec..b303b1b 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<DebugLocTuple, unsigned>::iterator II
+ = DebugLocInfo.DebugIdMap.find(Tuple);
if (II != DebugLocInfo.DebugIdMap.end())
return II->second;
// Add a new tuple.