From patchwork Thu Feb 29 22:37:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 86615 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 393923858419 for ; Thu, 29 Feb 2024 22:38:30 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id 161253858402 for ; Thu, 29 Feb 2024 22:37:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 161253858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 161253858402 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709246281; cv=none; b=WEDh1PrCTVeUUXFCIlYYgEIkaDJnwITB7z8SsslfackH1jYuCLLYdzKgsZN8teYpt1w6273xGs7xvsmHqytJUcDybw9RRLAlNdAuHV27lvKwmXXZaAzYP58zJlNDWzOBBl+TB3aTFDXuV4JXBHDfZsfRdsPCzVAM8umICG/7hyo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709246281; c=relaxed/simple; bh=NWtu0j+mKrmB8QjuFqmpmf9Z2SrUVsEL7nSkgYKKb9g=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=SeSex9JD1BSgtnV0HanqpvqYdUDNgChKaCluiuQiI9Q33SAL5E7MuhhHxSYge32ij5v9LIU/aIBe9JcUjQ6QAInziMw7V0p6osb8emQCp1IR4ucM8pO7gcFspJEKNPIqnaBQV+LtFfOadcPnmOn6fRszJGM055XhnKdgzyJLgLM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6010a.ext.cloudfilter.net ([10.0.30.248]) by cmsmtp with ESMTPS id fjolrJASKHXmAfp2JrdVRx; Thu, 29 Feb 2024 22:37:55 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id fp2IrdXSwZnrufp2Ir6LXW; Thu, 29 Feb 2024 22:37:54 +0000 X-Authority-Analysis: v=2.4 cv=TqnghiXh c=1 sm=1 tr=0 ts=65e10742 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=k7vzHIieQBIA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=lmjp5Qa83EzFXTsCgFoA:9 a=ul9cdbp4aOFLsgKbc677:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=2YhQ2GyO/xPS3S1f1F88NV3Z4qpDW9fRo3mPdNJL8UI=; b=SkAQenl2RWzS/P0fkB9ncgfZQc Cx6pLi122c/SqAglYTd21SXyinR2YHMwNSt0xSmR1gfXXORLyyrCEeZwglW08GVT3HmJfOY9g/BOY DC7Len9uIIqznFZOg3IQ0PgHs; Received: from 71-211-170-195.hlrn.qwest.net ([71.211.170.195]:40932 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rfp2I-001Kxv-0n; Thu, 29 Feb 2024 15:37:54 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [pushed] Synchronize GCC compile plugin headers Date: Thu, 29 Feb 2024 15:37:46 -0700 Message-ID: <20240229223746.2259090-1-tom@tromey.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.170.195 X-Source-L: No X-Exim-ID: 1rfp2I-001Kxv-0n X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-170-195.hlrn.qwest.net (localhost.localdomain) [71.211.170.195]:40932 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfHwG5OYQpoPGbfs8XQwN33ic0DFobOP0DoENkEIyPp9X/7+Jr4jxP+pU7QSR9W6pw+UhWdQqoIUddiOEbenZ1l1Vq4NhG8tNoC/kkZ5UGQxcgg3es1XL qsCcCxTyBfey47mSORh/FzvcIgqo7EdzlLSSXUwTtJ0l3qkgwDGctmiMMT3HYnsPpIKmUpPenxjEVYmrkSh51gh/A1mAW5KUdKg= X-Spam-Status: No, score=-3022.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H2, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org This patch copies some changes to the compile headers from GCC's include/ directory. It is the gdb equivalent of the GCC commit bc0e18a9 -- however, while that commit also necessarily touched libcc1, this one of course does not. Tested by rebuilding and also running the gdb.compile tests. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31397 --- include/gcc-c-fe.def | 13 ++++++++++++- include/gcc-c-interface.h | 11 +++++++++-- include/gcc-cp-interface.h | 6 +++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/include/gcc-c-fe.def b/include/gcc-c-fe.def index 36a765484a7..cb7cf197525 100644 --- a/include/gcc-c-fe.def +++ b/include/gcc-c-fe.def @@ -89,7 +89,10 @@ GCC_METHOD5 (int /* bool */, build_add_field, /* After all the fields have been added to a struct or union, the struct or union type must be "finished". This does some final - cleanups in GCC. */ + cleanups in GCC. + + Note that when using GCC_C_FE_VERSION_2, it is preferable to call + finish_record_with_alignment instead. */ GCC_METHOD2 (int /* bool */, finish_record_or_union, gcc_type, /* Argument RECORD_OR_UNION_TYPE. */ @@ -220,3 +223,11 @@ GCC_METHOD2 (gcc_type, float_type, unsigned long, /* Argument SIZE_IN_BYTES. */ const char *) /* Argument BUILTIN_NAME. */ +/* New in GCC_FE_VERSION_2. Like finish_record_or_union but the caller also + supplies the alignment. If the alignment is 0, this acts identically to + finish_record_or_union. */ + +GCC_METHOD3 (int /* bool */, finish_record_with_alignment, + gcc_type, /* Argument RECORD_OR_UNION_TYPE. */ + unsigned long, /* Argument SIZE_IN_BYTES. */ + unsigned long) /* Argument ALIGNMENT. */ diff --git a/include/gcc-c-interface.h b/include/gcc-c-interface.h index feece1e38a2..700d7483a4a 100644 --- a/include/gcc-c-interface.h +++ b/include/gcc-c-interface.h @@ -45,7 +45,10 @@ enum gcc_c_api_version /* Added char_type. Added new version of int_type and float_type, deprecated int_type_v0 and float_type_v0. */ - GCC_C_FE_VERSION_1 = 1 + GCC_C_FE_VERSION_1 = 1, + + /* Added finish_record_with_alignment method. */ + GCC_C_FE_VERSION_2 = 2, }; /* Qualifiers. */ @@ -198,7 +201,11 @@ struct gcc_c_context /* The type of the initialization function. The caller passes in the desired base version and desired C-specific version. If the request can be satisfied, a compatible gcc_context object will be - returned. Otherwise, the function returns NULL. */ + returned. In particular, this may return a context object with a higher + actual version number than was requested, provided the higher version is + fully compatible. (As of GCC_C_FE_VERSION_2, this is always true.) + + Otherwise, the function returns NULL. */ typedef struct gcc_c_context *gcc_c_fe_context_function (enum gcc_base_api_version, diff --git a/include/gcc-cp-interface.h b/include/gcc-cp-interface.h index 2f950729b9b..15b911cb216 100644 --- a/include/gcc-cp-interface.h +++ b/include/gcc-cp-interface.h @@ -483,7 +483,11 @@ struct gcc_cp_context /* The type of the initialization function. The caller passes in the desired base version and desired C-specific version. If the request can be satisfied, a compatible gcc_context object will be - returned. Otherwise, the function returns NULL. */ + returned. In particular, this may return a context object with a higher + actual version number than was requested, provided the higher version is + fully compatible. + + Otherwise, the function returns NULL. */ typedef struct gcc_cp_context *gcc_cp_fe_context_function (enum gcc_base_api_version,