expose Value::type and add asserts

This commit is contained in:
Joshua Warner
2014-05-01 12:14:27 -06:00
parent 00253ce528
commit 42fec084b0
5 changed files with 54 additions and 30 deletions

View File

@ -2663,7 +2663,7 @@ class MyCompiler: public Compiler {
}
virtual void condJump(lir::TernaryOperation op,
unsigned size,
ir::Type type,
Operand* a,
Operand* b,
Operand* address)
@ -2672,9 +2672,15 @@ class MyCompiler: public Compiler {
(isGeneralBranch(op) and isGeneralValue(a) and isGeneralValue(b))or(
isFloatBranch(op) and isFloatValue(a) and isFloatValue(b)));
// assert(&c, type.flavor() == static_cast<Value*>(a)->type.flavor());
// assert(&c, type.flavor() == static_cast<Value*>(b)->type.flavor());
assert(&c,
static_cast<Value*>(address)->type
== ir::Type(ir::Type::Integer, TargetBytesPerWord));
appendBranch(&c,
op,
size,
type.size(),
static_cast<Value*>(a),
static_cast<Value*>(b),
static_cast<Value*>(address));