//
/// 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 getOrCreateDebugLocID(unsigned Src, unsigned Line, unsigned Col);
+
+ /// getDebugLocTuple - Get the DebugLocTuple for a given DebugLoc object.
+ const DebugLocTuple &getDebugLocTuple(DebugLoc DL);
};
//===--------------------------------------------------------------------===//
}
/// 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())
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
//===----------------------------------------------------------------------===//