]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Rename functions for reuse in AArch64
authorEvgeny Karpov <Evgeny.Karpov@microsoft.com>
Mon, 24 Jun 2024 12:43:05 +0000 (12:43 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Tue, 25 Jun 2024 06:38:38 +0000 (06:38 +0000)
This patch renames functions related to dllimport/dllexport and
selectany functionality. These functions will be reused in the
aarch64-w64-mingw32 target.

2024-06-08  Evgeny Karpov <Evgeny.Karpov@microsoft.com>

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
gcc/config/i386/i386-protos.h
gcc/config/mingw/winnt.cc
gcc/config/mingw/winnt.h

index 56945f00c11c653150ca63ab2f972206e3e4fc58..4bb8d7f920c18ce3fbdd88ac23e84c161f63a984 100644 (file)
@@ -344,7 +344,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
@@ -445,7 +445,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 } */
 
@@ -453,7 +453,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
 
index a9171c3d2d87cd1ba29c6d9f77a389be0391b60c..4f48dc0bf75f987b602d75a6b19daf5f6c8b675e 100644 (file)
@@ -269,7 +269,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 *,
@@ -309,12 +308,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);
index 9901576ade08fd2cbe5b1e5be0d953bd3382737f..803e5f5ec85749b26475cd9dcb349b41edd81dad 100644 (file)
@@ -71,8 +71,8 @@ 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,
-                                bool *no_add_attrs)
+mingw_handle_selectany_attribute (tree *node, tree name, tree, int,
+                                 bool *no_add_attrs)
 {
   tree decl = *node;
   /* The attribute applies only to objects that are initialized and have
@@ -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;
 
index 74e454a13c8680c84f4565b70d45fe75b0e386c2..97fefbcebca5d3a2c1e7e7f978ce446a4d81aba1 100644 (file)
@@ -20,14 +20,18 @@ http://www.gnu.org/licenses/.  */
 
 #ifndef USED_FOR_TARGET
 
+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 /* not USED_FOR_TARGET.  */