mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 14:20:17 +00:00
Enable frame pointer elimination for OpenBSD on x86 and mips64.
llvm-svn: 358245
This commit is contained in:
parent
492cad51a4
commit
21375ca136
@ -534,6 +534,18 @@ static bool useFramePointerForTargetByDefault(const ArgList &Args,
|
||||
return !areOptimizationsEnabled(Args);
|
||||
}
|
||||
|
||||
if (Triple.isOSOpenBSD()) {
|
||||
switch (Triple.getArch()) {
|
||||
case llvm::Triple::mips64:
|
||||
case llvm::Triple::mips64el:
|
||||
case llvm::Triple::x86:
|
||||
case llvm::Triple::x86_64:
|
||||
return !areOptimizationsEnabled(Args);
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (Triple.isOSLinux() || Triple.getOS() == llvm::Triple::CloudABI ||
|
||||
Triple.isOSHurd()) {
|
||||
switch (Triple.getArch()) {
|
||||
|
@ -26,6 +26,15 @@
|
||||
// RUN: FileCheck --check-prefix=NETBSD %s
|
||||
// NETBSD-NOT: "-momit-leaf-frame-pointer"
|
||||
|
||||
// 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
|
||||
// OPENBSD-OPT: "-momit-leaf-frame-pointer"
|
||||
|
||||
// RUN: %clang -### -target x86_64-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
|
||||
// unless the command lines are given.
|
||||
// RUN: %clang -### -target i386-apple-darwin -S %s 2>&1 | \
|
||||
|
Loading…
Reference in New Issue
Block a user