From 393f5310ec66337ff46d11054ce67c79c0d367aa Mon Sep 17 00:00:00 2001 From: fye Date: Thu, 7 Jul 2022 17:24:00 -0700 Subject: [PATCH] debug: enable loc when there is no prolog --- .../src/cg/aarch64/aarch64_proepilog.cpp | 16 ++++++++++++++-- src/mapleall/maple_me/include/me_merge_stmts.h | 12 ++++++------ src/mapleall/maple_me/src/me_merge_stmts.cpp | 12 ++++++------ 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/mapleall/maple_be/src/cg/aarch64/aarch64_proepilog.cpp b/src/mapleall/maple_be/src/cg/aarch64/aarch64_proepilog.cpp index 883c14dd17..95ca52a725 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_proepilog.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_proepilog.cpp @@ -1415,8 +1415,14 @@ void AArch64GenProEpilog::GenerateProlog(BB &bb) { aarchCGFunc.GetDummyBB()->ClearInsns(); aarchCGFunc.GetDummyBB()->SetIsProEpilog(true); cgFunc.SetCurBB(*aarchCGFunc.GetDummyBB()); - if (!cgFunc.GetHasProEpilogue()) { - return; + + bool hasProEpilogue = cgFunc.GetHasProEpilogue(); + if (!hasProEpilogue) { + if (!(currCG->GetMIRModule()->IsCModule() && + currCG->GetCGOptions().WithLoc() && + currCG->GetMIRModule()->IsWithDbgInfo())) { + return; + } } // insert .loc for function @@ -1447,6 +1453,12 @@ void AArch64GenProEpilog::GenerateProlog(BB &bb) { Insn &loc = currCG->BuildInstruction(mpldbg::OP_DBG_loc, *o0, *o1); cgFunc.GetCurBB()->AppendInsn(loc); } + if (!hasProEpilogue) { + bb.InsertAtBeginning(*aarchCGFunc.GetDummyBB()); + cgFunc.SetCurBB(*formerCurBB); + aarchCGFunc.GetDummyBB()->SetIsProEpilog(false); + return; + } } const MapleVector ®sToSave = (!CGOptions::DoRegSavesOpt()) ? diff --git a/src/mapleall/maple_me/include/me_merge_stmts.h b/src/mapleall/maple_me/include/me_merge_stmts.h index 70e03ca1b7..dbc290ae1b 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) [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. */ #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