From 8269974e9c1c53bad0f1b43c6d9c18dbec07aec4 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 27 May 2010 20:25:04 +0000 Subject: Do not drop location info for inlined function args. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104884 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/Transforms/Utils/PromoteMemoryToRegister.cpp') diff --git a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index 13f0a28..a316876 100644 --- a/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -897,6 +897,11 @@ 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 propgate debug metadata from dbg.delcare for inlined fn args. + else if (!DISubprogram(DIVar.getContext()). + describes(DDI->getParent()->getParent())) + if (MDNode *MD = DDI->getMetadata("dbg")) + DbgVal->setMetadata("dbg", MD); } // QueuePhiNode - queues a phi-node to be added to a basic-block for a specific -- cgit v1.1