mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Simplify and delay extracting DebugLoc elements, scope and InlinedAt, as much as possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -128,6 +128,22 @@ DebugLoc DebugLoc::getFromDILocation(MDNode *N) {
|
||||
return get(LineNo, ColNo, Scope, dyn_cast_or_null<MDNode>(N->getOperand(3)));
|
||||
}
|
||||
|
||||
/// getFromDILexicalBlock - Translate the DILexicalBlock into a DebugLoc.
|
||||
DebugLoc DebugLoc::getFromDILexicalBlock(MDNode *N) {
|
||||
if (N == 0 || N->getNumOperands() < 3) return DebugLoc();
|
||||
|
||||
MDNode *Scope = dyn_cast_or_null<MDNode>(N->getOperand(1));
|
||||
if (Scope == 0) return DebugLoc();
|
||||
|
||||
unsigned LineNo = 0, ColNo = 0;
|
||||
if (ConstantInt *Line = dyn_cast_or_null<ConstantInt>(N->getOperand(2)))
|
||||
LineNo = Line->getZExtValue();
|
||||
if (ConstantInt *Col = dyn_cast_or_null<ConstantInt>(N->getOperand(3)))
|
||||
ColNo = Col->getZExtValue();
|
||||
|
||||
return get(LineNo, ColNo, Scope, NULL);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// DenseMap specialization
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Reference in New Issue
Block a user