From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id E0C053858409 for ; Tue, 14 Dec 2021 00:13:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E0C053858409 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: mq8UwPwSxpb0EOFH8DCyGE8KONLBBaklnV1MH2e8sfSKMFczoaSxXXNk++18V6U43ltDqMGMj3 LqAy27MVyUEJ58weT+F8t2/l/hcIFbT0ZRiCcAebJyLg08KjgYdh7R3qYmLgrwlVoOdZSkFvfZ VQdmhoGafEvhBgynjh3yGQDJFAQVorBzNUEqfyteVYCnNqTcm5V/upmMHTnyUfhTJlLqJteziF saEeodQW6WIpP3m98jkUDpuLP/ddwEDqYjqhyTY2TVFePPq0bGv0ziP/ZZaSqY7TCFlWtU0qTn b1etCWdOsutH2B11Cy3BPYwE X-IronPort-AV: E=Sophos;i="5.88,203,1635235200"; d="scan'208";a="69655053" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 13 Dec 2021 16:13:23 -0800 IronPort-SDR: 4boXBQjxYHJ2z0eafeMmpdV6SBJumAGYmBvZ2E2tdypsqo6gUYTr0H67dDN2r/IgfjHpfbbX3q qup5n5DsYlaavpZ8/Qcr12KlSnybOU98ZeAvEp7WoQ8U98Jo/FII8fzXURBlXqXP44QcZ7jXpq f4ZHtxvDDfJmcVu0XMN+FcOmAlCiW+jab5G3fFZQtnWbrdLUan2BqXHFm5izq9ThAjAoi7BqS3 Dy+ivmRQQBZtRV24opKjTF87RaqvB39GTHiJxN7DQLAQj881bVIsP54c/j5tuRNKvwLFD5IhyW Xps= Date: Tue, 14 Dec 2021 00:13:18 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Chenghua Xu CC: , , Subject: Re: [PATCH v3 06/12] LoongArch Port: Builtin macros. In-Reply-To: <20211210074359.988056-7-xuchenghua@loongson.cn> Message-ID: References: <20211210074359.988056-1-xuchenghua@loongson.cn> <20211210074359.988056-7-xuchenghua@loongson.cn> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3116.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2021 00:13:27 -0000 On Fri, 10 Dec 2021, Chenghua Xu wrote: > + /* Macros dependent on the C dialect. */ > + if (preprocessing_asm_p ()) > + { > + builtin_define_std ("LANGUAGE_ASSEMBLY"); > + builtin_define ("_LANGUAGE_ASSEMBLY"); > + } > + else if (c_dialect_cxx ()) > + { > + builtin_define ("_LANGUAGE_C_PLUS_PLUS"); > + builtin_define ("__LANGUAGE_C_PLUS_PLUS"); > + builtin_define ("__LANGUAGE_C_PLUS_PLUS__"); > + } > + else > + { > + builtin_define_std ("LANGUAGE_C"); > + builtin_define ("_LANGUAGE_C"); > + } > + if (c_dialect_objc ()) > + { > + builtin_define ("_LANGUAGE_OBJECTIVE_C"); > + builtin_define ("__LANGUAGE_OBJECTIVE_C"); > + /* Bizarre, but retained for backwards compatibility. */ > + builtin_define_std ("LANGUAGE_C"); > + builtin_define ("_LANGUAGE_C"); > + } > +} I think all of this should be removed. It's a new architecture, there should be no need for any such macros for things that are not architecture-specific. In general, be careful to remove anything in the port that is actually about the peculiarities of what was once done for compatibility with existing software for an old architecture (MIPS?) that you modelled the port on and that is not considered best practice for a new architecture where you can make a fresh start. -- Joseph S. Myers joseph@codesourcery.com