mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
IR: Fix ConstantArray::replaceUsesOfWithOnConstant()
Previously, `ConstantArray::replaceUsesOfWithOnConstant()` neglected to check whether it becomes a `ConstantDataArray`. Call `ConstantArray::getImpl()` to check for that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215965 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2701,6 +2701,12 @@ void ConstantArray::replaceUsesOfWithOnConstant(Value *From, Value *To,
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for any other type of constant-folding.
|
||||
if (Constant *C = getImpl(getType(), Values)) {
|
||||
replaceUsesOfWithOnConstantImpl(C);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check to see if we have this array type already.
|
||||
LLVMContextImpl::ArrayConstantsTy::LookupKey Lookup(
|
||||
cast<ArrayType>(getType()), makeArrayRef(Values));
|
||||
|
Reference in New Issue
Block a user