aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-01-30 19:37:48 +0000
committerAdrian Prantl <aprantl@apple.com>2015-01-30 19:37:48 +0000
commit3e2659eb92aeefef87dd16ede20efd45fb034fc2 (patch)
treec006ef0d9b52cb9067065b0670436c978efd3f78 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parent70fe588c889ea58c9a9d1d369bb3bbf96413e365 (diff)
downloadllvm-3e2659eb92aeefef87dd16ede20efd45fb034fc2.zip
llvm-3e2659eb92aeefef87dd16ede20efd45fb034fc2.tar.gz
llvm-3e2659eb92aeefef87dd16ede20efd45fb034fc2.tar.bz2
Inliner: Use replaceDbgDeclareForAlloca() instead of splicing the
instruction and generalize it to optionally dereference the variable. Follow-up to r227544. llvm-svn: 227604
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 313728c0..a28c56c 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -30,6 +30,7 @@
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DerivedTypes.h"
+#include "llvm/IR/DIBuilder.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
@@ -1112,13 +1113,10 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI,
AI, I);
}
// Move any dbg.declares describing the allocas into the entry basic block.
+ DIBuilder DIB(*Caller->getParent());
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());
+ replaceDbgDeclareForAlloca(AI, AI, DIB, /*Deref=*/false);
}
bool InlinedMustTailCalls = false;