From 92afb40eea6e9a09af2d355ff9ab6a4bd04c54bb Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 11 Apr 2018 12:02:29 -0700 Subject: Some simple integer math opts (#1504) Stuff like x + 5 != 2 => x != -3. Also some cleanups of utility functions I noticed while writing this, isTypeFloat => isFloatType. Inspired by https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/gen/generic.rules --- src/parsing.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parsing.h') diff --git a/src/parsing.h b/src/parsing.h index cb6ee8c4b..06797cf54 100644 --- a/src/parsing.h +++ b/src/parsing.h @@ -80,7 +80,7 @@ inline Expression* parseConst(cashew::IString s, Type type, MixedArena& allocato const char *str = s.str; auto ret = allocator.alloc(); ret->type = type; - if (isTypeFloat(type)) { + if (isFloatType(type)) { if (s == _INFINITY) { switch (type) { case f32: ret->value = Literal(std::numeric_limits::infinity()); break; -- cgit v1.2.3