1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

Refactor. No functionality change.

llvm-svn: 74659
This commit is contained in:
Devang Patel 2009-07-01 23:19:01 +00:00
parent 810a970c6f
commit 1fececd8c1

View File

@ -3955,13 +3955,15 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
if (!DIDescriptor::ValidDebugInfo(SP, OptLevel)) if (!DIDescriptor::ValidDebugInfo(SP, OptLevel))
return 0; return 0;
DISubprogram Subprogram(cast<GlobalVariable>(SP));
DICompileUnit CompileUnit = Subprogram.getCompileUnit();
unsigned Line = Subprogram.getLineNumber();
MachineFunction &MF = DAG.getMachineFunction(); MachineFunction &MF = DAG.getMachineFunction();
if (OptLevel == CodeGenOpt::None) { if (OptLevel == CodeGenOpt::None) {
// llvm.dbg.func.start implicitly defines a dbg_stoppoint which is what // llvm.dbg.func.start implicitly defines a dbg_stoppoint which is what
// (most?) gdb expects. // (most?) gdb expects.
DebugLoc PrevLoc = CurDebugLoc; DebugLoc PrevLoc = CurDebugLoc;
DISubprogram Subprogram(cast<GlobalVariable>(SP));
DICompileUnit CompileUnit = Subprogram.getCompileUnit();
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.
@ -3973,7 +3975,6 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
return 0; return 0;
// Record the source line. // Record the source line.
unsigned Line = Subprogram.getLineNumber();
setCurDebugLoc(DebugLoc::get( setCurDebugLoc(DebugLoc::get(
MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0))); MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0)));
@ -3997,8 +3998,6 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
} }
} }
} else { } else {
DISubprogram Subprogram(cast<GlobalVariable>(SP));
std::string SPName; std::string SPName;
Subprogram.getLinkageName(SPName); Subprogram.getLinkageName(SPName);
if (!SPName.empty() if (!SPName.empty()
@ -4008,14 +4007,9 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
return 0; return 0;
} }
// llvm.dbg.func.start implicitly defines a dbg_stoppoint which is
// what (most?) gdb expects.
DICompileUnit CompileUnit = Subprogram.getCompileUnit();
// Record the source line but does not create a label for the normal // Record the source line but does not create a label for the normal
// function start. It will be emitted at asm emission time. However, // function start. It will be emitted at asm emission time. However,
// create a label if this is a beginning of inlined function. // create a label if this is a beginning of inlined function.
unsigned Line = Subprogram.getLineNumber();
setCurDebugLoc(DebugLoc::get( setCurDebugLoc(DebugLoc::get(
MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0))); MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0)));
// FIXME - Start new region because llvm.dbg.func_start also defines // FIXME - Start new region because llvm.dbg.func_start also defines