From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 7EEAE3839DF5 for ; Thu, 6 Oct 2022 09:29:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7EEAE3839DF5 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x334.google.com with SMTP id l8so651945wmi.2 for ; Thu, 06 Oct 2022 02:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9U5QzTWOfobfpNzJXsXdBtc5LzbKlBw3z2ZWiCVg3S4=; b=IUuY8k/IPHrLBfUFuqSDml2JIZYtZmIxOLYa8EzHxDh70rb2WEoEHbH/lHLQ+CtRay +8Ad5rc1KrxbHhkLfXp+fUA6G6GTtEDHNoUyFp2GlE//G04RYSuGauFwWJTHTxiok7kM MjyoabBLMJ0x9pSB8Jsll9T8qdNL8mU6UF924vaXySV5QYir12VpZ2MYFsLHeXGP/lgG U4vcjkY2wp5nAE35Sed2sIx/ADxXCvWPE3rLitbABQ9AMnQlcU6A5j+0KcbuIHNvO3v6 XmpKo4acEE5wkco6Szgmq5PcqHOxrPGd/lvZVQey8bKnRZq6YMr2HuZpP8ifn6HdxGjq Zw3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9U5QzTWOfobfpNzJXsXdBtc5LzbKlBw3z2ZWiCVg3S4=; b=Y7ezf60IEFCfgv0piFSBswStiyMU/3SCGUBzFDZGz2UpQLV7XYCnyb2jwN5+sWa7/2 2UoroY9G6yf0q0dA0RVm2bpkTJOzSLfkRuyVazcljNzqcZaQl0cClOw0cLQ4/DvoVm7x 0vT/Js7LzBS5quZIRVI0dQTye1jdvnEngYnmsRsYCSHaiesWVQGUYJk5FsKfriPMB0Cx FhRBTcBJmcaEQxsteGby0jSWtJJ7fviukCcoI0TEXdN3Iy+qYu8sJZMs1XZZ3koDPDKB VUUSUnIofFgFts/hrb03bqmwawLW+Is5h5z/h2RJ1gHMivYpOOvs6OfTS3agWeeyotuO vjTg== X-Gm-Message-State: ACrzQf0aYGu6RI5C9O3H4fxww5SrcOGEKFRZVHAH8L6F122reC3OHIXH dDEWN8Yl8l1H5Q7efXAH5s4wGSy/ZGfc4H3y X-Google-Smtp-Source: AMsMyM6GKGWskADzBxpPbEAdKwtAWVNvvkD4NAF/o8HVUdaaYp+Q5RjfHWMGJTbffxjRyAxEQOaTmA== X-Received: by 2002:a05:600c:1d11:b0:3b4:7644:b788 with SMTP id l17-20020a05600c1d1100b003b47644b788mr2615827wms.114.1665048587270; Thu, 06 Oct 2022 02:29:47 -0700 (PDT) Received: from poulhies-Precision-5550.lan (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id e14-20020adfdbce000000b0022b014fb0b7sm17360026wrj.110.2022.10.06.02.29.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 02:29:46 -0700 (PDT) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= Subject: [COMMITED] ada: Add C declarations for Storage Model support Date: Thu, 6 Oct 2022 11:29:43 +0200 Message-Id: <20221006092943.261301-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.2 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Add needed C declarations for Storage Model support in gigi. gcc/ada/ * fe.h (Has_Storage_Model_Type_Aspect) (Has_Designated_Storage_Model_Aspect, Storage_Model_Object) (Storage_Model_Copy_From, Storage_Model_Copy_To): Add declarations. * sem_util.ads: Add WARNING markers for functions for which a new C declaration has been added in fe.h Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/fe.h | 10 ++++++++++ gcc/ada/sem_util.ads | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h index 02cf105d5e1..79a1b58836e 100644 --- a/gcc/ada/fe.h +++ b/gcc/ada/fe.h @@ -304,17 +304,27 @@ extern Boolean Compile_Time_Known_Value (Node_Id); #define Defining_Entity sem_util__defining_entity #define First_Actual sem_util__first_actual +#define Has_Storage_Model_Type_Aspect sem_util__storage_model_support__has_storage_model_type_aspect +#define Has_Designated_Storage_Model_Aspect sem_util__storage_model_support__has_designated_storage_model_aspect #define Is_Expression_Function sem_util__is_expression_function #define Is_Variable_Size_Record sem_util__is_variable_size_record #define Needs_Secondary_Stack sem_util__needs_secondary_stack #define Next_Actual sem_util__next_actual +#define Storage_Model_Object sem_util__storage_model_support__storage_model_object +#define Storage_Model_Copy_From sem_util__storage_model_support__storage_model_copy_from +#define Storage_Model_Copy_To sem_util__storage_model_support__storage_model_copy_to extern Entity_Id Defining_Entity (Node_Id); extern Node_Id First_Actual (Node_Id); +extern Boolean Has_Storage_Model_Type_Aspect (Entity_Id); +extern Boolean Has_Designated_Storage_Model_Aspect (Entity_Id); extern Boolean Is_Expression_Function (Entity_Id); extern Boolean Is_Variable_Size_Record (Entity_Id); extern Boolean Needs_Secondary_Stack (Entity_Id); extern Node_Id Next_Actual (Node_Id); +extern Entity_Id Storage_Model_Object (Entity_Id); +extern Entity_Id Storage_Model_Copy_From (Entity_Id); +extern Entity_Id Storage_Model_Copy_To (Entity_Id); /* sinfo: */ diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 132c2b8cddf..c23d358e2fb 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -3655,10 +3655,14 @@ package Sem_Util is function Has_Storage_Model_Type_Aspect (Typ : Entity_Id) return Boolean; -- Returns True iff Typ specifies aspect Storage_Model_Type + -- WARNING: There is a matching C declaration of this subprogram in fe.h + function Has_Designated_Storage_Model_Aspect (Typ : Entity_Id) return Boolean; -- Returns True iff Typ specifies aspect Designated_Storage_Model + -- WARNING: There is a matching C declaration of this subprogram in fe.h + function Storage_Model_Object (Typ : Entity_Id) return Entity_Id; -- Given an access type Typ with aspect Designated_Storage_Model, -- returns the storage-model object associated with that type. @@ -3666,6 +3670,8 @@ package Sem_Util is -- other functions declared in this interface to retrieve operations -- associated with Storage_Model_Type aspect of the object's type. + -- WARNING: There is a matching C declaration of this subprogram in fe.h + function Storage_Model_Type (Obj : Entity_Id) return Entity_Id; -- Given an object Obj of a type specifying aspect Storage_Model_Type, -- returns that type. @@ -3715,12 +3721,16 @@ package Sem_Util is -- type, returns the procedure specified for the Copy_From choice in -- that aspect; returns Empty if the procedure isn't specified. + -- WARNING: There is a matching C declaration of this subprogram in fe.h + function Storage_Model_Copy_To (SM_Obj_Or_Type : Entity_Id) return Entity_Id; -- Given a type with aspect Storage_Model_Type or an object of such a -- type, returns the procedure specified for the Copy_To choice in that -- aspect; returns Empty if the procedure isn't specified. + -- WARNING: There is a matching C declaration of this subprogram in fe.h + function Storage_Model_Storage_Size (SM_Obj_Or_Type : Entity_Id) return Entity_Id; -- Given a type with aspect Storage_Model_Type or an object of such a -- 2.34.1