From: Evgeny Karpov <Evgeny.Karpov@microsoft.com>
To: Evgeny Karpov <Evgeny.Karpov@microsoft.com>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: "richard.sandiford@arm.com" <richard.sandiford@arm.com>,
"Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com>,
Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>,
Radek Barton <radek.barton@microsoft.com>
Subject: [PATCH v1 3/6] Rename functions for reuse in AArch64
Date: Thu, 18 Apr 2024 21:45:57 +0000 [thread overview]
Message-ID: <PR3PR83MB0425B52DC6424B31ACBC9BC4F80E2@PR3PR83MB0425.EURPRD83.prod.outlook.com> (raw)
In-Reply-To: <PR3PR83MB0425E5A9911AEB3716BEC140F80E2@PR3PR83MB0425.EURPRD83.prod.outlook.com>
This patch renames functions related to dllimport/dllexport
and selectany functionality. These functions will be reused
in the aarch64-w64-mingw32 target.
gcc/ChangeLog:
* config/i386/cygming.h (mingw_pe_record_stub):
Rename functions in mingw folder which will be reused for
aarch64.
(TARGET_ASM_FILE_END): Update to new target-independent name.
(SUBTARGET_ATTRIBUTE_TABLE): Likewise.
(TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Likewise.
(SUB_TARGET_RECORD_STUB): Likewise.
* config/i386/i386-protos.h (ix86_handle_selectany_attribute): Likewise.
(mingw_handle_selectany_attribute): Likewise.
(i386_pe_valid_dllimport_attribute_p): Likewise.
(mingw_pe_valid_dllimport_attribute_p): Likewise.
(i386_pe_file_end): Likewise.
(mingw_pe_file_end): Likewise.
(i386_pe_record_stub): Likewise.
(mingw_pe_record_stub): Likewise.
* config/mingw/winnt.cc (ix86_handle_selectany_attribute): Likewise.
(mingw_handle_selectany_attribute): Likewise.
(i386_pe_valid_dllimport_attribute_p): Likewise.
(mingw_pe_valid_dllimport_attribute_p): Likewise.
(i386_pe_record_stub): Likewise.
(mingw_pe_record_stub): Likewise.
(i386_pe_file_end): Likewise.
(mingw_pe_file_end): Likewise.
* config/mingw/winnt.h (mingw_handle_selectany_attribute):
Declate functionality that will be reused by multiple targets.
(mingw_pe_file_end): Likewise.
(mingw_pe_record_stub): Likewise.
(mingw_pe_valid_dllimport_attribute_p): Likewise.
---
gcc/config/i386/cygming.h | 6 +++---
gcc/config/i386/i386-protos.h | 3 ---
gcc/config/mingw/winnt.cc | 6 +++---
gcc/config/mingw/winnt.h | 6 +++++-
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index 4110ceab824..061136efa0a 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -342,7 +342,7 @@ do { \
/* Output function declarations at the end of the file. */
#undef TARGET_ASM_FILE_END
-#define TARGET_ASM_FILE_END i386_pe_file_end
+#define TARGET_ASM_FILE_END mingw_pe_file_end
/* Kludge because of missing PE-COFF support for early LTO debug. */
#undef TARGET_ASM_LTO_START
@@ -443,7 +443,7 @@ do { \
#define SUBTARGET_ATTRIBUTE_TABLE \
{ "selectany", 0, 0, true, false, false, false, \
- ix86_handle_selectany_attribute, NULL }
+ mingw_handle_selectany_attribute, NULL }
/* { name, min_len, max_len, decl_req, type_req, fn_type_req,
affects_type_identity, handler, exclude } */
@@ -451,7 +451,7 @@ do { \
#undef NO_PROFILE_COUNTERS
#define NO_PROFILE_COUNTERS 1
-#define TARGET_VALID_DLLIMPORT_ATTRIBUTE_P i386_pe_valid_dllimport_attribute_p
+#define TARGET_VALID_DLLIMPORT_ATTRIBUTE_P mingw_pe_valid_dllimport_attribute_p
#define TARGET_CXX_ADJUST_CLASS_AT_DEFINITION i386_pe_adjust_class_at_definition
#define SUBTARGET_MANGLE_DECL_ASSEMBLER_NAME i386_pe_mangle_decl_assembler_name
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index dbced12f8d4..4dc90179b9b 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -261,7 +261,6 @@ extern unsigned int ix86_local_alignment (tree, machine_mode,
extern unsigned int ix86_minimum_alignment (tree, machine_mode,
unsigned int);
extern tree ix86_handle_shared_attribute (tree *, tree, tree, int, bool *);
-extern tree ix86_handle_selectany_attribute (tree *, tree, tree, int, bool *);
extern int x86_field_alignment (tree, int);
extern tree ix86_valid_target_attribute_tree (tree, tree,
struct gcc_options *,
@@ -301,12 +300,10 @@ extern void ix86_register_pragmas (void);
extern void i386_pe_record_external_function (tree, const char *);
extern bool i386_pe_binds_local_p (const_tree);
extern const char *i386_pe_strip_name_encoding_full (const char *);
-extern bool i386_pe_valid_dllimport_attribute_p (const_tree);
extern void i386_pe_asm_output_aligned_decl_common (FILE *, tree,
const char *,
HOST_WIDE_INT,
HOST_WIDE_INT);
-extern void i386_pe_file_end (void);
extern void i386_pe_asm_lto_start (void);
extern void i386_pe_asm_lto_end (void);
extern void i386_pe_start_function (FILE *, const char *, tree);
diff --git a/gcc/config/mingw/winnt.cc b/gcc/config/mingw/winnt.cc
index 9901576ade0..a0b5950be2e 100644
--- a/gcc/config/mingw/winnt.cc
+++ b/gcc/config/mingw/winnt.cc
@@ -71,7 +71,7 @@ ix86_handle_shared_attribute (tree *node, tree name, tree, int,
/* Handle a "selectany" attribute;
arguments as in struct attribute_spec.handler. */
tree
-ix86_handle_selectany_attribute (tree *node, tree name, tree, int,
+mingw_handle_selectany_attribute (tree *node, tree name, tree, int,
bool *no_add_attrs)
{
tree decl = *node;
@@ -162,7 +162,7 @@ i386_pe_determine_dllimport_p (tree decl)
/* Handle the -mno-fun-dllimport target switch. */
bool
-i386_pe_valid_dllimport_attribute_p (const_tree decl)
+mingw_pe_valid_dllimport_attribute_p (const_tree decl)
{
if (TARGET_NOP_FUN_DLLIMPORT && TREE_CODE (decl) == FUNCTION_DECL)
return false;
@@ -749,7 +749,7 @@ i386_find_on_wrapper_list (const char *target)
output the .drectve section. */
void
-i386_pe_file_end (void)
+mingw_pe_file_end (void)
{
struct extern_list *p;
diff --git a/gcc/config/mingw/winnt.h b/gcc/config/mingw/winnt.h
index 646654e872d..e02546e8ac2 100644
--- a/gcc/config/mingw/winnt.h
+++ b/gcc/config/mingw/winnt.h
@@ -18,13 +18,17 @@ http://www.gnu.org/licenses/. */
#ifndef GCC_MINGW_WINNT_H
#define GCC_MINGW_WINNT_H
+extern tree mingw_handle_selectany_attribute (tree *, tree, tree, int, bool *);
+
extern void mingw_pe_asm_named_section (const char *, unsigned int, tree);
extern void mingw_pe_declare_function_type (FILE *file, const char *name,
int pub);
extern void mingw_pe_encode_section_info (tree, rtx, int);
+extern void mingw_pe_file_end (void);
extern void mingw_pe_maybe_record_exported_symbol (tree, const char *, int);
-extern void mingw_pe_record_stub (const char *name);
+extern void mingw_pe_record_stub (const char *);
extern unsigned int mingw_pe_section_type_flags (tree, const char *, int);
extern void mingw_pe_unique_section (tree, int);
+extern bool mingw_pe_valid_dllimport_attribute_p (const_tree);
#endif
--
2.25.1
next prev parent reply other threads:[~2024-04-18 21:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-18 21:35 [PATCH v1 0/6] Add DLL import/export implementation to AArch64 Evgeny Karpov
2024-04-18 21:41 ` [PATCH v1 1/6] Move mingw_* declarations to the mingw folder Evgeny Karpov
2024-04-18 21:43 ` [PATCH v1 2/6] Extract ix86 dllimport implementation to mingw Evgeny Karpov
2024-05-22 11:05 ` Richard Sandiford
2024-05-22 14:32 ` Evgeny Karpov
2024-05-23 8:35 ` Uros Bizjak
2024-05-23 8:41 ` Uros Bizjak
2024-05-23 17:53 ` Evgeny Karpov
2024-05-23 19:37 ` Uros Bizjak
2024-04-18 21:45 ` Evgeny Karpov [this message]
2024-05-22 11:46 ` [PATCH v1 3/6] Rename functions for reuse in AArch64 Richard Sandiford
2024-04-18 21:46 ` [PATCH v1 4/6] aarch64: Add selectany attribute handling Evgeny Karpov
2024-05-22 11:57 ` Richard Sandiford
2024-04-18 21:48 ` [PATCH v1 5/6] Adjust DLL import/export implementation for AArch64 Evgeny Karpov
2024-05-22 12:07 ` Richard Sandiford
2024-04-18 21:49 ` [PATCH v1 6/6] aarch64: Add DLL import/export to AArch64 target Evgeny Karpov
2024-06-04 20:10 ` [PATCH v1 0/6] Add DLL import/export implementation to AArch64 Evgeny Karpov
2024-06-05 6:01 ` Uros Bizjak
2024-06-05 23:41 ` Jonathan Yong
2024-06-06 9:23 ` Evgeny Karpov
2024-06-08 1:59 ` Jonathan Yong
2024-06-05 8:13 ` Richard Sandiford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=PR3PR83MB0425B52DC6424B31ACBC9BC4F80E2@PR3PR83MB0425.EURPRD83.prod.outlook.com \
--to=evgeny.karpov@microsoft.com \
--cc=Richard.Earnshaw@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=maxim.kuvyrkov@linaro.org \
--cc=radek.barton@microsoft.com \
--cc=richard.sandiford@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).