mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-10 18:37:01 +00:00
Do not treat beginning of inlined scope as beginning of normal function scope if the location info is missing.
Insetad of doing ... if (inlined_subroutine && known_location) DW_TAG_inline_subroutine else DW_TAG_subprogram do if (inlined_subroutine) { if (known_location) DW_TAG_inline_subroutine } else { DW_TAG_subprogram } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69300 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
65e05b69d6
commit
02f8c41014
@ -362,7 +362,10 @@ bool FastISel::SelectCall(User *I) {
|
|||||||
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
|
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
|
||||||
ID = DW->RecordInlinedFnEnd(Subprogram);
|
ID = DW->RecordInlinedFnEnd(Subprogram);
|
||||||
if (ID)
|
if (ID)
|
||||||
// If ID is 0 then this was not an end of inlined region.
|
// Returned ID is 0 if this is unbalanced "end of inlined
|
||||||
|
// scope". This could happen if optimizer eats dbg intrinsics
|
||||||
|
// or "beginning of inlined scope" is not recoginized due to
|
||||||
|
// missing location info. In such cases, do ignore this region.end.
|
||||||
BuildMI(MBB, DL, II).addImm(ID);
|
BuildMI(MBB, DL, II).addImm(ID);
|
||||||
} else {
|
} else {
|
||||||
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
|
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
|
||||||
@ -387,9 +390,14 @@ bool FastISel::SelectCall(User *I) {
|
|||||||
unsigned SrcFile = DW->getOrCreateSourceID(CompileUnit.getDirectory(Dir),
|
unsigned SrcFile = DW->getOrCreateSourceID(CompileUnit.getDirectory(Dir),
|
||||||
CompileUnit.getFilename(FN));
|
CompileUnit.getFilename(FN));
|
||||||
|
|
||||||
if (!Subprogram.describes(MF.getFunction()) && !PrevLoc.isUnknown()) {
|
if (!Subprogram.describes(MF.getFunction())) {
|
||||||
// This is a beginning of an inlined function.
|
// This is a beginning of an inlined function.
|
||||||
|
|
||||||
|
// If llvm.dbg.func.start is seen in a new block before any
|
||||||
|
// llvm.dbg.stoppoint intrinsic then the location info is unknown.
|
||||||
|
// FIXME : Why DebugLoc is reset at the beginning of each block ?
|
||||||
|
if (PrevLoc.isUnknown())
|
||||||
|
return true;
|
||||||
// Record the source line.
|
// Record the source line.
|
||||||
unsigned Line = Subprogram.getLineNumber();
|
unsigned Line = Subprogram.getLineNumber();
|
||||||
unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile);
|
unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile);
|
||||||
|
@ -3966,6 +3966,10 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
|
|||||||
if (Fast) {
|
if (Fast) {
|
||||||
unsigned ID = DW->RecordInlinedFnEnd(Subprogram);
|
unsigned ID = DW->RecordInlinedFnEnd(Subprogram);
|
||||||
if (ID != 0)
|
if (ID != 0)
|
||||||
|
// Returned ID is 0 if this is unbalanced "end of inlined
|
||||||
|
// scope". This could happen if optimizer eats dbg intrinsics
|
||||||
|
// or "beginning of inlined scope" is not recoginized due to
|
||||||
|
// missing location info. In such cases, do ignore this region.end.
|
||||||
DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
|
DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
|
||||||
getRoot(), ID));
|
getRoot(), ID));
|
||||||
}
|
}
|
||||||
@ -4000,6 +4004,12 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
|
|||||||
if (!Subprogram.describes(MF.getFunction())) {
|
if (!Subprogram.describes(MF.getFunction())) {
|
||||||
// This is a beginning of an inlined function.
|
// This is a beginning of an inlined function.
|
||||||
|
|
||||||
|
// If llvm.dbg.func.start is seen in a new block before any
|
||||||
|
// llvm.dbg.stoppoint intrinsic then the location info is unknown.
|
||||||
|
// FIXME : Why DebugLoc is reset at the beginning of each block ?
|
||||||
|
if (PrevLoc.isUnknown())
|
||||||
|
return 0;
|
||||||
|
|
||||||
// Record the source line.
|
// Record the source line.
|
||||||
unsigned Line = Subprogram.getLineNumber();
|
unsigned Line = Subprogram.getLineNumber();
|
||||||
unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile);
|
unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user