From 15f9108dc372ce476c78d220c0fb8c48bd8b9f00 Mon Sep 17 00:00:00 2001 From: fye Date: Tue, 19 Jul 2022 11:12:20 -0700 Subject: [PATCH] debug: support variable parameters --- .../maple_be/src/cg/aarch64/aarch64_proepilog.cpp | 15 ++------------- src/mapleall/maple_ir/src/debug_info.cpp | 5 +++++ src/mapleall/maple_me/src/me_merge_stmts.cpp | 2 +- src/mapleall/mpl2mpl/include/gen_profile.h | 2 +- src/mapleall/mpl2mpl/src/gen_profile.cpp | 2 +- 5 files changed, 10 insertions(+), 16 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 c4d04bfefc..e5c5cdbedb 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_proepilog.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_proepilog.cpp @@ -1418,16 +1418,11 @@ void AArch64GenProEpilog::GenerateProlog(BB &bb) { bool hasProEpilogue = cgFunc.GetHasProEpilogue(); if (!hasProEpilogue) { - if (!(currCG->GetMIRModule()->IsCModule() && - currCG->GetCGOptions().WithLoc() && - currCG->GetMIRModule()->IsWithDbgInfo())) { - return; - } + return; } // insert .loc for function - if (currCG->GetCGOptions().WithLoc() && - (!currCG->GetMIRModule()->IsCModule() || currCG->GetMIRModule()->IsWithDbgInfo())) { + if (currCG->GetCGOptions().WithLoc() && (!currCG->GetMIRModule()->IsCModule())) { MIRFunction *func = &cgFunc.GetFunction(); MIRSymbol *fSym = GlobalTables::GetGsymTable().GetSymbolFromStidx(func->GetStIdx().Idx()); if (currCG->GetCGOptions().WithSrc()) { @@ -1455,12 +1450,6 @@ void AArch64GenProEpilog::GenerateProlog(BB &bb) { Insn &loc = currCG->BuildInstruction(mpldbg::OP_DBG_loc, *o0, *o1, *o2); 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_ir/src/debug_info.cpp b/src/mapleall/maple_ir/src/debug_info.cpp index 2d2c6d3c4c..2da205bcf5 100644 --- a/src/mapleall/maple_ir/src/debug_info.cpp +++ b/src/mapleall/maple_ir/src/debug_info.cpp @@ -676,6 +676,11 @@ DBGDie *DebugInfo::GetOrCreateFuncDeclDie(MIRFunction *func) { die->AddSubVec(param); } + if (func->IsVarargs()) { + DBGDie *varargDie = module->GetMemPool()->New(module, DW_TAG_unspecified_parameters); + die->AddSubVec(varargDie); + } + PopParentDie(); return die; diff --git a/src/mapleall/maple_me/src/me_merge_stmts.cpp b/src/mapleall/maple_me/src/me_merge_stmts.cpp index 184b7e3006..f29226ea7c 100644 --- a/src/mapleall/maple_me/src/me_merge_stmts.cpp +++ b/src/mapleall/maple_me/src/me_merge_stmts.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2022] Futurewei Technologies, Inc. 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/mpl2mpl/include/gen_profile.h b/src/mapleall/mpl2mpl/include/gen_profile.h index ed486e01b5..3f9184a0fe 100644 --- a/src/mapleall/mpl2mpl/include/gen_profile.h +++ b/src/mapleall/mpl2mpl/include/gen_profile.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2022] Futurewei Technologies, Inc. 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/mpl2mpl/src/gen_profile.cpp b/src/mapleall/mpl2mpl/src/gen_profile.cpp index 8147310bd8..ba613eacd7 100644 --- a/src/mapleall/mpl2mpl/src/gen_profile.cpp +++ b/src/mapleall/mpl2mpl/src/gen_profile.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2022] Futurewei Technologies, Inc. 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