diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-01-30 01:55:25 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-01-30 01:55:25 +0000 |
commit | 4d365250ec2ae22f031d5769c045694504c8f0be (patch) | |
tree | e88146653e893c2a0185b421f2377f25417f4e27 /llvm/lib/Transforms/Utils/InlineFunction.cpp | |
parent | afbe58f88b7d4710e1b921f1437b45f243322802 (diff) | |
download | llvm-4d365250ec2ae22f031d5769c045694504c8f0be.zip llvm-4d365250ec2ae22f031d5769c045694504c8f0be.tar.gz llvm-4d365250ec2ae22f031d5769c045694504c8f0be.tar.bz2 |
Fix PR22386. The inliner moves static allocas to the entry basic block
so we need to move the dbg.declare intrinsics that describe them, too.
llvm-svn: 227544
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 7386186..313728c0 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -1111,6 +1111,14 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI, FirstNewBlock->getInstList(), AI, I); } + // Move any dbg.declares describing the allocas into the entry basic block. + for (auto &I : IFI.StaticAllocas) + if (auto AI = dyn_cast<AllocaInst>(I)) + if (auto *DDI = FindAllocaDbgDeclare(AI)) + if (DDI->getParent() != Caller->begin()) + Caller->getEntryBlock().getInstList() + .splice(AI->getNextNode(), FirstNewBlock->getInstList(), + DDI, DDI->getNextNode()); } bool InlinedMustTailCalls = false; |