add type asserts in Compiler::truncate

This commit is contained in:
Joshua Warner 2014-05-03 20:02:29 -06:00 committed by Joshua Warner
parent b853f1a594
commit 3029bb2d7e

View File

@ -2562,6 +2562,10 @@ class MyCompiler: public Compiler {
virtual ir::Value* truncate(ir::Type type, ir::Type srcType, ir::Value* src)
{
assert(&c, srcType == src->type);
assert(&c, src->type.flavor() == type.flavor());
assert(&c, type.flavor() != ir::Type::Float);
assert(&c, type.size() < src->type.size());
Value* dst = value(&c, type);
appendMove(&c,
lir::Move,