mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
add support for ConstantPacked to the linker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25467 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
485a350bed
commit
a88eb9287e
@ -290,6 +290,11 @@ static Value *RemapOperand(const Value *In,
|
|||||||
Result = const_cast<Constant*>(CPV);
|
Result = const_cast<Constant*>(CPV);
|
||||||
} else if (isa<GlobalValue>(CPV)) {
|
} else if (isa<GlobalValue>(CPV)) {
|
||||||
Result = cast<Constant>(RemapOperand(CPV, ValueMap));
|
Result = cast<Constant>(RemapOperand(CPV, ValueMap));
|
||||||
|
} else if (const ConstantPacked *CP = dyn_cast<ConstantPacked>(CPV)) {
|
||||||
|
std::vector<Constant*> Operands(CP->getNumOperands());
|
||||||
|
for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
|
||||||
|
Operands[i] = cast<Constant>(RemapOperand(CP->getOperand(i), ValueMap));
|
||||||
|
Result = ConstantPacked::get(Operands);
|
||||||
} else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CPV)) {
|
} else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(CPV)) {
|
||||||
if (CE->getOpcode() == Instruction::GetElementPtr) {
|
if (CE->getOpcode() == Instruction::GetElementPtr) {
|
||||||
Value *Ptr = RemapOperand(CE->getOperand(0), ValueMap);
|
Value *Ptr = RemapOperand(CE->getOperand(0), ValueMap);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user