Copy location info for current function argument from dbg.declare if respective store instruction does not have any location info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105490 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2010-06-04 22:27:30 +00:00
parent 7c21f747c7
commit 93031ac032
3 changed files with 4 additions and 6 deletions

View File

@@ -897,10 +897,8 @@ void PromoteMem2Reg::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
// Propagate any debug metadata from the store onto the dbg.value.
if (MDNode *SIMD = SI->getMetadata("dbg"))
DbgVal->setMetadata("dbg", SIMD);
// Otherwise propagate debug metadata from dbg.declare for inlined fn args.
else if (!DISubprogram(DIVar.getContext()).
describes(DDI->getParent()->getParent()))
if (MDNode *MD = DDI->getMetadata("dbg"))
// Otherwise propagate debug metadata from dbg.declare.
else if (MDNode *MD = DDI->getMetadata("dbg"))
DbgVal->setMetadata("dbg", MD);
}