openbsd-ports/devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h

36 lines
1.6 KiB
Plaintext

$OpenBSD: patch-lib_Target_X86_X86Subtarget_h,v 1.8 2020/08/10 11:38:43 jca Exp $
- implement -msave-args in clang/llvm, like the sun did for gcc
- Turn on -mretpoline by default in clang on amd64.
Index: lib/Target/X86/X86Subtarget.h
--- lib/Target/X86/X86Subtarget.h.orig
+++ lib/Target/X86/X86Subtarget.h
@@ -441,6 +441,9 @@ class X86Subtarget final : public X86GenSubtargetInfo
/// entry to the function and which must be maintained by every function.
Align stackAlignment = Align(4);
+ /// Whether function prologues should save register arguments on the stack.
+ bool SaveArgs = false;
+
/// Max. memset / memcpy size that is turned into rep/movs, rep/stos ops.
///
// FIXME: this is a known good value for Yonah. How about others?
@@ -531,6 +534,8 @@ class X86Subtarget final : public X86GenSubtargetInfo
return &getInstrInfo()->getRegisterInfo();
}
+ bool getSaveArgs() const { return SaveArgs; }
+
/// Returns the minimum alignment known to hold of the
/// stack frame on entry to the function and which must be maintained by every
/// function for this subtarget.
@@ -776,6 +781,7 @@ class X86Subtarget final : public X86GenSubtargetInfo
bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
bool isTargetFreeBSD() const { return TargetTriple.isOSFreeBSD(); }
+ bool isTargetOpenBSD() const { return TargetTriple.isOSOpenBSD(); }
bool isTargetDragonFly() const { return TargetTriple.isOSDragonFly(); }
bool isTargetSolaris() const { return TargetTriple.isOSSolaris(); }
bool isTargetPS4() const { return TargetTriple.isPS4CPU(); }