| Index: src/IceInstARM32.h
|
| diff --git a/src/IceInstARM32.h b/src/IceInstARM32.h
|
| index 1ba5d4e9efd5a5a14adb96a811026193ffed8aba..b9ed01e36e40b25cd1df093e161f61694b284325 100644
|
| --- a/src/IceInstARM32.h
|
| +++ b/src/IceInstARM32.h
|
| @@ -258,6 +258,7 @@ public:
|
| k__Start = Inst::Target,
|
| Adc,
|
| Add,
|
| + Adjuststack,
|
| And,
|
| Asr,
|
| Bic,
|
| @@ -606,6 +607,34 @@ private:
|
| const CfgNode *TargetFalse;
|
| };
|
|
|
| +// AdjustStack instruction - subtracts SP by the given amount and
|
| +// updates the stack offset during code emission.
|
| +class InstARM32AdjustStack : public InstARM32 {
|
| + InstARM32AdjustStack() = delete;
|
| + InstARM32AdjustStack(const InstARM32AdjustStack &) = delete;
|
| + InstARM32AdjustStack &operator=(const InstARM32AdjustStack &) = delete;
|
| +
|
| +public:
|
| + // Note: We need both Amount and SrcAmount. If Amount is too large then
|
| + // it needs to be copied to a register (so SrcAmount could be a register).
|
| + // However, we also need the numeric Amount for bookkeeping, and it's
|
| + // hard to pull that from the generic SrcAmount operand.
|
| + static InstARM32AdjustStack *create(Cfg *Func, Variable *SP, SizeT Amount,
|
| + Operand *SrcAmount) {
|
| + return new (Func->allocate<InstARM32AdjustStack>())
|
| + InstARM32AdjustStack(Func, SP, Amount, SrcAmount);
|
| + }
|
| + void emit(const Cfg *Func) const override;
|
| + void emitIAS(const Cfg *Func) const override;
|
| + void dump(const Cfg *Func) const override;
|
| + static bool classof(const Inst *Inst) { return isClassof(Inst, Adjuststack); }
|
| +
|
| +private:
|
| + InstARM32AdjustStack(Cfg *Func, Variable *SP, SizeT Amount,
|
| + Operand *SrcAmount);
|
| + const SizeT Amount;
|
| +};
|
| +
|
| // Call instruction (bl/blx). Arguments should have already been pushed.
|
| // Technically bl and the register form of blx can be predicated, but we'll
|
| // leave that out until needed.
|
|
|