From cc5751e02b0ac7305648b36161b844a9e93e3005 Mon Sep 17 00:00:00 2001 From: linma Date: Thu, 7 Jul 2022 09:52:37 -0700 Subject: [PATCH] refine callInfo constructor function, mirFunc is null for icall function --- src/mapleall/maple_ir/src/bin_mpl_import.cpp | 2 +- src/mapleall/maple_me/include/lfo_loop_vec.h | 2 +- src/mapleall/maple_me/include/seqvec.h | 2 +- src/mapleall/maple_me/src/lfo_loop_vec.cpp | 2 +- src/mapleall/maple_me/src/me_autovec.cpp | 2 +- src/mapleall/maple_me/src/seqvec.cpp | 2 +- src/mapleall/maple_util/include/gcov_profile.h | 15 +++++++++++++++ src/mapleall/mpl2mpl/include/call_graph.h | 7 +++---- src/mapleall/mpl2mpl/include/gcov_parser.h | 13 +++++++------ src/mapleall/mpl2mpl/src/gcov_parser.cpp | 12 ++++++------ 10 files changed, 37 insertions(+), 22 deletions(-) diff --git a/src/mapleall/maple_ir/src/bin_mpl_import.cpp b/src/mapleall/maple_ir/src/bin_mpl_import.cpp index 2294e72594..73a4873086 100644 --- a/src/mapleall/maple_ir/src/bin_mpl_import.cpp +++ b/src/mapleall/maple_ir/src/bin_mpl_import.cpp @@ -1206,7 +1206,7 @@ CallInfo *BinaryMplImport::ImportCallInfo() { bool argLocal = Read() == 1; MIRSymbol *funcSym = InSymbol(nullptr); CHECK_FATAL(funcSym != nullptr, "func_sym is null in BinaryMplImport::InCallInfo"); - CallInfo *ret = mod.GetMemPool()->New(ctype, *funcSym->GetFunction(), + CallInfo *ret = mod.GetMemPool()->New(ctype, funcSym->GetFunction(), static_cast(nullptr), loopDepth, id, argLocal); callInfoTab.push_back(ret); return ret; diff --git a/src/mapleall/maple_me/include/lfo_loop_vec.h b/src/mapleall/maple_me/include/lfo_loop_vec.h index d5bf7a5e75..484c7bedb3 100644 --- a/src/mapleall/maple_me/include/lfo_loop_vec.h +++ b/src/mapleall/maple_me/include/lfo_loop_vec.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2021] Futurewei 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/seqvec.h b/src/mapleall/maple_me/include/seqvec.h index b11243d4fd..57db88d85c 100644 --- a/src/mapleall/maple_me/include/seqvec.h +++ b/src/mapleall/maple_me/include/seqvec.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2021] Futurewei 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/lfo_loop_vec.cpp b/src/mapleall/maple_me/src/lfo_loop_vec.cpp index 39dc56efd9..338631f079 100644 --- a/src/mapleall/maple_me/src/lfo_loop_vec.cpp +++ b/src/mapleall/maple_me/src/lfo_loop_vec.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2021] Futurewei 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_autovec.cpp b/src/mapleall/maple_me/src/me_autovec.cpp index a4b0480490..c6f5c25ec7 100644 --- a/src/mapleall/maple_me/src/me_autovec.cpp +++ b/src/mapleall/maple_me/src/me_autovec.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2021] Futurewei 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/seqvec.cpp b/src/mapleall/maple_me/src/seqvec.cpp index 2282453d89..8c653d72e5 100644 --- a/src/mapleall/maple_me/src/seqvec.cpp +++ b/src/mapleall/maple_me/src/seqvec.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) [2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2021] Futurewei 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_util/include/gcov_profile.h b/src/mapleall/maple_util/include/gcov_profile.h index b4d9387811..e7dcacdd83 100644 --- a/src/mapleall/maple_util/include/gcov_profile.h +++ b/src/mapleall/maple_util/include/gcov_profile.h @@ -1,3 +1,18 @@ +/* + * Copyright (c) [2022] Futurewei 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: + * + * 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 MulanPSL - 2.0 for more details. + */ + #ifndef MAPLE_UTIL_INCLUDE_GCOV_PROFILE_H #define MAPLE_UTIL_INCLUDE_GCOV_PROFILE_H diff --git a/src/mapleall/mpl2mpl/include/call_graph.h b/src/mapleall/mpl2mpl/include/call_graph.h index 594d7551fe..b81fbd7005 100644 --- a/src/mapleall/mpl2mpl/include/call_graph.h +++ b/src/mapleall/mpl2mpl/include/call_graph.h @@ -50,8 +50,8 @@ struct Comparator { // Information description of each callsite class CallInfo { public: - CallInfo(CallType type, MIRFunction &call, StmtNode *node, uint32 ld, uint32 stmtId, bool local = false) - : areAllArgsLocal(local), cType(type), mirFunc(&call), callStmt(node), loopDepth(ld), id(stmtId) {} + CallInfo(CallType type, MIRFunction *call, StmtNode *node, uint32 ld, uint32 stmtId, bool local = false) + : areAllArgsLocal(local), cType(type), mirFunc(call), callStmt(node), loopDepth(ld), id(stmtId) {} // For fake callInfo, only id needed explicit CallInfo(uint32 stmtId) : id(stmtId) {} ~CallInfo() = default; @@ -483,8 +483,7 @@ class CallGraph : public AnalysisResult { void IncrNodesCount(CGNode *cgNode, BaseNode *bn); CallInfo *GenCallInfo(CallType type, MIRFunction *call, StmtNode *s, uint32 loopDepth, uint32 callsiteID) { - ASSERT_NOT_NULL(call); - return cgAlloc.GetMemPool()->New(type, *call, s, loopDepth, callsiteID); + return cgAlloc.GetMemPool()->New(type, call, s, loopDepth, callsiteID); } bool debugFlag = false; diff --git a/src/mapleall/mpl2mpl/include/gcov_parser.h b/src/mapleall/mpl2mpl/include/gcov_parser.h index 3c74e91395..a89b7ccb78 100644 --- a/src/mapleall/mpl2mpl/include/gcov_parser.h +++ b/src/mapleall/mpl2mpl/include/gcov_parser.h @@ -1,17 +1,18 @@ /* - * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2022] Futurewei 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. - * You may obtain a copy of Mulan PSL v2 at: + * 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: * - * 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_GCOVPROFUSE_H #define MAPLE_MPL2MPL_INCLUDE_GCOVPROFUSE_H #include "mempool.h" diff --git a/src/mapleall/mpl2mpl/src/gcov_parser.cpp b/src/mapleall/mpl2mpl/src/gcov_parser.cpp index ad4cdae6b3..d244452999 100644 --- a/src/mapleall/mpl2mpl/src/gcov_parser.cpp +++ b/src/mapleall/mpl2mpl/src/gcov_parser.cpp @@ -1,16 +1,16 @@ /* - * Copyright (c) [2019-2021] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2022] Futurewei 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. - * You may obtain a copy of Mulan PSL v2 at: + * 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: * - * 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 -- Gitee