Changeset 2251 for trunk


Ignore:
Timestamp:
Jul 16, 2005, 12:27:42 AM (20 years ago)
Author:
bird
Message:

Attempt at fixing thunk exporting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gcc/gcc/config/i386/emx.c

    • Property cvs2svn:cvs-rev changed from 1.31 to 1.32
    r2250 r2251  
    3838#endif
    3939
    40 /** @todo remove debug code */
    4140/*#define BIRD_DEBUG - DO NOT COMMIT WITH THIS DEFINED!!! */
    4241
     
    9291        return psznone;
    9392
    94     attr = (DECL_P (node) ? DECL_ATTRIBUTES (node) : TYPE_ATTRIBUTES (node));
     93    attr = DECL_P (node) ? DECL_ATTRIBUTES (node) : TYPE_P (node) ? TYPE_ATTRIBUTES (node) : NULL_TREE;
    9594    if (!attr)
    9695        return pszdefault;
     
    640639  if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
    641640    {
     641#if 0
    642642      /* Artificial methods are not affected by the import/export status of
    643643         their class unless they are virtual.  */
    644644      if (! DECL_ARTIFICIAL (decl) || DECL_VINDEX (decl))
    645645        t = TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl))));
     646#else /* from the CVS 3.4 branch. */
     647      /* Artificial methods are not affected by the import/export status
     648         of their class unless they are COMDAT.  Implicit copy ctor's and
     649         dtor's are not affected by class status but virtual and
     650         non-virtual thunks are.  */
     651      if (!DECL_ARTIFICIAL (decl) || DECL_COMDAT (decl))
     652        t = TYPE_MAIN_VARIANT
     653          (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl)))));
     654      dfprintf((stderr, "trace: associated_type: decl=%p t=%p\n", decl, t));
     655      DUMP(decl);
     656      DUMP(t);
     657#endif
    646658    }
    647659  else if (DECL_CONTEXT (decl)
     
    745757        }
    746758
     759#if 0
    747760      /* Since we can't treat a pointer to a dllimport'd symbol as a
    748761         constant address, we turn off the attribute on C++ virtual
     
    751764               && (DECL_VIRTUAL_P (decl)))
    752765           return 0;
     766#else /* From the CVS 3.4 branch */
     767      /* Since we can't treat a pointer to a dllimport'd symbol as a
     768         constant address, we turn off the attribute on C++ virtual
     769         methods to allow creation of vtables using thunks.  Don't mark
     770         artificial methods either (in associated_type, only COMDAT
     771         artificial method get import status from class context).  */
     772      else if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE
     773               && (DECL_VIRTUAL_P (decl) || DECL_ARTIFICIAL (decl)))
     774        return 0;
     775#endif
    753776
    754777      return 1;
     
    808831      warning_with_decl (decl,"inconsistent dll linkage for '%s': dllexport assumed.");
    809832     /* Remove DLL_IMPORT_PREFIX.  */
    810       oldname += 9;
     833      oldname += 3; /* not 9 since we're not doing the __imp_ bit. */
    811834      DECL_NON_ADDR_CONST_P (decl) = 0;
    812835    }
     
    834857{
    835858  const char *oldname;
    836   char  *newname;
    837   tree idp;
    838   rtx rtlname, newrtl;
     859  /*char  *newname;*/
     860  /*tree idp;*/
     861  rtx rtlname/*, newrtl*/;
    839862  dfprintf ((stderr, "trace: i386_emx_mark_dllimport\n"));
    840863
     
    864887    }
    865888
     889#if 0 /* we're only tagging along for the error handling but need no special handling. */
    866890  newname = alloca (strlen (oldname) + 11);
    867891  sprintf (newname, "%ci.%s", DLL_IMPORT_EXPORT_PREFIX, oldname);
     
    880904  /* Can't treat a pointer to this as a constant address */
    881905  DECL_NON_ADDR_CONST_P (decl) = 1;
     906#endif
    882907}
    883908
     
    10951120            {
    10961121              DUMP(decl);
     1122              /* breaks thunks. Windows ain't doing this either.
     1123                 If it turns out to break stuff, try add "|| DECL_COMDAT (decl)".
    10971124              if (!TREE_STATIC (decl))
    10981125                {
     
    11001127                  continue;
    11011128                }
     1129               */
    11021130              if (!q->asm_name)
    11031131                q->asm_name = q->exported_name ? q->exported_name
Note: See TracChangeset for help on using the changeset viewer.