Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74677 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2009-07-02 00:28:03 +00:00
parent f530c92cd5
commit 6d8f1263f4
2 changed files with 16 additions and 16 deletions

View File

@ -376,24 +376,24 @@ bool FastISel::SelectCall(User *I) {
if (!DIDescriptor::ValidDebugInfo(SP, CodeGenOpt::None)) if (!DIDescriptor::ValidDebugInfo(SP, CodeGenOpt::None))
return true; return true;
// llvm.dbg.func.start implicitly defines a dbg_stoppoint which is what
// (most?) gdb expects.
DebugLoc PrevLoc = DL;
DISubprogram Subprogram(cast<GlobalVariable>(SP)); DISubprogram Subprogram(cast<GlobalVariable>(SP));
DICompileUnit CompileUnit = Subprogram.getCompileUnit(); DICompileUnit CompileUnit = Subprogram.getCompileUnit();
unsigned Line = Subprogram.getLineNumber();
// If this subprogram does not describe current function then this is
// beginning of a inlined function.
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 // If llvm.dbg.func.start is seen in a new block before any
// llvm.dbg.stoppoint intrinsic then the location info is unknown. // llvm.dbg.stoppoint intrinsic then the location info is unknown.
// FIXME : Why DebugLoc is reset at the beginning of each block ? // FIXME : Why DebugLoc is reset at the beginning of each block ?
DebugLoc PrevLoc = DL;
if (PrevLoc.isUnknown()) if (PrevLoc.isUnknown())
return true; return true;
// Record the source line. // Record the source line.
unsigned Line = Subprogram.getLineNumber(); unsigned LocID = MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0);
setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID( setCurDebugLoc(DebugLoc::get(LocID));
CompileUnit.getGV(), Line, 0)));
if (DW && DW->ShouldEmitDwarfDebug()) { if (DW && DW->ShouldEmitDwarfDebug()) {
DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc); DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
@ -404,17 +404,18 @@ bool FastISel::SelectCall(User *I) {
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
BuildMI(MBB, DL, II).addImm(LabelID); BuildMI(MBB, DL, II).addImm(LabelID);
} }
} else { return true;
// 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()));
}
} }
// 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 true; return true;
} }
case Intrinsic::dbg_declare: { case Intrinsic::dbg_declare: {

View File

@ -3962,7 +3962,6 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
MachineFunction &MF = DAG.getMachineFunction(); MachineFunction &MF = DAG.getMachineFunction();
// If this subprogram does not describe current function then this is // If this subprogram does not describe current function then this is
// beginning of a inlined function. // beginning of a inlined function.
bool isInlinedFnStart = !Subprogram.describes(MF.getFunction()); bool isInlinedFnStart = !Subprogram.describes(MF.getFunction());
if (isInlinedFnStart && OptLevel != CodeGenOpt::None) if (isInlinedFnStart && OptLevel != CodeGenOpt::None)
// FIXME: Debugging informaation for inlined function is only // FIXME: Debugging informaation for inlined function is only