[llvm-commits] [llvm] r63676 - in /llvm/trunk: include/llvm/CodeGen/MachineFunction.h lib/CodeGen/MachineFunction.cpp
Bill Wendling
isanbard at gmail.com
Tue Feb 3 14:49:58 PST 2009
Author: void
Date: Tue Feb 3 16:49:58 2009
New Revision: 63676
URL: http://llvm.org/viewvc/llvm-project?rev=63676&view=rev
Log:
Add getDebugLocTuple to retrieve the DebugLocTuple for a given DebugLoc object.
Modified:
llvm/trunk/include/llvm/CodeGen/MachineFunction.h
llvm/trunk/lib/CodeGen/MachineFunction.cpp
Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=63676&r1=63675&r2=63676&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Tue Feb 3 16:49:58 2009
@@ -313,9 +313,12 @@
//
/// 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);
};
//===--------------------------------------------------------------------===//
Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=63676&r1=63675&r2=63676&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Tue Feb 3 16:49:58 2009
@@ -380,11 +380,11 @@
}
/// 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 @@
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
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list