openbsd-ports/devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h
jca 435ee4856c Update to llvm-11.1.0
Tested with a bunch of consumers on amd64, and lightly tested on sparc64
(me) and powerpc (cwen@).
2021-05-13 23:54:24 +00:00

36 lines
1.6 KiB
Plaintext

$OpenBSD: patch-lib_Target_X86_X86Subtarget_h,v 1.9 2021/05/13 23:54:25 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
@@ -459,6 +459,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?
@@ -549,6 +552,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.
@@ -809,6 +814,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(); }