aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Constants.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/Constants.cpp')
-rw-r--r--lib/VMCore/Constants.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index e0adf9d2fd..2d3d71b686 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -1045,7 +1045,7 @@ BlockAddress::BlockAddress(Function *F, BasicBlock *BB)
&Op<0>(), 2) {
Op<0>() = F;
Op<1>() = BB;
- if (BB) BB->AdjustBlockAddressRefCount(1);
+ BB->AdjustBlockAddressRefCount(1);
}
@@ -1054,8 +1054,7 @@ BlockAddress::BlockAddress(Function *F, BasicBlock *BB)
void BlockAddress::destroyConstant() {
getFunction()->getType()->getContext().pImpl
->BlockAddresses.erase(std::make_pair(getFunction(), getBasicBlock()));
- if (BasicBlock *BB = getBasicBlock())
- BB->AdjustBlockAddressRefCount(-1);
+ getBasicBlock()->AdjustBlockAddressRefCount(-1);
destroyConstantImpl();
}