From 6f62a07edbe19c1daf4880f1aba6332e3f17545b Mon Sep 17 00:00:00 2001 From: Fred Chow Date: Tue, 5 Jul 2022 18:04:50 -0700 Subject: [PATCH] Handle .mbc and .lmbc files in more situations --- src/mapleall/maple_driver/src/driver_runner.cpp | 8 ++++++-- src/mapleall/maple_driver/src/maple_comb_compiler.cpp | 6 ++++++ src/mapleall/maple_driver/src/mpl_options.cpp | 6 ++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/mapleall/maple_driver/src/driver_runner.cpp b/src/mapleall/maple_driver/src/driver_runner.cpp index c901cc076b..759b59c671 100644 --- a/src/mapleall/maple_driver/src/driver_runner.cpp +++ b/src/mapleall/maple_driver/src/driver_runner.cpp @@ -208,7 +208,9 @@ ErrorCode DriverRunner::ParseInput() const { MIRParser parser(*theModule); ErrorCode ret = kErrorNoError; if (!fileParsed) { - if (inputFileType != kFileTypeBpl) { + if (inputFileType != kFileTypeBpl && + inputFileType != kFileTypeMbc && + inputFileType != kFileTypeLmbc) { bool parsed = parser.ParseMIR(0, 0, false, true); if (!parsed) { ret = kErrorExit; @@ -235,7 +237,9 @@ ErrorCode DriverRunner::ParseInput() const { ErrorCode DriverRunner::ParseSrcLang(MIRSrcLang &srcLang) const { ErrorCode ret = kErrorNoError; - if (inputFileType != kFileTypeBpl) { + if (inputFileType != kFileTypeBpl && + inputFileType != kFileTypeMbc && + inputFileType != kFileTypeLmbc) { MIRParser parser(*theModule); bool parsed = parser.ParseSrcLang(srcLang); if (!parsed) { diff --git a/src/mapleall/maple_driver/src/maple_comb_compiler.cpp b/src/mapleall/maple_driver/src/maple_comb_compiler.cpp index edefcc0d64..d749855b6c 100644 --- a/src/mapleall/maple_driver/src/maple_comb_compiler.cpp +++ b/src/mapleall/maple_driver/src/maple_comb_compiler.cpp @@ -33,6 +33,12 @@ std::string MapleCombCompiler::GetInputFileName(const MplOptions &options, const if (action.GetInputFileType() == InputFileType::kFileTypeBpl) { return action.GetFullOutputName() + ".bpl"; } + if (action.GetInputFileType() == InputFileType::kFileTypeMbc) { + return action.GetFullOutputName() + ".mbc"; + } + if (action.GetInputFileType() == InputFileType::kFileTypeLmbc) { + return action.GetFullOutputName() + ".lmbc"; + } return action.GetFullOutputName() + ".mpl"; } diff --git a/src/mapleall/maple_driver/src/mpl_options.cpp b/src/mapleall/maple_driver/src/mpl_options.cpp index b8c3c5da5d..7814eb0b57 100644 --- a/src/mapleall/maple_driver/src/mpl_options.cpp +++ b/src/mapleall/maple_driver/src/mpl_options.cpp @@ -807,6 +807,12 @@ std::string MplOptions::GetInputFileNameForPrint(const Action * const action) co if (action->GetInputFileType() == InputFileType::kFileTypeBpl) { return action->GetFullOutputName() + ".bpl"; } + if (action->GetInputFileType() == InputFileType::kFileTypeMbc) { + return action->GetFullOutputName() + ".mbc"; + } + if (action->GetInputFileType() == InputFileType::kFileTypeLmbc) { + return action->GetFullOutputName() + ".lmbc"; + } return action->GetFullOutputName() + ".mpl"; } -- Gitee