Refactor.

llvm-svn: 102661
This commit is contained in:
Devang Patel 2010-04-29 20:40:36 +00:00
parent 6feac8a39b
commit 0395553e35
2 changed files with 13 additions and 4 deletions

View File

@ -402,6 +402,17 @@ uint64_t DIDerivedType::getOriginalTypeSize() const {
return getSizeInBits();
}
/// isInlinedFnArgument - Return trule if this variable provides debugging
/// information for an inlined function arguments.
bool DIVariable::isInlinedFnArgument(const Function *CurFn) {
assert(CurFn && "Invalid function");
if (!getContext().isSubprogram())
return false;
// This variable is not inlined function argument if its scope
// does not describe current function.
return !(DISubprogram(getContext().getNode()).describes(CurFn));
}
/// describes - Return true if this subprogram provides debugging
/// information for the function F.
bool DISubprogram::describes(const Function *F) {

View File

@ -3691,14 +3691,12 @@ SelectionDAGBuilder::EmitFuncArgumentDbgValue(const DbgValueInst &DI,
if (!isa<Argument>(V))
return false;
MachineFunction &MF = DAG.getMachineFunction();
// Ignore inlined function arguments here.
DIVariable DV(Variable);
if (DV.getContext().isSubprogram()
&& DISubprogram(DV.getContext().getNode()).getLinkageName()
!= cast<Argument>(V)->getParent()->getName())
if (DV.isInlinedFnArgument(MF.getFunction()))
return false;
MachineFunction &MF = DAG.getMachineFunction();
MachineBasicBlock *MBB = FuncInfo.MBBMap[DI.getParent()];
if (MBB != &MF.front())
return false;