move OperationEvent out of compiler.cpp

This commit is contained in:
Joshua Warner 2013-02-13 20:33:33 -07:00
parent 70f9209a6e
commit 9c102bc1a8
3 changed files with 26 additions and 23 deletions

View File

@ -1595,29 +1595,6 @@ register_(Context* c, int number)
return value(c, type, s, s);
}
class OperationEvent: public Event {
public:
OperationEvent(Context* c, lir::Operation op):
Event(c), op(op)
{ }
virtual const char* name() {
return "OperationEvent";
}
virtual void compile(Context* c) {
c->assembler->apply(op);
}
lir::Operation op;
};
void
appendOperation(Context* c, lir::Operation op)
{
append(c, new(c->zone) OperationEvent(c, op));
}
void
moveIfConflict(Context* c, Value* v, MemorySite* s)
{

View File

@ -1045,6 +1045,29 @@ appendTranslate(Context* c, lir::BinaryOperation type, unsigned firstSize,
}
}
class OperationEvent: public Event {
public:
OperationEvent(Context* c, lir::Operation op):
Event(c), op(op)
{ }
virtual const char* name() {
return "OperationEvent";
}
virtual void compile(Context* c) {
c->assembler->apply(op);
}
lir::Operation op;
};
void
appendOperation(Context* c, lir::Operation op)
{
append(c, new(c->zone) OperationEvent(c, op));
}
} // namespace compiler
} // namespace codegen
} // namespace avian

View File

@ -132,6 +132,9 @@ void
appendTranslate(Context* c, lir::BinaryOperation type, unsigned firstSize,
Value* first, unsigned resultSize, Value* result);
void
appendOperation(Context* c, lir::Operation op);
} // namespace compiler
} // namespace codegen
} // namespace avian