From: Brad Smith Date: Fri, 19 Apr 2019 18:41:40 +0000 (+0000) Subject: Enable frame pointer elimination for OpenBSD on powerpc. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9bf0c4c44cb2e54f95d38d15ace3677c88d7ec00;p=clang Enable frame pointer elimination for OpenBSD on powerpc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358775 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp index a7055b437d..cbaf5cbf92 100644 --- a/lib/Driver/ToolChains/Clang.cpp +++ b/lib/Driver/ToolChains/Clang.cpp @@ -538,6 +538,7 @@ static bool useFramePointerForTargetByDefault(const ArgList &Args, switch (Triple.getArch()) { case llvm::Triple::mips64: case llvm::Triple::mips64el: + case llvm::Triple::ppc: case llvm::Triple::x86: case llvm::Triple::x86_64: return !areOptimizationsEnabled(Args); diff --git a/test/Driver/frame-pointer-elim.c b/test/Driver/frame-pointer-elim.c index b050f71611..32935178e0 100644 --- a/test/Driver/frame-pointer-elim.c +++ b/test/Driver/frame-pointer-elim.c @@ -29,10 +29,14 @@ // OpenBSD follows the same rules as Linux. // RUN: %clang -### -target x86_64-unknown-openbsd -S -O1 %s 2>&1 | \ // RUN: FileCheck --check-prefix=OPENBSD-OPT %s +// RUN: %clang -### -target powerpc-unknown-openbsd -S -O1 %s 2>&1 | \ +// RUN: FileCheck --check-prefix=OPENBSD-OPT %s // OPENBSD-OPT: "-momit-leaf-frame-pointer" // RUN: %clang -### -target x86_64-unknown-openbsd -S %s 2>&1 | \ // RUN: FileCheck --check-prefix=OPENBSD %s +// RUN: %clang -### -target powerpc-unknown-openbsd -S %s 2>&1 | \ +// RUN: FileCheck --check-prefix=OPENBSD %s // OPENBSD-NOT: "-momit-leaf-frame-pointer" // Darwin disables omitting the leaf frame pointer even under optimization