[cfe-dev] Problem with struct arguments passed by value

Eli Friedman eli.friedman at gmail.com
Wed Apr 9 13:35:49 PDT 2008


On Wed, Apr 9, 2008 at 1:06 PM, Shantonu Sen <ssen at apple.com> wrote:
> I have the following program that I'm trying to compile with clang on
>  Mac OS X on Intel, which clang fails to codegen correctly.
>
>  $ cat a.c
>
>  typedef struct {
>      long location;
>      long length;
>  } CFRange;
>
>  char CFArrayContainsValue(void *theArray, CFRange range, const void
>  *value);

llvm-gcc:
declare i8 @CFArrayContainsValue(i8*, i32, i32, i8*) signext

clang:
declare i8 @CFArrayContainsValue(i8*, %struct.anon*, i8*)

What the heck is llvm-gcc doing here?!

-Eli



More information about the cfe-dev mailing list