From patchwork Wed Aug 24 11:59:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: herron.philip@googlemail.com X-Patchwork-Id: 713 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ecc5:0:0:0:0:0 with SMTP id s5csp1388100wro; Wed, 24 Aug 2022 05:13:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR5qXzjCmahFeSb61hRQe+on2Z609TaheFzFppwNut0PIA33p1n5edcu8aGsdSzc1qvp5YQD X-Received: by 2002:a17:907:2c61:b0:73d:94d1:7b3e with SMTP id ib1-20020a1709072c6100b0073d94d17b3emr2795489ejc.222.1661343216153; Wed, 24 Aug 2022 05:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661343216; cv=none; d=google.com; s=arc-20160816; b=ou2DwaegZ7RV+rjIlUq8UkIvS7EXBAAxjrQwPoYHC15zKUzeuLC+6gvTkm1hxaT8QV /QcQxCsPCRKGfalxYZhNtQBhzAtra1azp+feU8St4F/vOTzDvZH/2+Mm7mi3W3oXnpkl wCF65ckcTd0At4SD2kQ1J1SKqwyjXQ3BmvL8yTLNarx+ohvpY8sKVmqLcR71o7yFXc7M a6psJmA2ldLjvY+K00t1D6uslkbuAtYkxyFEWfJ1FhvjNFpuEqrbMIbtUvfKT5A22Dz5 7S429APXpjMa0A/TGgWO4CapmxXtbkeQS0vkC3LnO/mjf7guk3GGDTeyoJW4yJHStGGf 0LPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:dmarc-filter :delivered-to; bh=rCjpV2ZCNEapwjgvPvjdsWbWm7LPTueLWr2pAEg47HI=; b=FU/mVx+awthNO6xxbVWfKac3+w5VjecdHukWNZotu0J2ZFEGtqtJUUgwVslK7Q3osY dlPYCudKPYY3TNEHkm0QAFaGETpwLupe8CeBjCAdeTROJ6GVucUApv+uySRj3VyyWH7E EM/N50ppFH40ikUF/pFlCI62xMZ8i+kTu+MheObdHt3trv79KfqpkAx2exhhY+arj78+ cga/G4RzKzgTY7rAkLU9w17tPhZZbcxv+9QlJf1zzognSLtaGB8bCZycWqumlBKh5SJs NF2FB2VGoOgMHyfYJkkzbDgcfZb21H1P8l0r1lTdyDRetn9imQSce9bBpvix1N9MErNK neUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=DO8lYnJv; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id js8-20020a17090797c800b0073d89516878si1983509ejc.241.2022.08.24.05.13.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 05:13:36 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=DO8lYnJv; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 78D9D3839046 for ; Wed, 24 Aug 2022 12:05:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 7C9C138A90AA; Wed, 24 Aug 2022 12:01:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7C9C138A90AA Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=googlemail.com Received: by mail-wr1-x42e.google.com with SMTP id a4so20521374wrq.1; Wed, 24 Aug 2022 05:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc; bh=rCjpV2ZCNEapwjgvPvjdsWbWm7LPTueLWr2pAEg47HI=; b=DO8lYnJvJuWFye1/Us567Elzq5LjkjwYuoEJZqfRTpNX1xOB1Paw+FqRm7ryz/OtzL dgkx/npBdj3PZ0zumpXaT8Zbe7xmt63Tcf1U5JRZgpbIbsKXm6mUBVCGzFQG6U1vgP9W jC/p6zot8v+nvu8NOTS70NFYawvXoMBYAQ3wEvHHZQK2sNywooYBjlYghRmLUf+S599r SXoeusHKGjYxZYtYdo6pER7gQWjKdq8GGFdDOjAcf0ba1nIj/sKBKwZGGVo6C0091o1S OMQBSz8dgijkxMOcF+HNSI52GrKPQ1Spa4oU2BwnMNW3lCVXyon6vOMeoi0rTIjnLkx5 h7aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc; bh=rCjpV2ZCNEapwjgvPvjdsWbWm7LPTueLWr2pAEg47HI=; b=2BkjDF+BTA16FObmfDJyCOeLMTgJONae8gMP3pG+TLDBtdGtubtdo1KsChbal6pDQ/ jEIWkiIDrurrYZFvdWwAJOuwfeHYEHKNWChCrw5FpaV6hoGCmHZVG5+jcAb056rCnYvB HnBBafEStJMNzzxtm39IaNPMxcN+S10evUxytS0PC1+JWKFDK5u9aILjezHphePd/qG6 dapK1sJbVndBj7ocaAvtBGSLTtnOXJIwiSbj85quYBv58RrN+UNZKv+q3IamSSuDyuef 5H08Ti2RxO4BQkhwi6pjUE38nPhG5Pc9GMsNeJwwmEtO7yjH4K9H5upNexnWk57jQ2bR 2fXQ== X-Gm-Message-State: ACgBeo1kG3AiVzFD5iUwAdqVp+cibePFRGl8rPhYc88YqwUeVhsZnBg+ 8+PP5m9VPlmcUVQr9/PBM7Ixr8OQaN0= X-Received: by 2002:a05:6000:1e0e:b0:225:4e27:b806 with SMTP id bj14-20020a0560001e0e00b002254e27b806mr9451955wrb.605.1661342480823; Wed, 24 Aug 2022 05:01:20 -0700 (PDT) Received: from localhost.localdomain ([86.14.124.218]) by smtp.gmail.com with ESMTPSA id cc19-20020a5d5c13000000b0022571d43d32sm1697676wrb.21.2022.08.24.05.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 05:01:20 -0700 (PDT) From: herron.philip@googlemail.com X-Google-Original-From: philip.herron@embecosm.com To: gcc-patches@gcc.gnu.org Subject: [PATCH Rust front-end v2 34/37] gccrs: add lang.opt Date: Wed, 24 Aug 2022 12:59:53 +0100 Message-Id: <20220824115956.737931-35-philip.herron@embecosm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220824115956.737931-1-philip.herron@embecosm.com> References: <20220824115956.737931-1-philip.herron@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , Reply-To: philip.herron@embecosm.com Cc: gcc-rust@gcc.gnu.org, Philip Herron Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1742044624715618997?= X-GMAIL-MSGID: =?utf-8?q?1742044624715618997?= From: Philip Herron We have some rust specific langugage options note -fwrapv is enabled by default in the code. We are trying to respect options such as -Wunused-result which we get by porting over c++ no-discard for rust's must-use attribute, so we have enabled these by default directly here. --- gcc/rust/lang.opt | 118 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 gcc/rust/lang.opt diff --git a/gcc/rust/lang.opt b/gcc/rust/lang.opt new file mode 100644 index 00000000000..1f6855ede1d --- /dev/null +++ b/gcc/rust/lang.opt @@ -0,0 +1,118 @@ +; Options for the Rust front end. +; Copyright (C) 2003-2022 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 3, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; You should have received a copy of the GNU General Public License +; along with GCC; see the file COPYING3. If not see +; . + +; See the GCC internals manual for a description of this file's format. + +; Please try to keep this file in ASCII collating order. + +; Describes command-line options used by this frontend + +Language +Rust + +I +Rust Joined Separate +; Documented in c.opt + +L +Rust Joined Separate +; Not documented + +Wall +Rust +; Documented in c.opt + +Wunused-variable +Rust Var(warn_unused_variable) Init(1) Warning +; documented in common.opt + +Wunused-const-variable +Rust Warning Alias(Wunused-const-variable=, 2, 0) +Warn when a const variable is unused. + +Wunused-const-variable= +Rust Joined RejectNegative UInteger Var(warn_unused_const_variable) Init(1) Warning LangEnabledBy(Rust,Wunused-variable, 1, 0) IntegerRange(0, 2) +Warn when a const variable is unused. + +Wunused-result +Rust Var(warn_unused_result) Init(1) Warning +Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value. + +frust-crate= +Rust Joined RejectNegative +-frust-crate= Set the crate name for the compilation + +frust-debug +Rust Var(flag_rust_debug) +Dump various Rust front end internals. + +frust-dump- +Rust Joined RejectNegative +-frust-dump- Dump Rust frontend internal information. + +frust-max-recursion-depth= +Rust RejectNegative Type(int) Var(rust_max_recursion_depth) Init(64) +-frust-max-recursion-depth=integer + +frust-mangling= +Rust Joined RejectNegative Enum(frust_mangling) Var(flag_rust_mangling) +-frust-mangling=[legacy|v0] Choose which version to use for name mangling + +Enum +Name(frust_mangling) Type(int) UnknownError(unknown rust mangling option %qs) + +EnumValue +Enum(frust_mangling) String(legacy) Value(0) + +EnumValue +Enum(frust_mangling) String(v0) Value(1) + +frust-cfg= +Rust Joined RejectNegative +-frust-cfg= Set a config expansion option + +frust-edition= +Rust Joined RejectNegative Enum(frust_edition) Var(flag_rust_edition) +-frust-edition=[2015|2018|2021] Choose which edition to use when compiling rust code + +Enum +Name(frust_edition) Type(int) UnknownError(unknown rust edition %qs) + +EnumValue +Enum(frust_edition) String(2015) Value(0) + +EnumValue +Enum(frust_edition) String(2018) Value(1) + +EnumValue +Enum(frust_edition) String(2021) Value(2) + +frust-embed-metadata +Rust Var(flag_rust_embed_metadata) +Flag to enable embeding metadata directly into object files + +frust-metadata-output= +Rust Joined RejectNegative +-frust-metadata-output= Path to output crate metadata + +o +Rust Joined Separate +; Documented in common.opt + +; This comment is to ensure we retain the blank line above.