00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "config.h"
00022 #include "system.h"
00023 #include "rtl.h"
00024 #include "regs.h"
00025 #include "hard-reg-set.h"
00026 #include "output.h"
00027 #include "tree.h"
00028 #include "flags.h"
00029
00030
00031
00032
00033
00034 const char *
00035 gen_stdcall_suffix (decl)
00036 tree decl;
00037 {
00038 int total = 0;
00039
00040
00041 const char *const asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
00042 char *newsym;
00043
00044 if (TYPE_ARG_TYPES (TREE_TYPE (decl)))
00045 if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl))))
00046 == void_type_node)
00047 {
00048 tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
00049
00050 while (TREE_VALUE (formal_type) != void_type_node)
00051 {
00052 int parm_size
00053 = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
00054
00055
00056 parm_size = ((parm_size + PARM_BOUNDARY - 1)
00057 / PARM_BOUNDARY * PARM_BOUNDARY);
00058 total += parm_size;
00059 formal_type = TREE_CHAIN (formal_type);
00060 }
00061 }
00062
00063 newsym = xmalloc (strlen (asmname) + 10);
00064 sprintf (newsym, "%s@%d", asmname, total/BITS_PER_UNIT);
00065 return IDENTIFIER_POINTER (get_identifier (newsym));
00066 }
00067
00068 #if 0
00069
00070
00071
00072
00073
00074
00075 void
00076 i386_pe_unique_section (decl, reloc)
00077 tree decl;
00078 int reloc;
00079 {
00080 int len;
00081 const char *name;
00082 char *string,*prefix;
00083
00084 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
00085
00086 STRIP_NAME_ENCODING (name, name);
00087
00088
00089
00090
00091
00092
00093
00094 if (TREE_CODE (decl) == FUNCTION_DECL)
00095 prefix = ".text$";
00096
00097
00098
00099 else if (DECL_READONLY_SECTION (decl, reloc))
00100 #ifdef READONLY_DATA_SECTION
00101 prefix = ".rdata$";
00102 #else
00103 prefix = ".text$";
00104 #endif
00105 else
00106 prefix = ".data$";
00107 len = strlen (name) + strlen (prefix);
00108 string = alloca (len + 1);
00109 sprintf (string, "%s%s", prefix, name);
00110
00111 DECL_SECTION_NAME (decl) = build_string (len, string);
00112 }
00113
00114 #endif