From patchwork Tue Dec 6 10:14:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 61535 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 97810396E45F for ; Tue, 6 Dec 2022 10:25:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 4C938398242C for ; Tue, 6 Dec 2022 10:14:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4C938398242C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x42d.google.com with SMTP id h12so22707499wrv.10 for ; Tue, 06 Dec 2022 02:14:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=wTRN3XeGCQw3AkJZOF436440QjgskRSwHcgXQ1ZGrGo=; b=bS2+BDtCgUn9CIsRHQ9qH5k8qXliKmPvqOxJOriyVtUFHt4V8/GzbxMYEHhJfcfLfu IHNpQpvmigVVeNGyqeG275Eq3ngk9no9N9pVHc1VJ9FOj1K7dvarZ47aVBq5XN9aY0v7 sAfgGTl+DMZbiSAICtkP8ARptMRrhyK0S9/i/tou6tHoxBzYEhfsRpSOSuLPgyd/GSLm BL6xhL31GiU1CEHWk0DyO2zK7BgeCyGGvFFeI5tIhN6+TfR81ZW01lATYBRxij5WHvaK zcqrfKyJgmq+8QQ3YEiBDugR3rofEpKRylJZf7Pt/x7C0GXipYlUVj9aLoFsYZJSyBhF p53w== 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:subject:date:message-id:reply-to; bh=wTRN3XeGCQw3AkJZOF436440QjgskRSwHcgXQ1ZGrGo=; b=60YiFrfm3z7smgrCQQ9Qlq6hBZtklB/8GLFfkak8PRQypBcXFPgmYQa90LFQ3rVviQ VbEzBzafCpn/cWGKNbYkBORX34GYgRDqOi+b6Sfv6WFIIGRjZGI3OENlsAk1gyIQtHKY X3lniRs6/r6TDTb3/HI8fZF/y7pEj8ITITGWLiNvBWCKQ3b0XczMlhENE0bcC5gXtJWT BmYcpNatkrUDEcTF852Xm3wUb24TAUS6eaR5gKvFuLXDGZOaEKqimnWceUmkEgBxl34v IDIKBzd28khtlK9NmGsR54WhDGfaP1YNFBgUc+qNAIEGK7MArzPRKZuEz4UJxKBN1PPa 2hKA== X-Gm-Message-State: ANoB5plro7894RVu9i/yY5RrJfkXDp/hWmD3wPepDjb1/kprbzwkb3tq 9o2exvSx8T46+3TRMZv5+uc6MA620f2NJHpfBw== X-Google-Smtp-Source: AA0mqf6BL/t598P9rFCWa8m/hY1AN3ucoePA/u74TwzT+XZjkXzGEkdsB3etv5RTmcelt3fZHgfikA== X-Received: by 2002:a5d:4950:0:b0:242:1f80:6cd9 with SMTP id r16-20020a5d4950000000b002421f806cd9mr20811636wrs.405.1670321651782; Tue, 06 Dec 2022 02:14:11 -0800 (PST) Received: from platypus.lan ([2001:861:5e4c:3bb0:6424:328a:1734:3249]) by smtp.googlemail.com with ESMTPSA id r10-20020a05600c458a00b003cfd4a50d5asm27052699wmo.34.2022.12.06.02.14.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 02:14:11 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Philip Herron Subject: [PATCH Rust front-end v4 43/46] gccrs: Add lang.opt Date: Tue, 6 Dec 2022 11:14:21 +0100 Message-Id: <20221206101417.778807-44-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221206101417.778807-1-arthur.cohen@embecosm.com> References: <20221206101417.778807-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-17.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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 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: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: Philip Herron We have some Rust-specific language options. Note that -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++'s 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..1130999d277 --- /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) 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) Warning LangEnabledBy(Rust,Wunused-variable, 1, 0) IntegerRange(0, 2) +Warn when a const variable is unused. + +Wunused-result +Rust Var(warn_unused_result) 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.