diff --git a/ts2panda/src/cmdOptions.ts b/ts2panda/src/cmdOptions.ts index 4e108670db4789dfb4ba0e5bde0af7bc345a089b..d4049f6c375a9b3269fd3c188dafc6d089626c5a 100644 --- a/ts2panda/src/cmdOptions.ts +++ b/ts2panda/src/cmdOptions.ts @@ -34,7 +34,7 @@ const ts2pandaOptions = [ { name: 'timeout', alias: 't', type: Number, defaultValue: 0, description: "js to abc timeout threshold(unit: seconds)." }, { name: 'opt-log-level', type: String, defaultValue: "error", description: "specifie optimizer log level. Possible values: ['debug', 'info', 'error', 'fatal']" }, { - name: 'opt-level', type: Number, defaultValue: 1, description: "Optimization level. Possible values: [0, 1, 2]. Default: 0\n 0: no optimizations\n \ + name: 'opt-level', type: Number, defaultValue: 0, description: "Optimization level. Possible values: [0, 1, 2]. Default: 0\n 0: no optimizations\n \ 1: basic bytecode optimizations, including valueNumber, lowering, constantResolver, regAccAllocator\n \ 2: other bytecode optimizations, unimplemented yet"}, { name: 'help', alias: 'h', type: Boolean, description: "Show usage guide." }, diff --git a/ts2panda/ts2abc/tests/type_adapter_test/type_adapter_test.cpp b/ts2panda/ts2abc/tests/type_adapter_test/type_adapter_test.cpp index 4e8bf2f9a2bc80c2d4682405b9a7af9466a17dd5..9f989d125d29469b75932608015618dce95b5ed4 100644 --- a/ts2panda/ts2abc/tests/type_adapter_test/type_adapter_test.cpp +++ b/ts2panda/ts2abc/tests/type_adapter_test/type_adapter_test.cpp @@ -100,7 +100,7 @@ void TypeAdapterTest::TestVariablesArgsType() const panda::pandasm::Parser p; auto res = p.Parse(source); auto &program = res.Value(); - auto it = program.function_table.find("foo"); + auto it = program.function_table.find("foo:(any,any)"); TestAssertNotEqual(it, program.function_table.end()); auto &foo = it->second; diff --git a/ts2panda/ts2abc/ts2abc.cpp b/ts2panda/ts2abc/ts2abc.cpp index f66e50ce9f674b76c53e2e5425e966c79f8519ee..fafa7ae825835fdd43fa7c195ad44fd3bade14d1 100644 --- a/ts2panda/ts2abc/ts2abc.cpp +++ b/ts2panda/ts2abc/ts2abc.cpp @@ -1327,9 +1327,11 @@ bool GenerateProgram([[maybe_unused]] const std::string &data, const std::string if (g_optLevel != static_cast(OptLevel::O_LEVEL0) || optLevel != static_cast(OptLevel::O_LEVEL0)) { optLogLevel = (optLogLevel != "error") ? optLogLevel : g_optLogLevel; - const uint32_t componentMask = panda::Logger::Component::CLASS2PANDA | panda::Logger::Component::ASSEMBLER | - panda::Logger::Component::BYTECODE_OPTIMIZER | panda::Logger::Component::COMPILER; - panda::Logger::InitializeStdLogging(panda::Logger::LevelFromString(optLogLevel), componentMask); + panda::Logger::ComponentMask mask; + mask.set(panda::Logger::Component::ASSEMBLER); + mask.set(panda::Logger::Component::BYTECODE_OPTIMIZER); + mask.set(panda::Logger::Component::COMPILER); + panda::Logger::InitializeStdLogging(panda::Logger::LevelFromString(optLogLevel), mask); bool emitDebugInfo = true; std::map stat;