aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-02-03 22:49:58 +0000
committerBill Wendling <isanbard@gmail.com>2009-02-03 22:49:58 +0000
commit4756f3b7c233c919df42ea652a7f071505375d51 (patch)
tree5ce7946b0ab83fa605b7ba0f492b487706b2145e /lib
parent341b405bc23e50658ff13dc959e0ed9946b9068b (diff)
downloadexternal_llvm-4756f3b7c233c919df42ea652a7f071505375d51.tar.gz
external_llvm-4756f3b7c233c919df42ea652a7f071505375d51.tar.bz2
external_llvm-4756f3b7c233c919df42ea652a7f071505375d51.zip
Add getDebugLocTuple to retrieve the DebugLocTuple for a given DebugLoc object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/MachineFunction.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp
index 434034b888..fc9aa843e7 100644
--- a/lib/CodeGen/MachineFunction.cpp
+++ b/lib/CodeGen/MachineFunction.cpp
@@ -380,11 +380,11 @@ MachineFunction& MachineFunction::get(const Function *F)
}
/// 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.
+/// source file, line, and column. If none currently exists, create a new
+/// DebugLocTuple, and insert it into the DebugIdMap.
unsigned MachineFunction::getOrCreateDebugLocID(unsigned Src, unsigned Line,
unsigned Col) {
- struct DebugLocTuple Tuple(Src, Line, Col);
+ DebugLocTuple Tuple(Src, Line, Col);
DenseMap<DebugLocTuple, unsigned>::iterator II
= DebugLocInfo.DebugIdMap.find(Tuple);
if (II != DebugLocInfo.DebugIdMap.end())
@@ -396,6 +396,14 @@ unsigned MachineFunction::getOrCreateDebugLocID(unsigned Src, unsigned Line,
return Id;
}
+/// getDebugLocTuple - Get the DebugLocTuple for a given DebugLoc object.
+const DebugLocTuple &MachineFunction::getDebugLocTuple(DebugLoc DL) {
+ unsigned Idx;
+ assert(Idx < DebugLocInfo.DebugLocations.size() &&
+ "Invalid index into debug locations!");
+ return DebugLocInfo.DebugLocations[Idx];
+}
+
//===----------------------------------------------------------------------===//
// MachineFrameInfo implementation
//===----------------------------------------------------------------------===//