aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-07-02 00:08:09 +0000
committerDevang Patel <dpatel@apple.com>2009-07-02 00:08:09 +0000
commit07b0ec0927e145458b2e49598b1bbe32262cda6f (patch)
treefd49760754b59e4f0563ee78ba624dbf89073488 /lib
parentfba933c823a2862067e0696bd5032ab18185bd77 (diff)
downloadexternal_llvm-07b0ec0927e145458b2e49598b1bbe32262cda6f.zip
external_llvm-07b0ec0927e145458b2e49598b1bbe32262cda6f.tar.gz
external_llvm-07b0ec0927e145458b2e49598b1bbe32262cda6f.tar.bz2
Simplify. No intentional functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74673 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp85
1 files changed, 36 insertions, 49 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index f3cb2b6..a5fe32b 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -3960,62 +3960,49 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
unsigned Line = Subprogram.getLineNumber();
MachineFunction &MF = DAG.getMachineFunction();
- if (OptLevel == CodeGenOpt::None) {
- // llvm.dbg.func.start implicitly defines a dbg_stoppoint which is what
- // (most?) gdb expects.
+ // 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
+ // supported at CodeGenOpt::Node.
+ return 0;
+
+ if (isInlinedFnStart && OptLevel == CodeGenOpt::None) {
+ // This is a beginning of an inlined function.
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())) {
- // 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.
- 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);
+ // Record the source line.
+ unsigned LocID = MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0);
+ setCurDebugLoc(DebugLoc::get(LocID));
+
+ 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(),
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 {
- 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.
+ return 0;
}
+ // 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;
}
case Intrinsic::dbg_declare: {