aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r--llvm/lib/IR/Constants.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index 62760ff..0f55a53 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -1914,6 +1914,12 @@ Value *DSOLocalEquivalent::handleOperandChangeImpl(Value *From, Value *To) {
getContext().pImpl->DSOLocalEquivalents.erase(getGlobalValue());
NewEquiv = this;
setOperand(0, Func);
+
+ if (Func->getType() != getType()) {
+ // It is ok to mutate the type here because this constant should always
+ // reflect the type of the function it's holding.
+ mutateType(Func->getType());
+ }
return nullptr;
}