Browse Source

relaxed inlining restrictions : allow to "const op const" to be inlined (because not all float operations can be precomputed)

Nicolas Cannasse 13 years ago
parent
commit
6b95768776
1 changed files with 1 additions and 0 deletions
  1. 1 0
      typeload.ml

+ 1 - 0
typeload.ml

@@ -925,6 +925,7 @@ let init_class ctx c p herits fields =
 								let e = ctx.g.do_optimize ctx e in
 								(match e.eexpr with
 								| TConst _ -> ()
+								| TBinop ((OpAdd|OpSub|OpMult|OpDiv|OpMod),{ eexpr = TConst (TInt _|TString _|TFloat _) },{ eexpr = TConst (TInt _|TString _|TFloat _) }) -> ()
 								| _ -> display_error ctx "Inline variable must be a constant value" p);
 								e
 							else e) in