[COMMITTED,09/25] gccrs: Set the default ABI to C for extern blocks and extern functions
Message ID | 20240207114419.1100894-10-arthur.cohen@embecosm.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp2202052dyb; Wed, 7 Feb 2024 04:49:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2LJTm36anmql6UUd1Xx+BVqdeL2UDQZh6DGq/+eG6MkvXoOWNteIzlFs93fDyaXRWdNxU X-Received: by 2002:a05:6214:258b:b0:681:78cf:3920 with SMTP id fq11-20020a056214258b00b0068178cf3920mr6823549qvb.25.1707310197154; Wed, 07 Feb 2024 04:49:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707310197; cv=pass; d=google.com; s=arc-20160816; b=hbB0/EOj4tlRLz8p056t5nxz+5VhWRkMOt59ExpaK09gCoo86JT+Vkj9uXFfail1Gj IRf9Q4wgGOpJ1uJ+l9AL8H772IJRsaEg/1R4lStEyRf8DRVjlqfuhX0aSbSeaumZLL1Q JdzZzb4EjGOpZ9oDvbdhSkLilbsWdInzqPVw5ayROb8UOToXVr67QmwOuwo+jucmqjXe WPvj1j5Mh4tqeNDQcdmA962xAF0AE9oJ31IwN/wxie34DDNhX06zH8CEuJ7ml3Jvn3do A8IzVkQW2mnUgZTeN3I3DrWx+2i62h5AslRyiUnFPfhFbGUgrR2eOYNYn3RVbs2nH+mj g8aA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to: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:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=ItWy1jd9IB0h/7EFl8Y/9+12Ai4pPLPuEY+pHZCzzbQ=; fh=aK4Te3vgCS23IvLV1n+UYbI0fcCMBkMlmTT5pW0079k=; b=yZwU8poIEpECeeWOWBLDjWME1se1UFwL/cLinkpXhK2idopAUCgdmi+kjxYiUFZQY2 XKowhodwGckfqbJM6Msf6tornHNRUIT1U1MUusH0QxJ8t+rUcX5zJ1FDu7jCHc56J1Sz 2SwoyvKz+dd0SWbI4ADPSdp+hCUkLW/aMAlKF1txJpW7aERBVBxQieWStApaPUUuGil1 jYKYPsV8xs0kGo33bRcjSwfLC4m/kTc7iK65xk7pzo7LDq3UEGv9mUVJRfovwPj58A+6 QnU8+oepm1PUhuz3BJlxMqHDwSIR0pWNHM0oTmlOdV1yKnex4ETHKt7knS1OIGgZarmw t+pw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=KG+nONC0; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" X-Forwarded-Encrypted: i=2; AJvYcCWPVBh7N4CzKMmakLwbilQ0fcRA0WoZLOvwsG2739FbujiV32ykVWjfW4AmCjgEjWHG3qFLS3is8WNkMxWbAKfVtRHp/w== Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id iy8-20020a0562140f6800b0068cbe717d32si985632qvb.117.2024.02.07.04.49.57 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 04:49:57 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=KG+nONC0; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C4D23385800C for <ouuuleilei@gmail.com>; Wed, 7 Feb 2024 12:49:56 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by sourceware.org (Postfix) with ESMTPS id 684A33858017 for <gcc-patches@gcc.gnu.org>; Wed, 7 Feb 2024 12:44:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 684A33858017 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 684A33858017 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::132 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707309860; cv=none; b=APm7nQYbRTdm0mfh6ePK1INHR367ZtehHq/oVQqgXu3yXlLXxiDNFdny0I8Q8KbfAUJkVGAPJ3df/HMyi2HiDc+q0ylQlahJqQG7FdCuDkRHsAbwnsVOSztpASnqY2refPJ2KTYcV5zwZbe8M13sdb/c0c4oM8wbdkiPmJGWKgc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707309860; c=relaxed/simple; bh=IjkmwbATDhzOZYjeopKGdi6xRRxiNzAT4t4OddsU7MQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jcXsZDkj7yKLz9HKBqFs/5JhTz6b0phW1WXgNxMpLmmeL6tCgNe129I2NBECwCzjXA5wqUUzwS3jb4FIuoXqq3pfPZS+MANAq8GMCvr6JBeuFy5C8EpB1u6Nf5q9tgxtsD/UmUBzJPEvU8TBuoogKxMGpNLOqfnAgfZXvOHSnI8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-511689cc22aso529857e87.0 for <gcc-patches@gcc.gnu.org>; Wed, 07 Feb 2024 04:44:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1707309848; x=1707914648; darn=gcc.gnu.org; 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=ItWy1jd9IB0h/7EFl8Y/9+12Ai4pPLPuEY+pHZCzzbQ=; b=KG+nONC0g4aHftQBz4pVruYc3jmHFuAFpGrIAluVOCME+/wtoD9RqqN5bmRWrzz38M 9zBM1eYq3+SVVP7IRuZG5yCpxi78Tw4K6E+kSawAptKR5dwa6JzqhK+COegTPooqIv8v j/+lgg5oS/vxkOuojdonSfJoTihlUYOCbOjc+2K9sM9FmG/bXHRN1vXIfbscjeu/eD2t 7XiY4HTcCCJx6PlPdcLPxpH6JJ6g0F2Y9lYRYo5N5zfXRBUi3ZgdYSXNLc7zzSjGJkgw w26FfjOj+Rr+lCJ3f2tWT7SboRDqq+1S8QSxqGfJ19PaBKCRBJAixvXiHdLBl/BTyPqi afIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707309848; x=1707914648; 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=ItWy1jd9IB0h/7EFl8Y/9+12Ai4pPLPuEY+pHZCzzbQ=; b=fwuji0c4NhvvR1Y3+zs5Ta6rBVy1EnWT9xB71n49FnRRzrk4P25N9faCeHqnakqJDM twijGd/sUmhawcGl7Rbwd/LSi/zCobKkL1SH9ojToto94xNBvrTRkbXbYn2ywvy95vLW 8Brs982rI8Ebibcagf6XMcRKtGOFCFvIU1KQSDNy+Gxa+tUHhkAtWbs6ljjP1cDfo+Xt /dldQNSrRsg7G/INBl2q2l9O243w1EsjIgSBKYi775brbdmPRmHTbdmH4jy1Tv0Bc956 NgoQVYkmXs4fN5u9xAKfgw1YjrSHwsCwcbef2hGaZkWNRYgHgwKedJTfzFgAiFA3Ic1d 9fFA== X-Gm-Message-State: AOJu0YxQIMJ3kS9v2Zn19vCiMeTaanqmvDMO5P/iYs3q9yn+A35xpYcF sEuh4Y7NTldLwSDOlbTC0uL6Y+ReJElQmD17oAXm8qhwWZzD3oJTs5ZqUdyWm3TeYvrVJEZArPm 29Q== X-Received: by 2002:a05:6512:33cc:b0:511:522f:12b with SMTP id d12-20020a05651233cc00b00511522f012bmr4893511lfg.14.1707309848180; Wed, 07 Feb 2024 04:44:08 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVcyqj7GNx9njgZETYgESLwA3jI595XGcFBWITGkQCUTM2svTM/QnNBk1+bzIP2p60kkpsqi0jVyHR+bogvmLMCrqIT Received: from platypus.sou.embecosm-corp.com ([212.69.42.53]) by smtp.gmail.com with ESMTPSA id x19-20020a05600c2a5300b0040fbdd6f69bsm5044188wme.33.2024.02.07.04.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 04:44:07 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Nobel Singh <nobel2073@gmail.com> Subject: [COMMITTED 09/25] gccrs: Set the default ABI to C for extern blocks and extern functions Date: Wed, 7 Feb 2024 12:43:55 +0100 Message-ID: <20240207114419.1100894-10-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240207114419.1100894-2-arthur.cohen@embecosm.com> References: <20240207114419.1100894-2-arthur.cohen@embecosm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790244497060290041 X-GMAIL-MSGID: 1790244497060290041 |
Series |
[COMMITTED,01/25] gccrs: Parse normal functions with `self` parameter correctly
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Arthur Cohen
Feb. 7, 2024, 11:43 a.m. UTC
From: Nobel Singh <nobel2073@gmail.com> Previously, the default ABI was set to Rust, which is not correct for extern blocks and extern functions. This patch changes the default ABI to C for these cases. gcc/rust/ChangeLog: * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_qualifiers): Change default ABI to C for extern functions (ASTLoweringBase::lower_extern_block): Likewise Signed-off-by: Nobel Singh <nobel2073@gmail.com> --- gcc/rust/hir/rust-ast-lower-base.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc index 748cec74829..19f20885209 100644 --- a/gcc/rust/hir/rust-ast-lower-base.cc +++ b/gcc/rust/hir/rust-ast-lower-base.cc @@ -718,8 +718,8 @@ ASTLoweringBase::lower_qualifiers (const AST::FunctionQualifiers &qualifiers) Unsafety unsafety = qualifiers.is_unsafe () ? Unsafety::Unsafe : Unsafety::Normal; bool has_extern = qualifiers.is_extern (); + ABI abi = has_extern ? ABI::C : ABI::RUST; - ABI abi = ABI::RUST; if (qualifiers.has_abi ()) { const std::string &extern_abi = qualifiers.get_extern_abi (); @@ -965,7 +965,7 @@ ASTLoweringBase::lower_extern_block (AST::ExternBlock &extern_block) extern_items.push_back (std::unique_ptr<HIR::ExternalItem> (lowered)); } - ABI abi = ABI::RUST; + ABI abi = ABI::C; if (extern_block.has_abi ()) { const std::string &extern_abi = extern_block.get_abi ();