#pragma once

#include "IR.h"
#include "IRBuilder.h"

namespace sysy {
/**
 * Reg2Mem(后端未做phi指令翻译)
 */
class Reg2Mem {
private:
  Module *pModule;
  IRBuilder *pBuilder;

public:
  Reg2Mem(Module *pMoudle, IRBuilder *pBuilder) : pModule(pMoudle), pBuilder(pBuilder) {}

  void DeletePhiInst();
  // 删除UD关系, 因为删除了phi指令会修改ud关系
  void usedelete(Instruction *instr);
};

} // namespace sysy