浏览代码

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

Nicolas Cannasse 13 年之前
父节点
当前提交
6b95768776
共有 1 个文件被更改,包括 1 次插入0 次删除
  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