diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-01-27 21:15:07 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-01-27 21:15:07 +0000 |
commit | 573e5291274d1e419a5996ac4a461a0275ad36bd (patch) | |
tree | 35e7108385e8b390bbfd5a4880202d4b34953160 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | f4a0cba545e4ada42dd5b7ae240a86573c779044 (diff) | |
download | bcm5719-llvm-573e5291274d1e419a5996ac4a461a0275ad36bd.tar.gz bcm5719-llvm-573e5291274d1e419a5996ac4a461a0275ad36bd.zip |
Refine DebugLoc per review comments.
llvm-svn: 63132
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index abd84ecbd5c..b303b1b58c9 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/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. |