forked from NUDT-compiler/nudt-compiler-cpp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
451 B
18 lines
451 B
#include "include/mir/MIR.h"
|
|
|
|
#include <utility>
|
|
|
|
namespace mir
|
|
{
|
|
|
|
MachineBasicBlock::MachineBasicBlock(std::string name, int label_id)
|
|
: name_(std::move(name)), label_id_(label_id) {}
|
|
|
|
MachineInstr &MachineBasicBlock::Append(
|
|
Opcode opcode, std::initializer_list<Operand> operands)
|
|
{
|
|
instructions_.emplace_back(opcode, std::vector<Operand>(operands));
|
|
return instructions_.back();
|
|
}
|
|
|
|
} // namespace mir
|