Index: src/IceInstARM32.cpp |
diff --git a/src/IceInstARM32.cpp b/src/IceInstARM32.cpp |
index 465d81d892378eed956afc351d5804e92d7786f1..4c4a01d09ab06fbda5a4114a9936bbb5ea249662 100644 |
--- a/src/IceInstARM32.cpp |
+++ b/src/IceInstARM32.cpp |
@@ -1005,6 +1005,26 @@ void InstARM32Call::emit(const Cfg *Func) const { |
Func->getTarget()->resetStackAdjustment(); |
} |
+void InstARM32Call::emitIAS(const Cfg *Func) const { |
+ assert(getSrcSize() == 1); |
+ auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
+ if (llvm::isa<ConstantInteger32>(getCallTarget())) { |
+ // This shouldn't happen (typically have to copy the full 32-bits to a |
+ // register and do an indirect jump). |
+ llvm::report_fatal_error("ARM32Call to ConstantInteger32"); |
+ } else if (const auto *CallTarget = |
+ llvm::dyn_cast<ConstantRelocatable>(getCallTarget())) { |
+ // Calls only have 24-bits, but the linker should insert veneers to extend |
+ // the range if needed. |
+ Asm->bl(CallTarget); |
+ } else { |
+ Asm->blx(getCallTarget()); |
+ } |
+ if (Asm->needsTextFixup()) |
+ return emitUsingTextFixup(Func); |
+ Func->getTarget()->resetStackAdjustment(); |
+} |
+ |
void InstARM32Call::dump(const Cfg *Func) const { |
if (!BuildDefs::dump()) |
return; |