From a02bd37a13acf5fc194921db334f37ac8636fa34 Mon Sep 17 00:00:00 2001 From: binaryfz Date: Tue, 2 Feb 2021 11:29:21 +0800 Subject: [PATCH 1/2] PR350 sync --- src/mapleall/maple_me/BUILD.gn | 2 +- src/mapleall/maple_me/include/bb.h | 2 +- src/mapleall/maple_me/include/irmap.h | 6 ++-- src/mapleall/maple_me/include/irmap_build.h | 27 +++++++------- src/mapleall/maple_me/include/me_irmap.h | 3 +- .../maple_me/include/me_irmap_build.h | 15 ++++---- src/mapleall/maple_me/include/me_phases.def | 2 +- src/mapleall/maple_me/src/irmap.cpp | 2 -- src/mapleall/maple_me/src/irmap_build.cpp | 36 +++++++++---------- src/mapleall/maple_me/src/irmap_emit.cpp | 3 +- src/mapleall/maple_me/src/me_abco.cpp | 2 +- src/mapleall/maple_me/src/me_analyze_rc.cpp | 2 +- src/mapleall/maple_me/src/me_analyzector.cpp | 2 +- src/mapleall/maple_me/src/me_emit.cpp | 2 +- src/mapleall/maple_me/src/me_hdse.cpp | 2 +- src/mapleall/maple_me/src/me_irmap.cpp | 4 +-- src/mapleall/maple_me/src/me_irmap_build.cpp | 21 ++++++----- src/mapleall/maple_me/src/me_profile_gen.cpp | 2 +- src/mapleall/maple_me/src/me_prop.cpp | 2 +- src/mapleall/maple_me/src/me_rc_lowering.cpp | 2 +- .../maple_me/src/me_ssa_devirtual.cpp | 2 +- src/mapleall/maple_me/src/me_ssa_epre.cpp | 2 +- src/mapleall/maple_me/src/me_stmt_pre.cpp | 2 +- src/mapleall/maple_me/src/me_store_pre.cpp | 2 +- 24 files changed, 71 insertions(+), 76 deletions(-) diff --git a/src/mapleall/maple_me/BUILD.gn b/src/mapleall/maple_me/BUILD.gn index 9f61721401..c0eef6269f 100644 --- a/src/mapleall/maple_me/BUILD.gn +++ b/src/mapleall/maple_me/BUILD.gn @@ -1,5 +1,5 @@ # -# Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. +# Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. # # OpenArkCompiler is licensed under Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/include/bb.h b/src/mapleall/maple_me/include/bb.h index 4572e415c5..4b1ce8df7b 100755 --- a/src/mapleall/maple_me/include/bb.h +++ b/src/mapleall/maple_me/include/bb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/include/irmap.h b/src/mapleall/maple_me/include/irmap.h index 5520489aa6..7932e47e8a 100755 --- a/src/mapleall/maple_me/include/irmap.h +++ b/src/mapleall/maple_me/include/irmap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -21,7 +21,7 @@ #include "me_builder.h" namespace maple { -class IRMapBuild; +class IRMapBuild; // circular dependency exists, no other choice class IRMap : public AnalysisResult { friend IRMapBuild; @@ -93,6 +93,7 @@ class IRMap : public AnalysisResult { meStmt.Dump(this); } } + virtual void Dump() = 0; virtual void SetCurFunction(const BB&) {} @@ -135,6 +136,7 @@ class IRMap : public AnalysisResult { MapleAllocator &GetIRMapAlloc() { return irMapAlloc; } + int32 GetExprID() const { return exprID; } diff --git a/src/mapleall/maple_me/include/irmap_build.h b/src/mapleall/maple_me/include/irmap_build.h index 6b1c39f19f..cbfbaca12d 100644 --- a/src/mapleall/maple_me/include/irmap_build.h +++ b/src/mapleall/maple_me/include/irmap_build.h @@ -1,16 +1,16 @@ /* - * Copyright (c) [2020] Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. * - * OpenArkCompiler is licensed under the Mulan Permissive Software License v2. - * You can use this software according to the terms and conditions of the MulanPSL - 2.0. - * You may obtain a copy of MulanPSL - 2.0 at: + * OpenArkCompiler is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: * - * https://opensource.org/licenses/MulanPSL-2.0 + * http://license.coscl.org.cn/MulanPSL2 * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR * FIT FOR A PARTICULAR PURPOSE. - * See the MulanPSL - 2.0 for more details. + * See the Mulan PSL v2 for more details. */ #ifndef MAPLE_ME_INCLUDE_IRMAP_BUILD_H @@ -19,13 +19,16 @@ #include "dominance.h" namespace maple { - // This class contains methods to convert Maple IR to MeIR. class IRMapBuild { public: - IRMapBuild(IRMap *hmap, Dominance *dom) : irMap(hmap), - mirModule(hmap->GetMIRModule()), ssaTab(irMap->GetSSATab()), dominance(*dom), curBB(nullptr) { - static auto stmtBuildPolicyLoader = InitMeStmtFactory(); + IRMapBuild(IRMap *hmap, Dominance *dom) + : irMap(hmap), + mirModule(hmap->GetMIRModule()), + ssaTab(irMap->GetSSATab()), + dominance(*dom), + curBB(nullptr) { + static const auto stmtBuildPolicyLoader = InitMeStmtFactory(); (void)stmtBuildPolicyLoader; } ~IRMapBuild() {} @@ -58,13 +61,11 @@ class IRMapBuild { MeStmt *BuildMeStmt(StmtNode&); MeExpr *BuildExpr(BaseNode&); - private: IRMap *irMap; MIRModule &mirModule; SSATab &ssaTab; Dominance &dominance; BB *curBB; // current mapleme::BB being visited }; - } // namespace maple -#endif // MAPLE_ME_INCLUDE_IRMAP_BUILD_H +#endif // MAPLE_ME_INCLUDE_IRMAP_BUILD_H \ No newline at end of file diff --git a/src/mapleall/maple_me/include/me_irmap.h b/src/mapleall/maple_me/include/me_irmap.h index df297f7c0e..eef5b97f84 100644 --- a/src/mapleall/maple_me/include/me_irmap.h +++ b/src/mapleall/maple_me/include/me_irmap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -46,6 +46,5 @@ class MeIRMap : public IRMap { private: MeFunction &func; }; - } // namespace maple #endif // MAPLE_ME_INCLUDE_ME_IRMAP_H diff --git a/src/mapleall/maple_me/include/me_irmap_build.h b/src/mapleall/maple_me/include/me_irmap_build.h index 1f19446fe1..3cf23c963c 100644 --- a/src/mapleall/maple_me/include/me_irmap_build.h +++ b/src/mapleall/maple_me/include/me_irmap_build.h @@ -1,16 +1,16 @@ /* - * Copyright (c) [2020] Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. * - * OpenArkCompiler is licensed under the Mulan Permissive Software License v2. - * You can use this software according to the terms and conditions of the MulanPSL - 2.0. - * You may obtain a copy of MulanPSL - 2.0 at: + * OpenArkCompiler is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: * - * https://opensource.org/licenses/MulanPSL-2.0 + * http://license.coscl.org.cn/MulanPSL2 * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR * FIT FOR A PARTICULAR PURPOSE. - * See the MulanPSL - 2.0 for more details. + * See the Mulan PSL v2 for more details. */ #ifndef MAPLE_ME_INCLUDE_ME_IRMAP_BUILD_H @@ -20,7 +20,6 @@ #include "irmap_build.h" namespace maple { - class MeDoIRMapBuild : public MeFuncPhase { public: explicit MeDoIRMapBuild(MePhaseID id) : MeFuncPhase(id) {} @@ -33,4 +32,4 @@ class MeDoIRMapBuild : public MeFuncPhase { } }; } // namespace maple -#endif // MAPLE_ME_INCLUDE_ME_IRMAP_BUILD_H +#endif // MAPLE_ME_INCLUDE_ME_IRMAP_BUILD_H \ No newline at end of file diff --git a/src/mapleall/maple_me/include/me_phases.def b/src/mapleall/maple_me/include/me_phases.def index a8490395d9..a471fb26f2 100644 --- a/src/mapleall/maple_me/include/me_phases.def +++ b/src/mapleall/maple_me/include/me_phases.def @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under the Mulan PSL v1. * You can use this software according to the terms and conditions of the Mulan PSL v1. diff --git a/src/mapleall/maple_me/src/irmap.cpp b/src/mapleall/maple_me/src/irmap.cpp index f0ccc0bb09..e729d42a52 100755 --- a/src/mapleall/maple_me/src/irmap.cpp +++ b/src/mapleall/maple_me/src/irmap.cpp @@ -18,7 +18,6 @@ #include "mir_builder.h" namespace maple { - VarMeExpr *IRMap::CreateVarMeExprVersion(const VarMeExpr &origExpr) { auto *varMeExpr = New(&irMapAlloc, exprID++, origExpr.GetOStIdx(), vst2MeExprTable.size()); vst2MeExprTable.push_back(varMeExpr); @@ -539,5 +538,4 @@ MeExpr *IRMap::CreateAddrofMeExprFromSymbol(MIRSymbol &st, PUIdx puIdx) { addrOfMe.SetPtyp(PTY_ptr); return HashMeExpr(addrOfMe); } - } // namespace maple diff --git a/src/mapleall/maple_me/src/irmap_build.cpp b/src/mapleall/maple_me/src/irmap_build.cpp index dc628a4d8e..0179b72087 100644 --- a/src/mapleall/maple_me/src/irmap_build.cpp +++ b/src/mapleall/maple_me/src/irmap_build.cpp @@ -1,16 +1,16 @@ /* - * Copyright (c) [2020] Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. * - * OpenArkCompiler is licensed under the Mulan Permissive Software License v2. - * You can use this software according to the terms and conditions of the MulanPSL - 2.0. - * You may obtain a copy of MulanPSL - 2.0 at: + * OpenArkCompiler is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: * - * https://opensource.org/licenses/MulanPSL-2.0 + * http://license.coscl.org.cn/MulanPSL2 * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR * FIT FOR A PARTICULAR PURPOSE. - * See the MulanPSL - 2.0 for more details. + * See the Mulan PSL v2 for more details. */ #include "factory.h" @@ -48,7 +48,8 @@ RegMeExpr *IRMapBuild::GetOrCreateRegFromVerSt(const VersionSt &vst) { const OriginalSt *ost = vst.GetOrigSt(); ASSERT(ost->IsPregOst(), "GetOrCreateRegFromVerSt: PregOST expected"); auto *regx = - irMap->NewInPool(irMap->exprID++, ost->GetPregIdx(), mirModule.CurFunction()->GetPuidx(), ost->GetIndex(), vindex); + irMap->NewInPool(irMap->exprID++, ost->GetPregIdx(), mirModule.CurFunction()->GetPuidx(), + ost->GetIndex(), vindex); regx->InitBase(OP_regread, ost->GetMIRPreg()->GetPrimType(), 0); irMap->regMeExprTable.push_back(regx); irMap->vst2MeExprTable[vindex] = regx; @@ -74,7 +75,7 @@ MeExpr *IRMapBuild::BuildLHSReg(const VersionSt &vst, RegassignMeStmt &defMeStmt // build Me chilist from MayDefNode list void IRMapBuild::BuildChiList(MeStmt &meStmt, TypeOfMayDefList &mayDefNodes, - MapleMap &outList) { + MapleMap &outList) { for (auto &mayDefNode : mayDefNodes) { VersionSt *opndSt = mayDefNode.GetOpnd(); VersionSt *resSt = mayDefNode.GetResult(); @@ -84,17 +85,17 @@ void IRMapBuild::BuildChiList(MeStmt &meStmt, TypeOfMayDefList &mayDefNodes, lhs->SetDefBy(kDefByChi); lhs->SetDefChi(*chiMeStmt); chiMeStmt->SetLHS(lhs); - outList.insert(std::make_pair(lhs->GetOStIdx(), chiMeStmt)); + (void)outList.insert(std::make_pair(lhs->GetOStIdx(), chiMeStmt)); } } void IRMapBuild::BuildMustDefList(MeStmt &meStmt, TypeOfMustDefList &mustDefList, - MapleVector &mustDefMeList) { + MapleVector &mustDefMeList) { for (auto &mustDefNode : mustDefList) { VersionSt *vst = mustDefNode.GetResult(); VarMeExpr *lhs = GetOrCreateVarFromVerSt(*vst); ASSERT(lhs->GetMeOp() == kMeOpReg || lhs->GetMeOp() == kMeOpVar, "unexpected opcode"); - mustDefMeList.push_back(MustDefMeNode(lhs, &meStmt)); + mustDefMeList.emplace_back(MustDefMeNode(lhs, &meStmt)); } } @@ -128,7 +129,7 @@ void IRMapBuild::BuildMuList(TypeOfMayUseList &mayUseList, MapleMapGetOStIdx(), varMeExpr)); + (void)muList.insert(std::make_pair(varMeExpr->GetOStIdx(), varMeExpr)); } } @@ -161,7 +162,7 @@ void IRMapBuild::SetMeExprOpnds(MeExpr &meExpr, BaseNode &mirNode) { MeExpr *IRMapBuild::BuildExpr(BaseNode &mirNode) { Opcode op = mirNode.GetOpCode(); if (op == OP_dread) { - auto &addrOfNode = static_cast(mirNode); + auto &addrOfNode = static_cast(mirNode); VersionSt *vst = addrOfNode.GetSSAVar(); VarMeExpr *varMeExpr = GetOrCreateVarFromVerSt(*vst); varMeExpr->InitBase(mirNode.GetOpCode(), mirNode.GetPrimType(), mirNode.GetNumOpnds()); @@ -174,7 +175,7 @@ MeExpr *IRMapBuild::BuildExpr(BaseNode &mirNode) { } if (op == OP_regread) { - auto ®Node = static_cast(mirNode); + auto ®Node = static_cast(mirNode); VersionSt *vst = regNode.GetSSAVar(); RegMeExpr *regMeExpr = GetOrCreateRegFromVerSt(*vst); regMeExpr->InitBase(mirNode.GetOpCode(), mirNode.GetPrimType(), mirNode.GetNumOpnds()); @@ -244,8 +245,8 @@ MeStmt *IRMapBuild::BuildMeStmtWithNoSSAPart(StmtNode &stmt) { case OP_free: case OP_switch: { auto &unaryStmt = static_cast(stmt); - auto *unMeStmt = - static_cast((op == OP_switch) ? irMap->NewInPool(&stmt) : irMap->New(&stmt)); + auto *unMeStmt = static_cast((op == OP_switch) ? irMap->NewInPool(&stmt) + : irMap->New(&stmt)); unMeStmt->SetOpnd(0, BuildExpr(*unaryStmt.Opnd(0))); return unMeStmt; } @@ -441,5 +442,4 @@ void IRMapBuild::BuildBB(BB &bb, std::vector &bbIRMapProcessed) { BuildBB(*irMap->GetBB(childBBId), bbIRMapProcessed); } } - -} // namespace maple +} // namespace maple \ No newline at end of file diff --git a/src/mapleall/maple_me/src/irmap_emit.cpp b/src/mapleall/maple_me/src/irmap_emit.cpp index 830e3322dc..5804bdd17e 100755 --- a/src/mapleall/maple_me/src/irmap_emit.cpp +++ b/src/mapleall/maple_me/src/irmap_emit.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -591,5 +591,4 @@ void BB::EmitBB(SSATab &ssaTab, BlockNode &curblk, bool needAnotherPass) { curblk.AddStatement(endtry); } } - } // namespace maple diff --git a/src/mapleall/maple_me/src/me_abco.cpp b/src/mapleall/maple_me/src/me_abco.cpp index e293b9c1a3..2b3f20950a 100755 --- a/src/mapleall/maple_me/src/me_abco.cpp +++ b/src/mapleall/maple_me/src/me_abco.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/me_analyze_rc.cpp b/src/mapleall/maple_me/src/me_analyze_rc.cpp index 894521f056..25c744721a 100755 --- a/src/mapleall/maple_me/src/me_analyze_rc.cpp +++ b/src/mapleall/maple_me/src/me_analyze_rc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/me_analyzector.cpp b/src/mapleall/maple_me/src/me_analyzector.cpp index bf1407f4eb..bdcb5df99a 100644 --- a/src/mapleall/maple_me/src/me_analyzector.cpp +++ b/src/mapleall/maple_me/src/me_analyzector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/me_emit.cpp b/src/mapleall/maple_me/src/me_emit.cpp index e47871b954..8aa69c97a6 100644 --- a/src/mapleall/maple_me/src/me_emit.cpp +++ b/src/mapleall/maple_me/src/me_emit.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/me_hdse.cpp b/src/mapleall/maple_me/src/me_hdse.cpp index 2eada8ff53..63f22a2397 100755 --- a/src/mapleall/maple_me/src/me_hdse.cpp +++ b/src/mapleall/maple_me/src/me_hdse.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/me_irmap.cpp b/src/mapleall/maple_me/src/me_irmap.cpp index ef0205420d..65e4de3baf 100755 --- a/src/mapleall/maple_me/src/me_irmap.cpp +++ b/src/mapleall/maple_me/src/me_irmap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -15,7 +15,6 @@ #include "me_irmap.h" namespace maple { - void MeIRMap::Dump() { // back up mempool and use a new mempool every time // we dump IRMap, restore the mempool afterwards @@ -44,5 +43,4 @@ void MeIRMap::Dump() { memPoolCtrler.DeleteMemPool(mirFunction->GetCodeMempool()); mirFunction->SetMemPool(backup); } - } // namespace maple diff --git a/src/mapleall/maple_me/src/me_irmap_build.cpp b/src/mapleall/maple_me/src/me_irmap_build.cpp index 2050e30776..1972185c42 100644 --- a/src/mapleall/maple_me/src/me_irmap_build.cpp +++ b/src/mapleall/maple_me/src/me_irmap_build.cpp @@ -1,16 +1,16 @@ /* - * Copyright (c) [2020] Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. * - * OpenArkCompiler is licensed under the Mulan Permissive Software License v2. - * You can use this software according to the terms and conditions of the MulanPSL - 2.0. - * You may obtain a copy of MulanPSL - 2.0 at: + * OpenArkCompiler is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: * - * https://opensource.org/licenses/MulanPSL-2.0 + * http://license.coscl.org.cn/MulanPSL2 * * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR * FIT FOR A PARTICULAR PURPOSE. - * See the MulanPSL - 2.0 for more details. + * See the Mulan PSL v2 for more details. */ #include "me_irmap_build.h" @@ -22,10 +22,10 @@ // This phase converts Maple IR to MeIR. namespace maple { - AnalysisResult *MeDoIRMapBuild::Run(MeFunction *func, MeFuncResultMgr *funcResMgr, ModuleResultMgr *moduleResMgr) { - Dominance *dom = static_cast(funcResMgr->GetAnalysisResult(MeFuncPhase_DOMINANCE, func)); - CHECK_FATAL(dom, "dominance phase has problem"); + (void)moduleResMgr; + Dominance *dom = static_cast(funcResMgr->GetAnalysisResult(MeFuncPhase_DOMINANCE, func)); + CHECK_FATAL(dom != nullptr, "dominance phase has problem"); MemPool *irmapmp = NewMemPool(); @@ -63,5 +63,4 @@ AnalysisResult *MeDoIRMapBuild::Run(MeFunction *func, MeFuncResultMgr *funcResMg func->GetMeSSATab()->GetVersionStTable().GetVSTAlloc().GetMemPool()->Release(); return irMap; } - -} // namespace maple +} // namespace maple \ No newline at end of file diff --git a/src/mapleall/maple_me/src/me_profile_gen.cpp b/src/mapleall/maple_me/src/me_profile_gen.cpp index 8b2616ff8f..77bc04253d 100644 --- a/src/mapleall/maple_me/src/me_profile_gen.cpp +++ b/src/mapleall/maple_me/src/me_profile_gen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/me_prop.cpp b/src/mapleall/maple_me/src/me_prop.cpp index e81d8c4b19..01a24643b3 100644 --- a/src/mapleall/maple_me/src/me_prop.cpp +++ b/src/mapleall/maple_me/src/me_prop.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/me_rc_lowering.cpp b/src/mapleall/maple_me/src/me_rc_lowering.cpp index 93fd13ee11..e1a00fbee0 100644 --- a/src/mapleall/maple_me/src/me_rc_lowering.cpp +++ b/src/mapleall/maple_me/src/me_rc_lowering.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/me_ssa_devirtual.cpp b/src/mapleall/maple_me/src/me_ssa_devirtual.cpp index 1a064301ac..d03f480ada 100644 --- a/src/mapleall/maple_me/src/me_ssa_devirtual.cpp +++ b/src/mapleall/maple_me/src/me_ssa_devirtual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/me_ssa_epre.cpp b/src/mapleall/maple_me/src/me_ssa_epre.cpp index e5f2ce56ea..7eac26662e 100644 --- a/src/mapleall/maple_me/src/me_ssa_epre.cpp +++ b/src/mapleall/maple_me/src/me_ssa_epre.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/me_stmt_pre.cpp b/src/mapleall/maple_me/src/me_stmt_pre.cpp index 5ad849d27f..bc5af520f8 100755 --- a/src/mapleall/maple_me/src/me_stmt_pre.cpp +++ b/src/mapleall/maple_me/src/me_stmt_pre.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. diff --git a/src/mapleall/maple_me/src/me_store_pre.cpp b/src/mapleall/maple_me/src/me_store_pre.cpp index 2644fc151f..ddfd0d1da3 100755 --- a/src/mapleall/maple_me/src/me_store_pre.cpp +++ b/src/mapleall/maple_me/src/me_store_pre.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. -- Gitee From d666f7f491d6292e6913e080567d5e6de5d3d436 Mon Sep 17 00:00:00 2001 From: binaryfz Date: Tue, 2 Feb 2021 14:06:07 +0800 Subject: [PATCH 2/2] mod lcn header --- src/mapleall/maple_me/include/irmap_build.h | 4 ++-- src/mapleall/maple_me/include/me_irmap_build.h | 4 ++-- src/mapleall/maple_me/src/irmap_build.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mapleall/maple_me/include/irmap_build.h b/src/mapleall/maple_me/include/irmap_build.h index cbfbaca12d..e478927df5 100644 --- a/src/mapleall/maple_me/include/irmap_build.h +++ b/src/mapleall/maple_me/include/irmap_build.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -68,4 +68,4 @@ class IRMapBuild { BB *curBB; // current mapleme::BB being visited }; } // namespace maple -#endif // MAPLE_ME_INCLUDE_IRMAP_BUILD_H \ No newline at end of file +#endif // MAPLE_ME_INCLUDE_IRMAP_BUILD_H diff --git a/src/mapleall/maple_me/include/me_irmap_build.h b/src/mapleall/maple_me/include/me_irmap_build.h index 3cf23c963c..094adeabbe 100644 --- a/src/mapleall/maple_me/include/me_irmap_build.h +++ b/src/mapleall/maple_me/include/me_irmap_build.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -32,4 +32,4 @@ class MeDoIRMapBuild : public MeFuncPhase { } }; } // namespace maple -#endif // MAPLE_ME_INCLUDE_ME_IRMAP_BUILD_H \ No newline at end of file +#endif // MAPLE_ME_INCLUDE_ME_IRMAP_BUILD_H diff --git a/src/mapleall/maple_me/src/irmap_build.cpp b/src/mapleall/maple_me/src/irmap_build.cpp index 0179b72087..70eb616c6b 100644 --- a/src/mapleall/maple_me/src/irmap_build.cpp +++ b/src/mapleall/maple_me/src/irmap_build.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -442,4 +442,4 @@ void IRMapBuild::BuildBB(BB &bb, std::vector &bbIRMapProcessed) { BuildBB(*irMap->GetBB(childBBId), bbIRMapProcessed); } } -} // namespace maple \ No newline at end of file +} // namespace maple -- Gitee