[llvm-commits] [llvm-gcc-4.0] r40622 - in /llvm-gcc-4.0/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm-types.cpp

Christopher Lamb christopher.lamb at gmail.com
Tue Jul 31 16:14:32 PDT 2007


On Jul 31, 2007, at 3:02 PM, Christopher Lamb wrote:

>
>
> On Jul 31, 2007, at 1:59 PM, Anton Korobeynikov wrote:
>
>> Hello, Christopher.
>>
>>> -    return TypeDB.setType(type, ConvertFunctionType(type, NULL,  
>>> CallingConv));
>>> +    return TypeDB.setType(type, ConvertFunctionType(type,  
>>> orig_type, NULL, CallingConv));
>> and another one: second argument should be "declaration" tree, not
>> "type" tree. This was caused build error on darwin (reported by  
>> Tanya):
>
> Right. It seems that getting the declaration tree at that point is  
> rather difficult. Any suggestions?

Turns out that this type conversion is being requested on a struct  
which contains a function pointer, and the conversion is happening on  
that function pointer.

Am I correct in assuming that if we've followed this code path to  
ConvertFunctionType then we have no declaration to pass through?


from darwin-crt3.c:


typedef int (*cxa_atexit_p)(void (*func) (void*), void* arg, const  
void* dso);

struct atexit_data
{
   int result;
   cxa_atexit_p cxa_atexit;
};

static void cxa_atexit_check_2 (void *arg)
{
   ((struct atexit_data *)arg)->result = 1;
}


--
Christopher Lamb






More information about the llvm-commits mailing list