forked from OSchip/llvm-project
Provide a way to extract location info from DILocation.
llvm-svn: 82064
This commit is contained in:
parent
0d9950e315
commit
820640d39f
|
@ -669,6 +669,11 @@ namespace llvm {
|
|||
DebugLoc ExtractDebugLocation(DbgStopPointInst &SPI,
|
||||
DebugLocTracker &DebugLocInfo);
|
||||
|
||||
/// ExtractDebugLocation - Extract debug location information
|
||||
/// from DILocation.
|
||||
DebugLoc ExtractDebugLocation(DILocation &Loc,
|
||||
DebugLocTracker &DebugLocInfo);
|
||||
|
||||
/// ExtractDebugLocation - Extract debug location information
|
||||
/// from llvm.dbg.func_start intrinsic.
|
||||
DebugLoc ExtractDebugLocation(DbgFuncStartInst &FSI,
|
||||
|
|
|
@ -1209,6 +1209,29 @@ namespace llvm {
|
|||
return DebugLoc::get(Id);
|
||||
}
|
||||
|
||||
/// ExtractDebugLocation - Extract debug location information
|
||||
/// from DILocation.
|
||||
DebugLoc ExtractDebugLocation(DILocation &Loc,
|
||||
DebugLocTracker &DebugLocInfo) {
|
||||
DebugLoc DL;
|
||||
MDNode *Context = Loc.getScope().getNode();
|
||||
|
||||
// If this location is already tracked then use it.
|
||||
DebugLocTuple Tuple(Context, Loc.getLineNumber(),
|
||||
Loc.getColumnNumber());
|
||||
DenseMap<DebugLocTuple, unsigned>::iterator II
|
||||
= DebugLocInfo.DebugIdMap.find(Tuple);
|
||||
if (II != DebugLocInfo.DebugIdMap.end())
|
||||
return DebugLoc::get(II->second);
|
||||
|
||||
// Add a new location entry.
|
||||
unsigned Id = DebugLocInfo.DebugLocations.size();
|
||||
DebugLocInfo.DebugLocations.push_back(Tuple);
|
||||
DebugLocInfo.DebugIdMap[Tuple] = Id;
|
||||
|
||||
return DebugLoc::get(Id);
|
||||
}
|
||||
|
||||
/// ExtractDebugLocation - Extract debug location information
|
||||
/// from llvm.dbg.func_start intrinsic.
|
||||
DebugLoc ExtractDebugLocation(DbgFuncStartInst &FSI,
|
||||
|
|
Loading…
Reference in New Issue