mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-21 18:51:43 +00:00
Add trapMode option to asc; Disable flatten/ssa passes for now
This commit is contained in:
@ -393,7 +393,8 @@ export class Compiler extends DiagnosticEmitter {
|
||||
if (getExpressionId(initializer) != ExpressionId.Const) {
|
||||
initializer = this.precomputeExpressionRef(initializer);
|
||||
if (getExpressionId(initializer) != ExpressionId.Const) {
|
||||
this.warning(DiagnosticCode.Compiling_constant_global_with_non_constant_initializer_as_mutable, declaration.range);
|
||||
if (element.isConstant)
|
||||
this.warning(DiagnosticCode.Compiling_constant_global_with_non_constant_initializer_as_mutable, declaration.range);
|
||||
initializeInStart = true;
|
||||
}
|
||||
}
|
||||
@ -407,7 +408,8 @@ export class Compiler extends DiagnosticEmitter {
|
||||
this.module.createGetGlobal(previousValue.internalName, NativeType.I32),
|
||||
this.module.createI32(1)
|
||||
);
|
||||
this.warning(DiagnosticCode.Compiling_constant_global_with_non_constant_initializer_as_mutable, val.declaration.range);
|
||||
if (element.isConstant)
|
||||
this.warning(DiagnosticCode.Compiling_constant_global_with_non_constant_initializer_as_mutable, val.declaration.range);
|
||||
initializeInStart = true;
|
||||
}
|
||||
if (initializeInStart) {
|
||||
|
@ -702,7 +702,7 @@ export class Module {
|
||||
|
||||
optimize(func: FunctionRef = 0): void {
|
||||
// see: https://github.com/WebAssembly/binaryen/issues/1331#issuecomment-350328175
|
||||
this.runPasses([ "flatten", "ssa" ], func);
|
||||
// this.runPasses([ "flatten", "ssa" ], func);
|
||||
if (func) {
|
||||
_BinaryenFunctionOptimize(func, this.ref);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user