summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-07-02 00:28:03 +0000
committerDevang Patel <dpatel@apple.com>2009-07-02 00:28:03 +0000
commit6bab414f87104d9ddcfd91d8b193816abed39a3a (patch)
tree369ec27e57cf2e57c43d59e073564bf65393f2fd /llvm/lib/CodeGen
parent43f33dd550a2d165c41cbf01cae97d513dd5002c (diff)
downloadbcm5719-llvm-6bab414f87104d9ddcfd91d8b193816abed39a3a.tar.gz
bcm5719-llvm-6bab414f87104d9ddcfd91d8b193816abed39a3a.zip
Simplify.
llvm-svn: 74677
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp33
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp1
2 files changed, 17 insertions, 17 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 45c7ace78bd..9437e86f0f7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -376,24 +376,24 @@ bool FastISel::SelectCall(User *I) {
if (!DIDescriptor::ValidDebugInfo(SP, CodeGenOpt::None))
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));
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())) {
// 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 ?
+ DebugLoc PrevLoc = DL;
if (PrevLoc.isUnknown())
return true;
// Record the source line.
- unsigned Line = Subprogram.getLineNumber();
- setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(
- CompileUnit.getGV(), Line, 0)));
+ unsigned LocID = MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0);
+ setCurDebugLoc(DebugLoc::get(LocID));
if (DW && DW->ShouldEmitDwarfDebug()) {
DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
@@ -404,17 +404,18 @@ bool FastISel::SelectCall(User *I) {
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
BuildMI(MBB, DL, II).addImm(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()));
- }
+ return true;
}
-
+
+ // 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;
}
case Intrinsic::dbg_declare: {
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index a5fe32b8535..d4a330b0125 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -3962,7 +3962,6 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
MachineFunction &MF = DAG.getMachineFunction();
// If this subprogram does not describe current function then this is
// beginning of a inlined function.
-
bool isInlinedFnStart = !Subprogram.describes(MF.getFunction());
if (isInlinedFnStart && OptLevel != CodeGenOpt::None)
// FIXME: Debugging informaation for inlined function is only
OpenPOWER on IntegriCloud