mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
Simplify. No intentional functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74673 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fba933c823
commit
07b0ec0927
@ -3960,62 +3960,49 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
|
|||||||
unsigned Line = Subprogram.getLineNumber();
|
unsigned Line = Subprogram.getLineNumber();
|
||||||
|
|
||||||
MachineFunction &MF = DAG.getMachineFunction();
|
MachineFunction &MF = DAG.getMachineFunction();
|
||||||
if (OptLevel == CodeGenOpt::None) {
|
// If this subprogram does not describe current function then this is
|
||||||
// llvm.dbg.func.start implicitly defines a dbg_stoppoint which is what
|
// beginning of a inlined function.
|
||||||
// (most?) gdb expects.
|
|
||||||
|
bool isInlinedFnStart = !Subprogram.describes(MF.getFunction());
|
||||||
|
if (isInlinedFnStart && OptLevel != CodeGenOpt::None)
|
||||||
|
// FIXME: Debugging informaation for inlined function is only
|
||||||
|
// supported at CodeGenOpt::Node.
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (isInlinedFnStart && OptLevel == CodeGenOpt::None) {
|
||||||
|
// This is a beginning of an inlined function.
|
||||||
DebugLoc PrevLoc = CurDebugLoc;
|
DebugLoc PrevLoc = CurDebugLoc;
|
||||||
|
// 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;
|
||||||
|
|
||||||
if (!Subprogram.describes(MF.getFunction())) {
|
// Record the source line.
|
||||||
// This is a beginning of an inlined function.
|
unsigned LocID = MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0);
|
||||||
|
setCurDebugLoc(DebugLoc::get(LocID));
|
||||||
// If llvm.dbg.func.start is seen in a new block before any
|
|
||||||
// llvm.dbg.stoppoint intrinsic then the location info is unknown.
|
if (DW && DW->ShouldEmitDwarfDebug()) {
|
||||||
// FIXME : Why DebugLoc is reset at the beginning of each block ?
|
DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
|
||||||
if (PrevLoc.isUnknown())
|
unsigned LabelID = DW->RecordInlinedFnStart(Subprogram,
|
||||||
return 0;
|
DICompileUnit(PrevLocTpl.CompileUnit),
|
||||||
|
PrevLocTpl.Line,
|
||||||
// Record the source line.
|
PrevLocTpl.Col);
|
||||||
setCurDebugLoc(DebugLoc::get(
|
|
||||||
MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0)));
|
|
||||||
|
|
||||||
if (DW && DW->ShouldEmitDwarfDebug()) {
|
|
||||||
DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
|
|
||||||
unsigned LabelID = DW->RecordInlinedFnStart(Subprogram,
|
|
||||||
DICompileUnit(PrevLocTpl.CompileUnit),
|
|
||||||
PrevLocTpl.Line,
|
|
||||||
PrevLocTpl.Col);
|
|
||||||
DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
|
DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
|
||||||
getRoot(), LabelID));
|
getRoot(), LabelID));
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Record the source line.
|
|
||||||
unsigned Line = Subprogram.getLineNumber();
|
|
||||||
MF.setDefaultDebugLoc(DebugLoc::get(
|
|
||||||
MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0)));
|
|
||||||
if (DW && DW->ShouldEmitDwarfDebug()) {
|
|
||||||
// llvm.dbg.func_start also defines beginning of function scope.
|
|
||||||
DW->RecordRegionStart(cast<GlobalVariable>(FSI.getSubprogram()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
return 0;
|
||||||
std::string SPName;
|
|
||||||
Subprogram.getLinkageName(SPName);
|
|
||||||
if (!SPName.empty()
|
|
||||||
&& strcmp(SPName.c_str(), MF.getFunction()->getNameStart())) {
|
|
||||||
// This is beginning of inlined function. Debugging information for
|
|
||||||
// inlined function is not handled yet (only supported by FastISel).
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Record the source line but does not create a label for the normal
|
|
||||||
// function start. It will be emitted at asm emission time. However,
|
|
||||||
// create a label if this is a beginning of inlined function.
|
|
||||||
setCurDebugLoc(DebugLoc::get(
|
|
||||||
MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0)));
|
|
||||||
// FIXME - Start new region because llvm.dbg.func_start also defines
|
|
||||||
// beginning of function scope.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is a beginning of a new function.
|
||||||
|
// Record the source line.
|
||||||
|
unsigned LocID = MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0);
|
||||||
|
MF.setDefaultDebugLoc(DebugLoc::get(LocID));
|
||||||
|
|
||||||
|
if (DW && DW->ShouldEmitDwarfDebug())
|
||||||
|
// llvm.dbg.func_start also defines beginning of function scope.
|
||||||
|
DW->RecordRegionStart(cast<GlobalVariable>(FSI.getSubprogram()));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case Intrinsic::dbg_declare: {
|
case Intrinsic::dbg_declare: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user