diff --git a/src/mapleall/maple_be/include/cg/dbg.def b/src/mapleall/maple_be/include/cg/dbg.def index b95eefe0c588588023923fd7f8818d11bc94f42f..e3f6760b783b4d2299d90a6850867f541172f1ca 100644 --- a/src/mapleall/maple_be/include/cg/dbg.def +++ b/src/mapleall/maple_be/include/cg/dbg.def @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-2022] Futurewei Technologies, Inc. All rights reverved. * * 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_be/include/cg/dbg.h b/src/mapleall/maple_be/include/cg/dbg.h index dd70e6ed7280f4071a26e2a8a4b1ce58ab044597..6034b2b0a9322601ac1bd558586fc081c8f851d7 100644 --- a/src/mapleall/maple_be/include/cg/dbg.h +++ b/src/mapleall/maple_be/include/cg/dbg.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020-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. diff --git a/src/mapleall/maple_be/src/cg/dbg.cpp b/src/mapleall/maple_be/src/cg/dbg.cpp index 4a5efacac0e191451023210e76e9b115072b0e5c..90b4f3b4eb1e12b58fe14e82ddcdd08fa77582f5 100644 --- a/src/mapleall/maple_be/src/cg/dbg.cpp +++ b/src/mapleall/maple_be/src/cg/dbg.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2020-2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (C) [2020-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. diff --git a/src/mapleall/maple_ir/include/debug_info.h b/src/mapleall/maple_ir/include/debug_info.h index ab42514856bafcbbe6f9d1dd532634f158dbac64..0c778be24874d89c0f585ca3978ab237bf4c1d21 100644 --- a/src/mapleall/maple_ir/include/debug_info.h +++ b/src/mapleall/maple_ir/include/debug_info.h @@ -1,5 +1,5 @@ /* - * Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. + * Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * 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. diff --git a/src/mapleall/maple_ir/include/mir_function.h b/src/mapleall/maple_ir/include/mir_function.h index 9efc790d209c5f324b6d3b65a2b6be221a8568ee..bafcb951c81035eca47aaddbf11f32283e2d1dd8 100644 --- a/src/mapleall/maple_ir/include/mir_function.h +++ b/src/mapleall/maple_ir/include/mir_function.h @@ -69,9 +69,7 @@ class MIRFunction { public: MIRFunction(MIRModule *mod, StIdx idx) : module(mod), - symbolTableIdx(idx) { - scope = module->GetMemPool()->New(module, this); - } + symbolTableIdx(idx) {} ~MIRFunction() = default; @@ -723,29 +721,44 @@ class MIRFunction { infoIsString.push_back(isString); } + void SetupScope() { + if (!scope) { + scope = module->GetMemPool()->New(module, this); + } + } + MIRScope *GetScope() { + SetupScope(); return scope; } + void SetScope(MIRScope *scp) { + scope = scp; + } + bool NeedEmitAliasInfo() const { - return !scope->IsEmpty(); + return scope && !scope->IsEmpty(); } - MapleMap &GetAliasVarMap() const { + MapleMap &GetAliasVarMap() { + SetupScope(); return scope->GetAliasVarMap(); } void SetAliasVarMap(GStrIdx idx, const MIRAliasVars &vars) { + SetupScope(); scope->SetAliasVarMap(idx, vars); } void AddAliasVarMap(GStrIdx idx, const MIRAliasVars &vars) { + SetupScope(); scope->AddAliasVarMap(idx, vars); } bool HasVlaOrAlloca() const { return hasVlaOrAlloca; } + void SetVlaOrAlloca(bool has) { hasVlaOrAlloca = has; } diff --git a/src/mapleall/maple_ir/src/debug_info.cpp b/src/mapleall/maple_ir/src/debug_info.cpp index 0cfa53aaaf30d6653dd34e55a77137a25a2a9cd3..5caa06dd9841b47fadd3cf07898fecde69a25f91 100644 --- a/src/mapleall/maple_ir/src/debug_info.cpp +++ b/src/mapleall/maple_ir/src/debug_info.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) [2021] Futurewei Technologies, Inc. All rights reverved. + * Copyright (C) [2021-2022] Futurewei Technologies, Inc. All rights reverved. * * 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.