[cfe-commits] r79288 - /cfe/trunk/lib/CodeGen/TargetABIInfo.cpp

Chris Lattner clattner at apple.com
Wed Aug 19 23:15:15 PDT 2009


On Aug 17, 2009, at 4:08 PM, David Chisnall wrote:

> Author: theraven
> Date: Mon Aug 17 18:08:21 2009
> New Revision: 79288
>
> URL: http://llvm.org/viewvc/llvm-project?rev=79288&view=rev
> Log:
> Changes to TargetABIInfo to (hopefully) select the correct calling  
> convention.  This has been tested on FreeBSD, and now correctly  
> generates GCC-compatible code for functions returning small  
> structures.  Please test it on other platforms!

Yay for good results!

>   if (strcmp(TargetPrefix, "x86") == 0) {
>     bool IsDarwin = strstr(getContext().Target.getTargetTriple(),  
> "darwin");
> +    bool isPPCStructReturnABI = IsDarwin ||
> +       strstr(getContext().Target.getTargetTriple(), "cygwin") ||
> +       strstr(getContext().Target.getTargetTriple(), "mingw") ||
> +       strstr(getContext().Target.getTargetTriple(), "netware") ||
> +       strstr(getContext().Target.getTargetTriple(), "freebsd") ||
> +       strstr(getContext().Target.getTargetTriple(), "openbsd");

I admit that the original check for darwin was completely hideous  
here, but this is making it a lot worse.  Can this be factored out  
into targetInfo somehow?  At the very least, can this use llvm::Triple  
to do this decoding?

-Chris




More information about the cfe-commits mailing list