From 95037f5621a73cb575f879854b6ba415987c3f22 Mon Sep 17 00:00:00 2001 From: dong Date: Wed, 6 Sep 2023 10:28:36 +0800 Subject: [PATCH 1/2] Signed-off-by: dong Change-Id: I967790a3e45459adb1da45031e89f100d9a5b274 --- es2panda/aot/options.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/es2panda/aot/options.cpp b/es2panda/aot/options.cpp index 6fd8a71469..fbf1f16049 100644 --- a/es2panda/aot/options.cpp +++ b/es2panda/aot/options.cpp @@ -334,6 +334,7 @@ bool Options::Parse(int argc, const char **argv) } if (opModule.GetValue()) { + opMergeAbc = opModule.GetValue(); scriptKind_ = es2panda::parser::ScriptKind::MODULE; } else if (opCommonjs.GetValue()) { scriptKind_ = es2panda::parser::ScriptKind::COMMONJS; -- Gitee From 402816a71f1377928b07d6b0b3cd5f6b875de878 Mon Sep 17 00:00:00 2001 From: dong Date: Wed, 6 Sep 2023 10:51:55 +0800 Subject: [PATCH 2/2] Signed-off-by: dong Change-Id: I476c90ad01e86a21b49bf479181d6f7f698fc43e Change-Id: I6ae8513fc279c3d4ae09c87583796e25b88088a0 --- es2panda/aot/options.cpp | 6 +++--- es2panda/aot/options.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/es2panda/aot/options.cpp b/es2panda/aot/options.cpp index fbf1f16049..1641d0abaa 100644 --- a/es2panda/aot/options.cpp +++ b/es2panda/aot/options.cpp @@ -334,7 +334,7 @@ bool Options::Parse(int argc, const char **argv) } if (opModule.GetValue()) { - opMergeAbc = opModule.GetValue(); + mergeAbc_ = opModule.GetValue(); scriptKind_ = es2panda::parser::ScriptKind::MODULE; } else if (opCommonjs.GetValue()) { scriptKind_ = es2panda::parser::ScriptKind::COMMONJS; @@ -376,7 +376,7 @@ bool Options::Parse(int argc, const char **argv) compilerOutput_ = RemoveExtension(util::Helpers::BaseName(sourceFile_)).append(".abc"); } - if (opMergeAbc.GetValue()) { + if (opMergeAbc.GetValue() || mergeAbc_) { recordName_ = recordName.GetValue(); if (recordName_.empty()) { recordName_ = compilerOutput_.empty() ? "Base64Output" : @@ -456,7 +456,7 @@ bool Options::Parse(int argc, const char **argv) compilerOptions_.optLevel = (compilerOptions_.isDebug || !base64Input.GetValue().empty() || base64Output.GetValue()) ? 0 : opOptLevel.GetValue(); compilerOptions_.sourceFiles = sourceFiles_; - compilerOptions_.mergeAbc = opMergeAbc.GetValue(); + compilerOptions_.mergeAbc = opMergeAbc.GetValue() || mergeAbc_; compilerOptions_.patchFixOptions.dumpSymbolTable = opDumpSymbolTable.GetValue(); compilerOptions_.patchFixOptions.symbolTable = opInputSymbolTable.GetValue(); diff --git a/es2panda/aot/options.h b/es2panda/aot/options.h index 00a2b7cf99..3c284c8357 100644 --- a/es2panda/aot/options.h +++ b/es2panda/aot/options.h @@ -146,6 +146,7 @@ private: int optLevel_ {0}; int functionThreadCount_ {0}; int fileThreadCount_ {0}; + bool mergeAbc_ {false}; std::string npmModuleEntryList_; std::vector sourceFiles_; std::unordered_map outputFiles_; -- Gitee