From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpbgau2.qq.com (smtpbgau2.qq.com [54.206.34.216]) by sourceware.org (Postfix) with ESMTPS id 315343858C52 for ; Fri, 14 Oct 2022 23:02:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 315343858C52 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp86t1665788562tqrozdy4 Received: from rios-cad5.localdomain ( [42.247.22.66]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 15 Oct 2022 07:02:40 +0800 (CST) X-QQ-SSF: 01400000002000D0K000B00A0000000 X-QQ-FEAT: RFp2QSjOiS7qFog9k/ciEaO1T+fQoSWL2Z/mxO8cDDkWEdTQQhASfSczfiJjU S8oH7ZlaDOLFdnrUlf1EzyPnFXqC7Mh66+US4+xRJvwoeMcsMMj8BS50P50nsSIKCqrywR4 5pa+cSxiL3R3JoWNeljjMUEA+e7dQA//TYvxfwjgO3dEIvAcuHUWOBnvDGYaZWpjGx9R7F+ +rweeVGIMuUUFpIoXT+CFsy9V2GWiLwCfPAcQXAtGgV7YNu0MR3o34uF/QRnwlgi5TBOLto HKFfRi7JZMrlp7U45uPjdD2yd3TvWLWdlzWIPn3kJh6kQAisu6IDMIY3vMkndOM5b5RtImR 5jh0Do4L40bvTBVkRh7ijPCrgSLzBehWTch8u3YlusqOGBj5as= X-QQ-GoodBg: 2 From: juzhe.zhong@rivai.ai To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, palmer@dabbelt.com, Ju-Zhe Zhong Subject: [PATCH] RISC-V: Reorganize mangle_builtin_type.[NFC] Date: Sat, 15 Oct 2022 07:02:36 +0800 Message-Id: <20221014230236.134044-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvr:qybglogicsvr7 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Ju-Zhe Zhong Hi, this patch fixed my mistake in the previous commit patch. Since "mangle_builtin_type" is a global function will be called in riscv.cc. It's reasonable move it down and put them together stay with other global functions. gcc/ChangeLog: * config/riscv/riscv-vector-builtins.cc (mangle_builtin_type): Move down the function. --- gcc/config/riscv/riscv-vector-builtins.cc | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gcc/config/riscv/riscv-vector-builtins.cc b/gcc/config/riscv/riscv-vector-builtins.cc index 99c482582d3..55d45651618 100644 --- a/gcc/config/riscv/riscv-vector-builtins.cc +++ b/gcc/config/riscv/riscv-vector-builtins.cc @@ -155,19 +155,6 @@ lookup_vector_type_attribute (const_tree type) return lookup_attribute ("RVV type", TYPE_ATTRIBUTES (type)); } -/* If TYPE is a built-in type defined by the RVV ABI, return the mangled name, - otherwise return NULL. */ -const char * -mangle_builtin_type (const_tree type) -{ - if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL) - type = TREE_TYPE (TYPE_NAME (type)); - if (tree attr = lookup_vector_type_attribute (type)) - if (tree id = TREE_VALUE (chain_index (0, TREE_VALUE (attr)))) - return IDENTIFIER_POINTER (id); - return NULL; -} - /* Return a representation of "const T *". */ static tree build_const_pointer (tree t) @@ -250,6 +237,19 @@ register_vector_type (vector_type_index type) builtin_types[type].vector_ptr = build_pointer_type (vectype); } +/* If TYPE is a built-in type defined by the RVV ABI, return the mangled name, + otherwise return NULL. */ +const char * +mangle_builtin_type (const_tree type) +{ + if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL) + type = TREE_TYPE (TYPE_NAME (type)); + if (tree attr = lookup_vector_type_attribute (type)) + if (tree id = TREE_VALUE (chain_index (0, TREE_VALUE (attr)))) + return IDENTIFIER_POINTER (id); + return NULL; +} + /* Initialize all compiler built-ins related to RVV that should be defined at start-up. */ void -- 2.36.1