Fancy templated helpers.

This commit is contained in:
Ben Vanik
2014-01-26 03:17:03 -08:00
parent ecf0988ddb
commit cb352c6c86
2 changed files with 370 additions and 378 deletions

View File

@@ -79,6 +79,14 @@ public:
Use* AddUse(Arena* arena, Instr* instr);
void RemoveUse(Use* use);
int8_t get_constant(int8_t) const { return constant.i8; }
int16_t get_constant(int16_t) const { return constant.i16; }
int32_t get_constant(int32_t) const { return constant.i32; }
int64_t get_constant(int64_t) const { return constant.i64; }
float get_constant(float) const { return constant.f32; }
double get_constant(double) const { return constant.f64; }
vec128_t get_constant(vec128_t&) const { return constant.v128; }
void set_zero(TypeName type) {
this->type = type;
flags |= VALUE_IS_CONSTANT;