aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/SSAUpdater.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-05-24 06:00:08 +0000
committerCameron Zwarich <zwarich@apple.com>2011-05-24 06:00:08 +0000
commit13a16083abcdacf2ee44ae95b084f87937ea9ace (patch)
treecd282d17f5036fc35b071c69723160568386c07e /lib/Transforms/Utils/SSAUpdater.cpp
parentdfa178bc2a21667aab745ba9a182cd3e702fec3b (diff)
Clean up the lazy initialization of DIBuilder a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SSAUpdater.cpp')
-rw-r--r--lib/Transforms/Utils/SSAUpdater.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/Transforms/Utils/SSAUpdater.cpp b/lib/Transforms/Utils/SSAUpdater.cpp
index 09f0a50cb0..b336194a35 100644
--- a/lib/Transforms/Utils/SSAUpdater.cpp
+++ b/lib/Transforms/Utils/SSAUpdater.cpp
@@ -358,7 +358,7 @@ Value *SSAUpdater::GetValueAtEndOfBlockInternal(BasicBlock *BB) {
LoadAndStorePromoter::
LoadAndStorePromoter(const SmallVectorImpl<Instruction*> &Insts,
- SSAUpdater &S, DbgDeclareInst *DD, DIBuilder *&DB,
+ SSAUpdater &S, DbgDeclareInst *DD, DIBuilder *DB,
StringRef BaseName) : SSA(S), DDI(DD), DIB(DB) {
if (Insts.empty()) return;
@@ -407,11 +407,8 @@ run(const SmallVectorImpl<Instruction*> &Insts) const {
if (BlockUses.size() == 1) {
// If it is a store, it is a trivial def of the value in the block.
if (StoreInst *SI = dyn_cast<StoreInst>(User)) {
- if (DDI) {
- if (!DIB)
- DIB = new DIBuilder(*SI->getParent()->getParent()->getParent());
+ if (DDI)
ConvertDebugDeclareToDebugValue(DDI, SI, *DIB);
- }
SSA.AddAvailableValue(BB, SI->getOperand(0));
} else
// Otherwise it is a load, queue it to rewrite as a live-in load.
@@ -466,11 +463,8 @@ run(const SmallVectorImpl<Instruction*> &Insts) const {
// If this is a store to an unrelated pointer, ignore it.
if (!isInstInList(SI, Insts)) continue;
- if (DDI) {
- if (!DIB)
- DIB = new DIBuilder(*SI->getParent()->getParent()->getParent());
+ if (DDI)
ConvertDebugDeclareToDebugValue(DDI, SI, *DIB);
- }
// Remember that this is the active value in the block.
StoredValue = SI->getOperand(0);