[PATCH] ARM: Default to apcs-gnu ABI for NetBSD

Joerg Sonnenberger joerg at britannica.bec.de
Thu Aug 28 07:26:47 PDT 2014


On Thu, Aug 28, 2014 at 02:16:55PM +0000, Oliver Stannard wrote:
> Index: lib/Driver/Tools.cpp
> ===================================================================
> --- lib/Driver/Tools.cpp
> +++ lib/Driver/Tools.cpp
> @@ -745,6 +745,11 @@
>    } else if (Triple.isOSWindows()) {
>      // FIXME: this is invalid for WindowsCE
>      ABIName = "aapcs";
> +  } else if (Triple.getOS() == llvm::Triple::NetBSD) {
> +    if (Triple.getEnvironment() == llvm::Triple::EABI)
> +      ABIName = "aapcs";
> +    else
> +      ABIName = "apcs-gnu";
>    } else {
>      // Select the default based on the platform.
>      switch(Triple.getEnvironment()) {

What about the other possible environment? I think it is better to sink
this into the default case below.

> Index: test/Driver/arm-abi.c
> ===================================================================
> --- test/Driver/arm-abi.c
> +++ test/Driver/arm-abi.c
> @@ -20,6 +20,12 @@
>  // RUN: %clang -target arm--windows-gnueabi %s -### -o %t.o 2>&1 \
>  // RUN:   | FileCheck -check-prefix=CHECK-AAPCS %s
>  
> +// NetBSD defaults to apcs-gnu, but can also use aapcs
> +// RUN: %clang -target arm--netbsd- %s -### -o %t.o 2>&1 \

Is the trailing - in the triple intentional?

> +// RUN:   | FileCheck -check-prefix=CHECK-APCS-GNU %s
> +// RUN: %clang -target arm--netbsd-eabi %s -### -o %t.o 2>&1 \
> +// RUN:   | FileCheck -check-prefix=CHECK-AAPCS %s
> +

Joerg



More information about the cfe-commits mailing list