From 69fe6fac8c9bfb8a27579b15c002677c1d99e6cf Mon Sep 17 00:00:00 2001 From: fye Date: Mon, 11 Jul 2022 17:37:43 -0700 Subject: [PATCH 1/3] debug: LowerBlock didnt maintain srcpos --- src/mapleall/maple_be/src/be/lower.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mapleall/maple_be/src/be/lower.cpp b/src/mapleall/maple_be/src/be/lower.cpp index a973a0989e..82933fc1e8 100644 --- a/src/mapleall/maple_be/src/be/lower.cpp +++ b/src/mapleall/maple_be/src/be/lower.cpp @@ -1826,6 +1826,7 @@ BlockNode *CGLowerer::LowerBlock(BlockNode &block) { nextStmt = stmt->GetNext(); stmt->SetNext(nullptr); currentBlock = newBlk; + auto lastStmt = newBlk->GetStmtNodes().rbegin(); LowerTypePtr(*stmt); @@ -1966,6 +1967,13 @@ BlockNode *CGLowerer::LowerBlock(BlockNode &block) { break; } CHECK_FATAL(beCommon.GetSizeOfTypeSizeTable() == GlobalTables::GetTypeTable().GetTypeTableSize(), "Error!"); + + for (auto itStmt = newBlk->GetStmtNodes().rbegin(); itStmt != lastStmt; ++itStmt) { + if (stmt->GetSrcPos().IsValid()) { + itStmt->SetSrcPos(stmt->GetSrcPos()); + } + } + lastStmt = newBlk->GetStmtNodes().rbegin(); } while (nextStmt != nullptr); for (auto node : abortNode) { newBlk->AddStatement(node); -- Gitee From 1df80975fcf2d34b58903a8f7f3b49a625e19d62 Mon Sep 17 00:00:00 2001 From: fye Date: Tue, 12 Jul 2022 18:40:38 -0700 Subject: [PATCH 2/3] debug: LowerBlock didnt maintain srcpos --- src/mapleall/mpl2mpl/include/gen_profile.h | 12 ++++++------ src/mapleall/mpl2mpl/src/gen_profile.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/mapleall/mpl2mpl/include/gen_profile.h b/src/mapleall/mpl2mpl/include/gen_profile.h index 4c9af1e1f0..f6cdc717af 100644 --- a/src/mapleall/mpl2mpl/include/gen_profile.h +++ b/src/mapleall/mpl2mpl/include/gen_profile.h @@ -1,16 +1,16 @@ /* - * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (C) [2022] Futurewei Technologies, Inc. All rights reverved. * - * 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: + * 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: * - * http://license.coscl.org.cn/MulanPSL2 + * https://opensource.org/licenses/MulanPSL-2.0 * * 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 Mulan PSL v2 for more details. + * See the MulanPSL - 2.0 for more details. */ #ifndef MAPLE_MPL2MPL_INCLUDE_PROFILEGEN_H #define MAPLE_MPL2MPL_INCLUDE_PROFILEGEN_H diff --git a/src/mapleall/mpl2mpl/src/gen_profile.cpp b/src/mapleall/mpl2mpl/src/gen_profile.cpp index d155383691..aaec659522 100644 --- a/src/mapleall/mpl2mpl/src/gen_profile.cpp +++ b/src/mapleall/mpl2mpl/src/gen_profile.cpp @@ -1,16 +1,16 @@ /* - * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (C) [2022] Futurewei Technologies, Inc. All rights reverved. * - * 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: + * 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: * - * http://license.coscl.org.cn/MulanPSL2 + * https://opensource.org/licenses/MulanPSL-2.0 * * 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 Mulan PSL v2 for more details. + * See the MulanPSL - 2.0 for more details. */ #include #include "gen_profile.h" -- Gitee From 01fc89f953fd5e8ec74f373b446f7f1064315434 Mon Sep 17 00:00:00 2001 From: fye Date: Tue, 12 Jul 2022 19:20:10 -0700 Subject: [PATCH 3/3] debug: LowerBlock didnt maintain srcpos --- src/mapleall/maple_me/include/me_merge_stmts.h | 12 ++++++------ src/mapleall/maple_me/src/me_merge_stmts.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/mapleall/maple_me/include/me_merge_stmts.h b/src/mapleall/maple_me/include/me_merge_stmts.h index 70e03ca1b7..02a3c2e652 100644 --- a/src/mapleall/maple_me/include/me_merge_stmts.h +++ b/src/mapleall/maple_me/include/me_merge_stmts.h @@ -1,16 +1,16 @@ /* - * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (C) [2022] Futurewei Technologies, Inc. All rights reverved. * - * 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: + * 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: * - * http://license.coscl.org.cn/MulanPSL2 + * https://opensource.org/licenses/MulanPSL-2.0 * * 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 Mulan PSL v2 for more details. + * See the MulanPSL - 2.0 for more details. */ #ifndef MAPLE_ME_INCLUDE_ME_MERGE_STMTS_H #define MAPLE_ME_INCLUDE_ME_MERGE_STMTS_H diff --git a/src/mapleall/maple_me/src/me_merge_stmts.cpp b/src/mapleall/maple_me/src/me_merge_stmts.cpp index d8e1b59a53..49d1a2a4e6 100644 --- a/src/mapleall/maple_me/src/me_merge_stmts.cpp +++ b/src/mapleall/maple_me/src/me_merge_stmts.cpp @@ -1,16 +1,16 @@ /* - * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. * - * 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: + * 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: * - * http://license.coscl.org.cn/MulanPSL2 + * https://opensource.org/licenses/MulanPSL-2.0 * * 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 Mulan PSL v2 for more details. + * See the MulanPSL - 2.0 for more details. */ #include "me_merge_stmts.h" #include "me_irmap.h" -- Gitee