WebAssemblyRegisterInfo.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // WebAssemblyRegisterInfo.h - WebAssembly Register Information Impl -*- C++ -*-
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. ///
  9. /// \file
  10. /// This file contains the WebAssembly implementation of the
  11. /// WebAssemblyRegisterInfo class.
  12. ///
  13. //===----------------------------------------------------------------------===//
  14. #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYREGISTERINFO_H
  15. #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYREGISTERINFO_H
  16. #define GET_REGINFO_HEADER
  17. #include "WebAssemblyGenRegisterInfo.inc"
  18. namespace llvm {
  19. class MachineFunction;
  20. class RegScavenger;
  21. class TargetRegisterClass;
  22. class Triple;
  23. class WebAssemblyRegisterInfo final : public WebAssemblyGenRegisterInfo {
  24. const Triple &TT;
  25. public:
  26. explicit WebAssemblyRegisterInfo(const Triple &TT);
  27. // Code Generation virtual methods.
  28. const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
  29. BitVector getReservedRegs(const MachineFunction &MF) const override;
  30. bool eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj,
  31. unsigned FIOperandNum,
  32. RegScavenger *RS = nullptr) const override;
  33. // Debug information queries.
  34. Register getFrameRegister(const MachineFunction &MF) const override;
  35. const TargetRegisterClass *
  36. getPointerRegClass(const MachineFunction &MF,
  37. unsigned Kind = 0) const override;
  38. // This does not apply to wasm.
  39. const uint32_t *getNoPreservedMask() const override { return nullptr; }
  40. };
  41. } // end namespace llvm
  42. #endif