[wip] devel/llvm 8.0.0

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[wip] devel/llvm 8.0.0

Jeremie Courreges-Anglas-2

Here's the diff I'm testing right now.  I have merged the llvm patches
this morning and I did not double check them so far, but this lets llvm,
include-what-you-use, rust and ripgrep build on amd64.  mozillas are
building on amd64, llvm still compiling on sparc64.

Sebastien, I guess we'll need to coordinate regarding rust-1.35 /
rust-1.36 and llvm-7 / llvm-8.

Feedback and tests welcome.


Index: devel/include-what-you-use/Makefile
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/Makefile,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile
--- devel/include-what-you-use/Makefile 17 Jun 2019 21:33:45 -0000 1.16
+++ devel/include-what-you-use/Makefile 29 Jun 2019 06:45:28 -0000
@@ -2,9 +2,8 @@
 
 COMMENT= tool to analyse \#includes in C and C++ source files
 CATEGORIES= devel
-DISTNAME= include-what-you-use-0.11.src
+DISTNAME= include-what-you-use-0.12.src
 PKGNAME= ${DISTNAME:.src=}
-REVISION= 1
 
 HOMEPAGE= https://include-what-you-use.org
 MASTER_SITES= ${HOMEPAGE}/downloads/
@@ -16,7 +15,7 @@ MAINTAINER= Jonathan Gray <[hidden email]
 PERMIT_PACKAGE= Yes
 
 WANTLIB= ${COMPILER_LIBCXX} c m pthread
-LLVM_V= 7.0.1
+LLVM_V= 8.0.0
 BUILD_DEPENDS= devel/llvm>=${LLVM_V}
 RUN_DEPENDS= devel/llvm>=${LLVM_V}
 
Index: devel/include-what-you-use/distinfo
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/distinfo,v
retrieving revision 1.7
diff -u -p -r1.7 distinfo
--- devel/include-what-you-use/distinfo 28 Jan 2019 06:27:28 -0000 1.7
+++ devel/include-what-you-use/distinfo 29 Jun 2019 06:45:28 -0000
@@ -1,2 +1,2 @@
-SHA256 (include-what-you-use-0.11.src.tar.gz) = LSh3cmxK7ZUYy7N2c/+8K32pwjm/j+KUMto1wcDsNno=
-SIZE (include-what-you-use-0.11.src.tar.gz) = 541763
+SHA256 (include-what-you-use-0.12.src.tar.gz) = pYkvsKvMuCDDlOTiRcAO8w/JTkrligSLI/lAR8CBYCU=
+SIZE (include-what-you-use-0.12.src.tar.gz) = 545673
Index: devel/include-what-you-use/patches/patch-iwyu_include_picker_cc
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/patches/patch-iwyu_include_picker_cc,v
retrieving revision 1.5
diff -u -p -r1.5 patch-iwyu_include_picker_cc
--- devel/include-what-you-use/patches/patch-iwyu_include_picker_cc 28 Jan 2019 06:27:28 -0000 1.5
+++ devel/include-what-you-use/patches/patch-iwyu_include_picker_cc 29 Jun 2019 06:45:28 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-iwyu_include_picker_cc,v
 Index: iwyu_include_picker.cc
 --- iwyu_include_picker.cc.orig
 +++ iwyu_include_picker.cc
-@@ -116,8 +116,6 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -118,8 +118,6 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "gid_t", kPrivate, "<unistd.h>", kPublic },
    { "id_t", kPrivate, "<sys/types.h>", kPublic },
    { "id_t", kPrivate, "<sys/resource.h>", kPublic },
@@ -12,7 +12,7 @@ Index: iwyu_include_picker.cc
    { "ino_t", kPrivate, "<sys/types.h>", kPublic },
    { "ino_t", kPrivate, "<dirent.h>", kPublic },
    { "ino_t", kPrivate, "<sys/stat.h>", kPublic },
-@@ -133,8 +131,6 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -143,8 +141,6 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "mode_t", kPrivate, "<sys/mman.h>", kPublic },
    { "nlink_t", kPrivate, "<sys/types.h>", kPublic },
    { "nlink_t", kPrivate, "<sys/stat.h>", kPublic },
@@ -21,7 +21,7 @@ Index: iwyu_include_picker.cc
    { "off_t", kPrivate, "<sys/types.h>", kPublic },
    { "off_t", kPrivate, "<unistd.h>", kPublic },
    { "off_t", kPrivate, "<sys/stat.h>", kPublic },
-@@ -148,11 +144,8 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -158,11 +154,8 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "pid_t", kPrivate, "<time.h>", kPublic },
    { "pid_t", kPrivate, "<utmpx.h>", kPublic },
    { "sigset_t", kPrivate, "<signal.h>", kPublic },
@@ -34,7 +34,7 @@ Index: iwyu_include_picker.cc
    { "ssize_t", kPrivate, "<sys/types.h>", kPublic },
    { "ssize_t", kPrivate, "<unistd.h>", kPublic },
    { "ssize_t", kPrivate, "<monetary.h>", kPublic },
-@@ -181,6 +174,7 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -195,6 +188,7 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "size_t", kPrivate, "<time.h>", kPublic },
    { "size_t", kPrivate, "<uchar.h>", kPublic },
    { "size_t", kPrivate, "<wchar.h>", kPublic },
@@ -42,7 +42,7 @@ Index: iwyu_include_picker.cc
    // Macros that can be defined in more than one file, don't have the
    // same __foo_defined guard that other types do, so the grep above
    // doesn't discover them.  Until I figure out a better way, I just
-@@ -195,6 +189,10 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -209,6 +203,10 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "calloc", kPrivate, "<stdlib.h>", kPublic },
    { "realloc", kPrivate, "<stdlib.h>", kPublic },
    { "free", kPrivate, "<stdlib.h>", kPublic },
@@ -53,7 +53,7 @@ Index: iwyu_include_picker.cc
    // Entries for NULL
    { "NULL", kPrivate, "<stddef.h>", kPublic },  // 'canonical' location for NULL
    { "NULL", kPrivate, "<clocale>", kPublic },
-@@ -240,7 +238,7 @@ const IncludeMapEntry libstdcpp_symbol_map[] = {
+@@ -254,7 +252,7 @@ const IncludeMapEntry libstdcpp_symbol_map[] = {
  };
 
  // Private -> public include mappings for GNU libc
@@ -62,7 +62,7 @@ Index: iwyu_include_picker.cc
    // ( cd /usr/include && grep '^ *# *include' {sys/,net/,}* | perl -nle 'm/^([^:]+).*<([^>]+)>/ && print qq@    { "<$2>", kPrivate, "<$1>", kPublic },@' | grep bits/ | sort )
    // When I saw more than one mapping for these, I typically picked
    // what I thought was the "best" one.
-@@ -443,6 +441,42 @@ const IncludeMapEntry libc_include_map[] = {
+@@ -457,6 +455,42 @@ const IncludeMapEntry libc_include_map[] = {
    { "<linux/limits.h>", kPrivate, "<limits.h>", kPublic },   // PATH_MAX
    { "<linux/prctl.h>", kPrivate, "<sys/prctl.h>", kPublic },
    { "<sys/ucontext.h>", kPrivate, "<ucontext.h>", kPublic },
Index: devel/include-what-you-use/pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -r1.3 PLIST
--- devel/include-what-you-use/pkg/PLIST 17 Jun 2019 21:33:45 -0000 1.3
+++ devel/include-what-you-use/pkg/PLIST 29 Jun 2019 06:45:28 -0000
@@ -24,4 +24,3 @@ share/include-what-you-use/libcxx.imp
 share/include-what-you-use/qt4.imp
 share/include-what-you-use/qt5_4.imp
 share/include-what-you-use/stl.c.headers.imp
-share/include-what-you-use/third_party.imp
Index: devel/llvm/Makefile
===================================================================
RCS file: /cvs/ports/devel/llvm/Makefile,v
retrieving revision 1.227
diff -u -p -r1.227 Makefile
--- devel/llvm/Makefile 22 Jun 2019 22:44:06 -0000 1.227
+++ devel/llvm/Makefile 29 Jun 2019 06:45:28 -0000
@@ -11,15 +11,13 @@ COMMENT-python = Python bindings for Cla
 
 # XXX: Remember to bump MODCLANG_VERSION in lang/clang/clang.port.mk when
 # updating this port.
-LLVM_V = 7.0.1
+LLVM_V = 8.0.0
 DISTNAME = llvm-${LLVM_V}.src
 PKGNAME = llvm-${LLVM_V}
 PKGSPEC-main = llvm-=${LLVM_V}
 PKGNAME-main = llvm-${LLVM_V}
 PKGNAME-python = py-llvm-${LLVM_V}
 PKGNAME-lldb = lldb-${LLVM_V}
-REVISION-main = 13
-REVISION-lldb = 3
 
 CATEGORIES = devel
 
Index: devel/llvm/distinfo
===================================================================
RCS file: /cvs/ports/devel/llvm/distinfo,v
retrieving revision 1.32
diff -u -p -r1.32 distinfo
--- devel/llvm/distinfo 8 May 2019 22:34:02 -0000 1.32
+++ devel/llvm/distinfo 29 Jun 2019 06:45:28 -0000
@@ -1,8 +1,8 @@
-SHA256 (cfe-7.0.1.src.tar.xz) = pFti3eXX1f3N+odrCvkvFk1DSwbp6JtdCxy8Zd/j9Bg=
-SHA256 (lld-7.0.1.src.tar.xz) = iGmqst0tjgDWmUM1LTFm0VnX6uJhX2amhPSgmZ/HQDE=
-SHA256 (lldb-7.0.1.src.tar.xz) = drRr51tBKj0i8NJieTBq5+J0/k15iKIYTFKcOKanaYI=
-SHA256 (llvm-7.0.1.src.tar.xz) = o438TbRxAux53MKqYek3IsX28G8KlhBzvYS3j7lJQZs=
-SIZE (cfe-7.0.1.src.tar.xz) = 12488668
-SIZE (lld-7.0.1.src.tar.xz) = 912812
-SIZE (lldb-7.0.1.src.tar.xz) = 19384628
-SIZE (llvm-7.0.1.src.tar.xz) = 28311056
+SHA256 (cfe-8.0.0.src.tar.xz) = CEwRWqsAhOY7I+7owjOrtnOcOZ4plm6uzPxuCI4Lc2s=
+SHA256 (lld-8.0.0.src.tar.xz) = nK7I7JIuMv+hMPD7COTFokLX5oznV2MeQl6eui4abjc=
+SHA256 (lldb-8.0.0.src.tar.xz) = SZGLnwmBZVSiCsRMX4WjLcCnoAdZsyWeeAZNZ06sA3M=
+SHA256 (llvm-8.0.0.src.tar.xz) = iHK+GxLGFFDKzIKz0VPqsCviVG7zT6NYDtFBN7smIkw=
+SIZE (cfe-8.0.0.src.tar.xz) = 12868468
+SIZE (lld-8.0.0.src.tar.xz) = 999864
+SIZE (lldb-8.0.0.src.tar.xz) = 19602332
+SIZE (llvm-8.0.0.src.tar.xz) = 30503732
Index: devel/llvm/patches/patch-include_llvm_ADT_Optional_h
===================================================================
RCS file: devel/llvm/patches/patch-include_llvm_ADT_Optional_h
diff -N devel/llvm/patches/patch-include_llvm_ADT_Optional_h
--- devel/llvm/patches/patch-include_llvm_ADT_Optional_h 28 Jan 2019 06:27:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,35 +0,0 @@
-$OpenBSD: patch-include_llvm_ADT_Optional_h,v 1.1 2019/01/28 06:27:28 jca Exp $
-
-[ADT] Drop llvm::Optional clang-specific optmization for trivially copyable types
-
-This fixes libLLVM.so ABI mismatches between llvm compiled with clang
-and llvm compiled with gcc (PR39427).
-
-Index: include/llvm/ADT/Optional.h
---- include/llvm/ADT/Optional.h.orig
-+++ include/llvm/ADT/Optional.h
-@@ -108,24 +108,6 @@ template <typename T, bool IsPodLike> struct OptionalS
-   }
- };
-
--#if !defined(__GNUC__) || defined(__clang__) // GCC up to GCC7 miscompiles this.
--/// Storage for trivially copyable types only.
--template <typename T> struct OptionalStorage<T, true> {
--  AlignedCharArrayUnion<T> storage;
--  bool hasVal = false;
--
--  OptionalStorage() = default;
--
--  OptionalStorage(const T &y) : hasVal(true) { new (storage.buffer) T(y); }
--  OptionalStorage &operator=(const T &y) {
--    *reinterpret_cast<T *>(storage.buffer) = y;
--    hasVal = true;
--    return *this;
--  }
--
--  void reset() { hasVal = false; }
--};
--#endif
- } // namespace optional_detail
-
- template <typename T> class Optional {
Index: devel/llvm/patches/patch-include_llvm_BinaryFormat_Dwarf_def
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-include_llvm_BinaryFormat_Dwarf_def,v
retrieving revision 1.3
diff -u -p -r1.3 patch-include_llvm_BinaryFormat_Dwarf_def
--- devel/llvm/patches/patch-include_llvm_BinaryFormat_Dwarf_def 11 Feb 2019 05:24:16 -0000 1.3
+++ devel/llvm/patches/patch-include_llvm_BinaryFormat_Dwarf_def 29 Jun 2019 06:45:28 -0000
@@ -5,7 +5,7 @@ implement -msave-args in clang/llvm, lik
 Index: include/llvm/BinaryFormat/Dwarf.def
 --- include/llvm/BinaryFormat/Dwarf.def.orig
 +++ include/llvm/BinaryFormat/Dwarf.def
-@@ -355,6 +355,8 @@ HANDLE_DW_AT(0x2133, GNU_addr_base, 0, GNU)
+@@ -365,6 +365,8 @@ HANDLE_DW_AT(0x2133, GNU_addr_base, 0, GNU)
  HANDLE_DW_AT(0x2134, GNU_pubnames, 0, GNU)
  HANDLE_DW_AT(0x2135, GNU_pubtypes, 0, GNU)
  HANDLE_DW_AT(0x2136, GNU_discriminator, 0, GNU)
Index: devel/llvm/patches/patch-include_llvm_CodeGen_AsmPrinter_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-include_llvm_CodeGen_AsmPrinter_h,v
retrieving revision 1.4
diff -u -p -r1.4 patch-include_llvm_CodeGen_AsmPrinter_h
--- devel/llvm/patches/patch-include_llvm_CodeGen_AsmPrinter_h 28 Jan 2019 06:27:28 -0000 1.4
+++ devel/llvm/patches/patch-include_llvm_CodeGen_AsmPrinter_h 29 Jun 2019 06:45:28 -0000
@@ -5,7 +5,7 @@ Use int3 trap padding between functions
 Index: include/llvm/CodeGen/AsmPrinter.h
 --- include/llvm/CodeGen/AsmPrinter.h.orig
 +++ include/llvm/CodeGen/AsmPrinter.h
-@@ -344,6 +344,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
+@@ -348,6 +348,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
    /// correctness.
    void EmitAlignment(unsigned NumBits, const GlobalObject *GV = nullptr) const;
 
@@ -17,7 +17,7 @@ Index: include/llvm/CodeGen/AsmPrinter.h
    /// Lower the specified LLVM Constant to an MCExpr.
    virtual const MCExpr *lowerConstant(const Constant *CV);
 
-@@ -401,6 +406,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
+@@ -408,6 +413,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
    virtual void EmitInstruction(const MachineInstr *) {
      llvm_unreachable("EmitInstruction not implemented");
    }
Index: devel/llvm/patches/patch-include_llvm_CodeGen_MachineFrameInfo_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-include_llvm_CodeGen_MachineFrameInfo_h,v
retrieving revision 1.3
diff -u -p -r1.3 patch-include_llvm_CodeGen_MachineFrameInfo_h
--- devel/llvm/patches/patch-include_llvm_CodeGen_MachineFrameInfo_h 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-include_llvm_CodeGen_MachineFrameInfo_h 29 Jun 2019 06:45:28 -0000
@@ -22,7 +22,7 @@ $OpenBSD: patch-include_llvm_CodeGen_Mac
 Index: include/llvm/CodeGen/MachineFrameInfo.h
 --- include/llvm/CodeGen/MachineFrameInfo.h.orig
 +++ include/llvm/CodeGen/MachineFrameInfo.h
-@@ -257,6 +257,13 @@ class MachineFrameInfo { (private)
+@@ -274,6 +274,15 @@ class MachineFrameInfo { (private)
    /// The frame index for the stack protector.
    int StackProtectorIdx = -1;
 
@@ -31,12 +31,14 @@ Index: include/llvm/CodeGen/MachineFrame
 +    unsigned Register = 0;
 +    /// Set to true if this function needs return protectors
 +    bool Needed = false;
++    /// Does the return protector cookie need to be stored in frame
++    bool NeedsStore = true;
 +  } RPI;
 +
    /// The frame index for the function context. Used for SjLj exceptions.
    int FunctionContextIdx = -1;
 
-@@ -333,6 +340,14 @@ class MachineFrameInfo { (private)
+@@ -354,6 +363,17 @@ class MachineFrameInfo { (private)
    int getStackProtectorIndex() const { return StackProtectorIdx; }
    void setStackProtectorIndex(int I) { StackProtectorIdx = I; }
    bool hasStackProtectorIndex() const { return StackProtectorIdx != -1; }
@@ -48,6 +50,9 @@ Index: include/llvm/CodeGen/MachineFrame
 +  /// Get / Set if this frame needs a return protector
 +  void setReturnProtectorNeeded(bool I) { RPI.Needed = I; }
 +  bool getReturnProtectorNeeded() const { return RPI.Needed; }
++  /// Get / Set if the return protector cookie needs to be stored in frame
++  void setReturnProtectorNeedsStore(bool I) { RPI.NeedsStore = I; }
++  bool getReturnProtectorNeedsStore() const { return RPI.NeedsStore; }
 
    /// Return the index for the function context object.
    /// This object is used for SjLj exceptions.
Index: devel/llvm/patches/patch-include_llvm_InitializePasses_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-include_llvm_InitializePasses_h,v
retrieving revision 1.2
diff -u -p -r1.2 patch-include_llvm_InitializePasses_h
--- devel/llvm/patches/patch-include_llvm_InitializePasses_h 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-include_llvm_InitializePasses_h 29 Jun 2019 06:45:28 -0000
@@ -21,7 +21,7 @@ remove these gadgets will continue throu
 Index: include/llvm/InitializePasses.h
 --- include/llvm/InitializePasses.h.orig
 +++ include/llvm/InitializePasses.h
-@@ -339,6 +339,7 @@ void initializeRegionViewerPass(PassRegistry&);
+@@ -345,6 +345,7 @@ void initializeRegionViewerPass(PassRegistry&);
  void initializeRegisterCoalescerPass(PassRegistry&);
  void initializeRenameIndependentSubregsPass(PassRegistry&);
  void initializeResetMachineFunctionPass(PassRegistry&);
Index: devel/llvm/patches/patch-lib_Bitcode_Reader_MetadataLoader_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Bitcode_Reader_MetadataLoader_cpp
diff -N devel/llvm/patches/patch-lib_Bitcode_Reader_MetadataLoader_cpp
--- devel/llvm/patches/patch-lib_Bitcode_Reader_MetadataLoader_cpp 30 Jan 2019 07:36:06 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-lib_Bitcode_Reader_MetadataLoader_cpp,v 1.1 2019/01/30 07:36:06 semarie Exp $
-https://github.com/llvm-mirror/llvm/commit/da1fb72bb305d6bc1f3899d541414146934bf80f
-Index: lib/Bitcode/Reader/MetadataLoader.cpp
---- lib/Bitcode/Reader/MetadataLoader.cpp.orig
-+++ lib/Bitcode/Reader/MetadataLoader.cpp
-@@ -1308,7 +1308,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMeta
-                            (Context, Tag, Name, File, Line, Scope, BaseType,
-                             SizeInBits, AlignInBits, OffsetInBits, Flags,
-                             Elements, RuntimeLang, VTableHolder, TemplateParams,
--                            Identifier));
-+                            Identifier, Discriminator));
-     if (!IsNotUsedInTypeRef && Identifier)
-       MetadataList.addTypeRef(*Identifier, *cast<DICompositeType>(CT));
-
Index: devel/llvm/patches/patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp,v
retrieving revision 1.7
diff -u -p -r1.7 patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp
--- devel/llvm/patches/patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp 28 Jan 2019 06:27:28 -0000 1.7
+++ devel/llvm/patches/patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp 29 Jun 2019 06:45:28 -0000
@@ -8,7 +8,7 @@ $OpenBSD: patch-lib_CodeGen_AsmPrinter_A
 Index: lib/CodeGen/AsmPrinter/AsmPrinter.cpp
 --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp.orig
 +++ lib/CodeGen/AsmPrinter/AsmPrinter.cpp
-@@ -651,7 +651,7 @@ void AsmPrinter::EmitFunctionHeader() {
+@@ -653,7 +653,7 @@ void AsmPrinter::EmitFunctionHeader() {
 
    EmitLinkage(&F, CurrentFnSym);
    if (MAI->hasFunctionAlignment())
@@ -17,7 +17,7 @@ Index: lib/CodeGen/AsmPrinter/AsmPrinter
 
    if (MAI->hasDotTypeDotSizeDirective())
      OutStreamer->EmitSymbolAttribute(CurrentFnSym, MCSA_ELF_TypeFunction);
-@@ -2036,6 +2036,31 @@ void AsmPrinter::EmitAlignment(unsigned NumBits, const
+@@ -2112,6 +2112,31 @@ void AsmPrinter::EmitAlignment(unsigned NumBits, const
  }
 
  //===----------------------------------------------------------------------===//
@@ -49,7 +49,7 @@ Index: lib/CodeGen/AsmPrinter/AsmPrinter
  // Constant emission.
  //===----------------------------------------------------------------------===//
 
-@@ -2803,11 +2828,15 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasi
+@@ -2879,11 +2904,15 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasi
      }
    }
 
Index: devel/llvm/patches/patch-lib_CodeGen_PrologEpilogInserter_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_CodeGen_PrologEpilogInserter_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_CodeGen_PrologEpilogInserter_cpp
--- devel/llvm/patches/patch-lib_CodeGen_PrologEpilogInserter_cpp 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-lib_CodeGen_PrologEpilogInserter_cpp 29 Jun 2019 06:45:28 -0000
@@ -22,7 +22,7 @@ $OpenBSD: patch-lib_CodeGen_PrologEpilog
 Index: lib/CodeGen/PrologEpilogInserter.cpp
 --- lib/CodeGen/PrologEpilogInserter.cpp.orig
 +++ lib/CodeGen/PrologEpilogInserter.cpp
-@@ -171,7 +171,11 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
+@@ -176,7 +176,11 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
    const Function &F = MF.getFunction();
    const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
    const TargetFrameLowering *TFI = MF.getSubtarget().getFrameLowering();
@@ -34,7 +34,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
    RS = TRI->requiresRegisterScavenging(MF) ? new RegScavenger() : nullptr;
    FrameIndexVirtualScavenging = TRI->requiresFrameIndexScavenging(MF);
    FrameIndexEliminationScavenging = (RS && !FrameIndexVirtualScavenging) ||
-@@ -206,6 +210,10 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
+@@ -211,6 +215,10 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
    if (!F.hasFnAttribute(Attribute::Naked))
      insertPrologEpilogCode(MF);
 
@@ -45,7 +45,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
    // Replace all MO_FrameIndex operands with physical register references
    // and actual offsets.
    //
-@@ -296,7 +304,9 @@ void PEI::calculateCallFrameInfo(MachineFunction &MF)
+@@ -301,7 +309,9 @@ void PEI::calculateCallFrameInfo(MachineFunction &MF)
  /// Compute the sets of entry and return blocks for saving and restoring
  /// callee-saved registers, and placing prolog and epilog code.
  void PEI::calculateSaveRestoreBlocks(MachineFunction &MF) {
@@ -56,7 +56,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
 
    // Even when we do not change any CSR, we still want to insert the
    // prologue and epilogue of the function.
-@@ -312,7 +322,18 @@ void PEI::calculateSaveRestoreBlocks(MachineFunction &
+@@ -317,7 +327,18 @@ void PEI::calculateSaveRestoreBlocks(MachineFunction &
      // epilogue.
      if (!RestoreBlock->succ_empty() || RestoreBlock->isReturnBlock())
        RestoreBlocks.push_back(RestoreBlock);
@@ -76,7 +76,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
    }
 
    // Save refs to entry and return blocks.
-@@ -323,6 +344,9 @@ void PEI::calculateSaveRestoreBlocks(MachineFunction &
+@@ -328,6 +349,9 @@ void PEI::calculateSaveRestoreBlocks(MachineFunction &
      if (MBB.isReturnBlock())
        RestoreBlocks.push_back(&MBB);
    }
@@ -86,7 +86,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
  }
 
  static void assignCalleeSavedSpillSlots(MachineFunction &F,
-@@ -344,6 +368,10 @@ static void assignCalleeSavedSpillSlots(MachineFunctio
+@@ -349,6 +373,10 @@ static void assignCalleeSavedSpillSlots(MachineFunctio
 
    const TargetFrameLowering *TFI = F.getSubtarget().getFrameLowering();
    MachineFrameInfo &MFI = F.getFrameInfo();
Index: devel/llvm/patches/patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp
diff -N devel/llvm/patches/patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp
--- devel/llvm/patches/patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp 28 Jan 2019 06:27:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-$OpenBSD: patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp,v 1.1 2019/01/28 06:27:28 jca Exp $
-
-Revert "Revert r342183 "[DAGCombine] Fix crash when store merging created an
-extract_subvector with invalid index.""
-
-Index: lib/CodeGen/SelectionDAG/DAGCombiner.cpp
---- lib/CodeGen/SelectionDAG/DAGCombiner.cpp.orig
-+++ lib/CodeGen/SelectionDAG/DAGCombiner.cpp
-@@ -13727,17 +13727,24 @@ bool DAGCombiner::MergeStoresOfConstantsOrVecElts(
-              Val.getOpcode() == ISD::EXTRACT_SUBVECTOR)) {
-           SDValue Vec = Val.getOperand(0);
-           EVT MemVTScalarTy = MemVT.getScalarType();
-+          SDValue Idx = Val.getOperand(1);
-           // We may need to add a bitcast here to get types to line up.
-           if (MemVTScalarTy != Vec.getValueType()) {
-             unsigned Elts = Vec.getValueType().getSizeInBits() /
-                             MemVTScalarTy.getSizeInBits();
-+            if (Val.getValueType().isVector() && MemVT.isVector()) {
-+              unsigned IdxC = cast<ConstantSDNode>(Idx)->getZExtValue();
-+              unsigned NewIdx =
-+                  ((uint64_t)IdxC * MemVT.getVectorNumElements()) / Elts;
-+              Idx = DAG.getConstant(NewIdx, SDLoc(Val), Idx.getValueType());
-+            }
-             EVT NewVecTy =
-                 EVT::getVectorVT(*DAG.getContext(), MemVTScalarTy, Elts);
-             Vec = DAG.getBitcast(NewVecTy, Vec);
-           }
-           auto OpC = (MemVT.isVector()) ? ISD::EXTRACT_SUBVECTOR
-                                         : ISD::EXTRACT_VECTOR_ELT;
--          Val = DAG.getNode(OpC, SDLoc(Val), MemVT, Vec, Val.getOperand(1));
-+          Val = DAG.getNode(OpC, SDLoc(Val), MemVT, Vec, Idx);
-         }
-         Ops.push_back(Val);
-       }
Index: devel/llvm/patches/patch-lib_CodeGen_TargetLoweringBase_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_CodeGen_TargetLoweringBase_cpp,v
retrieving revision 1.5
diff -u -p -r1.5 patch-lib_CodeGen_TargetLoweringBase_cpp
--- devel/llvm/patches/patch-lib_CodeGen_TargetLoweringBase_cpp 28 Jan 2019 06:27:28 -0000 1.5
+++ devel/llvm/patches/patch-lib_CodeGen_TargetLoweringBase_cpp 29 Jun 2019 06:45:28 -0000
@@ -7,7 +7,7 @@ solve the crashes in the previous code.
 Index: lib/CodeGen/TargetLoweringBase.cpp
 --- lib/CodeGen/TargetLoweringBase.cpp.orig
 +++ lib/CodeGen/TargetLoweringBase.cpp
-@@ -1624,7 +1624,10 @@ Value *TargetLoweringBase::getIRStackGuard(IRBuilder<>
+@@ -1636,7 +1636,10 @@ Value *TargetLoweringBase::getIRStackGuard(IRBuilder<>
    if (getTargetMachine().getTargetTriple().isOSOpenBSD()) {
      Module &M = *IRB.GetInsertBlock()->getParent()->getParent();
      PointerType *PtrTy = Type::getInt8PtrTy(M.getContext());
Index: devel/llvm/patches/patch-lib_CodeGen_TargetPassConfig_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_CodeGen_TargetPassConfig_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_CodeGen_TargetPassConfig_cpp
--- devel/llvm/patches/patch-lib_CodeGen_TargetPassConfig_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_CodeGen_TargetPassConfig_cpp 29 Jun 2019 06:45:28 -0000
@@ -21,7 +21,7 @@ remove these gadgets will continue throu
 Index: lib/CodeGen/TargetPassConfig.cpp
 --- lib/CodeGen/TargetPassConfig.cpp.orig
 +++ lib/CodeGen/TargetPassConfig.cpp
-@@ -696,6 +696,8 @@ void TargetPassConfig::addISelPrepare() {
+@@ -737,6 +737,8 @@ void TargetPassConfig::addISelPrepare() {
    if (requiresCodeGenSCCOrder())
      addPass(new DummyCGSCCPass);
 
Index: devel/llvm/patches/patch-lib_MC_MCParser_AsmParser_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_MC_MCParser_AsmParser_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-lib_MC_MCParser_AsmParser_cpp
--- devel/llvm/patches/patch-lib_MC_MCParser_AsmParser_cpp 28 Jan 2019 15:34:22 -0000 1.6
+++ devel/llvm/patches/patch-lib_MC_MCParser_AsmParser_cpp 29 Jun 2019 06:45:28 -0000
@@ -11,7 +11,7 @@ a file directive.
 Index: lib/MC/MCParser/AsmParser.cpp
 --- lib/MC/MCParser/AsmParser.cpp.orig
 +++ lib/MC/MCParser/AsmParser.cpp
-@@ -874,6 +874,10 @@ bool AsmParser::Run(bool NoInitialTextSection, bool No
+@@ -878,6 +878,10 @@ bool AsmParser::Run(bool NoInitialTextSection, bool No
      (void)InsertResult;
    }
 
Index: devel/llvm/patches/patch-lib_Support_Unix_Threading_inc
===================================================================
RCS file: devel/llvm/patches/patch-lib_Support_Unix_Threading_inc
diff -N devel/llvm/patches/patch-lib_Support_Unix_Threading_inc
--- devel/llvm/patches/patch-lib_Support_Unix_Threading_inc 11 Feb 2019 05:24:16 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
-$OpenBSD: patch-lib_Support_Unix_Threading_inc,v 1.3 2019/02/11 05:24:16 jca Exp $
-
-Add OpenBSD support to be able to get the thread name
-
-Index: lib/Support/Unix/Threading.inc
---- lib/Support/Unix/Threading.inc.orig
-+++ lib/Support/Unix/Threading.inc
-@@ -203,6 +203,12 @@ void llvm::get_thread_name(SmallVectorImpl<char> &Name
-   ::pthread_getname_np(::pthread_self(), buf, len);
-
-   Name.append(buf, buf + strlen(buf));
-+#elif defined(__OpenBSD__)
-+  constexpr uint32_t len = get_max_thread_name_length_impl();
-+  char buf[len];
-+  ::pthread_get_name_np(::pthread_self(), buf, len);
-+
-+  Name.append(buf, buf + strlen(buf));
- #elif defined(__linux__)
- #if HAVE_PTHREAD_GETNAME_NP
-   constexpr uint32_t len = get_max_thread_name_length_impl();
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64AsmPrinter_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64AsmPrinter_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_AArch64_AArch64AsmPrinter_cpp
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64AsmPrinter_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64AsmPrinter_cpp 29 Jun 2019 06:45:28 -0000
@@ -5,9 +5,9 @@ Add retguard for arm64.
 Index: lib/Target/AArch64/AArch64AsmPrinter.cpp
 --- lib/Target/AArch64/AArch64AsmPrinter.cpp.orig
 +++ lib/Target/AArch64/AArch64AsmPrinter.cpp
-@@ -683,6 +683,19 @@ void AArch64AsmPrinter::EmitInstruction(const MachineI
-   case TargetOpcode::PATCHABLE_TAIL_CALL:
-     LowerPATCHABLE_TAIL_CALL(*MI);
+@@ -986,6 +986,19 @@ void AArch64AsmPrinter::EmitInstruction(const MachineI
+   case AArch64::SEH_EpilogEnd:
+     TS->EmitARM64WinCFIEpilogEnd();
      return;
 +
 +  case AArch64::RETGUARD_JMP_TRAP:
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64FrameLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64FrameLowering_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_AArch64_AArch64FrameLowering_cpp
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64FrameLowering_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64FrameLowering_cpp 29 Jun 2019 06:45:28 -0000
@@ -13,23 +13,41 @@ Index: lib/Target/AArch64/AArch64FrameLo
  #include "AArch64Subtarget.h"
  #include "AArch64TargetMachine.h"
  #include "MCTargetDesc/AArch64AddressingModes.h"
-@@ -1421,6 +1422,12 @@ void AArch64FrameLowering::determineCalleeSaves(Machin
-     if (produceCompactUnwindFrame(MF) && !SavedRegs.test(PairedReg))
-       SpillEstimate++;
-   }
+@@ -1975,6 +1976,30 @@ void AArch64FrameLowering::determineCalleeSaves(Machin
+                                 ? RegInfo->getBaseRegister()
+                                 : (unsigned)AArch64::NoRegister;
+
++  unsigned SpillEstimate = SavedRegs.count();
++  for (unsigned i = 0; CSRegs[i]; ++i) {
++    unsigned Reg = CSRegs[i];
++    unsigned PairedReg = CSRegs[i ^ 1];
++    if (Reg == BasePointerReg)
++      SpillEstimate++;
++    if (produceCompactUnwindFrame(MF) && !SavedRegs.test(PairedReg))
++      SpillEstimate++;
++  }
 +
-+  if (MFI.hasReturnProtectorRegister()) {
++  if (MFI.hasReturnProtectorRegister() && MFI.getReturnProtectorNeedsStore()) {
 +    SavedRegs.set(MFI.getReturnProtectorRegister());
 +    SpillEstimate++;
 +  }
 +
-   SpillEstimate += 2; // Conservatively include FP+LR in the estimate
-   unsigned StackEstimate = MFI.estimateStackSize(MF) + 8 * SpillEstimate;
-
-@@ -1523,4 +1530,8 @@ bool AArch64FrameLowering::enableStackSlotScavenging(
-     const MachineFunction &MF) const {
-   const AArch64FunctionInfo *AFI = MF.getInfo<AArch64FunctionInfo>();
-   return AFI->hasCalleeSaveStackFreeSpace();
++  SpillEstimate += 2; // Conservatively include FP+LR in the estimate
++  unsigned StackEstimate = MFI.estimateStackSize(MF) + 8 * SpillEstimate;
++
++  // The frame record needs to be created by saving the appropriate registers
++  if (hasFP(MF) || windowsRequiresStackProbe(MF, StackEstimate)) {
++    SavedRegs.set(AArch64::FP);
++    SavedRegs.set(AArch64::LR);
++  }
++
+   unsigned ExtraCSSpill = 0;
+   // Figure out which callee-saved registers to save/restore.
+   for (unsigned i = 0; CSRegs[i]; ++i) {
+@@ -2156,4 +2181,8 @@ unsigned AArch64FrameLowering::getWinEHFuncletFrameSiz
+   // This is the amount of stack a funclet needs to allocate.
+   return alignTo(CSSize + MF.getFrameInfo().getMaxCallFrameSize(),
+                  getStackAlignment());
 +}
 +
 +const ReturnProtectorLowering *AArch64FrameLowering::getReturnProtector() const {
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64ISelLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64ISelLowering_cpp,v
retrieving revision 1.9
diff -u -p -r1.9 patch-lib_Target_AArch64_AArch64ISelLowering_cpp
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64ISelLowering_cpp 28 Jan 2019 06:27:28 -0000 1.9
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64ISelLowering_cpp 29 Jun 2019 06:45:28 -0000
@@ -7,7 +7,7 @@ IR Stack Guard.
 Index: lib/Target/AArch64/AArch64ISelLowering.cpp
 --- lib/Target/AArch64/AArch64ISelLowering.cpp.orig
 +++ lib/Target/AArch64/AArch64ISelLowering.cpp
-@@ -11298,7 +11298,8 @@ void AArch64TargetLowering::ReplaceNodeResults(
+@@ -11559,7 +11559,8 @@ void AArch64TargetLowering::ReplaceNodeResults(
  }
 
  bool AArch64TargetLowering::useLoadStackGuardNode() const {
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64InstrInfo_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64InstrInfo_td,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_AArch64_AArch64InstrInfo_td
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64InstrInfo_td 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64InstrInfo_td 29 Jun 2019 06:45:28 -0000
@@ -5,7 +5,7 @@ Add retguard for arm64.
 Index: lib/Target/AArch64/AArch64InstrInfo.td
 --- lib/Target/AArch64/AArch64InstrInfo.td.orig
 +++ lib/Target/AArch64/AArch64InstrInfo.td
-@@ -418,6 +418,12 @@ def ADDlowTLS
+@@ -491,6 +491,12 @@ def ADDlowTLS
 
  } // isReMaterializable, isCodeGenOnly
 
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64Subtarget_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64Subtarget_h,v
retrieving revision 1.4
diff -u -p -r1.4 patch-lib_Target_AArch64_AArch64Subtarget_h
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64Subtarget_h 28 Jan 2019 06:27:28 -0000 1.4
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64Subtarget_h 29 Jun 2019 06:45:28 -0000
@@ -7,7 +7,7 @@ IR Stack Guard.
 Index: lib/Target/AArch64/AArch64Subtarget.h
 --- lib/Target/AArch64/AArch64Subtarget.h.orig
 +++ lib/Target/AArch64/AArch64Subtarget.h
-@@ -302,6 +302,7 @@ class AArch64Subtarget final : public AArch64GenSubtar
+@@ -371,6 +371,7 @@ class AArch64Subtarget final : public AArch64GenSubtar
    bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
    bool isTargetIOS() const { return TargetTriple.isiOS(); }
    bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
Index: devel/llvm/patches/patch-lib_Target_AArch64_CMakeLists_txt
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_CMakeLists_txt,v
retrieving revision 1.1
diff -u -p -r1.1 patch-lib_Target_AArch64_CMakeLists_txt
--- devel/llvm/patches/patch-lib_Target_AArch64_CMakeLists_txt 21 Aug 2018 06:56:09 -0000 1.1
+++ devel/llvm/patches/patch-lib_Target_AArch64_CMakeLists_txt 29 Jun 2019 06:45:28 -0000
@@ -5,11 +5,11 @@ Add retguard for arm64.
 Index: lib/Target/AArch64/CMakeLists.txt
 --- lib/Target/AArch64/CMakeLists.txt.orig
 +++ lib/Target/AArch64/CMakeLists.txt
-@@ -47,6 +47,7 @@ add_llvm_target(AArch64CodeGen
+@@ -51,6 +51,7 @@ add_llvm_target(AArch64CodeGen
    AArch64PBQPRegAlloc.cpp
    AArch64RegisterBankInfo.cpp
    AArch64RegisterInfo.cpp
 +  AArch64ReturnProtectorLowering.cpp
    AArch64SelectionDAGInfo.cpp
+   AArch64SpeculationHardening.cpp
    AArch64StorePairSuppress.cpp
-   AArch64Subtarget.cpp
Index: devel/llvm/patches/patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp
diff -N devel/llvm/patches/patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp
--- devel/llvm/patches/patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp 28 Jan 2019 06:27:28 -0000 1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-$OpenBSD: patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp,v 1.8 2019/01/28 06:27:28 jca Exp $
-
-[mips] Enable using of integrated assembler in all cases.
-
-Index: lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
---- lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp.orig
-+++ lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
-@@ -50,21 +50,5 @@ MipsMCAsmInfo::MipsMCAsmInfo(const Triple &TheTriple)
-   ExceptionsType = ExceptionHandling::DwarfCFI;
-   DwarfRegNumForCFI = true;
-   HasMipsExpressions = true;
--
--  // Enable IAS by default for O32.
--  if (TheTriple.isMIPS32())
--    UseIntegratedAssembler = true;
--
--  // Enable IAS by default for Debian mips64/mips64el.
--  if (TheTriple.getEnvironment() == Triple::GNUABI64)
--    UseIntegratedAssembler = true;
--
--  // Enable IAS by default for Android mips64el that uses N64 ABI.
--  if (TheTriple.getArch() == Triple::mips64el && TheTriple.isAndroid())
--    UseIntegratedAssembler = true;
--
--  // Enable IAS by default for FreeBSD / OpenBSD mips64/mips64el.
--  if (TheTriple.isOSFreeBSD() ||
--      TheTriple.isOSOpenBSD())
--    UseIntegratedAssembler = true;
-+  UseIntegratedAssembler = true;
- }
Index: devel/llvm/patches/patch-lib_Target_PowerPC_PPCISelLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_PowerPC_PPCISelLowering_cpp,v
retrieving revision 1.4
diff -u -p -r1.4 patch-lib_Target_PowerPC_PPCISelLowering_cpp
--- devel/llvm/patches/patch-lib_Target_PowerPC_PPCISelLowering_cpp 20 Feb 2019 00:24:11 -0000 1.4
+++ devel/llvm/patches/patch-lib_Target_PowerPC_PPCISelLowering_cpp 29 Jun 2019 06:45:28 -0000
@@ -10,7 +10,7 @@ compiler generate code that only uses al
 Index: lib/Target/PowerPC/PPCISelLowering.cpp
 --- lib/Target/PowerPC/PPCISelLowering.cpp.orig
 +++ lib/Target/PowerPC/PPCISelLowering.cpp
-@@ -13921,6 +13921,14 @@ bool PPCTargetLowering::allowsMisalignedMemoryAccesses
+@@ -14204,6 +14204,14 @@ bool PPCTargetLowering::allowsMisalignedMemoryAccesses
    if (VT == MVT::ppcf128)
      return false;
 
Index: devel/llvm/patches/patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp
diff -N devel/llvm/patches/patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp
--- devel/llvm/patches/patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp 28 Jan 2019 06:27:28 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,84 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp,v 1.6 2019/01/28 06:27:28 jca Exp $
-
-[Sparc] Add membar assembler tags
-
-Index: lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
---- lib/Target/Sparc/AsmParser/SparcAsmParser.cpp.orig
-+++ lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
-@@ -78,6 +78,8 @@ class SparcAsmParser : public MCTargetAsmParser {
-   // Custom parse functions for Sparc specific operands.
-   OperandMatchResultTy parseMEMOperand(OperandVector &Operands);
-
-+  OperandMatchResultTy parseMembarTag(OperandVector &Operands);
-+
-   OperandMatchResultTy parseOperand(OperandVector &Operands, StringRef Name);
-
-   OperandMatchResultTy
-@@ -256,6 +258,7 @@ class SparcOperand : public MCParsedAsmOperand { (publ
-   bool isMem() const override { return isMEMrr() || isMEMri(); }
-   bool isMEMrr() const { return Kind == k_MemoryReg; }
-   bool isMEMri() const { return Kind == k_MemoryImm; }
-+  bool isMembarTag() const { return Kind == k_Immediate; }
-
-   bool isIntReg() const {
-     return (Kind == k_Register && Reg.Kind == rk_IntReg);
-@@ -366,6 +369,12 @@ class SparcOperand : public MCParsedAsmOperand { (publ
-     addExpr(Inst, Expr);
-   }
-
-+  void addMembarTagOperands(MCInst &Inst, unsigned N) const {
-+    assert(N == 1 && "Invalid number of operands!");
-+    const MCExpr *Expr = getImm();
-+    addExpr(Inst, Expr);
-+  }
-+
-   static std::unique_ptr<SparcOperand> CreateToken(StringRef Str, SMLoc S) {
-     auto Op = make_unique<SparcOperand>(k_Token);
-     Op->Tok.Data = Str.data();
-@@ -739,6 +748,46 @@ SparcAsmParser::parseMEMOperand(OperandVector &Operand
-       Offset->isImm() ? SparcOperand::MorphToMEMri(BaseReg, std::move(Offset))
-                       : SparcOperand::MorphToMEMrr(BaseReg, std::move(Offset)));
-
-+  return MatchOperand_Success;
-+}
-+
-+OperandMatchResultTy SparcAsmParser::parseMembarTag(OperandVector &Operands) {
-+  SMLoc S = Parser.getTok().getLoc();
-+  const MCExpr *EVal;
-+  unsigned ImmVal = 0;
-+
-+  while (getLexer().getKind() == AsmToken::Hash) {
-+    SMLoc TagStart = getLexer().getLoc();
-+    Parser.Lex(); // Eat the '#'.
-+    unsigned MaskVal = StringSwitch<unsigned>(Parser.getTok().getString())
-+      .Case("LoadLoad", 0x1)
-+      .Case("StoreLoad", 0x2)
-+      .Case("LoadStore", 0x4)
-+      .Case("StoreStore", 0x8)
-+      .Case("Lookaside", 0x10)
-+      .Case("MemIssue", 0x20)
-+      .Case("Sync", 0x40)
-+      .Default(0);
-+
-+    Parser.Lex(); // Eat the identifier token.
-+
-+    if (!MaskVal) {
-+      Error(TagStart, "unknown membar tag");
-+      return MatchOperand_ParseFail;
-+    }
-+
-+    ImmVal |= MaskVal;
-+
-+    if (getLexer().getKind() == AsmToken::Pipe)
-+      Parser.Lex(); // Eat the '|'.
-+  }
-+
-+  if (!ImmVal)
-+    return MatchOperand_NoMatch;
-+
-+  EVal = MCConstantExpr::create(ImmVal, getContext());
-+  SMLoc E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1);
-+  Operands.push_back(SparcOperand::CreateImm(EVal, S, E));
-   return MatchOperand_Success;
- }
-
Index: devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp
diff -N devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp
--- devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp 28 Jan 2019 06:27:28 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp,v 1.4 2019/01/28 06:27:28 jca Exp $
-
-[Sparc] Add membar assembler tags
-
-Index: lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp
---- lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp.orig
-+++ lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp
-@@ -195,3 +195,26 @@ bool SparcInstPrinter::printGetPCX(const MCInst *MI, u
-   llvm_unreachable("FIXME: Implement SparcInstPrinter::printGetPCX.");
-   return true;
- }
-+
-+void SparcInstPrinter::printMembarTag(const MCInst *MI, int opNum,
-+                                      const MCSubtargetInfo &STI,
-+                                      raw_ostream &O) {
-+  static const char *const TagNames[] = {
-+      "#LoadLoad",  "#StoreLoad", "#LoadStore", "#StoreStore",
-+      "#Lookaside", "#MemIssue",  "#Sync"};
-+
-+  unsigned Imm = MI->getOperand(opNum).getImm();
-+
-+  if (Imm > 127) {
-+    O << Imm;
-+    return;
-+  }
-+
-+  bool First = true;
-+  for (unsigned i = 0; i < sizeof(TagNames) / sizeof(char *); i++) {
-+    if (Imm & (1 << i)) {
-+      O << (First ? "" : " | ") << TagNames[i];
-+      First = false;
-+    }
-+  }
-+}
Index: devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h
diff -N devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h
--- devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h 14 Nov 2018 09:07:41 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h,v 1.3 2018/11/14 09:07:41 ajacoutot Exp $
-
-[Sparc] Add membar assembler tags
-
-Index: lib/Target/Sparc/InstPrinter/SparcInstPrinter.h
---- lib/Target/Sparc/InstPrinter/SparcInstPrinter.h.orig
-+++ lib/Target/Sparc/InstPrinter/SparcInstPrinter.h
-@@ -49,6 +49,8 @@ class SparcInstPrinter : public MCInstPrinter { (publi
-                       raw_ostream &OS);
-   bool printGetPCX(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
-                    raw_ostream &OS);
-+  void printMembarTag(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
-+                      raw_ostream &O);
- };
- } // end namespace llvm
-
Index: devel/llvm/patches/patch-lib_Target_Sparc_SparcISelLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_Sparc_SparcISelLowering_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_Target_Sparc_SparcISelLowering_cpp
--- devel/llvm/patches/patch-lib_Target_Sparc_SparcISelLowering_cpp 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-lib_Target_Sparc_SparcISelLowering_cpp 29 Jun 2019 06:45:28 -0000
@@ -1,51 +1,16 @@
 $OpenBSD: patch-lib_Target_Sparc_SparcISelLowering_cpp,v 1.3 2019/01/28 06:27:28 jca Exp $
 
 - Use a 64-bit register when required
-- [Sparc] Use float register for integer constrained with "f" in inline asm
-
-  Constraining an integer value to a floating point register using "f"
-  causes an llvm_unreachable to trigger. This patch allows i32 integers
-  to be placed in a single precision float register and i64 integers to
-  be placed in a double precision float register. This matches the behavior
-  of GCC.
 
 Index: lib/Target/Sparc/SparcISelLowering.cpp
 --- lib/Target/Sparc/SparcISelLowering.cpp.orig
 +++ lib/Target/Sparc/SparcISelLowering.cpp
-@@ -3491,26 +3491,28 @@ SparcTargetLowering::getRegForInlineAsmConstraint(cons
+@@ -3258,6 +3258,8 @@ SparcTargetLowering::getRegForInlineAsmConstraint(cons
      case 'r':
        if (VT == MVT::v2i32)
          return std::make_pair(0U, &SP::IntPairRegClass);
 +      else if (VT == MVT::i64 && Subtarget->is64Bit())
-+       return std::make_pair(0U, &SP::I64RegsRegClass);
++ return std::make_pair(0U, &SP::I64RegsRegClass);
        else
          return std::make_pair(0U, &SP::IntRegsRegClass);
      case 'f':
--      if (VT == MVT::f32)
-+      if (VT == MVT::f32 || VT == MVT::i32)
-         return std::make_pair(0U, &SP::FPRegsRegClass);
--      else if (VT == MVT::f64)
-+      else if (VT == MVT::f64 || VT == MVT::i64)
-         return std::make_pair(0U, &SP::LowDFPRegsRegClass);
-       else if (VT == MVT::f128)
-         return std::make_pair(0U, &SP::LowQFPRegsRegClass);
--      llvm_unreachable("Unknown ValueType for f-register-type!");
--      break;
-+      // This will generate an error message
-+      return std::make_pair(0U, nullptr);
-     case 'e':
--      if (VT == MVT::f32)
-+      if (VT == MVT::f32 || VT == MVT::i32)
-         return std::make_pair(0U, &SP::FPRegsRegClass);
--      else if (VT == MVT::f64)
-+      else if (VT == MVT::f64 || VT == MVT::i64 )
-         return std::make_pair(0U, &SP::DFPRegsRegClass);
-       else if (VT == MVT::f128)
-         return std::make_pair(0U, &SP::QFPRegsRegClass);
--      llvm_unreachable("Unknown ValueType for e-register-type!");
--      break;
-+      // This will generate an error message
-+      return std::make_pair(0U, nullptr);
-     }
-   } else if (!Constraint.empty() && Constraint.size() <= 5
-               && Constraint[0] == '{' && *(Constraint.end()-1) == '}') {
Index: devel/llvm/patches/patch-lib_Target_Sparc_SparcInstr64Bit_td
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_SparcInstr64Bit_td
diff -N devel/llvm/patches/patch-lib_Target_Sparc_SparcInstr64Bit_td
--- devel/llvm/patches/patch-lib_Target_Sparc_SparcInstr64Bit_td 26 Oct 2017 10:05:55 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_SparcInstr64Bit_td,v 1.5 2017/10/26 10:05:55 ajacoutot Exp $
-
-[Sparc] allow tls_add/tls_call syntax in assembler parser
-
-Index: lib/Target/Sparc/SparcInstr64Bit.td
---- lib/Target/Sparc/SparcInstr64Bit.td.orig
-+++ lib/Target/Sparc/SparcInstr64Bit.td
-@@ -239,7 +239,7 @@ let Predicates = [Is64Bit] in {
- let DecoderMethod = "DecodeLoadInt" in
-   defm LDX   : Load<"ldx", 0b001011, load, I64Regs, i64>;
-
--let mayLoad = 1, isCodeGenOnly = 1, isAsmParserOnly = 1 in
-+let mayLoad = 1, isAsmParserOnly = 1 in
-   def TLS_LDXrr : F3_1<3, 0b001011,
-                        (outs IntRegs:$dst), (ins MEMrr:$addr, TLSSym:$sym),
-                        "ldx [$addr], $dst, $sym",
Index: devel/llvm/patches/patch-lib_Target_Sparc_SparcInstrInfo_td
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_SparcInstrInfo_td
diff -N devel/llvm/patches/patch-lib_Target_Sparc_SparcInstrInfo_td
--- devel/llvm/patches/patch-lib_Target_Sparc_SparcInstrInfo_td 28 Jan 2019 06:27:28 -0000 1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,43 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_SparcInstrInfo_td,v 1.8 2019/01/28 06:27:28 jca Exp $
-
-- [Sparc] allow tls_add/tls_call syntax in assembler parser
-- [Sparc] Add membar assembler tags
-
-Index: lib/Target/Sparc/SparcInstrInfo.td
---- lib/Target/Sparc/SparcInstrInfo.td.orig
-+++ lib/Target/Sparc/SparcInstrInfo.td
-@@ -121,6 +121,16 @@ def MEMri : Operand<iPTR> {
-
- def TLSSym : Operand<iPTR>;
-
-+def SparcMembarTagAsmOperand : AsmOperandClass {
-+  let Name = "MembarTag";
-+  let ParserMethod = "parseMembarTag";
-+}
-+
-+def MembarTag : Operand<i32> {
-+  let PrintMethod = "printMembarTag";
-+  let ParserMatchClass = SparcMembarTagAsmOperand;
-+}
-+
- // Branch targets have OtherVT type.
- def brtarget : Operand<OtherVT> {
-   let EncoderMethod = "getBranchTargetOpValue";
-@@ -1316,7 +1326,7 @@ let Defs = [FCC0], rd = 0, isCodeGenOnly = 1 in {
- //===----------------------------------------------------------------------===//
- // Instructions for Thread Local Storage(TLS).
- //===----------------------------------------------------------------------===//
--let isCodeGenOnly = 1, isAsmParserOnly = 1 in {
-+let isAsmParserOnly = 1 in {
- def TLS_ADDrr : F3_1<2, 0b000000,
-                     (outs IntRegs:$rd),
-                     (ins IntRegs:$rs1, IntRegs:$rs2, TLSSym:$sym),
-@@ -1511,7 +1521,7 @@ def : Pat<(ctpop i32:$src),
-           (POPCrr (SRLri $src, 0))>;
-
- let Predicates = [HasV9], hasSideEffects = 1, rd = 0, rs1 = 0b01111 in
-- def MEMBARi : F3_2<2, 0b101000, (outs), (ins simm13Op:$simm13),
-+ def MEMBARi : F3_2<2, 0b101000, (outs), (ins MembarTag:$simm13),
-                     "membar $simm13", []>;
-
- // The CAS instruction, unlike other instructions, only comes in a
Index: devel/llvm/patches/patch-lib_Target_X86_AsmParser_X86AsmParser_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_AsmParser_X86AsmParser_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_AsmParser_X86AsmParser_cpp
--- devel/llvm/patches/patch-lib_Target_X86_AsmParser_X86AsmParser_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_AsmParser_X86AsmParser_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/AsmParser/X86AsmParser.cpp
---- lib/Target/X86/AsmParser/X86AsmParser.cpp.orig
-+++ lib/Target/X86/AsmParser/X86AsmParser.cpp
-@@ -1109,8 +1109,7 @@ bool X86AsmParser::ParseRegister(unsigned &RegNo,
-   }
-
-   // Parse "%st" as "%st(0)" and "%st(1)", which is multiple tokens.
--  if (RegNo == 0 && (Tok.getString() == "st" || Tok.getString() == "ST")) {
--    RegNo = X86::ST0;
-+  if (RegNo == X86::ST0) {
-     Parser.Lex(); // Eat 'st'
-
-     // Check to see if we have '(4)' after %st.
Index: devel/llvm/patches/patch-lib_Target_X86_CMakeLists_txt
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_CMakeLists_txt,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_Target_X86_CMakeLists_txt
--- devel/llvm/patches/patch-lib_Target_X86_CMakeLists_txt 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-lib_Target_X86_CMakeLists_txt 29 Jun 2019 06:45:28 -0000
@@ -10,7 +10,7 @@ $OpenBSD: patch-lib_Target_X86_CMakeList
 Index: lib/Target/X86/CMakeLists.txt
 --- lib/Target/X86/CMakeLists.txt.orig
 +++ lib/Target/X86/CMakeLists.txt
-@@ -31,6 +31,7 @@ set(sources
+@@ -34,6 +34,7 @@ set(sources
    X86ExpandPseudo.cpp
    X86FastISel.cpp
    X86FixupBWInsts.cpp
@@ -18,7 +18,7 @@ Index: lib/Target/X86/CMakeLists.txt
    X86FixupLEAs.cpp
    X86AvoidStoreForwardingBlocks.cpp
    X86FixupSetCC.cpp
-@@ -55,6 +56,7 @@ set(sources
+@@ -59,6 +60,7 @@ set(sources
    X86RegisterBankInfo.cpp
    X86RegisterInfo.cpp
    X86RetpolineThunks.cpp
Index: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp
--- devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
---- lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp.orig
-+++ lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
-@@ -200,3 +200,14 @@ void X86ATTInstPrinter::printU8Imm(const MCInst *MI, u
-   O << markup("<imm:") << '$' << formatImm(MI->getOperand(Op).getImm() & 0xff)
-     << markup(">");
- }
-+
-+void X86ATTInstPrinter::printSTiRegOperand(const MCInst *MI, unsigned OpNo,
-+                                           raw_ostream &OS) {
-+  const MCOperand &Op = MI->getOperand(OpNo);
-+  unsigned Reg = Op.getReg();
-+  // Override the default printing to print st(0) instead st.
-+  if (Reg == X86::ST0)
-+    OS << markup("<reg:") << "%st(0)" << markup(">");
-+  else
-+    printRegName(OS, Reg);
-+}
Index: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h
diff -N devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h
--- devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/InstPrinter/X86ATTInstPrinter.h
---- lib/Target/X86/InstPrinter/X86ATTInstPrinter.h.orig
-+++ lib/Target/X86/InstPrinter/X86ATTInstPrinter.h
-@@ -44,6 +44,7 @@ class X86ATTInstPrinter final : public X86InstPrinterC
-   void printSrcIdx(const MCInst *MI, unsigned Op, raw_ostream &O);
-   void printDstIdx(const MCInst *MI, unsigned Op, raw_ostream &O);
-   void printU8Imm(const MCInst *MI, unsigned Op, raw_ostream &OS);
-+  void printSTiRegOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
-
-   void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
-     printMemReference(MI, OpNo, O);
Index: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp
--- devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
---- lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp.orig
-+++ lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
-@@ -160,3 +160,14 @@ void X86IntelInstPrinter::printU8Imm(const MCInst *MI,
-
-   O << formatImm(MI->getOperand(Op).getImm() & 0xff);
- }
-+
-+void X86IntelInstPrinter::printSTiRegOperand(const MCInst *MI, unsigned OpNo,
-+                                            raw_ostream &OS) {
-+  const MCOperand &Op = MI->getOperand(OpNo);
-+  unsigned Reg = Op.getReg();
-+  // Override the default printing to print st(0) instead st.
-+  if (Reg == X86::ST0)
-+    OS << "st(0)";
-+  else
-+    printRegName(OS, Reg);
-+}
Index: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h
diff -N devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h
--- devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/InstPrinter/X86IntelInstPrinter.h
---- lib/Target/X86/InstPrinter/X86IntelInstPrinter.h.orig
-+++ lib/Target/X86/InstPrinter/X86IntelInstPrinter.h
-@@ -39,6 +39,7 @@ class X86IntelInstPrinter final : public X86InstPrinte
-   void printSrcIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
-   void printDstIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
-   void printU8Imm(const MCInst *MI, unsigned Op, raw_ostream &O);
-+  void printSTiRegOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
-
-   void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
-     printMemReference(MI, OpNo, O);
Index: devel/llvm/patches/patch-lib_Target_X86_X86FixupGadgets_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86FixupGadgets_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_Target_X86_X86FixupGadgets_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86FixupGadgets_cpp 24 Feb 2019 20:53:56 -0000 1.3
+++ devel/llvm/patches/patch-lib_Target_X86_X86FixupGadgets_cpp 29 Jun 2019 06:45:28 -0000
@@ -10,7 +10,7 @@ $OpenBSD: patch-lib_Target_X86_X86FixupG
 Index: lib/Target/X86/X86FixupGadgets.cpp
 --- lib/Target/X86/X86FixupGadgets.cpp.orig
 +++ lib/Target/X86/X86FixupGadgets.cpp
-@@ -0,0 +1,720 @@
+@@ -0,0 +1,670 @@
 +//===-- X86FixupGadgets.cpp - Fixup Instructions that make ROP Gadgets ----===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -212,53 +212,6 @@ Index: lib/Target/X86/X86FixupGadgets.cp
 +    case X86::ADD32rr_DB:
 +    case X86::ADD16rr_DB:
 +      goto Handle_MRMDestReg;
-+    case X86::ACQUIRE_MOV8rm:
-+    case X86::ACQUIRE_MOV16rm:
-+    case X86::ACQUIRE_MOV32rm:
-+    case X86::ACQUIRE_MOV64rm:
-+      goto Handle_MRMSrcMem;
-+    case X86::RELEASE_MOV8mr:
-+    case X86::RELEASE_MOV16mr:
-+    case X86::RELEASE_MOV32mr:
-+    case X86::RELEASE_MOV64mr:
-+    case X86::RELEASE_ADD8mr:
-+    case X86::RELEASE_ADD32mr:
-+    case X86::RELEASE_ADD64mr:
-+    case X86::RELEASE_AND8mr:
-+    case X86::RELEASE_AND32mr:
-+    case X86::RELEASE_AND64mr:
-+    case X86::RELEASE_OR8mr:
-+    case X86::RELEASE_OR32mr:
-+    case X86::RELEASE_OR64mr:
-+    case X86::RELEASE_XOR8mr:
-+    case X86::RELEASE_XOR32mr:
-+    case X86::RELEASE_XOR64mr:
-+      goto Handle_MRMDestMem;
-+    case X86::RELEASE_MOV8mi:
-+    case X86::RELEASE_MOV16mi:
-+    case X86::RELEASE_MOV32mi:
-+    case X86::RELEASE_ADD8mi:
-+    case X86::RELEASE_MOV64mi32:
-+    case X86::RELEASE_ADD32mi:
-+    case X86::RELEASE_ADD64mi32:
-+    case X86::RELEASE_AND8mi:
-+    case X86::RELEASE_AND32mi:
-+    case X86::RELEASE_AND64mi32:
-+    case X86::RELEASE_OR8mi:
-+    case X86::RELEASE_OR32mi:
-+    case X86::RELEASE_OR64mi32:
-+    case X86::RELEASE_XOR8mi:
-+    case X86::RELEASE_XOR32mi:
-+    case X86::RELEASE_XOR64mi32:
-+    case X86::RELEASE_INC8m:
-+    case X86::RELEASE_INC16m:
-+    case X86::RELEASE_INC32m:
-+    case X86::RELEASE_INC64m:
-+    case X86::RELEASE_DEC8m:
-+    case X86::RELEASE_DEC16m:
-+    case X86::RELEASE_DEC32m:
-+    case X86::RELEASE_DEC64m:
-+      goto Handle_MRMXm;
 +    case X86::ADD16ri_DB:
 +    case X86::ADD32ri_DB:
 +    case X86::ADD64ri32_DB:
@@ -281,7 +234,6 @@ Index: lib/Target/X86/X86FixupGadgets.cp
 +    break;
 +  }
 +  case X86II::MRMDestMem: {
-+  Handle_MRMDestMem:
 +    checkSIB(MI, CurOp, info);
 +    unsigned opcode = MI.getOpcode();
 +    if (opcode == X86::MOVNTImr || opcode == X86::MOVNTI_64mr)
@@ -289,7 +241,6 @@ Index: lib/Target/X86/X86FixupGadgets.cp
 +    break;
 +  }
 +  case X86II::MRMSrcMem: {
-+  Handle_MRMSrcMem:
 +    CurOp += 1;
 +    if (HasVEX_4V)
 +      CurOp += 1;
@@ -317,7 +268,6 @@ Index: lib/Target/X86/X86FixupGadgets.cp
 +  case X86II::MRM5m:
 +  case X86II::MRM6m:
 +  case X86II::MRM7m: {
-+  Handle_MRMXm:
 +    if (HasVEX_4V)
 +      CurOp += 1;
 +    if (HasEVEX_K)
Index: devel/llvm/patches/patch-lib_Target_X86_X86FrameLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86FrameLowering_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-lib_Target_X86_X86FrameLowering_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86FrameLowering_cpp 11 Feb 2019 05:24:16 -0000 1.6
+++ devel/llvm/patches/patch-lib_Target_X86_X86FrameLowering_cpp 29 Jun 2019 06:45:28 -0000
@@ -58,7 +58,7 @@ Index: lib/Target/X86/X86FrameLowering.c
  }
 
  static unsigned getSUBriOpcode(unsigned IsLP64, int64_t Imm) {
-@@ -871,6 +874,24 @@ void X86FrameLowering::BuildStackAlignAND(MachineBasic
+@@ -872,6 +875,24 @@ void X86FrameLowering::BuildStackAlignAND(MachineBasic
    MI->getOperand(3).setIsDead();
  }
 
@@ -83,7 +83,7 @@ Index: lib/Target/X86/X86FrameLowering.c
  /// emitPrologue - Push callee-saved registers onto the stack, which
  /// automatically adjust the stack pointer. Adjust the stack pointer to allocate
  /// space for local variables. Also emit labels used by the exception handler to
-@@ -1153,6 +1174,43 @@ void X86FrameLowering::emitPrologue(MachineFunction &M
+@@ -1145,6 +1166,43 @@ void X86FrameLowering::emitPrologue(MachineFunction &M
                                      nullptr, DwarfFramePtr));
        }
 
@@ -127,7 +127,7 @@ Index: lib/Target/X86/X86FrameLowering.c
        if (NeedsWinFPO) {
          // .cv_fpo_setframe $FramePtr
          HasWinCFI = true;
-@@ -1618,20 +1676,6 @@ void X86FrameLowering::emitEpilogue(MachineFunction &M
+@@ -1626,20 +1684,6 @@ void X86FrameLowering::emitEpilogue(MachineFunction &M
    }
    uint64_t SEHStackAllocAmt = NumBytes;
 
@@ -148,7 +148,7 @@ Index: lib/Target/X86/X86FrameLowering.c
    MachineBasicBlock::iterator FirstCSPop = MBBI;
    // Skip the callee-saved pop instructions.
    while (MBBI != MBB.begin()) {
-@@ -1701,6 +1745,28 @@ void X86FrameLowering::emitEpilogue(MachineFunction &M
+@@ -1709,6 +1753,28 @@ void X86FrameLowering::emitEpilogue(MachineFunction &M
      --MBBI;
    }
 
@@ -177,7 +177,7 @@ Index: lib/Target/X86/X86FrameLowering.c
    // Windows unwinder will not invoke function's exception handler if IP is
    // either in prologue or in epilogue.  This behavior causes a problem when a
    // call immediately precedes an epilogue, because the return address points
-@@ -1789,6 +1855,8 @@ int X86FrameLowering::getFrameIndexReference(const Mac
+@@ -1797,6 +1863,8 @@ int X86FrameLowering::getFrameIndexReference(const Mac
             "FPDelta isn't aligned per the Win64 ABI!");
    }
 
@@ -186,7 +186,7 @@ Index: lib/Target/X86/X86FrameLowering.c
 
    if (TRI->hasBasePointer(MF)) {
      assert(HasFP && "VLAs and dynamic stack realign, but no FP?!");
-@@ -3153,4 +3221,8 @@ void X86FrameLowering::processFunctionBeforeFrameFinal
+@@ -3168,4 +3236,8 @@ void X86FrameLowering::processFunctionBeforeFrameFinal
    addFrameReference(BuildMI(MBB, MBBI, DL, TII.get(X86::MOV64mi32)),
                      UnwindHelpFI)
        .addImm(-2);
Index: devel/llvm/patches/patch-lib_Target_X86_X86ISelLowering_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_X86ISelLowering_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_X86ISelLowering_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86ISelLowering_cpp 20 Feb 2019 00:24:11 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_X86ISelLowering_cpp,v 1.6 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/X86ISelLowering.cpp
---- lib/Target/X86/X86ISelLowering.cpp.orig
-+++ lib/Target/X86/X86ISelLowering.cpp
-@@ -40619,6 +40619,20 @@ X86TargetLowering::getRegForInlineAsmConstraint(const
-       return Res;
-     }
-
-+    // dirflag -> DF
-+    if (StringRef("{dirflag}").equals_lower(Constraint)) {
-+      Res.first = X86::DF;
-+      Res.second = &X86::DFCCRRegClass;
-+      return Res;
-+    }
-+
-+    // fpsr -> FPSW
-+    if (StringRef("{fpsr}").equals_lower(Constraint)) {
-+      Res.first = X86::FPSW;
-+      Res.second = &X86::FPCCRRegClass;
-+      return Res;
-+    }
-+
-     // 'A' means [ER]AX + [ER]DX.
-     if (Constraint == "A") {
-       if (Subtarget.is64Bit()) {
Index: devel/llvm/patches/patch-lib_Target_X86_X86InstrCompiler_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86InstrCompiler_td,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_X86_X86InstrCompiler_td
--- devel/llvm/patches/patch-lib_Target_X86_X86InstrCompiler_td 24 Feb 2019 20:53:56 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_X86_X86InstrCompiler_td 29 Jun 2019 06:45:28 -0000
@@ -22,7 +22,7 @@ $OpenBSD: patch-lib_Target_X86_X86InstrC
 Index: lib/Target/X86/X86InstrCompiler.td
 --- lib/Target/X86/X86InstrCompiler.td.orig
 +++ lib/Target/X86/X86InstrCompiler.td
-@@ -267,6 +267,25 @@ def MORESTACK_RET_RESTORE_R10 : I<0, Pseudo, (outs), (
+@@ -264,6 +264,25 @@ def MORESTACK_RET_RESTORE_R10 : I<0, Pseudo, (outs), (
  }
 
  //===----------------------------------------------------------------------===//
Index: devel/llvm/patches/patch-lib_Target_X86_X86InstrFPStack_td
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_X86InstrFPStack_td
diff -N devel/llvm/patches/patch-lib_Target_X86_X86InstrFPStack_td
--- devel/llvm/patches/patch-lib_Target_X86_X86InstrFPStack_td 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,300 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_X86InstrFPStack_td,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/X86InstrFPStack.td
---- lib/Target/X86/X86InstrFPStack.td.orig
-+++ lib/Target/X86/X86InstrFPStack.td
-@@ -230,7 +230,7 @@ def _FI32m  : FPI<0xDA, fp, (outs), (ins i32mem:$src),
- } // mayLoad = 1, hasSideEffects = 1
- }
-
--let Defs = [FPSW] in {
-+let Defs = [FPSW], Uses = [FPCW] in {
- // FPBinary_rr just defines pseudo-instructions, no need to set a scheduling
- // resources.
- let hasNoSchedulingInfo = 1 in {
-@@ -258,42 +258,42 @@ defm DIVR: FPBinary<fdiv, MRM7m, "divr", 0>;
- } // Defs = [FPSW]
-
- class FPST0rInst<Format fp, string asm>
--  : FPI<0xD8, fp, (outs), (ins RST:$op), asm>;
-+  : FPI<0xD8, fp, (outs), (ins RSTi:$op), asm>;
- class FPrST0Inst<Format fp, string asm>
--  : FPI<0xDC, fp, (outs), (ins RST:$op), asm>;
-+  : FPI<0xDC, fp, (outs), (ins RSTi:$op), asm>;
- class FPrST0PInst<Format fp, string asm>
--  : FPI<0xDE, fp, (outs), (ins RST:$op), asm>;
-+  : FPI<0xDE, fp, (outs), (ins RSTi:$op), asm>;
-
- // NOTE: GAS and apparently all other AT&T style assemblers have a broken notion
- // of some of the 'reverse' forms of the fsub and fdiv instructions.  As such,
- // we have to put some 'r's in and take them out of weird places.
--let SchedRW = [WriteFAdd] in {
--def ADD_FST0r   : FPST0rInst <MRM0r, "fadd\t$op">;
--def ADD_FrST0   : FPrST0Inst <MRM0r, "fadd\t{%st(0), $op|$op, st(0)}">;
--def ADD_FPrST0  : FPrST0PInst<MRM0r, "faddp\t$op">;
--def SUBR_FST0r  : FPST0rInst <MRM5r, "fsubr\t$op">;
--def SUB_FrST0   : FPrST0Inst <MRM5r, "fsub{r}\t{%st(0), $op|$op, st(0)}">;
--def SUB_FPrST0  : FPrST0PInst<MRM5r, "fsub{r}p\t$op">;
--def SUB_FST0r   : FPST0rInst <MRM4r, "fsub\t$op">;
--def SUBR_FrST0  : FPrST0Inst <MRM4r, "fsub{|r}\t{%st(0), $op|$op, st(0)}">;
--def SUBR_FPrST0 : FPrST0PInst<MRM4r, "fsub{|r}p\t$op">;
-+let SchedRW = [WriteFAdd], Defs = [FPSW], Uses = [FPCW] in {
-+def ADD_FST0r   : FPST0rInst <MRM0r, "fadd\t{$op, %st|st, $op}">;
-+def ADD_FrST0   : FPrST0Inst <MRM0r, "fadd\t{%st, $op|$op, st}">;
-+def ADD_FPrST0  : FPrST0PInst<MRM0r, "faddp\t{%st, $op|$op, st}">;
-+def SUBR_FST0r  : FPST0rInst <MRM5r, "fsubr\t{$op, %st|st, $op}">;
-+def SUB_FrST0   : FPrST0Inst <MRM5r, "fsub{r}\t{%st, $op|$op, st}">;
-+def SUB_FPrST0  : FPrST0PInst<MRM5r, "fsub{r}p\t{%st, $op|$op, st}">;
-+def SUB_FST0r   : FPST0rInst <MRM4r, "fsub\t{$op, %st|st, $op}">;
-+def SUBR_FrST0  : FPrST0Inst <MRM4r, "fsub{|r}\t{%st, $op|$op, st}">;
-+def SUBR_FPrST0 : FPrST0PInst<MRM4r, "fsub{|r}p\t{%st, $op|$op, st}">;
- } // SchedRW
--let SchedRW = [WriteFCom] in {
-+let SchedRW = [WriteFCom], Defs = [FPSW], Uses = [FPCW] in {
- def COM_FST0r   : FPST0rInst <MRM2r, "fcom\t$op">;
- def COMP_FST0r  : FPST0rInst <MRM3r, "fcomp\t$op">;
- } // SchedRW
--let SchedRW = [WriteFMul] in {
--def MUL_FST0r   : FPST0rInst <MRM1r, "fmul\t$op">;
--def MUL_FrST0   : FPrST0Inst <MRM1r, "fmul\t{%st(0), $op|$op, st(0)}">;
--def MUL_FPrST0  : FPrST0PInst<MRM1r, "fmulp\t$op">;
-+let SchedRW = [WriteFMul], Defs = [FPSW], Uses = [FPCW] in {
-+def MUL_FST0r   : FPST0rInst <MRM1r, "fmul\t{$op, %st|st, $op}">;
-+def MUL_FrST0   : FPrST0Inst <MRM1r, "fmul\t{%st, $op|$op, st}">;
-+def MUL_FPrST0  : FPrST0PInst<MRM1r, "fmulp\t{%st, $op|$op, st}">;
- } // SchedRW
--let SchedRW = [WriteFDiv] in {
--def DIVR_FST0r  : FPST0rInst <MRM7r, "fdivr\t$op">;
--def DIV_FrST0   : FPrST0Inst <MRM7r, "fdiv{r}\t{%st(0), $op|$op, st(0)}">;
--def DIV_FPrST0  : FPrST0PInst<MRM7r, "fdiv{r}p\t$op">;
--def DIV_FST0r   : FPST0rInst <MRM6r, "fdiv\t$op">;
--def DIVR_FrST0  : FPrST0Inst <MRM6r, "fdiv{|r}\t{%st(0), $op|$op, st(0)}">;
--def DIVR_FPrST0 : FPrST0PInst<MRM6r, "fdiv{|r}p\t$op">;
-+let SchedRW = [WriteFDiv], Defs = [FPSW], Uses = [FPCW] in {
-+def DIVR_FST0r  : FPST0rInst <MRM7r, "fdivr\t{$op, %st|st, $op}">;
-+def DIV_FrST0   : FPrST0Inst <MRM7r, "fdiv{r}\t{%st, $op|$op, st}">;
-+def DIV_FPrST0  : FPrST0PInst<MRM7r, "fdiv{r}p\t{%st, $op|$op, st}">;
-+def DIV_FST0r   : FPST0rInst <MRM6r, "fdiv\t{$op, %st|st, $op}">;
-+def DIVR_FrST0  : FPrST0Inst <MRM6r, "fdiv{|r}\t{%st, $op|$op, st}">;
-+def DIVR_FPrST0 : FPrST0PInst<MRM6r, "fdiv{|r}p\t{%st, $op|$op, st}">;
- } // SchedRW
-
- // Unary operations.
-@@ -307,7 +307,7 @@ def _Fp80  : FpI_<(outs RFP80:$dst), (ins RFP80:$src),
- def _F     : FPI<0xD9, fp, (outs), (ins), asmstring>;
- }
-
--let Defs = [FPSW] in {
-+let Defs = [FPSW], Uses = [FPCW] in {
-
- let SchedRW = [WriteFSign] in {
- defm CHS : FPUnary<fneg, MRM_E0, "fchs">;
-@@ -335,7 +335,7 @@ def TST_F  : FPI<0xD9, MRM_E4, (outs), (ins), "ftst">;
-
- // Versions of FP instructions that take a single memory operand.  Added for the
- //   disassembler; remove as they are included with patterns elsewhere.
--let SchedRW = [WriteFComLd] in {
-+let SchedRW = [WriteFComLd], Defs = [FPSW], Uses = [FPCW] in {
- def FCOM32m  : FPI<0xD8, MRM2m, (outs), (ins f32mem:$src), "fcom{s}\t$src">;
- def FCOMP32m : FPI<0xD8, MRM3m, (outs), (ins f32mem:$src), "fcomp{s}\t$src">;
-
-@@ -398,22 +398,22 @@ defm CMOVNP : FPCMov<X86_COND_NP>;
-
- let Predicates = [HasCMov] in {
- // These are not factored because there's no clean way to pass DA/DB.
--def CMOVB_F  : FPI<0xDA, MRM0r, (outs), (ins RST:$op),
--                  "fcmovb\t{$op, %st(0)|st(0), $op}">;
--def CMOVBE_F : FPI<0xDA, MRM2r, (outs), (ins RST:$op),
--                  "fcmovbe\t{$op, %st(0)|st(0), $op}">;
--def CMOVE_F  : FPI<0xDA, MRM1r, (outs), (ins RST:$op),
--                  "fcmove\t{$op, %st(0)|st(0), $op}">;
--def CMOVP_F  : FPI<0xDA, MRM3r, (outs), (ins RST:$op),
--                  "fcmovu\t{$op, %st(0)|st(0), $op}">;
--def CMOVNB_F : FPI<0xDB, MRM0r, (outs), (ins RST:$op),
--                  "fcmovnb\t{$op, %st(0)|st(0), $op}">;
--def CMOVNBE_F: FPI<0xDB, MRM2r, (outs), (ins RST:$op),
--                  "fcmovnbe\t{$op, %st(0)|st(0), $op}">;
--def CMOVNE_F : FPI<0xDB, MRM1r, (outs), (ins RST:$op),
--                  "fcmovne\t{$op, %st(0)|st(0), $op}">;
--def CMOVNP_F : FPI<0xDB, MRM3r, (outs), (ins RST:$op),
--                  "fcmovnu\t{$op, %st(0)|st(0), $op}">;
-+def CMOVB_F  : FPI<0xDA, MRM0r, (outs), (ins RSTi:$op),
-+                  "fcmovb\t{$op, %st|st, $op}">;
-+def CMOVBE_F : FPI<0xDA, MRM2r, (outs), (ins RSTi:$op),
-+                  "fcmovbe\t{$op, %st|st, $op}">;
-+def CMOVE_F  : FPI<0xDA, MRM1r, (outs), (ins RSTi:$op),
-+                  "fcmove\t{$op, %st|st, $op}">;
-+def CMOVP_F  : FPI<0xDA, MRM3r, (outs), (ins RSTi:$op),
-+                  "fcmovu\t{$op, %st|st, $op}">;
-+def CMOVNB_F : FPI<0xDB, MRM0r, (outs), (ins RSTi:$op),
-+                  "fcmovnb\t{$op, %st|st, $op}">;
-+def CMOVNBE_F: FPI<0xDB, MRM2r, (outs), (ins RSTi:$op),
-+                  "fcmovnbe\t{$op, %st|st, $op}">;
-+def CMOVNE_F : FPI<0xDB, MRM1r, (outs), (ins RSTi:$op),
-+                  "fcmovne\t{$op, %st|st, $op}">;
-+def CMOVNP_F : FPI<0xDB, MRM3r, (outs), (ins RSTi:$op),
-+                  "fcmovnu\t{$op, %st|st, $op}">;
- } // Predicates = [HasCMov]
- } // SchedRW
-
-@@ -454,7 +454,7 @@ def ILD_Fp64m80: FpI_<(outs RFP80:$dst), (ins i64mem:$
-                   [(set RFP80:$dst, (X86fild addr:$src, i64))]>;
- } // SchedRW
-
--let SchedRW = [WriteStore] in {
-+let SchedRW = [WriteStore], Uses = [FPCW] in {
- def ST_Fp32m   : FpIf32<(outs), (ins f32mem:$op, RFP32:$src), OneArgFP,
-                   [(store RFP32:$src, addr:$op)]>;
- def ST_Fp64m32 : FpIf64<(outs), (ins f32mem:$op, RFP64:$src), OneArgFP,
-@@ -489,7 +489,7 @@ def IST_Fp16m80  : FpI_<(outs), (ins i16mem:$op, RFP80
- def IST_Fp32m80  : FpI_<(outs), (ins i32mem:$op, RFP80:$src), OneArgFP, []>;
- def IST_Fp64m80  : FpI_<(outs), (ins i64mem:$op, RFP80:$src), OneArgFP, []>;
- } // mayStore
--} // SchedRW
-+} // SchedRW, Uses = [FPCW]
-
- let mayLoad = 1, SchedRW = [WriteLoad] in {
- def LD_F32m   : FPI<0xD9, MRM0m, (outs), (ins f32mem:$src), "fld{s}\t$src">;
-@@ -499,7 +499,7 @@ def ILD_F16m  : FPI<0xDF, MRM0m, (outs), (ins i16mem:$
- def ILD_F32m  : FPI<0xDB, MRM0m, (outs), (ins i32mem:$src), "fild{l}\t$src">;
- def ILD_F64m  : FPI<0xDF, MRM5m, (outs), (ins i64mem:$src), "fild{ll}\t$src">;
- }
--let mayStore = 1, SchedRW = [WriteStore] in {
-+let mayStore = 1, SchedRW = [WriteStore], Uses = [FPCW] in {
- def ST_F32m   : FPI<0xD9, MRM2m, (outs), (ins f32mem:$dst), "fst{s}\t$dst">;
- def ST_F64m   : FPI<0xDD, MRM2m, (outs), (ins f64mem:$dst), "fst{l}\t$dst">;
- def ST_FP32m  : FPI<0xD9, MRM3m, (outs), (ins f32mem:$dst), "fstp{s}\t$dst">;
-@@ -513,7 +513,7 @@ def IST_FP64m : FPI<0xDF, MRM7m, (outs), (ins i64mem:$
- }
-
- // FISTTP requires SSE3 even though it's a FPStack op.
--let Predicates = [HasSSE3], SchedRW = [WriteStore] in {
-+let Predicates = [HasSSE3], SchedRW = [WriteStore], Uses = [FPCW] in {
- def ISTT_Fp16m32 : FpI_<(outs), (ins i16mem:$op, RFP32:$src), OneArgFP,
-                     [(X86fp_to_i16mem RFP32:$src, addr:$op)]>;
- def ISTT_Fp32m32 : FpI_<(outs), (ins i32mem:$op, RFP32:$src), OneArgFP,
-@@ -534,7 +534,7 @@ def ISTT_Fp64m80 : FpI_<(outs), (ins i64mem:$op, RFP80
-                     [(X86fp_to_i64mem RFP80:$src, addr:$op)]>;
- } // Predicates = [HasSSE3]
-
--let mayStore = 1, SchedRW = [WriteStore] in {
-+let mayStore = 1, SchedRW = [WriteStore], Uses = [FPCW] in {
- def ISTT_FP16m : FPI<0xDF, MRM1m, (outs), (ins i16mem:$dst), "fisttp{s}\t$dst">;
- def ISTT_FP32m : FPI<0xDB, MRM1m, (outs), (ins i32mem:$dst), "fisttp{l}\t$dst">;
- def ISTT_FP64m : FPI<0xDD, MRM1m, (outs), (ins i64mem:$dst), "fisttp{ll}\t$dst">;
-@@ -542,10 +542,10 @@ def ISTT_FP64m : FPI<0xDD, MRM1m, (outs), (ins i64mem:
-
- // FP Stack manipulation instructions.
- let SchedRW = [WriteMove] in {
--def LD_Frr   : FPI<0xD9, MRM0r, (outs), (ins RST:$op), "fld\t$op">;
--def ST_Frr   : FPI<0xDD, MRM2r, (outs), (ins RST:$op), "fst\t$op">;
--def ST_FPrr  : FPI<0xDD, MRM3r, (outs), (ins RST:$op), "fstp\t$op">;
--def XCH_F    : FPI<0xD9, MRM1r, (outs), (ins RST:$op), "fxch\t$op">;
-+def LD_Frr   : FPI<0xD9, MRM0r, (outs), (ins RSTi:$op), "fld\t$op">;
-+def ST_Frr   : FPI<0xDD, MRM2r, (outs), (ins RSTi:$op), "fst\t$op">;
-+def ST_FPrr  : FPI<0xDD, MRM3r, (outs), (ins RSTi:$op), "fstp\t$op">;
-+def XCH_F    : FPI<0xD9, MRM1r, (outs), (ins RSTi:$op), "fxch\t$op">;
- }
-
- // Floating point constant loads.
-@@ -570,7 +570,7 @@ def LD_F0 : FPI<0xD9, MRM_EE, (outs), (ins), "fldz">;
- let SchedRW = [WriteFLD1] in
- def LD_F1 : FPI<0xD9, MRM_E8, (outs), (ins), "fld1">;
-
--let SchedRW = [WriteFLDC], Defs = [FPSW] in {
-+let SchedRW = [WriteFLDC] in {
- def FLDL2T : I<0xD9, MRM_E9, (outs), (ins), "fldl2t", []>;
- def FLDL2E : I<0xD9, MRM_EA, (outs), (ins), "fldl2e", []>;
- def FLDPI : I<0xD9, MRM_EB, (outs), (ins), "fldpi", []>;
-@@ -579,7 +579,7 @@ def FLDLN2 : I<0xD9, MRM_ED, (outs), (ins), "fldln2",
- } // SchedRW
-
- // Floating point compares.
--let SchedRW = [WriteFCom] in {
-+let SchedRW = [WriteFCom], Uses = [FPCW] in {
- def UCOM_Fpr32 : FpIf32<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP,
-                         [(set FPSW, (trunc (X86cmp RFP32:$lhs, RFP32:$rhs)))]>;
- def UCOM_Fpr64 : FpIf64<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP,
-@@ -591,34 +591,37 @@ def UCOM_Fpr80 : FpI_  <(outs), (ins RFP80:$lhs, RFP80
-
- let SchedRW = [WriteFCom] in {
- // CC = ST(0) cmp ST(i)
--let Defs = [EFLAGS, FPSW] in {
--def UCOM_FpIr32: FpIf32<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP,
--                  [(set EFLAGS, (X86cmp RFP32:$lhs, RFP32:$rhs))]>;
--def UCOM_FpIr64: FpIf64<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP,
--                  [(set EFLAGS, (X86cmp RFP64:$lhs, RFP64:$rhs))]>;
-+let Defs = [EFLAGS, FPSW], Uses = [FPCW] in {
-+def UCOM_FpIr32: FpI_<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP,
-+                  [(set EFLAGS, (X86cmp RFP32:$lhs, RFP32:$rhs))]>,
-+                  Requires<[FPStackf32, HasCMov]>;
-+def UCOM_FpIr64: FpI_<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP,
-+                  [(set EFLAGS, (X86cmp RFP64:$lhs, RFP64:$rhs))]>,
-+                  Requires<[FPStackf64, HasCMov]>;
- def UCOM_FpIr80: FpI_<(outs), (ins RFP80:$lhs, RFP80:$rhs), CompareFP,
--                  [(set EFLAGS, (X86cmp RFP80:$lhs, RFP80:$rhs))]>;
-+                  [(set EFLAGS, (X86cmp RFP80:$lhs, RFP80:$rhs))]>,
-+                  Requires<[HasCMov]>;
- }
-
--let Defs = [FPSW], Uses = [ST0] in {
-+let Defs = [FPSW], Uses = [ST0, FPCW] in {
- def UCOM_Fr    : FPI<0xDD, MRM4r,    // FPSW = cmp ST(0) with ST(i)
--                    (outs), (ins RST:$reg), "fucom\t$reg">;
-+                    (outs), (ins RSTi:$reg), "fucom\t$reg">;
- def UCOM_FPr   : FPI<0xDD, MRM5r,    // FPSW = cmp ST(0) with ST(i), pop
--                    (outs), (ins RST:$reg), "fucomp\t$reg">;
-+                    (outs), (ins RSTi:$reg), "fucomp\t$reg">;
- def UCOM_FPPr  : FPI<0xDA, MRM_E9,       // cmp ST(0) with ST(1), pop, pop
-                     (outs), (ins), "fucompp">;
- }
-
--let Defs = [EFLAGS, FPSW], Uses = [ST0] in {
-+let Defs = [EFLAGS, FPSW], Uses = [ST0, FPCW] in {
- def UCOM_FIr   : FPI<0xDB, MRM5r,     // CC = cmp ST(0) with ST(i)
--                    (outs), (ins RST:$reg), "fucomi\t$reg">;
-+                    (outs), (ins RSTi:$reg), "fucomi\t{$reg, %st|st, $reg}">;
- def UCOM_FIPr  : FPI<0xDF, MRM5r,     // CC = cmp ST(0) with ST(i), pop
--                    (outs), (ins RST:$reg), "fucompi\t$reg">;
--}
-+                    (outs), (ins RSTi:$reg), "fucompi\t{$reg, %st|st, $reg}">;
-
--let Defs = [EFLAGS, FPSW] in {
--def COM_FIr : FPI<0xDB, MRM6r, (outs), (ins RST:$reg), "fcomi\t$reg">;
--def COM_FIPr : FPI<0xDF, MRM6r, (outs), (ins RST:$reg), "fcompi\t$reg">;
-+def COM_FIr : FPI<0xDB, MRM6r, (outs), (ins RSTi:$reg),
-+                  "fcomi\t{$reg, %st|st, $reg}">;
-+def COM_FIPr : FPI<0xDF, MRM6r, (outs), (ins RSTi:$reg),
-+                   "fcompi\t{$reg, %st|st, $reg}">;
- }
- } // SchedRW
-
-@@ -628,12 +631,12 @@ let Defs = [AX], Uses = [FPSW] in
- def FNSTSW16r : I<0xDF, MRM_E0,                  // AX = fp flags
-                   (outs), (ins), "fnstsw\t{%ax|ax}",
-                   [(set AX, (X86fp_stsw FPSW))]>;
--let Defs = [FPSW] in
-+let Defs = [FPSW], Uses = [FPCW] in
- def FNSTCW16m : I<0xD9, MRM7m,                   // [mem16] = X87 control world
-                   (outs), (ins i16mem:$dst), "fnstcw\t$dst",
-                   [(X86fp_cwd_get16 addr:$dst)]>;
- } // SchedRW
--let Defs = [FPSW], mayLoad = 1 in
-+let Defs = [FPSW,FPCW], mayLoad = 1 in
- def FLDCW16m  : I<0xD9, MRM5m,                   // X87 control world = [mem16]
-                   (outs), (ins i16mem:$dst), "fldcw\t$dst", []>,
-                 Sched<[WriteLoad]>;
-@@ -642,8 +645,8 @@ def FLDCW16m  : I<0xD9, MRM5m,                   // X8
- let SchedRW = [WriteMicrocoded] in {
- let Defs = [FPSW] in {
- def FNINIT : I<0xDB, MRM_E3, (outs), (ins), "fninit", []>;
--def FFREE : FPI<0xDD, MRM0r, (outs), (ins RST:$reg), "ffree\t$reg">;
--def FFREEP : FPI<0xDF, MRM0r, (outs), (ins RST:$reg), "ffreep\t$reg">;
-+def FFREE : FPI<0xDD, MRM0r, (outs), (ins RSTi:$reg), "ffree\t$reg">;
-+def FFREEP : FPI<0xDF, MRM0r, (outs), (ins RSTi:$reg), "ffreep\t$reg">;
-
- // Clear exceptions
- def FNCLEX : I<0xDB, MRM_E2, (outs), (ins), "fnclex", []>;
Index: devel/llvm/patches/patch-lib_Target_X86_X86InstrInfo_td
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_X86InstrInfo_td
diff -N devel/llvm/patches/patch-lib_Target_X86_X86InstrInfo_td
--- devel/llvm/patches/patch-lib_Target_X86_X86InstrInfo_td 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,71 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_X86InstrInfo_td,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/X86InstrInfo.td
---- lib/Target/X86/X86InstrInfo.td.orig
-+++ lib/Target/X86/X86InstrInfo.td
-@@ -3259,39 +3259,39 @@ def : InstAlias<"fucompi",      (UCOM_FIPr   ST1), 0>;
- // instructions like "fadd %st(0), %st(0)" as "fadd %st(0)" for consistency with
- // gas.
- multiclass FpUnaryAlias<string Mnemonic, Instruction Inst, bit EmitAlias = 1> {
-- def : InstAlias<!strconcat(Mnemonic, "\t{$op, %st(0)|st(0), $op}"),
--                 (Inst RST:$op), EmitAlias>;
-- def : InstAlias<!strconcat(Mnemonic, "\t{%st(0), %st(0)|st(0), st(0)}"),
-+ def : InstAlias<!strconcat(Mnemonic, "\t$op"),
-+                 (Inst RSTi:$op), EmitAlias>;
-+ def : InstAlias<!strconcat(Mnemonic, "\t{%st, %st|st, st}"),
-                  (Inst ST0), EmitAlias>;
- }
-
--defm : FpUnaryAlias<"fadd",   ADD_FST0r>;
-+defm : FpUnaryAlias<"fadd",   ADD_FST0r, 0>;
- defm : FpUnaryAlias<"faddp",  ADD_FPrST0, 0>;
--defm : FpUnaryAlias<"fsub",   SUB_FST0r>;
--defm : FpUnaryAlias<"fsub{|r}p",  SUBR_FPrST0>;
--defm : FpUnaryAlias<"fsubr",  SUBR_FST0r>;
--defm : FpUnaryAlias<"fsub{r|}p", SUB_FPrST0>;
--defm : FpUnaryAlias<"fmul",   MUL_FST0r>;
--defm : FpUnaryAlias<"fmulp",  MUL_FPrST0>;
--defm : FpUnaryAlias<"fdiv",   DIV_FST0r>;
--defm : FpUnaryAlias<"fdiv{|r}p",  DIVR_FPrST0>;
--defm : FpUnaryAlias<"fdivr",  DIVR_FST0r>;
--defm : FpUnaryAlias<"fdiv{r|}p", DIV_FPrST0>;
-+defm : FpUnaryAlias<"fsub",   SUB_FST0r, 0>;
-+defm : FpUnaryAlias<"fsub{|r}p",  SUBR_FPrST0, 0>;
-+defm : FpUnaryAlias<"fsubr",  SUBR_FST0r, 0>;
-+defm : FpUnaryAlias<"fsub{r|}p", SUB_FPrST0, 0>;
-+defm : FpUnaryAlias<"fmul",   MUL_FST0r, 0>;
-+defm : FpUnaryAlias<"fmulp",  MUL_FPrST0, 0>;
-+defm : FpUnaryAlias<"fdiv",   DIV_FST0r, 0>;
-+defm : FpUnaryAlias<"fdiv{|r}p",  DIVR_FPrST0, 0>;
-+defm : FpUnaryAlias<"fdivr",  DIVR_FST0r, 0>;
-+defm : FpUnaryAlias<"fdiv{r|}p", DIV_FPrST0, 0>;
- defm : FpUnaryAlias<"fcomi",   COM_FIr, 0>;
- defm : FpUnaryAlias<"fucomi",  UCOM_FIr, 0>;
--defm : FpUnaryAlias<"fcompi",   COM_FIPr>;
--defm : FpUnaryAlias<"fucompi",  UCOM_FIPr>;
-+defm : FpUnaryAlias<"fcompi",   COM_FIPr, 0>;
-+defm : FpUnaryAlias<"fucompi",  UCOM_FIPr, 0>;
-
-
--// Handle "f{mulp,addp} st(0), $op" the same as "f{mulp,addp} $op", since they
-+// Handle "f{mulp,addp} $op, %st(0)" the same as "f{mulp,addp} $op", since they
- // commute.  We also allow fdiv[r]p/fsubrp even though they don't commute,
- // solely because gas supports it.
--def : InstAlias<"faddp\t{%st(0), $op|$op, st(0)}", (ADD_FPrST0 RST:$op), 0>;
--def : InstAlias<"fmulp\t{%st(0), $op|$op, st(0)}", (MUL_FPrST0 RST:$op)>;
--def : InstAlias<"fsub{|r}p\t{%st(0), $op|$op, st(0)}", (SUBR_FPrST0 RST:$op)>;
--def : InstAlias<"fsub{r|}p\t{%st(0), $op|$op, st(0)}", (SUB_FPrST0 RST:$op)>;
--def : InstAlias<"fdiv{|r}p\t{%st(0), $op|$op, st(0)}", (DIVR_FPrST0 RST:$op)>;
--def : InstAlias<"fdiv{r|}p\t{%st(0), $op|$op, st(0)}", (DIV_FPrST0 RST:$op)>;
-+def : InstAlias<"faddp\t{$op, %st|st, $op}", (ADD_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fmulp\t{$op, %st|st, $op}", (MUL_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fsub{|r}p\t{$op, %st|st, $op}", (SUBR_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fsub{r|}p\t{$op, %st|st, $op}", (SUB_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fdiv{|r}p\t{$op, %st|st, $op}", (DIVR_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fdiv{r|}p\t{$op, %st|st, $op}", (DIV_FPrST0 RSTi:$op), 0>;
-
- def : InstAlias<"fnstsw"     , (FNSTSW16r), 0>;
-
Index: devel/llvm/patches/patch-lib_Target_X86_X86MCInstLower_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86MCInstLower_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-lib_Target_X86_X86MCInstLower_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86MCInstLower_cpp 24 Feb 2019 20:53:56 -0000 1.6
+++ devel/llvm/patches/patch-lib_Target_X86_X86MCInstLower_cpp 29 Jun 2019 06:45:28 -0000
@@ -22,7 +22,7 @@ $OpenBSD: patch-lib_Target_X86_X86MCInst
 Index: lib/Target/X86/X86MCInstLower.cpp
 --- lib/Target/X86/X86MCInstLower.cpp.orig
 +++ lib/Target/X86/X86MCInstLower.cpp
-@@ -1831,6 +1831,27 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr
+@@ -1786,6 +1786,27 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr
          MCInstBuilder(X86::MOV64rr).addReg(X86::R10).addReg(X86::RAX));
      return;
 
@@ -50,7 +50,7 @@ Index: lib/Target/X86/X86MCInstLower.cpp
    case X86::SEH_PushReg:
    case X86::SEH_SaveReg:
    case X86::SEH_SaveXMM:
-@@ -2257,4 +2278,10 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr
+@@ -2223,4 +2244,10 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr
    }
 
    EmitAndCountInstruction(TmpInst);
Index: devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_X86RegisterInfo_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/X86RegisterInfo.cpp
---- lib/Target/X86/X86RegisterInfo.cpp.orig
-+++ lib/Target/X86/X86RegisterInfo.cpp
-@@ -497,6 +497,9 @@ BitVector X86RegisterInfo::getReservedRegs(const Machi
-   BitVector Reserved(getNumRegs());
-   const X86FrameLowering *TFI = getFrameLowering(MF);
-
-+  // Set the floating point control register as reserved.
-+  Reserved.set(X86::FPCW);
-+
-   // Set the stack-pointer register and its aliases as reserved.
-   for (MCSubRegIterator I(X86::RSP, this, /*IncludeSelf=*/true); I.isValid();
-        ++I)
Index: devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_td,v
retrieving revision 1.5
diff -u -p -r1.5 patch-lib_Target_X86_X86RegisterInfo_td
--- devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_td 20 Feb 2019 00:24:11 -0000 1.5
+++ devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_td 29 Jun 2019 06:45:28 -0000
@@ -19,35 +19,11 @@ $OpenBSD: patch-lib_Target_X86_X86Regist
   There are other possible changes in this direction. BX/BL are obvious next
   targets for avoidance, and MM3/XMM3 may also be useful to try to avoid if
   possible.
-- Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-  to fix a regression in floating point operations.
 
 Index: lib/Target/X86/X86RegisterInfo.td
 --- lib/Target/X86/X86RegisterInfo.td.orig
 +++ lib/Target/X86/X86RegisterInfo.td
-@@ -278,7 +278,7 @@ def K7 : X86Reg<"k7", 7>, DwarfRegNum<[125, 100, 100]>
- // pseudo registers, but we still mark them as aliasing FP registers. That
- // way both kinds can be live without exceeding the stack depth. ST registers
- // are only live around inline assembly.
--def ST0 : X86Reg<"st(0)", 0>, DwarfRegNum<[33, 12, 11]>;
-+def ST0 : X86Reg<"st", 0>, DwarfRegNum<[33, 12, 11]>;
- def ST1 : X86Reg<"st(1)", 1>, DwarfRegNum<[34, 13, 12]>;
- def ST2 : X86Reg<"st(2)", 2>, DwarfRegNum<[35, 14, 13]>;
- def ST3 : X86Reg<"st(3)", 3>, DwarfRegNum<[36, 15, 14]>;
-@@ -288,8 +288,11 @@ def ST6 : X86Reg<"st(6)", 6>, DwarfRegNum<[39, 18, 17]
- def ST7 : X86Reg<"st(7)", 7>, DwarfRegNum<[40, 19, 18]>;
-
- // Floating-point status word
--def FPSW : X86Reg<"fpsw", 0>;
-+def FPSW : X86Reg<"fpsr", 0>;
-
-+// Floating-point control word
-+def FPCW : X86Reg<"fpcr", 0>;
-+
- // Status flags register.
- //
- // Note that some flags that are commonly thought of as part of the status
-@@ -402,8 +405,8 @@ def GRH16 : RegisterClass<"X86", [i16], 16,
+@@ -405,8 +405,8 @@ def GRH16 : RegisterClass<"X86", [i16], 16,
                                 R15WH)>;
 
  def GR32 : RegisterClass<"X86", [i32], 32,
@@ -58,7 +34,7 @@ Index: lib/Target/X86/X86RegisterInfo.td
 
  // GR64 - 64-bit GPRs. This oddly includes RIP, which isn't accurate, since
  // RIP isn't really a register and it can't be used anywhere except in an
-@@ -412,7 +415,7 @@ def GR32 : RegisterClass<"X86", [i32], 32,
+@@ -415,7 +415,7 @@ def GR32 : RegisterClass<"X86", [i32], 32,
  // tests because of the inclusion of RIP in this register class.
  def GR64 : RegisterClass<"X86", [i64], 64,
                           (add RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11,
@@ -67,13 +43,3 @@ Index: lib/Target/X86/X86RegisterInfo.td
 
  // Segment registers for use by MOV instructions (and others) that have a
  //   segment register as one operand.  Always contain a 16-bit segment
-@@ -521,6 +524,9 @@ def RFP80 : RegisterClass<"X86",[f80], 32, (add RFP32)
- def RST : RegisterClass<"X86", [f80, f64, f32], 32, (sequence "ST%u", 0, 7)> {
-   let isAllocatable = 0;
- }
-+
-+// Helper to allow %st to print as %st(0) when its encoded in the instruction.
-+def RSTi : RegisterOperand<RST, "printSTiRegOperand">;
-
- // Generic vector registers: VR64 and VR128.
- // Ensure that float types are declared first - only float is legal on SSE1.
Index: devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_X86_X86Subtarget_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_cpp 29 Jun 2019 06:45:28 -0000
@@ -5,7 +5,7 @@ Turn on -mretpoline by default in clang
 Index: lib/Target/X86/X86Subtarget.cpp
 --- lib/Target/X86/X86Subtarget.cpp.orig
 +++ lib/Target/X86/X86Subtarget.cpp
-@@ -238,6 +238,14 @@ void X86Subtarget::initSubtargetFeatures(StringRef CPU
+@@ -251,6 +251,14 @@ void X86Subtarget::initSubtargetFeatures(StringRef CPU
        FullFS = "+sahf";
    }
 
Index: devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h,v
retrieving revision 1.5
diff -u -p -r1.5 patch-lib_Target_X86_X86Subtarget_h
--- devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h 11 Feb 2019 05:24:16 -0000 1.5
+++ devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h 29 Jun 2019 06:45:28 -0000
@@ -6,7 +6,7 @@ $OpenBSD: patch-lib_Target_X86_X86Subtar
 Index: lib/Target/X86/X86Subtarget.h
 --- lib/Target/X86/X86Subtarget.h.orig
 +++ lib/Target/X86/X86Subtarget.h
-@@ -400,6 +400,9 @@ class X86Subtarget final : public X86GenSubtargetInfo
+@@ -411,6 +411,9 @@ class X86Subtarget final : public X86GenSubtargetInfo
    /// entry to the function and which must be maintained by every function.
    unsigned stackAlignment = 4;
 
@@ -16,7 +16,7 @@ Index: lib/Target/X86/X86Subtarget.h
    /// 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?
-@@ -478,6 +481,8 @@ class X86Subtarget final : public X86GenSubtargetInfo
+@@ -492,6 +495,8 @@ class X86Subtarget final : public X86GenSubtargetInfo
      return &getInstrInfo()->getRegisterInfo();
    }
 
@@ -25,7 +25,7 @@ Index: lib/Target/X86/X86Subtarget.h
    /// 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.
-@@ -699,6 +704,7 @@ class X86Subtarget final : public X86GenSubtargetInfo
+@@ -722,6 +727,7 @@ class X86Subtarget final : public X86GenSubtargetInfo
 
    bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
    bool isTargetFreeBSD() const { return TargetTriple.isOSFreeBSD(); }
Index: devel/llvm/patches/patch-lib_Target_X86_X86TargetMachine_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86TargetMachine_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_X86_X86TargetMachine_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86TargetMachine_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_X86_X86TargetMachine_cpp 29 Jun 2019 06:45:28 -0000
@@ -9,10 +9,10 @@ this framework.
 Index: lib/Target/X86/X86TargetMachine.cpp
 --- lib/Target/X86/X86TargetMachine.cpp.orig
 +++ lib/Target/X86/X86TargetMachine.cpp
-@@ -508,6 +508,7 @@ void X86PassConfig::addPreEmitPass() {
-     addPass(createX86FixupLEAs());
-     addPass(createX86EvexToVexInsts());
+@@ -504,6 +504,7 @@ void X86PassConfig::addPreEmitPass() {
    }
+   addPass(createX86DiscriminateMemOpsPass());
+   addPass(createX86InsertPrefetchPass());
 +  addPass(createX86FixupGadgetsPass());
  }
 
Index: devel/llvm/patches/patch-lib_Target_X86_X86_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86_h,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_X86_X86_h
--- devel/llvm/patches/patch-lib_Target_X86_X86_h 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_X86_X86_h 29 Jun 2019 06:45:28 -0000
@@ -9,9 +9,9 @@ this framework.
 Index: lib/Target/X86/X86.h
 --- lib/Target/X86/X86.h.orig
 +++ lib/Target/X86/X86.h
-@@ -114,6 +114,10 @@ FunctionPass *createX86DomainReassignmentPass();
-
- void initializeFixupBWInstPassPass(PassRegistry &);
+@@ -115,6 +115,10 @@ FunctionPass *createX86FixupBWInsts();
+ /// to another, when profitable.
+ FunctionPass *createX86DomainReassignmentPass();
 
 +/// Return a Machine Function pass that attempts to replace
 +/// ROP friendly instructions with alternatives.
Index: devel/llvm/patches/patch-lib_Target_X86_X86_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86_td,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_Target_X86_X86_td
--- devel/llvm/patches/patch-lib_Target_X86_X86_td 11 Feb 2019 05:24:16 -0000 1.3
+++ devel/llvm/patches/patch-lib_Target_X86_X86_td 29 Jun 2019 06:45:28 -0000
@@ -5,7 +5,7 @@ implement -msave-args in clang/llvm, lik
 Index: lib/Target/X86/X86.td
 --- lib/Target/X86/X86.td.orig
 +++ lib/Target/X86/X86.td
-@@ -284,6 +284,9 @@ def FeatureLZCNTFalseDeps : SubtargetFeature<"false-de
+@@ -283,6 +283,9 @@ def FeatureLZCNTFalseDeps : SubtargetFeature<"false-de
                                       "LZCNT/TZCNT have a false dependency on dest register">;
  def FeaturePCONFIG : SubtargetFeature<"pconfig", "HasPCONFIG", "true",
                                        "platform configuration instruction">;
Index: devel/llvm/patches/patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp,v
retrieving revision 1.4
diff -u -p -r1.4 patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp
--- devel/llvm/patches/patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp 28 Jan 2019 06:27:28 -0000 1.4
+++ devel/llvm/patches/patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp 29 Jun 2019 06:45:28 -0000
@@ -8,7 +8,7 @@ recursion.
 Index: lib/Transforms/Scalar/LoopIdiomRecognize.cpp
 --- lib/Transforms/Scalar/LoopIdiomRecognize.cpp.orig
 +++ lib/Transforms/Scalar/LoopIdiomRecognize.cpp
-@@ -280,6 +280,8 @@ bool LoopIdiomRecognize::runOnLoop(Loop *L) {
+@@ -282,6 +282,8 @@ bool LoopIdiomRecognize::runOnLoop(Loop *L) {
    StringRef Name = L->getHeader()->getParent()->getName();
    if (Name == "memset" || Name == "memcpy")
      return false;
Index: devel/llvm/patches/patch-test_Assembler_debug-info_ll
===================================================================
RCS file: devel/llvm/patches/patch-test_Assembler_debug-info_ll
diff -N devel/llvm/patches/patch-test_Assembler_debug-info_ll
--- devel/llvm/patches/patch-test_Assembler_debug-info_ll 30 Jan 2019 07:36:06 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-test_Assembler_debug-info_ll,v 1.1 2019/01/30 07:36:06 semarie Exp $
-https://github.com/llvm-mirror/llvm/commit/da1fb72bb305d6bc1f3899d541414146934bf80f
-Index: test/Assembler/debug-info.ll
---- test/Assembler/debug-info.ll.orig
-+++ test/Assembler/debug-info.ll
-@@ -83,7 +83,7 @@
- ; CHECK-NEXT: !32 = !DIFile(filename: "file", directory: "dir", checksumkind: CSK_MD5, checksum: "000102030405060708090a0b0c0d0e0f")
- !35 = !DIFile(filename: "file", directory: "dir", checksumkind: CSK_MD5, checksum: "000102030405060708090a0b0c0d0e0f")
-
--; CHECK-NEXT: !33 = !DICompositeType(tag: DW_TAG_variant_part, name: "A", scope: !14, size: 64)
-+; CHECK-NEXT: !33 = !DICompositeType(tag: DW_TAG_variant_part, name: "A", scope: !14, size: 64, discriminator: !34)
- ; CHECK-NEXT: !34 = !DIDerivedType(tag: DW_TAG_member, scope: !33, baseType: !35, size: 64, align: 64, flags: DIFlagArtificial)
- ; CHECK-NEXT: !35 = !DIBasicType(name: "u64", size: 64, encoding: DW_ATE_unsigned)
- !36 = !DICompositeType(tag: DW_TAG_variant_part, name: "A", scope: !16, size: 64, discriminator: !37)
Index: devel/llvm/patches/patch-test_Assembler_debug-variant-discriminator_ll
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-test_Assembler_debug-variant-discriminator_ll,v
retrieving revision 1.1
diff -u -p -r1.1 patch-test_Assembler_debug-variant-discriminator_ll
--- devel/llvm/patches/patch-test_Assembler_debug-variant-discriminator_ll 30 Jan 2019 07:36:06 -0000 1.1
+++ devel/llvm/patches/patch-test_Assembler_debug-variant-discriminator_ll 29 Jun 2019 06:45:28 -0000
@@ -3,7 +3,10 @@ https://github.com/llvm-mirror/llvm/comm
 Index: test/Assembler/debug-variant-discriminator.ll
 --- test/Assembler/debug-variant-discriminator.ll.orig
 +++ test/Assembler/debug-variant-discriminator.ll
-@@ -0,0 +1,14 @@
+@@ -12,3 +12,17 @@
+ !1 = !DICompositeType(tag: DW_TAG_variant_part, scope: !0, size: 64, discriminator: !2)
+ !2 = !DIDerivedType(tag: DW_TAG_member, scope: !1, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial)
+ !3 = !DIBasicType(name: "u64", size: 64, encoding: DW_ATE_unsigned)
 +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
 +; RUN: verify-uselistorder %s
 +
Index: devel/llvm/patches/patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h
diff -N devel/llvm/patches/patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h
--- devel/llvm/patches/patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h 14 Jan 2019 16:08:45 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-$OpenBSD: patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h,v 1.1 2019/01/14 16:08:45 jca Exp $
-
-The %b printf extension in the kernel is not fixed to a int type. On sparc64
-there are various %llb formats. Adjust the code to handle the length specifiers
-and type check like it is used by the regular case.
-
-Index: tools/clang/include/clang/Analysis/Analyses/FormatString.h
---- tools/clang/include/clang/Analysis/Analyses/FormatString.h.orig
-+++ tools/clang/include/clang/Analysis/Analyses/FormatString.h
-@@ -227,8 +227,10 @@ class ConversionSpecifier { (public)
-
-   bool isIntArg() const { return (kind >= IntArgBeg && kind <= IntArgEnd) ||
-     kind == FreeBSDrArg || kind == FreeBSDyArg; }
--  bool isUIntArg() const { return kind >= UIntArgBeg && kind <= UIntArgEnd; }
--  bool isAnyIntArg() const { return kind >= IntArgBeg && kind <= UIntArgEnd; }
-+  bool isUIntArg() const { return (kind >= UIntArgBeg && kind <= UIntArgEnd) ||
-+    kind == FreeBSDbArg; }
-+  bool isAnyIntArg() const { return (kind >= IntArgBeg && kind <= UIntArgEnd) ||
-+    kind == FreeBSDbArg; }
-   bool isDoubleArg() const {
-     return kind >= DoubleArgBeg && kind <= DoubleArgEnd;
-   }
Index: devel/llvm/patches/patch-tools_clang_include_clang_Basic_CodeGenOptions_def
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_include_clang_Basic_CodeGenOptions_def
diff -N devel/llvm/patches/patch-tools_clang_include_clang_Basic_CodeGenOptions_def
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ devel/llvm/patches/patch-tools_clang_include_clang_Basic_CodeGenOptions_def 29 Jun 2019 06:45:28 -0000
@@ -0,0 +1,33 @@
+$OpenBSD$
+
+Add RETGUARD to clang for amd64. This security mechanism uses per-function
+random cookies to protect access to function return instructions, with the
+effect that the integrity of the return address is protected, and function
+return instructions are harder to use in ROP gadgets.
+
+On function entry the return address is combined with a per-function random
+cookie and stored in the stack frame. The integrity of this value is verified
+before function return, and if this check fails, the program aborts. In this way
+RETGUARD is an improved stack protector, since the cookies are per-function. The
+verification routine is constructed such that the binary space immediately
+before each ret instruction is padded with int03 instructions, which makes these
+return instructions difficult to use in ROP gadgets. In the kernel, this has the
+effect of removing approximately 50% of total ROP gadgets, and 15% of unique
+ROP gadgets compared to the 6.3 release kernel. Function epilogues are
+essentially gadget free, leaving only the polymorphic gadgets that result from
+jumping into the instruction stream partway through other instructions. Work to
+remove these gadgets will continue through other mechanisms.
+
+Index: tools/clang/include/clang/Basic/CodeGenOptions.def
+--- tools/clang/include/clang/Basic/CodeGenOptions.def.orig
++++ tools/clang/include/clang/Basic/CodeGenOptions.def
+@@ -286,6 +286,9 @@ VALUE_CODEGENOPT(NumRegisterParameters, 32, 0)
+ /// The lower bound for a buffer to be considered for stack protection.
+ VALUE_CODEGENOPT(SSPBufferSize, 32, 0)
+
++/// Whether to use return protectors
++CODEGENOPT(ReturnProtector, 1, 0)
++
+ /// The kind of generated debug info.
+ ENUM_CODEGENOPT(DebugInfo, codegenoptions::DebugInfoKind, 3, codegenoptions::NoDebugInfo)
+
Index: devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td,v
retrieving revision 1.6
diff -u -p -r1.6 patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td
--- devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td 28 Jan 2019 06:27:28 -0000 1.6
+++ devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td 29 Jun 2019 06:45:28 -0000
@@ -2,7 +2,7 @@ $OpenBSD: patch-tools_clang_include_clan
 
 - Disable -Waddress-of-packed-member by default.
 
-While these warnings have the potential to be useful, there are too manu
+While these warnings have the potential to be useful, there are too many
 false positives right now.
 
 - Disable -Wpointer-sign warnings per default
@@ -12,7 +12,7 @@ base gcc does the same.
 Index: tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
 --- tools/clang/include/clang/Basic/DiagnosticSemaKinds.td.orig
 +++ tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
-@@ -5827,7 +5827,7 @@ def warn_pointer_indirection_from_incompatible_type :
+@@ -5857,7 +5857,7 @@ def warn_pointer_indirection_from_incompatible_type :
    InGroup<UndefinedReinterpretCast>, DefaultIgnore;
  def warn_taking_address_of_packed_member : Warning<
    "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
@@ -21,7 +21,7 @@ Index: tools/clang/include/clang/Basic/D
 
  def err_objc_object_assignment : Error<
    "cannot assign to class object (%0 invalid)">;
-@@ -6804,7 +6804,7 @@ def ext_typecheck_convert_incompatible_pointer_sign :
+@@ -6841,7 +6841,7 @@ def ext_typecheck_convert_incompatible_pointer_sign :
    "sending to parameter of different type}0,1"
    "|%diff{casting $ to type $|casting between types}0,1}2"
    " converts between pointers to integer types with different sign">,
Index: devel/llvm/patches/patch-tools_clang_include_clang_Driver_CC1Options_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_include_clang_Driver_CC1Options_td,v
retrieving revision 1.2
diff -u -p -r1.2 patch-tools_clang_include_clang_Driver_CC1Options_td
--- devel/llvm/patches/patch-tools_clang_include_clang_Driver_CC1Options_td 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-tools_clang_include_clang_Driver_CC1Options_td 29 Jun 2019 06:45:28 -0000
@@ -21,7 +21,7 @@ remove these gadgets will continue throu
 Index: tools/clang/include/clang/Driver/CC1Options.td
 --- tools/clang/include/clang/Driver/CC1Options.td.orig
 +++ tools/clang/include/clang/Driver/CC1Options.td
-@@ -676,6 +676,8 @@ def stack_protector : Separate<["-"], "stack-protector
+@@ -699,6 +699,8 @@ def stack_protector : Separate<["-"], "stack-protector
    HelpText<"Enable stack protectors">;
  def stack_protector_buffer_size : Separate<["-"], "stack-protector-buffer-size">,
    HelpText<"Lower bound for a buffer to be considered for stack protection">;
Index: devel/llvm/patches/patch-tools_clang_include_clang_Driver_Options_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_include_clang_Driver_Options_td,v
retrieving revision 1.18
diff -u -p -r1.18 patch-tools_clang_include_clang_Driver_Options_td
--- devel/llvm/patches/patch-tools_clang_include_clang_Driver_Options_td 24 Feb 2019 20:53:56 -0000 1.18
+++ devel/llvm/patches/patch-tools_clang_include_clang_Driver_Options_td 29 Jun 2019 06:45:28 -0000
@@ -8,10 +8,10 @@ $OpenBSD: patch-tools_clang_include_clan
 Index: tools/clang/include/clang/Driver/Options.td
 --- tools/clang/include/clang/Driver/Options.td.orig
 +++ tools/clang/include/clang/Driver/Options.td
-@@ -1595,6 +1595,14 @@ def fstack_protector_strong : Flag<["-"], "fstack-prot
-   HelpText<"Use a strong heuristic to apply stack protectors to functions">;
- def fstack_protector : Flag<["-"], "fstack-protector">, Group<f_Group>,
-   HelpText<"Enable stack protectors for functions potentially vulnerable to stack smashing">;
+@@ -1665,6 +1665,14 @@ def ftrivial_auto_var_init : Joined<["-"], "ftrivial-a
+ def enable_trivial_var_init_zero : Joined<["-"], "enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang">,
+   Flags<[CC1Option]>,
+   HelpText<"Trivial automatic variable initialization to zero is only here for benchmarks, it'll eventually be removed, and I'm OK with that because I'm only using it to benchmark">;
 +def fno_ret_protector : Flag<["-"], "fno-ret-protector">, Group<f_Group>,
 +  HelpText<"Disable return protector">;
 +def fret_protector : Flag<["-"], "fret-protector">, Group<f_Group>,
@@ -23,7 +23,7 @@ Index: tools/clang/include/clang/Driver/
  def fstandalone_debug : Flag<["-"], "fstandalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
    HelpText<"Emit full debug info for all types used by the program">;
  def fno_standalone_debug : Flag<["-"], "fno-standalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
-@@ -2359,7 +2367,7 @@ def pthreads : Flag<["-"], "pthreads">;
+@@ -2500,7 +2508,7 @@ def pthreads : Flag<["-"], "pthreads">;
  def pthread : Flag<["-"], "pthread">, Flags<[CC1Option]>,
    HelpText<"Support POSIX threads in generated code">;
  def no_pthread : Flag<["-"], "no-pthread">, Flags<[CC1Option]>;
@@ -32,8 +32,8 @@ Index: tools/clang/include/clang/Driver/
  def pie : Flag<["-"], "pie">;
  def read__only__relocs : Separate<["-"], "read_only_relocs">;
  def remap : Flag<["-"], "remap">;
-@@ -2810,6 +2818,8 @@ def mretpoline : Flag<["-"], "mretpoline">, Group<m_x8
- def mno_retpoline : Flag<["-"], "mno-retpoline">, Group<m_x86_Features_Group>;
+@@ -2949,6 +2957,8 @@ def mshstk : Flag<["-"], "mshstk">, Group<m_x86_Featur
+ def mno_shstk : Flag<["-"], "mno-shstk">, Group<m_x86_Features_Group>;
  def mretpoline_external_thunk : Flag<["-"], "mretpoline-external-thunk">, Group<m_x86_Features_Group>;
  def mno_retpoline_external_thunk : Flag<["-"], "mno-retpoline-external-thunk">, Group<m_x86_Features_Group>;
 +def msave_args : Flag<["-"], "msave-args">, Group<m_x86_Features_Group>;
Index: devel/llvm/patches/patch-tools_clang_include_clang_Frontend_CodeGenOptions_def
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_include_clang_Frontend_CodeGenOptions_def
diff -N devel/llvm/patches/patch-tools_clang_include_clang_Frontend_CodeGenOptions_def
--- devel/llvm/patches/patch-tools_clang_include_clang_Frontend_CodeGenOptions_def 28 Jan 2019 06:27:28 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-$OpenBSD: patch-tools_clang_include_clang_Frontend_CodeGenOptions_def,v 1.2 2019/01/28 06:27:28 jca Exp $
-
-Add RETGUARD to clang for amd64. This security mechanism uses per-function
-random cookies to protect access to function return instructions, with the
-effect that the integrity of the return address is protected, and function
-return instructions are harder to use in ROP gadgets.
-
-On function entry the return address is combined with a per-function random
-cookie and stored in the stack frame. The integrity of this value is verified
-before function return, and if this check fails, the program aborts. In this way
-RETGUARD is an improved stack protector, since the cookies are per-function. The
-verification routine is constructed such that the binary space immediately
-before each ret instruction is padded with int03 instructions, which makes these
-return instructions difficult to use in ROP gadgets. In the kernel, this has the
-effect of removing approximately 50% of total ROP gadgets, and 15% of unique
-ROP gadgets compared to the 6.3 release kernel. Function epilogues are
-essentially gadget free, leaving only the polymorphic gadgets that result from
-jumping into the instruction stream partway through other instructions. Work to
-remove these gadgets will continue through other mechanisms.
-
-Index: tools/clang/include/clang/Frontend/CodeGenOptions.def
---- tools/clang/include/clang/Frontend/CodeGenOptions.def.orig
-+++ tools/clang/include/clang/Frontend/CodeGenOptions.def
-@@ -274,6 +274,9 @@ VALUE_CODEGENOPT(NumRegisterParameters, 32, 0)
- /// The lower bound for a buffer to be considered for stack protection.
- VALUE_CODEGENOPT(SSPBufferSize, 32, 0)
-
-+/// Whether to use return protectors
-+CODEGENOPT(ReturnProtector, 1, 0)
-+
- /// The kind of generated debug info.
- ENUM_CODEGENOPT(DebugInfo, codegenoptions::DebugInfoKind, 3, codegenoptions::NoDebugInfo)
-
Index: devel/llvm/patches/patch-tools_clang_include_clang_Sema_Sema_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_include_clang_Sema_Sema_h,v
retrieving revision 1.4
diff -u -p -r1.4 patch-tools_clang_include_clang_Sema_Sema_h
--- devel/llvm/patches/patch-tools_clang_include_clang_Sema_Sema_h 28 Jan 2019 06:27:28 -0000 1.4
+++ devel/llvm/patches/patch-tools_clang_include_clang_Sema_Sema_h 29 Jun 2019 06:45:28 -0000
@@ -5,7 +5,7 @@ Teach Clang about syslog format attribut
 Index: tools/clang/include/clang/Sema/Sema.h
 --- tools/clang/include/clang/Sema/Sema.h.orig
 +++ tools/clang/include/clang/Sema/Sema.h
-@@ -10454,6 +10454,7 @@ class Sema { (public)
+@@ -10561,6 +10561,7 @@ class Sema { (public)
      FST_FreeBSDKPrintf,
      FST_OSTrace,
      FST_OSLog,
Index: devel/llvm/patches/patch-tools_clang_lib_Analysis_FormatString_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Analysis_FormatString_cpp
diff -N devel/llvm/patches/patch-tools_clang_lib_Analysis_FormatString_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Analysis_FormatString_cpp 14 Jan 2019 16:08:45 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,39 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Analysis_FormatString_cpp,v 1.1 2019/01/14 16:08:45 jca Exp $
-
-The %b printf extension in the kernel is not fixed to a int type. On sparc64
-there are various %llb formats. Adjust the code to handle the length specifiers
-and type check like it is used by the regular case.
-
-Index: tools/clang/lib/Analysis/FormatString.cpp
---- tools/clang/lib/Analysis/FormatString.cpp.orig
-+++ tools/clang/lib/Analysis/FormatString.cpp
-@@ -706,6 +706,10 @@ bool FormatSpecifier::hasValidLengthModifier(const Tar
-         case ConversionSpecifier::XArg:
-         case ConversionSpecifier::nArg:
-           return true;
-+        case ConversionSpecifier::FreeBSDbArg:
-+          return Target.getTriple().isOSFreeBSD() ||
-+                 Target.getTriple().isPS4() ||
-+                 Target.getTriple().isOSOpenBSD();
-         case ConversionSpecifier::FreeBSDrArg:
-         case ConversionSpecifier::FreeBSDyArg:
-           return Target.getTriple().isOSFreeBSD() || Target.getTriple().isPS4();
-@@ -739,6 +743,10 @@ bool FormatSpecifier::hasValidLengthModifier(const Tar
-         case ConversionSpecifier::ScanListArg:
-         case ConversionSpecifier::ZArg:
-           return true;
-+        case ConversionSpecifier::FreeBSDbArg:
-+          return Target.getTriple().isOSFreeBSD() ||
-+                 Target.getTriple().isPS4() ||
-+                 Target.getTriple().isOSOpenBSD();
-         case ConversionSpecifier::FreeBSDrArg:
-         case ConversionSpecifier::FreeBSDyArg:
-           return Target.getTriple().isOSFreeBSD() || Target.getTriple().isPS4();
-@@ -897,6 +905,7 @@ bool FormatSpecifier::hasStandardLengthConversionCombi
-         case ConversionSpecifier::uArg:
-         case ConversionSpecifier::xArg:
-         case ConversionSpecifier::XArg:
-+        case ConversionSpecifier::FreeBSDbArg:
-           return false;
-         default:
-           return true;
Index: devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_PPC_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_PPC_h
diff -N devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_PPC_h
--- devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_PPC_h 11 Feb 2019 05:33:57 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Basic_Targets_PPC_h,v 1.1 2019/02/11 05:33:57 jca Exp $
-
-long double is double on OpenBSD/NetBSD/PPC.
-
-Index: tools/clang/lib/Basic/Targets/PPC.h
---- tools/clang/lib/Basic/Targets/PPC.h.orig
-+++ tools/clang/lib/Basic/Targets/PPC.h
-@@ -328,9 +328,15 @@ class LLVM_LIBRARY_VISIBILITY PPC32TargetInfo : public
-       break;
-     }
-
--    if (getTriple().getOS() == llvm::Triple::FreeBSD) {
-+    switch (getTriple().getOS()) {
-+    case llvm::Triple::FreeBSD:
-+    case llvm::Triple::NetBSD:
-+    case llvm::Triple::OpenBSD:
-       LongDoubleWidth = LongDoubleAlign = 64;
-       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
-+      break;
-+    default:
-+      break;
-     }
-
-     // PPC32 supports atomics up to 4 bytes.
Index: devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_clang_lib_Basic_Targets_X86_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_cpp 11 Feb 2019 05:24:16 -0000 1.3
+++ devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_cpp 29 Jun 2019 06:45:28 -0000
@@ -5,7 +5,7 @@ implement -msave-args in clang/llvm, lik
 Index: tools/clang/lib/Basic/Targets/X86.cpp
 --- tools/clang/lib/Basic/Targets/X86.cpp.orig
 +++ tools/clang/lib/Basic/Targets/X86.cpp
-@@ -814,6 +814,8 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<s
+@@ -817,6 +817,8 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<s
        HasPTWRITE = true;
      } else if (Feature == "+invpcid") {
        HasINVPCID = true;
@@ -14,7 +14,7 @@ Index: tools/clang/lib/Basic/Targets/X86
      }
 
      X86SSEEnum Level = llvm::StringSwitch<X86SSEEnum>(Feature)
-@@ -1386,6 +1388,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) cons
+@@ -1398,6 +1400,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) cons
        .Case("movdiri", HasMOVDIRI)
        .Case("movdir64b", HasMOVDIR64B)
        .Case("mpx", HasMPX)
Index: devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_h,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_clang_lib_Basic_Targets_X86_h
--- devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_h 11 Feb 2019 05:24:16 -0000 1.3
+++ devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_h 29 Jun 2019 06:45:28 -0000
@@ -5,7 +5,7 @@ implement -msave-args in clang/llvm, lik
 Index: tools/clang/lib/Basic/Targets/X86.h
 --- tools/clang/lib/Basic/Targets/X86.h.orig
 +++ tools/clang/lib/Basic/Targets/X86.h
-@@ -107,6 +107,7 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public T
+@@ -106,6 +106,7 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public T
    bool HasMOVDIR64B = false;
    bool HasPTWRITE = false;
    bool HasINVPCID = false;
Index: devel/llvm/patches/patch-tools_clang_lib_CodeGen_CGCall_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_CodeGen_CGCall_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-tools_clang_lib_CodeGen_CGCall_cpp
--- devel/llvm/patches/patch-tools_clang_lib_CodeGen_CGCall_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-tools_clang_lib_CodeGen_CGCall_cpp 29 Jun 2019 06:45:28 -0000
@@ -21,14 +21,13 @@ remove these gadgets will continue throu
 Index: tools/clang/lib/CodeGen/CGCall.cpp
 --- tools/clang/lib/CodeGen/CGCall.cpp.orig
 +++ tools/clang/lib/CodeGen/CGCall.cpp
-@@ -1936,6 +1936,10 @@ void CodeGenModule::ConstructAttributeList(
-
+@@ -1958,6 +1958,9 @@ void CodeGenModule::ConstructAttributeList(
      FuncAttrs.addAttribute("disable-tail-calls",
                             llvm::toStringRef(DisableTailCalls));
+     GetCPUAndFeaturesAttributes(CalleeInfo.getCalleeDecl(), FuncAttrs);
 +
 +    if (CodeGenOpts.ReturnProtector)
 +      FuncAttrs.addAttribute("ret-protector");
-+
-     GetCPUAndFeaturesAttributes(TargetDecl, FuncAttrs);
    }
 
+   ClangToLLVMArgMapping IRFunctionArgs(getContext(), FI);
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp 29 Jun 2019 06:45:28 -0000
@@ -5,17 +5,7 @@ Make LLVM create strict aligned code for
 Index: tools/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
 --- tools/clang/lib/Driver/ToolChains/Arch/AArch64.cpp.orig
 +++ tools/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
-@@ -152,7 +152,8 @@ getAArch64MicroArchFeaturesFromMcpu(const Driver &D, S
-   return getAArch64MicroArchFeaturesFromMtune(D, CPU, Args, Features);
- }
-
--void aarch64::getAArch64TargetFeatures(const Driver &D, const ArgList &Args,
-+void aarch64::getAArch64TargetFeatures(const Driver &D, const llvm::Triple &Triple,
-+                                       const ArgList &Args,
-                                        std::vector<StringRef> &Features) {
-   Arg *A;
-   bool success = true;
-@@ -194,9 +195,11 @@ void aarch64::getAArch64TargetFeatures(const Driver &D
+@@ -311,9 +311,11 @@ fp16_fml_fallthrough:
    }
 
    if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access,
@@ -26,5 +16,5 @@ Index: tools/clang/lib/Driver/ToolChains
 +  } else if (Triple.isOSOpenBSD())
 +    Features.push_back("+strict-align");
 
-   if (Args.hasArg(options::OPT_ffixed_x18))
-     Features.push_back("+reserve-x18");
+   if (Args.hasArg(options::OPT_ffixed_x1))
+     Features.push_back("+reserve-x1");
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h
diff -N devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h 1 Sep 2017 06:40:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h,v 1.1 2017/09/01 06:40:28 ajacoutot Exp $
-
-Make LLVM create strict aligned code for OpenBSD/arm64.
-
---- tools/clang/lib/Driver/ToolChains/Arch/AArch64.h.orig Sun Apr  2 02:26:33 2017
-+++ tools/clang/lib/Driver/ToolChains/Arch/AArch64.h Sun Apr  2 02:29:49 2017
-@@ -21,7 +21,8 @@ namespace driver {
- namespace tools {
- namespace aarch64 {
-
--void getAArch64TargetFeatures(const Driver &D, const llvm::opt::ArgList &Args,
-+void getAArch64TargetFeatures(const Driver &D, const llvm::Triple &Triple,
-+                              const llvm::opt::ArgList &Args,
-                               std::vector<llvm::StringRef> &Features);
-
- std::string getAArch64TargetCPU(const llvm::opt::ArgList &Args,
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Clang_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Clang_cpp,v
retrieving revision 1.8
diff -u -p -r1.8 patch-tools_clang_lib_Driver_ToolChains_Clang_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Clang_cpp 24 Feb 2019 20:53:56 -0000 1.8
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Clang_cpp 29 Jun 2019 06:45:28 -0000
@@ -32,16 +32,7 @@ $OpenBSD: patch-tools_clang_lib_Driver_T
 Index: tools/clang/lib/Driver/ToolChains/Clang.cpp
 --- tools/clang/lib/Driver/ToolChains/Clang.cpp.orig
 +++ tools/clang/lib/Driver/ToolChains/Clang.cpp
-@@ -341,7 +341,7 @@ static void getTargetFeatures(const ToolChain &TC, con
-     break;
-   case llvm::Triple::aarch64:
-   case llvm::Triple::aarch64_be:
--    aarch64::getAArch64TargetFeatures(D, Args, Features);
-+    aarch64::getAArch64TargetFeatures(D, Triple, Args, Features);
-     break;
-   case llvm::Triple::x86:
-   case llvm::Triple::x86_64:
-@@ -3478,9 +3478,12 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+@@ -3893,9 +3893,12 @@ void Clang::ConstructJob(Compilation &C, const JobActi
        OFastEnabled ? options::OPT_Ofast : options::OPT_fstrict_aliasing;
    // We turn strict aliasing off by default if we're in CL mode, since MSVC
    // doesn't do any TBAA.
@@ -56,19 +47,22 @@ Index: tools/clang/lib/Driver/ToolChains
      CmdArgs.push_back("-relaxed-aliasing");
    if (!Args.hasFlag(options::OPT_fstruct_path_tbaa,
                      options::OPT_fno_struct_path_tbaa))
-@@ -4086,7 +4089,8 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+@@ -4521,7 +4524,8 @@ void Clang::ConstructJob(Compilation &C, const JobActi
                                        options::OPT_fno_strict_overflow)) {
      if (A->getOption().matches(options::OPT_fno_strict_overflow))
        CmdArgs.push_back("-fwrapv");
 -  }
 +  } else if (getToolChain().getTriple().isOSOpenBSD())
-+      CmdArgs.push_back("-fwrapv");
++    CmdArgs.push_back("-fwrapv");
 
    if (Arg *A = Args.getLastArg(options::OPT_freroll_loops,
                                 options::OPT_fno_reroll_loops))
-@@ -4101,6 +4105,34 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+@@ -4538,9 +4542,44 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+                    false))
+     CmdArgs.push_back(Args.MakeArgString("-mspeculative-load-hardening"));
 
-   RenderSSPOptions(getToolChain(), Args, CmdArgs, KernelOrKext);
+-  RenderSSPOptions(TC, Args, CmdArgs, KernelOrKext);
+   RenderTrivialAutoVarInitOptions(D, TC, Args, CmdArgs);
 
 +  // -ret-protector
 +  unsigned RetProtector = 1;
@@ -85,7 +79,15 @@ Index: tools/clang/lib/Driver/ToolChains
 +      !Args.hasArg(options::OPT_fno_stack_protector) &&
 +      !Args.hasArg(options::OPT_pg)) {
 +    CmdArgs.push_back(Args.MakeArgString("-D_RET_PROTECTOR"));
-+    CmdArgs.push_back(Args.MakeArgString(Twine("-ret-protector")));
++    CmdArgs.push_back(Args.MakeArgString("-ret-protector"));
++    // Consume the stack protector arguments to prevent warning
++    Args.getLastArg(options::OPT_fstack_protector_all,
++        options::OPT_fstack_protector_strong,
++        options::OPT_fstack_protector,
++        options::OPT__param); // ssp-buffer-size
++  } else {
++    // If we're not using retguard, then do the usual stack protector
++    RenderSSPOptions(getToolChain(), Args, CmdArgs, KernelOrKext);
 +  }
 +
 +  // -fixup-gadgets
@@ -101,11 +103,10 @@ Index: tools/clang/lib/Driver/ToolChains
    // Translate -mstackrealign
    if (Args.hasFlag(options::OPT_mstackrealign, options::OPT_mno_stackrealign,
                     false))
-@@ -4579,6 +4611,18 @@ void Clang::ConstructJob(Compilation &C, const JobActi
-       llvm::sys::path::replace_extension(F, "opt.yaml");
-       CmdArgs.push_back(Args.MakeArgString(F));
-     }
-+  }
+@@ -5023,6 +5062,18 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+                                      options::OPT_fno_rewrite_imports, false);
+   if (RewriteImports)
+     CmdArgs.push_back("-frewrite-imports");
 +
 +  // Disable some builtins on OpenBSD because they are just not
 +  // right...
@@ -117,6 +118,7 @@ Index: tools/clang/lib/Driver/ToolChains
 +    CmdArgs.push_back("-fno-builtin-free");
 +    CmdArgs.push_back("-fno-builtin-strdup");
 +    CmdArgs.push_back("-fno-builtin-strndup");
-   }
++  }
 
-   bool RewriteImports = Args.hasFlag(options::OPT_frewrite_imports,
+   // Enable rewrite includes if the user's asked for it or if we're generating
+   // diagnostics.
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp 28 Jan 2019 06:27:28 -0000 1.6
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp 29 Jun 2019 06:45:28 -0000
@@ -1,30 +1,16 @@
 $OpenBSD: patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp,v 1.6 2019/01/28 06:27:28 jca Exp $
 
-- [mips] Enable using of integrated assembler in all cases.
-- Enable IAS for OpenBSD SPARC.
+- Disable IAS for OpenBSD SPARC.
 
 Index: tools/clang/lib/Driver/ToolChains/Gnu.cpp
 --- tools/clang/lib/Driver/ToolChains/Gnu.cpp.orig
 +++ tools/clang/lib/Driver/ToolChains/Gnu.cpp
-@@ -2412,16 +2412,13 @@ bool Generic_GCC::IsIntegratedAssemblerDefault() const
-   case llvm::Triple::systemz:
-   case llvm::Triple::mips:
-   case llvm::Triple::mipsel:
--    return true;
-   case llvm::Triple::mips64:
-   case llvm::Triple::mips64el:
--    // Enabled for Debian, Android, FreeBSD and OpenBSD mips64/mipsel, as they
--    // can precisely identify the ABI in use (Debian) or only use N64 for MIPS64
--    // (Android). Other targets are unable to distinguish N32 from N64.
--    if (getTriple().getEnvironment() == llvm::Triple::GNUABI64 ||
--        getTriple().isAndroid() ||
--        getTriple().isOSFreeBSD() ||
--        getTriple().isOSOpenBSD())
-+    return true;
-+  case llvm::Triple::sparc:
-+  case llvm::Triple::sparcel:
-+  case llvm::Triple::sparcv9:
-+    if (getTriple().isOSSolaris() || getTriple().isOSOpenBSD())
+@@ -2512,7 +2512,7 @@ bool Generic_GCC::IsIntegratedAssemblerDefault() const
+   case llvm::Triple::sparc:
+   case llvm::Triple::sparcel:
+   case llvm::Triple::sparcv9:
+-    if (getTriple().isOSSolaris() || getTriple().isOSOpenBSD())
++    if (getTriple().isOSSolaris())
        return true;
      return false;
    default:
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp,v
retrieving revision 1.8
diff -u -p -r1.8 patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp 28 Jan 2019 15:34:22 -0000 1.8
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp 29 Jun 2019 06:45:28 -0000
@@ -14,161 +14,27 @@ Index: tools/clang/lib/Driver/ToolChains
  #include "clang/Driver/Options.h"
  #include "clang/Driver/SanitizerArgs.h"
  #include "llvm/Option/ArgList.h"
-@@ -111,9 +113,9 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
-   // handled somewhere else.
-   Args.ClaimAllArgs(options::OPT_w);
-
--  if (getToolChain().getArch() == llvm::Triple::mips64)
-+  if (ToolChain.getArch() == llvm::Triple::mips64)
-     CmdArgs.push_back("-EB");
--  else if (getToolChain().getArch() == llvm::Triple::mips64el)
-+  else if (ToolChain.getArch() == llvm::Triple::mips64el)
-     CmdArgs.push_back("-EL");
-
-   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_shared)) {
-@@ -149,44 +151,50 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
-   }
-
-   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
-+    const char *crt0 = nullptr;
-+    const char *crtbegin = nullptr;
-     if (!Args.hasArg(options::OPT_shared)) {
-       if (Args.hasArg(options::OPT_pg))
--        CmdArgs.push_back(
--            Args.MakeArgString(getToolChain().GetFilePath("gcrt0.o")));
-+        crt0 = "gcrt0.o";
-       else if (Args.hasArg(options::OPT_static) &&
-                !Args.hasArg(options::OPT_nopie))
--        CmdArgs.push_back(
--            Args.MakeArgString(getToolChain().GetFilePath("rcrt0.o")));
-+        crt0 = "rcrt0.o";
-       else
--        CmdArgs.push_back(
--            Args.MakeArgString(getToolChain().GetFilePath("crt0.o")));
--      CmdArgs.push_back(
--          Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
-+        crt0 = "crt0.o";
-+      crtbegin = "crtbegin.o";
-     } else {
--      CmdArgs.push_back(
--          Args.MakeArgString(getToolChain().GetFilePath("crtbeginS.o")));
-+      crtbegin = "crtbeginS.o";
-     }
-+
-+    if (crt0)
-+      CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt0)));
-+    CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
-   }
-
--  std::string Triple = getToolChain().getTripleString();
--  if (Triple.substr(0, 6) == "x86_64")
--    Triple.replace(0, 6, "amd64");
--  CmdArgs.push_back(
--      Args.MakeArgString("-L/usr/lib/gcc-lib/" + Triple + "/4.2.1"));
--  CmdArgs.push_back(Args.MakeArgString("-L/usr/lib"));
-+  if (ToolChain.GetCXXStdlibType(Args) == ToolChain::CST_Libstdcxx) {
-+    std::string Triple = ToolChain.getTripleString();
-+    if (Triple.substr(0, 6) == "x86_64")
-+      Triple.replace(0, 6, "amd64");
-+    CmdArgs.push_back(
-+        Args.MakeArgString("-L${LOCALBASE}/lib/gcc/" + Triple + "/${GCC_VER}"));
-+    CmdArgs.push_back(
-+        Args.MakeArgString("-L${LOCALBASE}/lib"));
-+  }
-
--  Args.AddAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group,
--                            options::OPT_e, options::OPT_s, options::OPT_t,
-+  Args.AddAllArgs(CmdArgs, options::OPT_L);
-+  ToolChain.AddFilePathLibArgs(Args, CmdArgs);
-+  Args.AddAllArgs(CmdArgs, {options::OPT_T_Group, options::OPT_e,
-+                            options::OPT_s, options::OPT_t,
-                             options::OPT_Z_Flag, options::OPT_r});
-
-   bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
-   bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
--  AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
-+  AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
-
-   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
-     if (D.CCCIsCXX()) {
--      if (getToolChain().ShouldLinkCXXStdlib(Args))
--        getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
-+      if (ToolChain.ShouldLinkCXXStdlib(Args))
-+        ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
-       if (Args.hasArg(options::OPT_pg))
-         CmdArgs.push_back("-lm_p");
-       else
-@@ -202,7 +210,10 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
-     }
-     // FIXME: For some reason GCC passes -lgcc before adding
-     // the default system libraries. Just mimic this for now.
--    CmdArgs.push_back("-lgcc");
-+    if (ToolChain.GetCXXStdlibType(Args) == ToolChain::CST_Libcxx)
-+      CmdArgs.push_back("-lcompiler_rt");
-+    else
-+      CmdArgs.push_back("-lgcc");
-
-     if (Args.hasArg(options::OPT_pthread)) {
-       if (!Args.hasArg(options::OPT_shared) && Args.hasArg(options::OPT_pg))
-@@ -218,21 +229,25 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
-         CmdArgs.push_back("-lc");
-     }
-
--    CmdArgs.push_back("-lgcc");
-+    if (ToolChain.GetCXXStdlibType(Args) == ToolChain::CST_Libcxx)
-+      CmdArgs.push_back("-lcompiler_rt");
-+    else
-+      CmdArgs.push_back("-lgcc");
-   }
-
-   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
-+    const char *crtend = nullptr;
-     if (!Args.hasArg(options::OPT_shared))
--      CmdArgs.push_back(
--          Args.MakeArgString(getToolChain().GetFilePath("crtend.o")));
-+      crtend = "crtend.o";
-     else
--      CmdArgs.push_back(
--          Args.MakeArgString(getToolChain().GetFilePath("crtendS.o")));
-+      crtend = "crtendS.o";
-+
-+    CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));
-   }
-
-   const char *Exec = Args.MakeArgString(
--      !NeedsSanitizerDeps ? getToolChain().GetLinkerPath()
--                          : getToolChain().GetProgramPath("ld.lld"));
-+      !NeedsSanitizerDeps ? ToolChain.GetLinkerPath()
-+                          : ToolChain.GetProgramPath("ld.lld"));
-   C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
- }
-
-@@ -257,16 +272,60 @@ SanitizerMask OpenBSD::getSupportedSanitizers() const
+@@ -252,19 +254,82 @@ SanitizerMask OpenBSD::getSupportedSanitizers() const
  OpenBSD::OpenBSD(const Driver &D, const llvm::Triple &Triple,
                   const ArgList &Args)
      : Generic_ELF(D, Triple, Args) {
--  getFilePaths().push_back(getDriver().Dir + "/../lib");
--  getFilePaths().push_back("/usr/lib");
-+  getFilePaths().push_back(getDriver().SysRoot + "/usr/lib");
++  getFilePaths().push_back(getDriver().Dir + "/../lib");
+   getFilePaths().push_back(getDriver().SysRoot + "/usr/lib");
  }
 
- void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
-                                   ArgStringList &CmdArgs) const {
-   bool Profiling = Args.hasArg(options::OPT_pg);
-
+-void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
+-                                  ArgStringList &CmdArgs) const {
+-  bool Profiling = Args.hasArg(options::OPT_pg);
+-
 -  CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
 -  CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi");
-+  switch (GetCXXStdlibType(Args)) {
-+  case ToolChain::CST_Libcxx:
-+    CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
-+    CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi");
-+    CmdArgs.push_back(Profiling ? "-lpthread_p" : "-lpthread");
-+    break;
-+  case ToolChain::CST_Libstdcxx:
-+    CmdArgs.push_back("-lestdc++");
-+    break;
-+  }
-+}
+-}
+-
+ Tool *OpenBSD::buildAssembler() const {
+   return new tools::openbsd::Assembler(*this);
+ }
+
+ Tool *OpenBSD::buildLinker() const { return new tools::openbsd::Linker(*this); }
 +
 +ToolChain::CXXStdlibType OpenBSD::GetCXXStdlibType(const ArgList &Args) const {
 +  if (Arg *A = Args.getLastArg(options::OPT_stdlib_EQ)) {
@@ -178,10 +44,10 @@ Index: tools/clang/lib/Driver/ToolChains
 +    if (Value == "libc++")
 +      return ToolChain::CST_Libcxx;
 +
-+    getDriver().Diag(diag::err_drv_invalid_stdlib_name) << A->getAsString(Args);
++    getDriver().Diag(clang::diag::err_drv_invalid_stdlib_name)
++        << A->getAsString(Args);
 +  }
-+
-+  switch (getArch()) {
++  switch (getTriple().getArch()) {
 +  case llvm::Triple::arm:
 +  case llvm::Triple::aarch64:
 +  case llvm::Triple::x86:
@@ -194,17 +60,48 @@ Index: tools/clang/lib/Driver/ToolChains
 +  }
 +}
 +
-+void OpenBSD::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
-+                                       llvm::opt::ArgStringList &CC1Args) const {
-+  addLibStdCXXIncludePaths(getDriver().SysRoot,
-+      "${LOCALBASE}/include/c++/${GCC_VER}",
-+      "", "", "", "", DriverArgs, CC1Args);
-+  addLibStdCXXIncludePaths(getDriver().SysRoot,
-+      "${LOCALBASE}/include/c++/${GCC_VER}/${GCC_CONFIG}",
-+      "", "", "", "", DriverArgs, CC1Args);
-+  addLibStdCXXIncludePaths(getDriver().SysRoot,
-+      "${LOCALBASE}/include/c++/${GCC_VER}/backward",
-+      "", "", "", "", DriverArgs, CC1Args);
- }
-
- Tool *OpenBSD::buildAssembler() const {
++void OpenBSD::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
++                                          ArgStringList &CC1Args) const {
++  if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||
++      DriverArgs.hasArg(options::OPT_nostdincxx))
++    return;
++
++  switch (GetCXXStdlibType(DriverArgs)) {
++  case ToolChain::CST_Libcxx:
++    addSystemInclude(DriverArgs, CC1Args,
++                     getDriver().SysRoot + "/usr/include/c++/v1");
++    break;
++  case ToolChain::CST_Libstdcxx:
++    std::string Triple = getTriple().str();
++    if (Triple.substr(0, 6) == "x86_64")
++      Triple.replace(0, 6, "amd64");
++    addSystemInclude(DriverArgs, CC1Args,
++                     getDriver().SysRoot + "${LOCALBASE}/include/c++/${GCC_VER}");
++    addSystemInclude(DriverArgs, CC1Args,
++                     getDriver().SysRoot + "${LOCALBASE}/include/c++/${GCC_VER}/" + Triple);
++    addSystemInclude(DriverArgs, CC1Args,
++                     getDriver().SysRoot + "${LOCALBASE}/include/c++/${GCC_VER}/backward");
++    break;
++  }
++}
++
++void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
++                                 ArgStringList &CmdArgs) const {
++  bool Profiling = Args.hasArg(options::OPT_pg);
++
++  switch (GetCXXStdlibType(Args)) {
++  case ToolChain::CST_Libcxx:
++    CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
++    CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi");
++    CmdArgs.push_back(Profiling ? "-lpthread_p" : "-lpthread");
++    break;
++  case ToolChain::CST_Libstdcxx:
++    std::string Triple = getTriple().str();
++    if (Triple.substr(0, 6) == "x86_64")
++      Triple.replace(0, 6, "amd64");
++    CmdArgs.push_back(Args.MakeArgString("-L${LOCALBASE}/lib/gcc/" + Triple + "/${GCC_VER}"));
++    CmdArgs.push_back(Args.MakeArgString("-L${LOCALBASE}/lib"));
++    CmdArgs.push_back("-lestdc++");
++    break;
++  }
++}
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h 29 Jun 2019 06:45:28 -0000
@@ -2,17 +2,15 @@ $OpenBSD: patch-tools_clang_lib_Driver_T
 Index: tools/clang/lib/Driver/ToolChains/OpenBSD.h
 --- tools/clang/lib/Driver/ToolChains/OpenBSD.h.orig
 +++ tools/clang/lib/Driver/ToolChains/OpenBSD.h
-@@ -58,8 +58,13 @@ class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic
-   bool IsMathErrnoDefault() const override { return false; }
-   bool IsObjCNonFragileABIDefault() const override { return true; }
-   bool isPIEDefault() const override { return true; }
-+
+@@ -69,6 +69,11 @@ class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic
    void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
                             llvm::opt::ArgStringList &CmdArgs) const override;
+
 +  CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
-+  void addLibStdCxxIncludePaths(
++  void AddClangCXXStdlibIncludeArgs(
 +      const llvm::opt::ArgList &DriverArgs,
 +      llvm::opt::ArgStringList &CC1Args) const override;
-
++
    unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
      return 2;
+   }
Index: devel/llvm/patches/patch-tools_clang_lib_Frontend_CompilerInvocation_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Frontend_CompilerInvocation_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-tools_clang_lib_Frontend_CompilerInvocation_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Frontend_CompilerInvocation_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-tools_clang_lib_Frontend_CompilerInvocation_cpp 29 Jun 2019 06:45:28 -0000
@@ -21,7 +21,7 @@ remove these gadgets will continue throu
 Index: tools/clang/lib/Frontend/CompilerInvocation.cpp
 --- tools/clang/lib/Frontend/CompilerInvocation.cpp.orig
 +++ tools/clang/lib/Frontend/CompilerInvocation.cpp
-@@ -978,6 +978,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, Arg
+@@ -1133,6 +1133,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, Arg
      Opts.StackAlignment = StackAlignment;
    }
 
Index: devel/llvm/patches/patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp
diff -N devel/llvm/patches/patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp 28 Jan 2019 15:34:22 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp,v 1.6 2019/01/28 15:34:22 jca Exp $
-
-Index: tools/clang/lib/Frontend/InitHeaderSearch.cpp
---- tools/clang/lib/Frontend/InitHeaderSearch.cpp.orig
-+++ tools/clang/lib/Frontend/InitHeaderSearch.cpp
-@@ -431,14 +431,6 @@ void InitHeaderSearch::AddDefaultCPlusPlusIncludePaths
-   case llvm::Triple::DragonFly:
-     AddPath("/usr/include/c++/5.0", CXXSystem, false);
-     break;
--  case llvm::Triple::OpenBSD: {
--    std::string t = triple.getTriple();
--    if (t.substr(0, 6) == "x86_64")
--      t.replace(0, 6, "amd64");
--    AddGnuCPlusPlusIncludePaths("/usr/include/g++",
--                                t, "", "", triple);
--    break;
--  }
-   case llvm::Triple::Minix:
-     AddGnuCPlusPlusIncludePaths("/usr/gnu/include/c++/4.4.3",
-                                 "", "", "", triple);
Index: devel/llvm/patches/patch-tools_clang_lib_Parse_ParseStmtAsm_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Parse_ParseStmtAsm_cpp
diff -N devel/llvm/patches/patch-tools_clang_lib_Parse_ParseStmtAsm_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Parse_ParseStmtAsm_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,17 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Parse_ParseStmtAsm_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: tools/clang/lib/Parse/ParseStmtAsm.cpp
---- tools/clang/lib/Parse/ParseStmtAsm.cpp.orig
-+++ tools/clang/lib/Parse/ParseStmtAsm.cpp
-@@ -637,7 +637,7 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLo
-   // Filter out "fpsw" and "mxcsr". They aren't valid GCC asm clobber
-   // constraints. Clang always adds fpsr to the clobber list anyway.
-   llvm::erase_if(Clobbers, [](const std::string &C) {
--    return C == "fpsw" || C == "mxcsr";
-+    return C == "fpsr" || C == "mxcsr";
-   });
-
-   // Build the vector of clobber StringRefs.
Index: devel/llvm/patches/patch-tools_clang_lib_Sema_SemaChecking_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Sema_SemaChecking_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-tools_clang_lib_Sema_SemaChecking_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Sema_SemaChecking_cpp 28 Jan 2019 06:27:28 -0000 1.6
+++ devel/llvm/patches/patch-tools_clang_lib_Sema_SemaChecking_cpp 29 Jun 2019 06:45:28 -0000
@@ -9,7 +9,7 @@ $OpenBSD: patch-tools_clang_lib_Sema_Sem
 Index: tools/clang/lib/Sema/SemaChecking.cpp
 --- tools/clang/lib/Sema/SemaChecking.cpp.orig
 +++ tools/clang/lib/Sema/SemaChecking.cpp
-@@ -6431,7 +6431,7 @@ checkFormatStringExpr(Sema &S, const Expr *E, ArrayRef
+@@ -6608,7 +6608,7 @@ checkFormatStringExpr(Sema &S, const Expr *E, ArrayRef
  Sema::FormatStringType Sema::GetFormatStringType(const FormatAttr *Format) {
    return llvm::StringSwitch<FormatStringType>(Format->getType()->getName())
        .Case("scanf", FST_Scanf)
@@ -18,7 +18,7 @@ Index: tools/clang/lib/Sema/SemaChecking
        .Cases("NSString", "CFString", FST_NSString)
        .Case("strftime", FST_Strftime)
        .Case("strfmon", FST_Strfmon)
-@@ -6528,6 +6528,7 @@ bool Sema::CheckFormatArguments(ArrayRef<const Expr *>
+@@ -6705,6 +6705,7 @@ bool Sema::CheckFormatArguments(ArrayRef<const Expr *>
      case FST_Kprintf:
      case FST_FreeBSDKPrintf:
      case FST_Printf:
@@ -26,7 +26,7 @@ Index: tools/clang/lib/Sema/SemaChecking
        Diag(FormatLoc, diag::note_format_security_fixit)
          << FixItHint::CreateInsertion(FormatLoc, "\"%s\", ");
        break;
-@@ -7348,19 +7349,33 @@ CheckPrintfHandler::HandlePrintfSpecifier(const analyz
+@@ -7530,19 +7531,33 @@ CheckPrintfHandler::HandlePrintfSpecifier(const analyz
      // Claim the second argument.
      CoveredArgs.set(argIndex + 1);
 
@@ -37,21 +37,19 @@ Index: tools/clang/lib/Sema/SemaChecking
 -        ArgType(S.Context.IntTy) : ArgType::CPointerTy;
 -    if (AT.isValid() && !AT.matchesType(S.Context, Ex->getType()))
 -      EmitFormatDiagnostic(
--        S.PDiag(diag::warn_format_conversion_argument_type_mismatch)
--        << AT.getRepresentativeTypeName(S.Context) << Ex->getType()
--        << false << Ex->getSourceRange(),
--        Ex->getLocStart(), /*IsStringLocation*/false,
--        getSpecifierRange(startSpecifier, specifierLen));
 +    if (CS.getKind() == ConversionSpecifier::FreeBSDDArg) {
 +      // Type check the first argument (pointer for %D)
 +      const analyze_printf::ArgType &AT = ArgType::CPointerTy;
 +      if (AT.isValid() && !AT.matchesType(S.Context, Ex->getType()))
 +        EmitFormatDiagnostic(
-+          S.PDiag(diag::warn_format_conversion_argument_type_mismatch)
+           S.PDiag(diag::warn_format_conversion_argument_type_mismatch)
+-              << AT.getRepresentativeTypeName(S.Context) << Ex->getType()
+-              << false << Ex->getSourceRange(),
+-          Ex->getBeginLoc(), /*IsStringLocation*/ false,
 +          << AT.getRepresentativeTypeName(S.Context) << Ex->getType()
 +          << false << Ex->getSourceRange(),
-+          Ex->getLocStart(), /*IsStringLocation*/false,
-+          getSpecifierRange(startSpecifier, specifierLen));
++          Ex->getBeginLoc(), /*IsStringLocation*/false,
+           getSpecifierRange(startSpecifier, specifierLen));
 +    } else {
 +      // Check the length modifier for %b
 +      if (!FS.hasValidLengthModifier(S.getASTContext().getTargetInfo()))
@@ -71,7 +69,7 @@ Index: tools/clang/lib/Sema/SemaChecking
      // Type check the second argument (char * for both %b and %D)
      Ex = getDataArg(argIndex + 1);
      const analyze_printf::ArgType &AT2 = ArgType::CStrTy;
-@@ -8079,8 +8094,9 @@ static void CheckFormatString(Sema &S, const FormatStr
+@@ -8277,8 +8292,9 @@ static void CheckFormatString(Sema &S, const FormatStr
    }
 
    if (Type == Sema::FST_Printf || Type == Sema::FST_NSString ||
@@ -83,7 +81,7 @@ Index: tools/clang/lib/Sema/SemaChecking
      CheckPrintfHandler H(
          S, FExpr, OrigFormatExpr, Type, firstDataArg, numDataArgs,
          (Type == Sema::FST_NSString || Type == Sema::FST_OSTrace), Str,
-@@ -8090,7 +8106,7 @@ static void CheckFormatString(Sema &S, const FormatStr
+@@ -8288,7 +8304,7 @@ static void CheckFormatString(Sema &S, const FormatStr
      if (!analyze_format_string::ParsePrintfString(H, Str, Str + StrLen,
                                                    S.getLangOpts(),
                                                    S.Context.getTargetInfo(),
Index: devel/llvm/patches/patch-tools_clang_lib_Sema_SemaDeclAttr_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Sema_SemaDeclAttr_cpp,v
retrieving revision 1.9
diff -u -p -r1.9 patch-tools_clang_lib_Sema_SemaDeclAttr_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Sema_SemaDeclAttr_cpp 28 Jan 2019 06:27:28 -0000 1.9
+++ devel/llvm/patches/patch-tools_clang_lib_Sema_SemaDeclAttr_cpp 29 Jun 2019 06:45:28 -0000
@@ -5,7 +5,7 @@ Teach Clang about syslog format attribut
 Index: tools/clang/lib/Sema/SemaDeclAttr.cpp
 --- tools/clang/lib/Sema/SemaDeclAttr.cpp.orig
 +++ tools/clang/lib/Sema/SemaDeclAttr.cpp
-@@ -3179,6 +3179,7 @@ static FormatAttrKind getFormatAttrKind(StringRef Form
+@@ -3290,6 +3290,7 @@ static FormatAttrKind getFormatAttrKind(StringRef Form
        .Case("freebsd_kprintf", SupportedFormat) // FreeBSD.
        .Case("os_trace", SupportedFormat)
        .Case("os_log", SupportedFormat)
Index: devel/llvm/patches/patch-tools_lld_ELF_Config_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_lld_ELF_Config_h
diff -N devel/llvm/patches/patch-tools_lld_ELF_Config_h
--- devel/llvm/patches/patch-tools_lld_ELF_Config_h 28 Jan 2019 15:34:22 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-tools_lld_ELF_Config_h,v 1.6 2019/01/28 15:34:22 jca Exp $
-
-lld: add -z interpose support
-
-Index: tools/lld/ELF/Config.h
---- tools/lld/ELF/Config.h.orig
-+++ tools/lld/ELF/Config.h
-@@ -182,6 +182,7 @@ struct Configuration {
-   bool ZExecstack;
-   bool ZHazardplt;
-   bool ZInitfirst;
-+  bool ZInterpose;
-   bool ZKeepTextSectionPrefix;
-   bool ZNodelete;
-   bool ZNodlopen;
Index: devel/llvm/patches/patch-tools_lld_ELF_DriverUtils_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_DriverUtils_cpp,v
retrieving revision 1.8
diff -u -p -r1.8 patch-tools_lld_ELF_DriverUtils_cpp
--- devel/llvm/patches/patch-tools_lld_ELF_DriverUtils_cpp 28 Jan 2019 06:27:28 -0000 1.8
+++ devel/llvm/patches/patch-tools_lld_ELF_DriverUtils_cpp 29 Jun 2019 06:45:28 -0000
@@ -5,7 +5,7 @@ Handle the OpenBSD-style major/minor sha
 Index: tools/lld/ELF/DriverUtils.cpp
 --- tools/lld/ELF/DriverUtils.cpp.orig
 +++ tools/lld/ELF/DriverUtils.cpp
-@@ -218,9 +218,35 @@ Optional<std::string> elf::searchLibrary(StringRef Nam
+@@ -219,9 +219,35 @@ Optional<std::string> elf::searchLibrary(StringRef Nam
      return findFromSearchPaths(Name.substr(1));
 
    for (StringRef Dir : Config->SearchPaths) {
Index: devel/llvm/patches/patch-tools_lld_ELF_Driver_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_Driver_cpp,v
retrieving revision 1.12
diff -u -p -r1.12 patch-tools_lld_ELF_Driver_cpp
--- devel/llvm/patches/patch-tools_lld_ELF_Driver_cpp 28 Jan 2019 15:34:22 -0000 1.12
+++ devel/llvm/patches/patch-tools_lld_ELF_Driver_cpp 29 Jun 2019 06:45:28 -0000
@@ -1,38 +1,62 @@
 $OpenBSD: patch-tools_lld_ELF_Driver_cpp,v 1.12 2019/01/28 15:34:22 jca Exp $
 
 - Enable PIE by default.
-- lld: add -z interpose support
+- XXX retpoline, EM_SPARCV9, ???
 
 Index: tools/lld/ELF/Driver.cpp
 --- tools/lld/ELF/Driver.cpp.orig
 +++ tools/lld/ELF/Driver.cpp
-@@ -339,8 +339,9 @@ static bool getZFlag(opt::InputArgList &Args, StringRe
- static bool isKnown(StringRef S) {
-   return S == "combreloc" || S == "copyreloc" || S == "defs" ||
-          S == "execstack" || S == "hazardplt" || S == "initfirst" ||
--         S == "keep-text-section-prefix" || S == "lazy" || S == "muldefs" ||
--         S == "nocombreloc" || S == "nocopyreloc" || S == "nodelete" ||
-+         S == "interpose" || S == "keep-text-section-prefix" ||
-+         S == "lazy" || S == "muldefs" || S == "nocombreloc" ||
-+         S == "nocopyreloc" || S == "nodelete" ||
-          S == "nodlopen" || S == "noexecstack" ||
-          S == "nokeep-text-section-prefix" || S == "norelro" || S == "notext" ||
+@@ -131,6 +131,7 @@ static std::tuple<ELFKind, uint16_t, uint8_t> parseEmu
+           .Cases("elf32ltsmip", "elf32ltsmipn32", {ELF32LEKind, EM_MIPS})
+           .Case("elf32lriscv", {ELF32LEKind, EM_RISCV})
+           .Cases("elf32ppc", "elf32ppclinux", {ELF32BEKind, EM_PPC})
++          .Case("elf64_sparc", {ELF64BEKind, EM_SPARCV9})
+           .Case("elf64btsmip", {ELF64BEKind, EM_MIPS})
+           .Case("elf64ltsmip", {ELF64LEKind, EM_MIPS})
+           .Case("elf64lriscv", {ELF64LEKind, EM_RISCV})
+@@ -352,7 +353,8 @@ static bool isKnownZFlag(StringRef S) {
+          S == "keep-text-section-prefix" || S == "lazy" || S == "muldefs" ||
+          S == "nocombreloc" || S == "nocopyreloc" || S == "nodefaultlib" ||
+          S == "nodelete" || S == "nodlopen" || S == "noexecstack" ||
+-         S == "nokeep-text-section-prefix" || S == "norelro" || S == "notext" ||
++         S == "nokeep-text-section-prefix" || S == "norelro" ||
++         S == "noretpolineplt" || S == "notext" ||
           S == "now" || S == "origin" || S == "relro" || S == "retpolineplt" ||
-@@ -794,7 +795,8 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
+          S == "rodynamic" || S == "text" || S == "wxneeded" ||
+          S.startswith("max-page-size=") || S.startswith("stack-size=");
+@@ -795,7 +797,8 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
+   Config->IgnoreDataAddressEquality =
+       Args.hasArg(OPT_ignore_data_address_equality);
+   Config->IgnoreFunctionAddressEquality =
+-      Args.hasArg(OPT_ignore_function_address_equality);
++      Args.hasFlag(OPT_ignore_function_address_equality,
++      OPT_no_ignore_function_address_equality, true);
+   Config->Init = Args.getLastArgValue(OPT_init, "_init");
+   Config->LTOAAPipeline = Args.getLastArgValue(OPT_lto_aa_pipeline);
+   Config->LTODebugPassManager = Args.hasArg(OPT_lto_debug_pass_manager);
+@@ -818,7 +821,12 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
    Config->Optimize = args::getInteger(Args, OPT_O, 1);
    Config->OrphanHandling = getOrphanHandling(Args);
    Config->OutputFile = Args.getLastArgValue(OPT_o);
--  Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie, false);
++#ifdef __OpenBSD__
 +  Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie,
 +      !Args.hasArg(OPT_shared) && !Args.hasArg(OPT_relocatable));
++#else
+   Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie, false);
++#endif
    Config->PrintIcfSections =
        Args.hasFlag(OPT_print_icf_sections, OPT_no_print_icf_sections, false);
    Config->PrintGcSections =
-@@ -844,6 +846,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
-   Config->ZExecstack = getZFlag(Args, "execstack", "noexecstack", false);
-   Config->ZHazardplt = hasZOption(Args, "hazardplt");
-   Config->ZInitfirst = hasZOption(Args, "initfirst");
-+  Config->ZInterpose = hasZOption(Args, "interpose");
-   Config->ZKeepTextSectionPrefix = getZFlag(
-       Args, "keep-text-section-prefix", "nokeep-text-section-prefix", false);
-   Config->ZNodelete = hasZOption(Args, "nodelete");
+@@ -881,7 +889,11 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
+   Config->ZNow = getZFlag(Args, "now", "lazy", false);
+   Config->ZOrigin = hasZOption(Args, "origin");
+   Config->ZRelro = getZFlag(Args, "relro", "norelro", true);
+-  Config->ZRetpolineplt = hasZOption(Args, "retpolineplt");
++#ifndef __OpenBSD__
++  Config->ZRetpolineplt = getZFlag(Args, "retpolineplt", "noretpolineplt", false);
++#else
++  Config->ZRetpolineplt = getZFlag(Args, "retpolineplt", "noretpolineplt", true);
++#endif
+   Config->ZRodynamic = hasZOption(Args, "rodynamic");
+   Config->ZStackSize = args::getZOptionValue(Args, OPT_z, "stack-size", 0);
+   Config->ZText = getZFlag(Args, "text", "notext", true);
Index: devel/llvm/patches/patch-tools_lld_ELF_Options_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_Options_td,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_lld_ELF_Options_td
--- devel/llvm/patches/patch-tools_lld_ELF_Options_td 28 Jan 2019 15:34:22 -0000 1.3
+++ devel/llvm/patches/patch-tools_lld_ELF_Options_td 29 Jun 2019 06:45:28 -0000
@@ -5,7 +5,7 @@ $OpenBSD: patch-tools_lld_ELF_Options_td
 Index: tools/lld/ELF/Options.td
 --- tools/lld/ELF/Options.td.orig
 +++ tools/lld/ELF/Options.td
-@@ -178,8 +178,9 @@ def icf_safe: F<"icf=safe">, HelpText<"Enable safe ide
+@@ -188,8 +188,9 @@ def icf_safe: F<"icf=safe">, HelpText<"Enable safe ide
 
  def icf_none: F<"icf=none">, HelpText<"Disable identical code folding (default)">;
 
@@ -17,7 +17,7 @@ Index: tools/lld/ELF/Options.td
 
  def ignore_data_address_equality: F<"ignore-data-address-equality">,
    HelpText<"lld can break the address equality of data">;
-@@ -386,6 +387,7 @@ def: Separate<["-"], "b">, Alias<format>, HelpText<"Al
+@@ -407,6 +408,7 @@ def: Separate<["-"], "b">, Alias<format>, HelpText<"Al
  def: JoinedOrSeparate<["-"], "l">, Alias<library>, HelpText<"Alias for --library">;
  def: JoinedOrSeparate<["-"], "L">, Alias<library_path>, HelpText<"Alias for --library-path">;
  def: F<"no-pic-executable">, Alias<no_pie>, HelpText<"Alias for --no-pie">;
Index: devel/llvm/patches/patch-tools_lld_ELF_Symbols_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_Symbols_h,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_lld_ELF_Symbols_h
--- devel/llvm/patches/patch-tools_lld_ELF_Symbols_h 28 Jan 2019 15:34:22 -0000 1.3
+++ devel/llvm/patches/patch-tools_lld_ELF_Symbols_h 29 Jun 2019 06:45:28 -0000
@@ -6,7 +6,7 @@ is referenced from code being linked.
 Index: tools/lld/ELF/Symbols.h
 --- tools/lld/ELF/Symbols.h.orig
 +++ tools/lld/ELF/Symbols.h
-@@ -308,6 +308,9 @@ struct ElfSym {
+@@ -330,6 +330,9 @@ struct ElfSym {
    // __bss_start
    static Defined *Bss;
 
Index: devel/llvm/patches/patch-tools_lld_ELF_SyntheticSections_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_lld_ELF_SyntheticSections_cpp
diff -N devel/llvm/patches/patch-tools_lld_ELF_SyntheticSections_cpp
--- devel/llvm/patches/patch-tools_lld_ELF_SyntheticSections_cpp 28 Jan 2019 15:34:22 -0000 1.10
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-$OpenBSD: patch-tools_lld_ELF_SyntheticSections_cpp,v 1.10 2019/01/28 15:34:22 jca Exp $
-
-- lld: add -z interpose support
-- When merging sections into the output, lld tries to adjust the alignment of
-  the section to be at least as large as the entry size of the section.
-  This causes a later check that validates the alignment to fail if the
-  entry size isn't a power of two.  This happens when building some of the
-  java support code in ports gcc.  Fix this by sticking to the original
-  alignment if the entry size isn't a power of two.
-
-Index: tools/lld/ELF/SyntheticSections.cpp
---- tools/lld/ELF/SyntheticSections.cpp.orig
-+++ tools/lld/ELF/SyntheticSections.cpp
-@@ -1266,6 +1266,8 @@ template <class ELFT> void DynamicSection<ELFT>::final
-     DtFlags |= DF_SYMBOLIC;
-   if (Config->ZInitfirst)
-     DtFlags1 |= DF_1_INITFIRST;
-+  if (Config->ZInterpose)
-+    DtFlags1 |= DF_1_INTERPOSE;
-   if (Config->ZNodelete)
-     DtFlags1 |= DF_1_NODELETE;
-   if (Config->ZNodlopen)
-@@ -2935,7 +2937,9 @@ void elf::mergeSections() {
-     }
-
-     StringRef OutsecName = getOutputSectionName(MS);
--    uint32_t Alignment = std::max<uint32_t>(MS->Alignment, MS->Entsize);
-+    uint32_t Alignment = MS->Alignment;
-+    if (isPowerOf2_32(MS->Entsize))
-+        Alignment = std::max<uint32_t>(Alignment, MS->Entsize);
-
-     auto I = llvm::find_if(MergeSections, [=](MergeSyntheticSection *Sec) {
-       // While we could create a single synthetic section for two different
Index: devel/llvm/patches/patch-tools_lld_ELF_Writer_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_Writer_cpp,v
retrieving revision 1.10
diff -u -p -r1.10 patch-tools_lld_ELF_Writer_cpp
--- devel/llvm/patches/patch-tools_lld_ELF_Writer_cpp 28 Jan 2019 15:34:22 -0000 1.10
+++ devel/llvm/patches/patch-tools_lld_ELF_Writer_cpp 29 Jun 2019 06:45:28 -0000
@@ -14,13 +14,13 @@ Index: tools/lld/ELF/Writer.cpp
    for (StringRef V :
         {".text.", ".rodata.", ".data.rel.ro.", ".data.", ".bss.rel.ro.",
          ".bss.", ".init_array.", ".fini_array.", ".ctors.", ".dtors.", ".tbss.",
--        ".gcc_except_table.", ".tdata.", ".ARM.exidx.", ".ARM.extab."}) {
+-        ".gcc_except_table.", ".tdata.", ".ARM.exidx.", ".ARM.extab."})
 +        ".gcc_except_table.", ".tdata.", ".ARM.exidx.", ".ARM.extab.",
-+        ".openbsd.randomdata."}) {
++        ".openbsd.randomdata."})
      if (isSectionPrefix(V, S->Name))
        return V.drop_back();
-   }
-@@ -239,6 +240,7 @@ void elf::addReservedSymbols() {
+
+@@ -251,6 +252,7 @@ void elf::addReservedSymbols() {
    };
 
    ElfSym::Bss = Add("__bss_start", 0);
@@ -28,10 +28,10 @@ Index: tools/lld/ELF/Writer.cpp
    ElfSym::End1 = Add("end", -1);
    ElfSym::End2 = Add("_end", -1);
    ElfSym::Etext1 = Add("etext", -1);
-@@ -673,7 +675,11 @@ static bool isRelroSection(const OutputSection *Sec) {
+@@ -703,7 +705,11 @@ static bool isRelroSection(const OutputSection *Sec) {
    // However, if "-z now" is given, the lazy symbol resolution is
    // disabled, which enables us to put it into RELRO.
-   if (Sec == InX::GotPlt->getParent())
+   if (Sec == In.GotPlt->getParent())
 +#ifndef __OpenBSD__
      return Config->ZNow;
 +#else
@@ -40,7 +40,7 @@ Index: tools/lld/ELF/Writer.cpp
 
    // .dynamic section contains data for the dynamic linker, and
    // there's no need to write to it at runtime, so it's better to put
-@@ -962,6 +968,9 @@ template <class ELFT> void Writer<ELFT>::setReservedSy
+@@ -1006,6 +1012,9 @@ template <class ELFT> void Writer<ELFT>::setReservedSy
    if (ElfSym::Bss)
      ElfSym::Bss->Section = findSection(".bss");
 
@@ -50,7 +50,7 @@ Index: tools/lld/ELF/Writer.cpp
    // Setup MIPS _gp_disp/__gnu_local_gp symbols which should
    // be equal to the _gp symbol's value.
    if (ElfSym::MipsGp) {
-@@ -1937,6 +1946,23 @@ template <class ELFT> void Writer<ELFT>::fixSectionAli
+@@ -2042,6 +2051,23 @@ template <class ELFT> void Writer<ELFT>::fixSectionAli
          return alignTo(Script->getDot(), Config->MaxPageSize);
        };
    };
Index: devel/llvm/patches/patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h
diff -N devel/llvm/patches/patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h
--- devel/llvm/patches/patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h 28 Jan 2019 06:27:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-$OpenBSD: patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h,v 1.1 2019/01/28 06:27:28 jca Exp $
-
-Use llvm::VersionTuple instead of manual version marshalling
-
-Index: tools/lldb/include/lldb/Host/openbsd/HostInfoOpenBSD.h
---- tools/lldb/include/lldb/Host/openbsd/HostInfoOpenBSD.h.orig
-+++ tools/lldb/include/lldb/Host/openbsd/HostInfoOpenBSD.h
-@@ -12,12 +12,13 @@
-
- #include "lldb/Host/posix/HostInfoPosix.h"
- #include "lldb/Utility/FileSpec.h"
-+#include "llvm/Support/VersionTuple.h"
-
- namespace lldb_private {
-
- class HostInfoOpenBSD : public HostInfoPosix {
- public:
--  static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
-+  static llvm::VersionTuple GetOSVersion();
-   static bool GetOSBuildString(std::string &s);
-   static bool GetOSKernelDescription(std::string &s);
-   static FileSpec GetProgramFileSpec();
Index: devel/llvm/patches/patch-tools_lldb_scripts_utilsOsType_py
===================================================================
RCS file: devel/llvm/patches/patch-tools_lldb_scripts_utilsOsType_py
diff -N devel/llvm/patches/patch-tools_lldb_scripts_utilsOsType_py
--- devel/llvm/patches/patch-tools_lldb_scripts_utilsOsType_py 28 Jan 2019 06:27:28 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-$OpenBSD: patch-tools_lldb_scripts_utilsOsType_py,v 1.2 2019/01/28 06:27:28 jca Exp $
-
-Recognize OpenBSD.
-
-Index: tools/lldb/scripts/utilsOsType.py
---- tools/lldb/scripts/utilsOsType.py.orig
-+++ tools/lldb/scripts/utilsOsType.py
-@@ -35,8 +35,9 @@ if sys.version_info.major >= 3:
-         FreeBSD = 2
-         Linux = 3
-         NetBSD = 4
--        Windows = 5
--        kFreeBSD = 6
-+        OpenBSD = 5
-+        Windows = 6
-+        kFreeBSD = 7
- else:
-     class EnumOsType(object):
-         values = ["Unknown",
Index: devel/llvm/patches/patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp
diff -N devel/llvm/patches/patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp
--- devel/llvm/patches/patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp 28 Jan 2019 06:27:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-$OpenBSD: patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp,v 1.1 2019/01/28 06:27:28 jca Exp $
-
-Use llvm::VersionTuple instead of manual version marshalling
-
-Index: tools/lldb/source/Host/openbsd/HostInfoOpenBSD.cpp
---- tools/lldb/source/Host/openbsd/HostInfoOpenBSD.cpp.orig
-+++ tools/lldb/source/Host/openbsd/HostInfoOpenBSD.cpp
-@@ -17,16 +17,17 @@
-
- using namespace lldb_private;
-
--bool HostInfoOpenBSD::GetOSVersion(uint32_t &major, uint32_t &minor,
--                                   uint32_t &update) {
-+llvm::VersionTuple HostInfoOpenBSD::GetOSVersion() {
-   struct utsname un;
-
-   ::memset(&un, 0, sizeof(utsname));
-   if (uname(&un) < 0)
--    return false;
-+    return llvm::VersionTuple();
-
--  int status = sscanf(un.release, "%u.%u", &major, &minor);
--  return status == 2;
-+  unsigned major, minor;
-+  if (2 == sscanf(un.release, "%u.%u", &major, &minor))
-+    return llvm::VersionTuple(major, minor);
-+  return llvm::VersionTuple();
- }
-
- bool HostInfoOpenBSD::GetOSBuildString(std::string &s) {
Index: devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp,v
retrieving revision 1.1
diff -u -p -r1.1 patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp
--- devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp 29 Jun 2019 06:45:28 -0000
@@ -5,8 +5,8 @@ Skip retguard instructions in prologue d
 Index: tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
 --- tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp.orig
 +++ tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
-@@ -593,6 +593,18 @@ bool x86AssemblyInspectionEngine::ret_pattern_p() {
-   return false;
+@@ -672,6 +672,18 @@ bool x86AssemblyInspectionEngine::ret_pattern_p() {
+   return *p == 0xc9 || *p == 0xc2 || *p == 0xca || *p == 0xc3;
  }
 
 +// movq $0x????????(%rip), $reg [(0x4c || 0x48) 0x8b ?? ?? ?? ?? ??]
@@ -24,7 +24,7 @@ Index: tools/lldb/source/Plugins/UnwindA
  uint32_t x86AssemblyInspectionEngine::extract_4(uint8_t *b) {
    uint32_t v = 0;
    for (int i = 3; i >= 0; i--)
-@@ -1214,6 +1226,7 @@ bool x86AssemblyInspectionEngine::FindFirstNonPrologue
+@@ -1374,6 +1386,7 @@ bool x86AssemblyInspectionEngine::FindFirstNonPrologue
      if (push_rbp_pattern_p() || mov_rsp_rbp_pattern_p() ||
          sub_rsp_pattern_p(scratch) || push_reg_p(regno) ||
          mov_reg_to_local_stack_frame_p(regno, scratch) ||
Index: devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h,v
retrieving revision 1.1
diff -u -p -r1.1 patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h
--- devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h 20 Feb 2019 00:24:11 -0000 1.1
+++ devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h 29 Jun 2019 06:45:28 -0000
@@ -5,7 +5,7 @@ Skip retguard instructions in prologue d
 Index: tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h
 --- tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h.orig
 +++ tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h
-@@ -110,6 +110,7 @@ class x86AssemblyInspectionEngine { (private)
+@@ -115,6 +115,7 @@ class x86AssemblyInspectionEngine { (private)
    bool call_next_insn_pattern_p();
    bool mov_reg_to_local_stack_frame_p(int &regno, int &rbp_offset);
    bool ret_pattern_p();
Index: devel/llvm/patches/patch-unittests_ADT_OptionalTest_cpp
===================================================================
RCS file: devel/llvm/patches/patch-unittests_ADT_OptionalTest_cpp
diff -N devel/llvm/patches/patch-unittests_ADT_OptionalTest_cpp
--- devel/llvm/patches/patch-unittests_ADT_OptionalTest_cpp 22 Apr 2019 17:24:26 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-$OpenBSD: patch-unittests_ADT_OptionalTest_cpp,v 1.1 2019/04/22 17:24:26 jca Exp $
-
-XXX disable failing static_assert to let other tests run.
-
-Index: unittests/ADT/OptionalTest.cpp
---- unittests/ADT/OptionalTest.cpp.orig
-+++ unittests/ADT/OptionalTest.cpp
-@@ -519,8 +519,8 @@ TEST_F(OptionalTest, OperatorGreaterEqual) {
- }
-
- #if __has_feature(is_trivially_copyable) && defined(_LIBCPP_VERSION)
--static_assert(std::is_trivially_copyable<Optional<int>>::value,
--              "Should be trivially copyable");
-+//static_assert(std::is_trivially_copyable<Optional<int>>::value,
-+//              "Should be trivially copyable");
- static_assert(
-     !std::is_trivially_copyable<Optional<NonDefaultConstructible>>::value,
-     "Shouldn't be trivially copyable");
Index: devel/llvm/patches/patch-utils_TableGen_X86RecognizableInstr_cpp
===================================================================
RCS file: devel/llvm/patches/patch-utils_TableGen_X86RecognizableInstr_cpp
diff -N devel/llvm/patches/patch-utils_TableGen_X86RecognizableInstr_cpp
--- devel/llvm/patches/patch-utils_TableGen_X86RecognizableInstr_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-$OpenBSD: patch-utils_TableGen_X86RecognizableInstr_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: utils/TableGen/X86RecognizableInstr.cpp
---- utils/TableGen/X86RecognizableInstr.cpp.orig
-+++ utils/TableGen/X86RecognizableInstr.cpp
-@@ -842,6 +842,7 @@ OperandType RecognizableInstr::typeFromString(const st
-   TYPE("f32mem",              TYPE_M)
-   TYPE("ssmem",               TYPE_M)
-   TYPE("RST",                 TYPE_ST)
-+  TYPE("RSTi",                TYPE_ST)
-   TYPE("i128mem",             TYPE_M)
-   TYPE("i256mem",             TYPE_M)
-   TYPE("i512mem",             TYPE_M)
-@@ -964,6 +965,7 @@ OperandEncoding
- RecognizableInstr::rmRegisterEncodingFromString(const std::string &s,
-                                                 uint8_t OpSize) {
-   ENCODING("RST",             ENCODING_FP)
-+  ENCODING("RSTi",            ENCODING_FP)
-   ENCODING("GR16",            ENCODING_RM)
-   ENCODING("GR32",            ENCODING_RM)
-   ENCODING("GR32orGR64",      ENCODING_RM)
Index: devel/llvm/pkg/PLIST-lldb
===================================================================
RCS file: /cvs/ports/devel/llvm/pkg/PLIST-lldb,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST-lldb
--- devel/llvm/pkg/PLIST-lldb 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/pkg/PLIST-lldb 29 Jun 2019 06:45:28 -0000
@@ -5,6 +5,7 @@
 @bin bin/lldb-argdumper
 @bin bin/lldb-mi
 @bin bin/lldb-test
+@bin bin/lldb-vscode
 include/lldb/
 include/lldb/API/
 include/lldb/API/LLDB.h
@@ -32,6 +33,7 @@ include/lldb/API/SBFileSpecList.h
 include/lldb/API/SBFrame.h
 include/lldb/API/SBFunction.h
 include/lldb/API/SBHostOS.h
+include/lldb/API/SBInitializerOptions.h
 include/lldb/API/SBInstruction.h
 include/lldb/API/SBInstructionList.h
 include/lldb/API/SBLanguageRuntime.h
@@ -89,6 +91,7 @@ include/lldb/Breakpoint/BreakpointResolv
 include/lldb/Breakpoint/BreakpointResolverFileLine.h
 include/lldb/Breakpoint/BreakpointResolverFileRegex.h
 include/lldb/Breakpoint/BreakpointResolverName.h
+include/lldb/Breakpoint/BreakpointResolverScripted.h
 include/lldb/Breakpoint/BreakpointSite.h
 include/lldb/Breakpoint/BreakpointSiteList.h
 include/lldb/Breakpoint/Stoppoint.h
@@ -104,7 +107,6 @@ include/lldb/Core/AddressResolver.h
 include/lldb/Core/AddressResolverFileLine.h
 include/lldb/Core/AddressResolverName.h
 include/lldb/Core/Architecture.h
-include/lldb/Core/Broadcaster.h
 include/lldb/Core/ClangForward.h
 include/lldb/Core/Communication.h
 include/lldb/Core/Debugger.h
@@ -112,13 +114,12 @@ include/lldb/Core/Disassembler.h
 include/lldb/Core/DumpDataExtractor.h
 include/lldb/Core/DumpRegisterValue.h
 include/lldb/Core/EmulateInstruction.h
-include/lldb/Core/Event.h
 include/lldb/Core/FileLineResolver.h
 include/lldb/Core/FileSpecList.h
 include/lldb/Core/FormatEntity.h
+include/lldb/Core/Highlighter.h
 include/lldb/Core/IOHandler.h
 include/lldb/Core/IOStreamMacros.h
-include/lldb/Core/Listener.h
 include/lldb/Core/LoadedModuleInfoList.h
 include/lldb/Core/Mangled.h
 include/lldb/Core/MappedHash.h
@@ -130,13 +131,11 @@ include/lldb/Core/Opcode.h
 include/lldb/Core/PluginInterface.h
 include/lldb/Core/PluginManager.h
 include/lldb/Core/RangeMap.h
-include/lldb/Core/RegisterValue.h
+include/lldb/Core/RichManglingContext.h
 include/lldb/Core/STLUtils.h
-include/lldb/Core/Scalar.h
 include/lldb/Core/SearchFilter.h
 include/lldb/Core/Section.h
 include/lldb/Core/SourceManager.h
-include/lldb/Core/State.h
 include/lldb/Core/StreamAsynchronousIO.h
 include/lldb/Core/StreamBuffer.h
 include/lldb/Core/StreamFile.h
@@ -229,10 +228,10 @@ include/lldb/Host/OptionParser.h
 include/lldb/Host/Pipe.h
 include/lldb/Host/PipeBase.h
 include/lldb/Host/PosixApi.h
-include/lldb/Host/Predicate.h
 include/lldb/Host/ProcessLauncher.h
 include/lldb/Host/ProcessRunLock.h
 include/lldb/Host/PseudoTerminal.h
+include/lldb/Host/SafeMachO.h
 include/lldb/Host/Socket.h
 include/lldb/Host/SocketAddress.h
 include/lldb/Host/StringConvert.h
@@ -246,13 +245,11 @@ include/lldb/Host/android/
 include/lldb/Host/android/HostInfoAndroid.h
 include/lldb/Host/common/
 include/lldb/Host/common/GetOptInc.h
-include/lldb/Host/common/NativeBreakpoint.h
 include/lldb/Host/common/NativeBreakpointList.h
 include/lldb/Host/common/NativeProcessProtocol.h
 include/lldb/Host/common/NativeRegisterContext.h
 include/lldb/Host/common/NativeThreadProtocol.h
 include/lldb/Host/common/NativeWatchpointList.h
-include/lldb/Host/common/SoftwareBreakpoint.h
 include/lldb/Host/common/TCPSocket.h
 include/lldb/Host/common/UDPSocket.h
 include/lldb/Host/freebsd/
@@ -362,11 +359,8 @@ include/lldb/Symbol/DeclVendor.h
 include/lldb/Symbol/Declaration.h
 include/lldb/Symbol/FuncUnwinders.h
 include/lldb/Symbol/Function.h
-include/lldb/Symbol/GoASTContext.h
-include/lldb/Symbol/JavaASTContext.h
 include/lldb/Symbol/LineEntry.h
 include/lldb/Symbol/LineTable.h
-include/lldb/Symbol/OCamlASTContext.h
 include/lldb/Symbol/ObjectContainer.h
 include/lldb/Symbol/ObjectFile.h
 include/lldb/Symbol/Symbol.h
@@ -420,6 +414,7 @@ include/lldb/Target/SectionLoadHistory.h
 include/lldb/Target/SectionLoadList.h
 include/lldb/Target/StackFrame.h
 include/lldb/Target/StackFrameList.h
+include/lldb/Target/StackFrameRecognizer.h
 include/lldb/Target/StackID.h
 include/lldb/Target/StopInfo.h
 include/lldb/Target/StructuredDataPlugin.h
@@ -456,6 +451,7 @@ include/lldb/Utility/AnsiTerminal.h
 include/lldb/Utility/ArchSpec.h
 include/lldb/Utility/Args.h
 include/lldb/Utility/Baton.h
+include/lldb/Utility/Broadcaster.h
 include/lldb/Utility/CleanUp.h
 include/lldb/Utility/CompletionRequest.h
 include/lldb/Utility/Connection.h
@@ -465,25 +461,28 @@ include/lldb/Utility/DataBufferHeap.h
 include/lldb/Utility/DataBufferLLVM.h
 include/lldb/Utility/DataEncoder.h
 include/lldb/Utility/DataExtractor.h
-include/lldb/Utility/Either.h
 include/lldb/Utility/Endian.h
 include/lldb/Utility/Environment.h
-include/lldb/Utility/FastDemangle.h
+include/lldb/Utility/Event.h
 include/lldb/Utility/FileSpec.h
 include/lldb/Utility/Flags.h
 include/lldb/Utility/IOObject.h
 include/lldb/Utility/Iterable.h
 include/lldb/Utility/JSON.h
 include/lldb/Utility/LLDBAssert.h
+include/lldb/Utility/Listener.h
 include/lldb/Utility/Log.h
 include/lldb/Utility/Logging.h
 include/lldb/Utility/NameMatches.h
-include/lldb/Utility/Range.h
+include/lldb/Utility/Predicate.h
+include/lldb/Utility/RegisterValue.h
 include/lldb/Utility/RegularExpression.h
-include/lldb/Utility/SafeMachO.h
+include/lldb/Utility/Reproducer.h
+include/lldb/Utility/Scalar.h
 include/lldb/Utility/SelectHelper.h
 include/lldb/Utility/SharedCluster.h
 include/lldb/Utility/SharingPtr.h
+include/lldb/Utility/State.h
 include/lldb/Utility/Status.h
 include/lldb/Utility/Stream.h
 include/lldb/Utility/StreamCallback.h
@@ -542,9 +541,11 @@ lib/liblldbPluginABISysV_s390x.a
 lib/liblldbPluginABISysV_x86_64.a
 lib/liblldbPluginAppleObjCRuntime.a
 lib/liblldbPluginArchitectureArm.a
+lib/liblldbPluginArchitectureMips.a
 lib/liblldbPluginArchitecturePPC64.a
 lib/liblldbPluginCPlusPlusLanguage.a
 lib/liblldbPluginCXXItaniumABI.a
+lib/liblldbPluginClangCommon.a
 lib/liblldbPluginDisassemblerLLVM.a
 lib/liblldbPluginDynamicLoaderDarwinKernel.a
 lib/liblldbPluginDynamicLoaderHexagonDYLD.a
@@ -553,8 +554,6 @@ lib/liblldbPluginDynamicLoaderPosixDYLD.
 lib/liblldbPluginDynamicLoaderStatic.a
 lib/liblldbPluginDynamicLoaderWindowsDYLD.a
 lib/liblldbPluginExpressionParserClang.a
-lib/liblldbPluginExpressionParserGo.a
-lib/liblldbPluginGoLanguage.a
 lib/liblldbPluginInstructionARM.a
 lib/liblldbPluginInstructionARM64.a
 lib/liblldbPluginInstructionMIPS.a
@@ -565,17 +564,13 @@ lib/liblldbPluginInstrumentationRuntimeM
 lib/liblldbPluginInstrumentationRuntimeTSan.a
 lib/liblldbPluginInstrumentationRuntimeUBSan.a
 lib/liblldbPluginJITLoaderGDB.a
-lib/liblldbPluginJavaLanguage.a
-lib/liblldbPluginLanguageRuntimeGo.a
-lib/liblldbPluginLanguageRuntimeJava.a
 lib/liblldbPluginMemoryHistoryASan.a
-lib/liblldbPluginOCamlLanguage.a
-lib/liblldbPluginOSGo.a
 lib/liblldbPluginOSPython.a
 lib/liblldbPluginObjCLanguage.a
 lib/liblldbPluginObjCPlusPlusLanguage.a
 lib/liblldbPluginObjectContainerBSDArchive.a
 lib/liblldbPluginObjectContainerMachOArchive.a
+lib/liblldbPluginObjectFileBreakpad.a
 lib/liblldbPluginObjectFileELF.a
 lib/liblldbPluginObjectFileJIT.a
 lib/liblldbPluginObjectFileMachO.a
@@ -599,7 +594,9 @@ lib/liblldbPluginRenderScriptRuntime.a
 lib/liblldbPluginScriptInterpreterNone.a
 lib/liblldbPluginScriptInterpreterPython.a
 lib/liblldbPluginStructuredDataDarwinLog.a
+lib/liblldbPluginSymbolFileBreakpad.a
 lib/liblldbPluginSymbolFileDWARF.a
+lib/liblldbPluginSymbolFileNativePDB.a
 lib/liblldbPluginSymbolFilePDB.a
 lib/liblldbPluginSymbolFileSymtab.a
 lib/liblldbPluginSymbolVendorELF.a
Index: devel/llvm/pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/devel/llvm/pkg/PLIST-main,v
retrieving revision 1.12
diff -u -p -r1.12 PLIST-main
--- devel/llvm/pkg/PLIST-main 9 Mar 2019 06:18:11 -0000 1.12
+++ devel/llvm/pkg/PLIST-main 29 Jun 2019 06:45:28 -0000
@@ -4,12 +4,12 @@
 @bin bin/c-index-test
 bin/clang
 bin/clang++
-@bin bin/clang-7
+@bin bin/clang-8
 @bin bin/clang-check
 bin/clang-cl
 bin/clang-cpp
+@bin bin/clang-extdef-mapping
 @bin bin/clang-format
-@bin bin/clang-func-mapping
 @bin bin/clang-import-test
 @bin bin/clang-offload-bundler
 @bin bin/clang-refactor
@@ -35,11 +35,13 @@ bin/lld-link
 @bin bin/llvm-cvtres
 @bin bin/llvm-cxxdump
 @bin bin/llvm-cxxfilt
+@bin bin/llvm-cxxmap
 @bin bin/llvm-diff
 @bin bin/llvm-dis
 bin/llvm-dlltool
 @bin bin/llvm-dwarfdump
 @bin bin/llvm-dwp
+@bin bin/llvm-elfabi
 @bin bin/llvm-exegesis
 @bin bin/llvm-extract
 bin/llvm-lib
@@ -97,9 +99,12 @@ include/clang/AST/APValue.h
 include/clang/AST/AST.h
 include/clang/AST/ASTConsumer.h
 include/clang/AST/ASTContext.h
+include/clang/AST/ASTContextAllocate.h
 include/clang/AST/ASTDiagnostic.h
+include/clang/AST/ASTDumperUtils.h
 include/clang/AST/ASTFwd.h
 include/clang/AST/ASTImporter.h
+include/clang/AST/ASTImporterLookupTable.h
 include/clang/AST/ASTLambda.h
 include/clang/AST/ASTMutationListener.h
 include/clang/AST/ASTStructuralEquivalence.h
@@ -107,9 +112,11 @@ include/clang/AST/ASTTypeTraits.h
 include/clang/AST/ASTUnresolvedSet.h
 include/clang/AST/ASTVector.h
 include/clang/AST/Attr.h
-include/clang/AST/AttrDump.inc
 include/clang/AST/AttrImpl.inc
 include/clang/AST/AttrIterator.h
+include/clang/AST/AttrNodeTraverse.inc
+include/clang/AST/AttrTextNodeDump.inc
+include/clang/AST/AttrVisitor.h
 include/clang/AST/AttrVisitor.inc
 include/clang/AST/Attrs.inc
 include/clang/AST/Availability.h
@@ -156,6 +163,7 @@ include/clang/AST/ExprObjC.h
 include/clang/AST/ExprOpenMP.h
 include/clang/AST/ExternalASTMerger.h
 include/clang/AST/ExternalASTSource.h
+include/clang/AST/FormatString.h
 include/clang/AST/GlobalDecl.h
 include/clang/AST/LambdaCapture.h
 include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h
@@ -166,6 +174,7 @@ include/clang/AST/NSAPI.h
 include/clang/AST/NestedNameSpecifier.h
 include/clang/AST/NonTrivialTypeVisitor.h
 include/clang/AST/ODRHash.h
+include/clang/AST/OSLog.h
 include/clang/AST/OpenMPClause.h
 include/clang/AST/OperationKinds.def
 include/clang/AST/OperationKinds.h
@@ -187,8 +196,10 @@ include/clang/AST/StmtNodes.inc
 include/clang/AST/StmtObjC.h
 include/clang/AST/StmtOpenMP.h
 include/clang/AST/StmtVisitor.h
+include/clang/AST/TemplateArgumentVisitor.h
 include/clang/AST/TemplateBase.h
 include/clang/AST/TemplateName.h
+include/clang/AST/TextNodeDumper.h
 include/clang/AST/Type.h
 include/clang/AST/TypeLoc.h
 include/clang/AST/TypeLocNodes.def
@@ -214,11 +225,9 @@ include/clang/Analysis/Analyses/
 include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h
 include/clang/Analysis/Analyses/Consumed.h
 include/clang/Analysis/Analyses/Dominators.h
-include/clang/Analysis/Analyses/FormatString.h
+include/clang/Analysis/Analyses/ExprMutationAnalyzer.h
 include/clang/Analysis/Analyses/LiveVariables.h
-include/clang/Analysis/Analyses/OSLog.h
 include/clang/Analysis/Analyses/PostOrderCFGView.h
-include/clang/Analysis/Analyses/PseudoConstantAnalysis.h
 include/clang/Analysis/Analyses/ReachableCode.h
 include/clang/Analysis/Analyses/ThreadSafety.h
 include/clang/Analysis/Analyses/ThreadSafetyCommon.h
@@ -243,6 +252,7 @@ include/clang/Analysis/DomainSpecific/Ob
 include/clang/Analysis/FlowSensitive/
 include/clang/Analysis/FlowSensitive/DataflowValues.h
 include/clang/Analysis/ProgramPoint.h
+include/clang/Analysis/SelectorExtras.h
 include/clang/Analysis/Support/
 include/clang/Analysis/Support/BumpVector.h
 include/clang/Basic/
@@ -267,7 +277,6 @@ include/clang/Basic/BuiltinsLe64.def
 include/clang/Basic/BuiltinsMips.def
 include/clang/Basic/BuiltinsNEON.def
 include/clang/Basic/BuiltinsNVPTX.def
-include/clang/Basic/BuiltinsNios2.def
 include/clang/Basic/BuiltinsPPC.def
 include/clang/Basic/BuiltinsSystemZ.def
 include/clang/Basic/BuiltinsWebAssembly.def
@@ -276,28 +285,41 @@ include/clang/Basic/BuiltinsX86_64.def
 include/clang/Basic/BuiltinsXCore.def
 include/clang/Basic/CapturedStmt.h
 include/clang/Basic/CharInfo.h
+include/clang/Basic/CodeGenOptions.def
+include/clang/Basic/CodeGenOptions.h
 include/clang/Basic/CommentOptions.h
 include/clang/Basic/Cuda.h
 include/clang/Basic/DebugInfoOptions.h
 include/clang/Basic/Diagnostic.h
+include/clang/Basic/DiagnosticAST.h
 include/clang/Basic/DiagnosticASTKinds.inc
+include/clang/Basic/DiagnosticAnalysis.h
 include/clang/Basic/DiagnosticAnalysisKinds.inc
 include/clang/Basic/DiagnosticCategories.h
+include/clang/Basic/DiagnosticComment.h
 include/clang/Basic/DiagnosticCommentKinds.inc
 include/clang/Basic/DiagnosticCommonKinds.inc
+include/clang/Basic/DiagnosticCrossTU.h
 include/clang/Basic/DiagnosticCrossTUKinds.inc
+include/clang/Basic/DiagnosticDriver.h
 include/clang/Basic/DiagnosticDriverKinds.inc
 include/clang/Basic/DiagnosticError.h
+include/clang/Basic/DiagnosticFrontend.h
 include/clang/Basic/DiagnosticFrontendKinds.inc
 include/clang/Basic/DiagnosticGroups.inc
 include/clang/Basic/DiagnosticIDs.h
 include/clang/Basic/DiagnosticIndexName.inc
+include/clang/Basic/DiagnosticLex.h
 include/clang/Basic/DiagnosticLexKinds.inc
 include/clang/Basic/DiagnosticOptions.def
 include/clang/Basic/DiagnosticOptions.h
+include/clang/Basic/DiagnosticParse.h
 include/clang/Basic/DiagnosticParseKinds.inc
+include/clang/Basic/DiagnosticRefactoring.h
 include/clang/Basic/DiagnosticRefactoringKinds.inc
+include/clang/Basic/DiagnosticSema.h
 include/clang/Basic/DiagnosticSemaKinds.inc
+include/clang/Basic/DiagnosticSerialization.h
 include/clang/Basic/DiagnosticSerializationKinds.inc
 include/clang/Basic/ExceptionSpecificationType.h
 include/clang/Basic/ExpressionTraits.h
@@ -305,16 +327,19 @@ include/clang/Basic/Features.def
 include/clang/Basic/FileManager.h
 include/clang/Basic/FileSystemOptions.h
 include/clang/Basic/FileSystemStatCache.h
+include/clang/Basic/FixedPoint.h
 include/clang/Basic/IdentifierTable.h
 include/clang/Basic/LLVM.h
 include/clang/Basic/Lambda.h
 include/clang/Basic/LangOptions.def
 include/clang/Basic/LangOptions.h
 include/clang/Basic/Linkage.h
+include/clang/Basic/MSP430Target.def
 include/clang/Basic/MacroBuilder.h
 include/clang/Basic/MemoryBufferCache.h
 include/clang/Basic/Module.h
 include/clang/Basic/ObjCRuntime.h
+include/clang/Basic/OpenCLExtensionTypes.def
 include/clang/Basic/OpenCLExtensions.def
 include/clang/Basic/OpenCLImageTypes.def
 include/clang/Basic/OpenCLOptions.h
@@ -347,7 +372,6 @@ include/clang/Basic/TokenKinds.h
 include/clang/Basic/TypeTraits.h
 include/clang/Basic/Version.h
 include/clang/Basic/Version.inc
-include/clang/Basic/VirtualFileSystem.h
 include/clang/Basic/Visibility.h
 include/clang/Basic/X86Target.def
 include/clang/Basic/XRayInstr.h
@@ -372,6 +396,7 @@ include/clang/CrossTU/CrossTranslationUn
 include/clang/Driver/
 include/clang/Driver/Action.h
 include/clang/Driver/Compilation.h
+include/clang/Driver/DarwinSDKInfo.h
 include/clang/Driver/Distro.h
 include/clang/Driver/Driver.h
 include/clang/Driver/DriverDiagnostic.h
@@ -399,8 +424,6 @@ include/clang/Frontend/
 include/clang/Frontend/ASTConsumers.h
 include/clang/Frontend/ASTUnit.h
 include/clang/Frontend/ChainedDiagnosticConsumer.h
-include/clang/Frontend/CodeGenOptions.def
-include/clang/Frontend/CodeGenOptions.h
 include/clang/Frontend/CommandLineSourceLoc.h
 include/clang/Frontend/CompilerInstance.h
 include/clang/Frontend/CompilerInvocation.h
@@ -455,8 +478,6 @@ include/clang/Lex/ModuleMap.h
 include/clang/Lex/MultipleIncludeOpt.h
 include/clang/Lex/PPCallbacks.h
 include/clang/Lex/PPConditionalDirectiveRecord.h
-include/clang/Lex/PTHLexer.h
-include/clang/Lex/PTHManager.h
 include/clang/Lex/Pragma.h
 include/clang/Lex/PreprocessingRecord.h
 include/clang/Lex/Preprocessor.h
@@ -470,6 +491,7 @@ include/clang/Lex/VariadicMacroSupport.h
 include/clang/Parse/
 include/clang/Parse/AttrParserStringSwitches.inc
 include/clang/Parse/AttrSubMatchRulesParserStringSwitches.inc
+include/clang/Parse/LoopHint.h
 include/clang/Parse/ParseAST.h
 include/clang/Parse/ParseDiagnostic.h
 include/clang/Parse/Parser.h
@@ -505,7 +527,6 @@ include/clang/Sema/ExternalSemaSource.h
 include/clang/Sema/IdentifierResolver.h
 include/clang/Sema/Initialization.h
 include/clang/Sema/Lookup.h
-include/clang/Sema/LoopHint.h
 include/clang/Sema/MultiplexExternalSemaSource.h
 include/clang/Sema/ObjCMethodList.h
 include/clang/Sema/Overload.h
@@ -537,17 +558,18 @@ include/clang/Serialization/GlobalModule
 include/clang/Serialization/Module.h
 include/clang/Serialization/ModuleFileExtension.h
 include/clang/Serialization/ModuleManager.h
+include/clang/Serialization/PCHContainerOperations.h
 include/clang/Serialization/SerializationDiagnostic.h
 include/clang/StaticAnalyzer/
 include/clang/StaticAnalyzer/Checkers/
+include/clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h
 include/clang/StaticAnalyzer/Checkers/Checkers.inc
-include/clang/StaticAnalyzer/Checkers/ClangCheckers.h
 include/clang/StaticAnalyzer/Checkers/LocalCheckers.h
 include/clang/StaticAnalyzer/Checkers/MPIFunctionClassifier.h
-include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h
 include/clang/StaticAnalyzer/Checkers/SValExplainer.h
 include/clang/StaticAnalyzer/Core/
 include/clang/StaticAnalyzer/Core/Analyses.def
+include/clang/StaticAnalyzer/Core/AnalyzerOptions.def
 include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
 include/clang/StaticAnalyzer/Core/BugReporter/
 include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
@@ -557,8 +579,6 @@ include/clang/StaticAnalyzer/Core/BugRep
 include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
 include/clang/StaticAnalyzer/Core/Checker.h
 include/clang/StaticAnalyzer/Core/CheckerManager.h
-include/clang/StaticAnalyzer/Core/CheckerOptInfo.h
-include/clang/StaticAnalyzer/Core/CheckerRegistry.h
 include/clang/StaticAnalyzer/Core/IssueHash.h
 include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h
 include/clang/StaticAnalyzer/Core/PathSensitive/
@@ -586,7 +606,7 @@ include/clang/StaticAnalyzer/Core/PathSe
 include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h
 include/clang/StaticAnalyzer/Core/PathSensitive/Regions.def
 include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h
-include/clang/StaticAnalyzer/Core/PathSensitive/SMTContext.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SMTConv.h
 include/clang/StaticAnalyzer/Core/PathSensitive/SMTExpr.h
 include/clang/StaticAnalyzer/Core/PathSensitive/SMTSolver.h
 include/clang/StaticAnalyzer/Core/PathSensitive/SMTSort.h
@@ -605,9 +625,11 @@ include/clang/StaticAnalyzer/Core/PathSe
 include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h
 include/clang/StaticAnalyzer/Core/PathSensitive/TaintTag.h
 include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h
+include/clang/StaticAnalyzer/Core/RetainSummaryManager.h
 include/clang/StaticAnalyzer/Frontend/
 include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h
 include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h
+include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
 include/clang/StaticAnalyzer/Frontend/FrontendActions.h
 include/clang/StaticAnalyzer/Frontend/ModelConsumer.h
 include/clang/Tooling/
@@ -709,6 +731,7 @@ include/llvm-c/DataTypes.h
 include/llvm-c/DebugInfo.h
 include/llvm-c/Disassembler.h
 include/llvm-c/DisassemblerTypes.h
+include/llvm-c/Error.h
 include/llvm-c/ErrorHandling.h
 include/llvm-c/ExecutionEngine.h
 include/llvm-c/IRReader.h
@@ -716,11 +739,14 @@ include/llvm-c/Initialization.h
 include/llvm-c/LinkTimeOptimizer.h
 include/llvm-c/Linker.h
 include/llvm-c/Object.h
+include/llvm-c/OptRemarks.h
 include/llvm-c/OrcBindings.h
 include/llvm-c/Support.h
 include/llvm-c/Target.h
 include/llvm-c/TargetMachine.h
 include/llvm-c/Transforms/
+include/llvm-c/Transforms/AggressiveInstCombine.h
+include/llvm-c/Transforms/Coroutines.h
 include/llvm-c/Transforms/IPO.h
 include/llvm-c/Transforms/InstCombine.h
 include/llvm-c/Transforms/PassManagerBuilder.h
@@ -796,6 +822,7 @@ include/llvm/ADT/Triple.h
 include/llvm/ADT/Twine.h
 include/llvm/ADT/UniqueVector.h
 include/llvm/ADT/VariadicFunction.h
+include/llvm/ADT/bit.h
 include/llvm/ADT/edit_distance.h
 include/llvm/ADT/ilist.h
 include/llvm/ADT/ilist_base.h
@@ -837,10 +864,13 @@ include/llvm/Analysis/DominanceFrontier.
 include/llvm/Analysis/DominanceFrontierImpl.h
 include/llvm/Analysis/EHPersonalities.h
 include/llvm/Analysis/GlobalsModRef.h
+include/llvm/Analysis/GuardUtils.h
+include/llvm/Analysis/IVDescriptors.h
 include/llvm/Analysis/IVUsers.h
 include/llvm/Analysis/IndirectCallPromotionAnalysis.h
-include/llvm/Analysis/IndirectCallSiteVisitor.h
+include/llvm/Analysis/IndirectCallVisitor.h
 include/llvm/Analysis/InlineCost.h
+include/llvm/Analysis/InstructionPrecedenceTracking.h
 include/llvm/Analysis/InstructionSimplify.h
 include/llvm/Analysis/Interval.h
 include/llvm/Analysis/IntervalIterator.h
@@ -850,6 +880,7 @@ include/llvm/Analysis/LazyBlockFrequency
 include/llvm/Analysis/LazyBranchProbabilityInfo.h
 include/llvm/Analysis/LazyCallGraph.h
 include/llvm/Analysis/LazyValueInfo.h
+include/llvm/Analysis/LegacyDivergenceAnalysis.h
 include/llvm/Analysis/Lint.h
 include/llvm/Analysis/Loads.h
 include/llvm/Analysis/LoopAccessAnalysis.h
@@ -871,6 +902,7 @@ include/llvm/Analysis/ObjCARCAnalysisUti
 include/llvm/Analysis/ObjCARCInstKind.h
 include/llvm/Analysis/OptimizationRemarkEmitter.h
 include/llvm/Analysis/OrderedBasicBlock.h
+include/llvm/Analysis/OrderedInstructions.h
 include/llvm/Analysis/PHITransAddr.h
 include/llvm/Analysis/Passes.h
 include/llvm/Analysis/PhiValues.h
@@ -889,6 +921,8 @@ include/llvm/Analysis/ScalarEvolutionExp
 include/llvm/Analysis/ScalarEvolutionNormalization.h
 include/llvm/Analysis/ScopedNoAliasAA.h
 include/llvm/Analysis/SparsePropagation.h
+include/llvm/Analysis/StackSafetyAnalysis.h
+include/llvm/Analysis/SyncDependenceAnalysis.h
 include/llvm/Analysis/SyntheticCountsUtils.h
 include/llvm/Analysis/TargetFolder.h
 include/llvm/Analysis/TargetLibraryInfo.def
@@ -908,6 +942,7 @@ include/llvm/AsmParser/
 include/llvm/AsmParser/Parser.h
 include/llvm/AsmParser/SlotMapping.h
 include/llvm/BinaryFormat/
+include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
 include/llvm/BinaryFormat/COFF.h
 include/llvm/BinaryFormat/Dwarf.def
 include/llvm/BinaryFormat/Dwarf.h
@@ -922,6 +957,7 @@ include/llvm/BinaryFormat/ELFRelocs/AVR.
 include/llvm/BinaryFormat/ELFRelocs/BPF.def
 include/llvm/BinaryFormat/ELFRelocs/Hexagon.def
 include/llvm/BinaryFormat/ELFRelocs/Lanai.def
+include/llvm/BinaryFormat/ELFRelocs/MSP430.def
 include/llvm/BinaryFormat/ELFRelocs/Mips.def
 include/llvm/BinaryFormat/ELFRelocs/PowerPC.def
 include/llvm/BinaryFormat/ELFRelocs/PowerPC64.def
@@ -933,6 +969,11 @@ include/llvm/BinaryFormat/ELFRelocs/x86_
 include/llvm/BinaryFormat/MachO.def
 include/llvm/BinaryFormat/MachO.h
 include/llvm/BinaryFormat/Magic.h
+include/llvm/BinaryFormat/MsgPack.def
+include/llvm/BinaryFormat/MsgPack.h
+include/llvm/BinaryFormat/MsgPackReader.h
+include/llvm/BinaryFormat/MsgPackTypes.h
+include/llvm/BinaryFormat/MsgPackWriter.h
 include/llvm/BinaryFormat/Wasm.h
 include/llvm/BinaryFormat/WasmRelocs/
 include/llvm/BinaryFormat/WasmRelocs.def
@@ -948,8 +989,10 @@ include/llvm/CodeGen/
 include/llvm/CodeGen/AccelTable.h
 include/llvm/CodeGen/Analysis.h
 include/llvm/CodeGen/AsmPrinter.h
+include/llvm/CodeGen/AsmPrinterHandler.h
 include/llvm/CodeGen/AtomicExpandUtils.h
 include/llvm/CodeGen/BasicTTIImpl.h
+include/llvm/CodeGen/BuiltinGCs.h
 include/llvm/CodeGen/CalcSpillWeights.h
 include/llvm/CodeGen/CallingConvLower.h
 include/llvm/CodeGen/CommandFlags.inc
@@ -958,6 +1001,8 @@ include/llvm/CodeGen/DAGCombine.h
 include/llvm/CodeGen/DFAPacketizer.h
 include/llvm/CodeGen/DIE.h
 include/llvm/CodeGen/DIEValue.def
+include/llvm/CodeGen/DbgEntityHistoryCalculator.h
+include/llvm/CodeGen/DebugHandlerBase.h
 include/llvm/CodeGen/DwarfStringPoolEntry.h
 include/llvm/CodeGen/EdgeBundles.h
 include/llvm/CodeGen/ExecutionDomainFix.h
@@ -968,13 +1013,15 @@ include/llvm/CodeGen/FunctionLoweringInf
 include/llvm/CodeGen/GCMetadata.h
 include/llvm/CodeGen/GCMetadataPrinter.h
 include/llvm/CodeGen/GCStrategy.h
-include/llvm/CodeGen/GCs.h
 include/llvm/CodeGen/GlobalISel/
+include/llvm/CodeGen/GlobalISel/CSEInfo.h
+include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h
 include/llvm/CodeGen/GlobalISel/CallLowering.h
 include/llvm/CodeGen/GlobalISel/Combiner.h
 include/llvm/CodeGen/GlobalISel/CombinerHelper.h
 include/llvm/CodeGen/GlobalISel/CombinerInfo.h
 include/llvm/CodeGen/GlobalISel/ConstantFoldingMIRBuilder.h
+include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h
 include/llvm/CodeGen/GlobalISel/GISelWorkList.h
 include/llvm/CodeGen/GlobalISel/IRTranslator.h
 include/llvm/CodeGen/GlobalISel/InstructionSelect.h
@@ -1038,6 +1085,7 @@ include/llvm/CodeGen/MachineOperand.h
 include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h
 include/llvm/CodeGen/MachineOutliner.h
 include/llvm/CodeGen/MachinePassRegistry.h
+include/llvm/CodeGen/MachinePipeliner.h
 include/llvm/CodeGen/MachinePostDominators.h
 include/llvm/CodeGen/MachineRegionInfo.h
 include/llvm/CodeGen/MachineRegisterInfo.h
@@ -1148,6 +1196,7 @@ include/llvm/DebugInfo/CodeView/SymbolDe
 include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h
 include/llvm/DebugInfo/CodeView/SymbolDumper.h
 include/llvm/DebugInfo/CodeView/SymbolRecord.h
+include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h
 include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
 include/llvm/DebugInfo/CodeView/SymbolSerializer.h
 include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h
@@ -1160,6 +1209,7 @@ include/llvm/DebugInfo/CodeView/TypeHash
 include/llvm/DebugInfo/CodeView/TypeIndex.h
 include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h
 include/llvm/DebugInfo/CodeView/TypeRecord.h
+include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h
 include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
 include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
 include/llvm/DebugInfo/CodeView/TypeSymbolEmitter.h
@@ -1210,6 +1260,7 @@ include/llvm/DebugInfo/PDB/ConcreteSymbo
 include/llvm/DebugInfo/PDB/DIA/
 include/llvm/DebugInfo/PDB/DIA/DIADataStream.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h
+include/llvm/DebugInfo/PDB/DIA/DIAEnumFrameData.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h
@@ -1217,6 +1268,7 @@ include/llvm/DebugInfo/PDB/DIA/DIAEnumSo
 include/llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h
 include/llvm/DebugInfo/PDB/DIA/DIAError.h
+include/llvm/DebugInfo/PDB/DIA/DIAFrameData.h
 include/llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h
 include/llvm/DebugInfo/PDB/DIA/DIALineNumber.h
 include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h
@@ -1229,6 +1281,7 @@ include/llvm/DebugInfo/PDB/DIA/DIAUtils.
 include/llvm/DebugInfo/PDB/GenericError.h
 include/llvm/DebugInfo/PDB/IPDBDataStream.h
 include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
+include/llvm/DebugInfo/PDB/IPDBFrameData.h
 include/llvm/DebugInfo/PDB/IPDBInjectedSource.h
 include/llvm/DebugInfo/PDB/IPDBLineNumber.h
 include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
@@ -1253,14 +1306,22 @@ include/llvm/DebugInfo/PDB/Native/InfoSt
 include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
 include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
 include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
-include/llvm/DebugInfo/PDB/Native/NativeBuiltinSymbol.h
 include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
+include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
 include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
-include/llvm/DebugInfo/PDB/Native/NativeEnumSymbol.h
 include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
 include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
 include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
 include/llvm/DebugInfo/PDB/Native/NativeSession.h
+include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
+include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
 include/llvm/DebugInfo/PDB/Native/PDBFile.h
 include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
 include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
@@ -1269,6 +1330,7 @@ include/llvm/DebugInfo/PDB/Native/Public
 include/llvm/DebugInfo/PDB/Native/RawConstants.h
 include/llvm/DebugInfo/PDB/Native/RawError.h
 include/llvm/DebugInfo/PDB/Native/RawTypes.h
+include/llvm/DebugInfo/PDB/Native/SymbolCache.h
 include/llvm/DebugInfo/PDB/Native/SymbolStream.h
 include/llvm/DebugInfo/PDB/Native/TpiHashing.h
 include/llvm/DebugInfo/PDB/Native/TpiStream.h
@@ -1316,7 +1378,13 @@ include/llvm/DebugInfo/Symbolize/DIPrint
 include/llvm/DebugInfo/Symbolize/SymbolizableModule.h
 include/llvm/DebugInfo/Symbolize/Symbolize.h
 include/llvm/Demangle/
+include/llvm/Demangle/Compiler.h
 include/llvm/Demangle/Demangle.h
+include/llvm/Demangle/ItaniumDemangle.h
+include/llvm/Demangle/MicrosoftDemangle.h
+include/llvm/Demangle/MicrosoftDemangleNodes.h
+include/llvm/Demangle/StringView.h
+include/llvm/Demangle/Utility.h
 include/llvm/ExecutionEngine/
 include/llvm/ExecutionEngine/ExecutionEngine.h
 include/llvm/ExecutionEngine/GenericValue.h
@@ -1335,10 +1403,12 @@ include/llvm/ExecutionEngine/Orc/GlobalM
 include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
 include/llvm/ExecutionEngine/Orc/IRTransformLayer.h
 include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
+include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
 include/llvm/ExecutionEngine/Orc/LLJIT.h
 include/llvm/ExecutionEngine/Orc/LambdaResolver.h
 include/llvm/ExecutionEngine/Orc/Layer.h
 include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
+include/llvm/ExecutionEngine/Orc/LazyReexports.h
 include/llvm/ExecutionEngine/Orc/Legacy.h
 include/llvm/ExecutionEngine/Orc/NullResolver.h
 include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h
@@ -1353,6 +1423,7 @@ include/llvm/ExecutionEngine/Orc/RTDyldO
 include/llvm/ExecutionEngine/Orc/RawByteChannel.h
 include/llvm/ExecutionEngine/Orc/RemoteObjectLayer.h
 include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
+include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h
 include/llvm/ExecutionEngine/OrcMCJITReplacement.h
 include/llvm/ExecutionEngine/RTDyldMemoryManager.h
 include/llvm/ExecutionEngine/RuntimeDyld.h
@@ -1374,6 +1445,7 @@ include/llvm/IR/Attributes.td
 include/llvm/IR/AutoUpgrade.h
 include/llvm/IR/BasicBlock.h
 include/llvm/IR/CFG.h
+include/llvm/IR/CFGDiff.h
 include/llvm/IR/CallSite.h
 include/llvm/IR/CallingConv.h
 include/llvm/IR/Comdat.h
@@ -1425,6 +1497,7 @@ include/llvm/IR/IntrinsicsHexagon.td
 include/llvm/IR/IntrinsicsMips.td
 include/llvm/IR/IntrinsicsNVVM.td
 include/llvm/IR/IntrinsicsPowerPC.td
+include/llvm/IR/IntrinsicsRISCV.td
 include/llvm/IR/IntrinsicsSystemZ.td
 include/llvm/IR/IntrinsicsWebAssembly.td
 include/llvm/IR/IntrinsicsX86.td
@@ -1445,8 +1518,10 @@ include/llvm/IR/NoFolder.h
 include/llvm/IR/OperandTraits.h
 include/llvm/IR/Operator.h
 include/llvm/IR/OptBisect.h
+include/llvm/IR/PassInstrumentation.h
 include/llvm/IR/PassManager.h
 include/llvm/IR/PassManagerInternal.h
+include/llvm/IR/PassTimingInfo.h
 include/llvm/IR/PatternMatch.h
 include/llvm/IR/PredIteratorCache.h
 include/llvm/IR/ProfileSummary.h
@@ -1456,7 +1531,6 @@ include/llvm/IR/Statepoint.h
 include/llvm/IR/SymbolTableListTraits.h
 include/llvm/IR/TrackingMDRef.h
 include/llvm/IR/Type.h
-include/llvm/IR/TypeBuilder.h
 include/llvm/IR/TypeFinder.h
 include/llvm/IR/Use.h
 include/llvm/IR/UseListOrder.h
@@ -1475,6 +1549,7 @@ include/llvm/LTO/Caching.h
 include/llvm/LTO/Config.h
 include/llvm/LTO/LTO.h
 include/llvm/LTO/LTOBackend.h
+include/llvm/LTO/SummaryBasedOptimizations.h
 include/llvm/LTO/legacy/
 include/llvm/LTO/legacy/LTOCodeGenerator.h
 include/llvm/LTO/legacy/LTOModule.h
@@ -1567,6 +1642,28 @@ include/llvm/MC/MachineLocation.h
 include/llvm/MC/SectionKind.h
 include/llvm/MC/StringTableBuilder.h
 include/llvm/MC/SubtargetFeature.h
+include/llvm/MCA/
+include/llvm/MCA/Context.h
+include/llvm/MCA/HWEventListener.h
+include/llvm/MCA/HardwareUnits/
+include/llvm/MCA/HardwareUnits/HardwareUnit.h
+include/llvm/MCA/HardwareUnits/LSUnit.h
+include/llvm/MCA/HardwareUnits/RegisterFile.h
+include/llvm/MCA/HardwareUnits/ResourceManager.h
+include/llvm/MCA/HardwareUnits/RetireControlUnit.h
+include/llvm/MCA/HardwareUnits/Scheduler.h
+include/llvm/MCA/InstrBuilder.h
+include/llvm/MCA/Instruction.h
+include/llvm/MCA/Pipeline.h
+include/llvm/MCA/SourceMgr.h
+include/llvm/MCA/Stages/
+include/llvm/MCA/Stages/DispatchStage.h
+include/llvm/MCA/Stages/EntryStage.h
+include/llvm/MCA/Stages/ExecuteStage.h
+include/llvm/MCA/Stages/InstructionTables.h
+include/llvm/MCA/Stages/RetireStage.h
+include/llvm/MCA/Stages/Stage.h
+include/llvm/MCA/Support.h
 include/llvm/Object/
 include/llvm/Object/Archive.h
 include/llvm/Object/ArchiveWriter.h
@@ -1621,6 +1718,7 @@ include/llvm/PassSupport.h
 include/llvm/Passes/
 include/llvm/Passes/PassBuilder.h
 include/llvm/Passes/PassPlugin.h
+include/llvm/Passes/StandardInstrumentations.h
 include/llvm/ProfileData/
 include/llvm/ProfileData/Coverage/
 include/llvm/ProfileData/Coverage/CoverageMapping.h
@@ -1637,12 +1735,14 @@ include/llvm/ProfileData/SampleProfReade
 include/llvm/ProfileData/SampleProfWriter.h
 include/llvm/Support/
 include/llvm/Support/AArch64TargetParser.def
+include/llvm/Support/AArch64TargetParser.h
 include/llvm/Support/AMDGPUMetadata.h
 include/llvm/Support/AMDHSAKernelDescriptor.h
 include/llvm/Support/ARMAttributeParser.h
 include/llvm/Support/ARMBuildAttributes.h
 include/llvm/Support/ARMEHABI.h
 include/llvm/Support/ARMTargetParser.def
+include/llvm/Support/ARMTargetParser.h
 include/llvm/Support/ARMWinEH.h
 include/llvm/Support/AlignOf.h
 include/llvm/Support/Allocator.h
@@ -1659,7 +1759,9 @@ include/llvm/Support/BinaryStreamRef.h
 include/llvm/Support/BinaryStreamWriter.h
 include/llvm/Support/BlockFrequency.h
 include/llvm/Support/BranchProbability.h
+include/llvm/Support/BuryPointer.h
 include/llvm/Support/CBindingWrapping.h
+include/llvm/Support/CFGUpdate.h
 include/llvm/Support/COM.h
 include/llvm/Support/CachePruning.h
 include/llvm/Support/Capacity.h
@@ -1687,6 +1789,7 @@ include/llvm/Support/Errno.h
 include/llvm/Support/Error.h
 include/llvm/Support/ErrorHandling.h
 include/llvm/Support/ErrorOr.h
+include/llvm/Support/FileCheck.h
 include/llvm/Support/FileOutputBuffer.h
 include/llvm/Support/FileSystem.h
 include/llvm/Support/FileUtilities.h
@@ -1703,6 +1806,7 @@ include/llvm/Support/GlobPattern.h
 include/llvm/Support/GraphWriter.h
 include/llvm/Support/Host.h
 include/llvm/Support/InitLLVM.h
+include/llvm/Support/ItaniumManglingCanonicalizer.h
 include/llvm/Support/JSON.h
 include/llvm/Support/JamCRC.h
 include/llvm/Support/KnownBits.h
@@ -1713,6 +1817,7 @@ include/llvm/Support/Locale.h
 include/llvm/Support/LockFileManager.h
 include/llvm/Support/LowLevelTypeImpl.h
 include/llvm/Support/MD5.h
+include/llvm/Support/MSVCErrorWorkarounds.h
 include/llvm/Support/MachineValueType.h
 include/llvm/Support/ManagedStatic.h
 include/llvm/Support/MathExtras.h
@@ -1755,6 +1860,7 @@ include/llvm/Support/SpecialCaseList.h
 include/llvm/Support/StringPool.h
 include/llvm/Support/StringSaver.h
 include/llvm/Support/SwapByteOrder.h
+include/llvm/Support/SymbolRemappingReader.h
 include/llvm/Support/SystemUtils.h
 include/llvm/Support/TarWriter.h
 include/llvm/Support/TargetOpcodes.def
@@ -1776,6 +1882,7 @@ include/llvm/Support/UniqueLock.h
 include/llvm/Support/VCSRevision.h
 include/llvm/Support/Valgrind.h
 include/llvm/Support/VersionTuple.h
+include/llvm/Support/VirtualFileSystem.h
 include/llvm/Support/Watchdog.h
 include/llvm/Support/Win64EH.h
 include/llvm/Support/WindowsError.h
@@ -1815,12 +1922,18 @@ include/llvm/Target/TargetItinerary.td
 include/llvm/Target/TargetLoweringObjectFile.h
 include/llvm/Target/TargetMachine.h
 include/llvm/Target/TargetOptions.h
+include/llvm/Target/TargetPfmCounters.td
 include/llvm/Target/TargetSchedule.td
 include/llvm/Target/TargetSelectionDAG.td
 include/llvm/Testing/
 include/llvm/Testing/Support/
 include/llvm/Testing/Support/Error.h
 include/llvm/Testing/Support/SupportHelpers.h
+include/llvm/TextAPI/
+include/llvm/TextAPI/ELF/
+include/llvm/TextAPI/ELF/ELFStub.h
+include/llvm/TextAPI/ELF/TBEHandler.h
+include/llvm/TextAPI/MachO/
 include/llvm/ToolDrivers/
 include/llvm/ToolDrivers/llvm-dlltool/
 include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h
@@ -1845,6 +1958,7 @@ include/llvm/Transforms/IPO/FunctionImpo
 include/llvm/Transforms/IPO/GlobalDCE.h
 include/llvm/Transforms/IPO/GlobalOpt.h
 include/llvm/Transforms/IPO/GlobalSplit.h
+include/llvm/Transforms/IPO/HotColdSplitting.h
 include/llvm/Transforms/IPO/InferFunctionAttrs.h
 include/llvm/Transforms/IPO/Inliner.h
 include/llvm/Transforms/IPO/Internalize.h
@@ -1864,9 +1978,12 @@ include/llvm/Transforms/Instrumentation/
 include/llvm/Transforms/Instrumentation.h
 include/llvm/Transforms/Instrumentation/BoundsChecking.h
 include/llvm/Transforms/Instrumentation/CGProfile.h
+include/llvm/Transforms/Instrumentation/ControlHeightReduction.h
 include/llvm/Transforms/Instrumentation/GCOVProfiler.h
 include/llvm/Transforms/Instrumentation/InstrProfiling.h
+include/llvm/Transforms/Instrumentation/MemorySanitizer.h
 include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
+include/llvm/Transforms/Instrumentation/ThreadSanitizer.h
 include/llvm/Transforms/ObjCARC.h
 include/llvm/Transforms/Scalar/
 include/llvm/Transforms/Scalar.h
@@ -1908,6 +2025,7 @@ include/llvm/Transforms/Scalar/LoopUnrol
 include/llvm/Transforms/Scalar/LowerAtomic.h
 include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h
 include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h
+include/llvm/Transforms/Scalar/MakeGuardsExplicit.h
 include/llvm/Transforms/Scalar/MemCpyOptimizer.h
 include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h
 include/llvm/Transforms/Scalar/NaryReassociate.h
@@ -1917,12 +2035,14 @@ include/llvm/Transforms/Scalar/Reassocia
 include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h
 include/llvm/Transforms/Scalar/SCCP.h
 include/llvm/Transforms/Scalar/SROA.h
+include/llvm/Transforms/Scalar/Scalarizer.h
 include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h
 include/llvm/Transforms/Scalar/SimplifyCFG.h
 include/llvm/Transforms/Scalar/Sink.h
 include/llvm/Transforms/Scalar/SpeculateAroundPHIs.h
 include/llvm/Transforms/Scalar/SpeculativeExecution.h
 include/llvm/Transforms/Scalar/TailRecursionElimination.h
+include/llvm/Transforms/Scalar/WarnMissedTransforms.h
 include/llvm/Transforms/Utils/
 include/llvm/Transforms/Utils.h
 include/llvm/Transforms/Utils/ASanStackFrameLayout.h
@@ -1932,6 +2052,7 @@ include/llvm/Transforms/Utils/BreakCriti
 include/llvm/Transforms/Utils/BuildLibCalls.h
 include/llvm/Transforms/Utils/BypassSlowDivision.h
 include/llvm/Transforms/Utils/CallPromotionUtils.h
+include/llvm/Transforms/Utils/CanonicalizeAliases.h
 include/llvm/Transforms/Utils/Cloning.h
 include/llvm/Transforms/Utils/CodeExtractor.h
 include/llvm/Transforms/Utils/CtorUtils.h
@@ -1941,6 +2062,7 @@ include/llvm/Transforms/Utils/Evaluator.
 include/llvm/Transforms/Utils/FunctionComparator.h
 include/llvm/Transforms/Utils/FunctionImportUtils.h
 include/llvm/Transforms/Utils/GlobalStatus.h
+include/llvm/Transforms/Utils/GuardUtils.h
 include/llvm/Transforms/Utils/ImportedFunctionsInliningStatistics.h
 include/llvm/Transforms/Utils/IntegerDivision.h
 include/llvm/Transforms/Utils/LCSSA.h
@@ -1955,7 +2077,6 @@ include/llvm/Transforms/Utils/LowerMemIn
 include/llvm/Transforms/Utils/Mem2Reg.h
 include/llvm/Transforms/Utils/ModuleUtils.h
 include/llvm/Transforms/Utils/NameAnonGlobals.h
-include/llvm/Transforms/Utils/OrderedInstructions.h
 include/llvm/Transforms/Utils/PredicateInfo.h
 include/llvm/Transforms/Utils/PromoteMemToReg.h
 include/llvm/Transforms/Utils/SSAUpdater.h
@@ -1972,6 +2093,7 @@ include/llvm/Transforms/Utils/VNCoercion
 include/llvm/Transforms/Utils/ValueMapper.h
 include/llvm/Transforms/Vectorize/
 include/llvm/Transforms/Vectorize.h
+include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h
 include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
 include/llvm/Transforms/Vectorize/LoopVectorize.h
 include/llvm/Transforms/Vectorize/SLPVectorizer.h
@@ -1982,14 +2104,23 @@ include/llvm/WindowsResource/ResourcePro
 include/llvm/WindowsResource/ResourceScriptToken.h
 include/llvm/WindowsResource/ResourceScriptTokenList.h
 include/llvm/XRay/
+include/llvm/XRay/BlockIndexer.h
+include/llvm/XRay/BlockPrinter.h
+include/llvm/XRay/BlockVerifier.h
+include/llvm/XRay/FDRLogBuilder.h
+include/llvm/XRay/FDRRecordConsumer.h
+include/llvm/XRay/FDRRecordProducer.h
+include/llvm/XRay/FDRRecords.h
+include/llvm/XRay/FDRTraceExpander.h
+include/llvm/XRay/FDRTraceWriter.h
+include/llvm/XRay/FileHeaderReader.h
 include/llvm/XRay/Graph.h
 include/llvm/XRay/InstrumentationMap.h
+include/llvm/XRay/Profile.h
+include/llvm/XRay/RecordPrinter.h
 include/llvm/XRay/Trace.h
 include/llvm/XRay/XRayRecord.h
 include/llvm/XRay/YAMLXRayRecord.h
-lib/BugpointPasses.so
-lib/LLVMHello.so
-lib/TestPlugin.so
 lib/clang/
 lib/clang/${LLVM_V}/
 ${CLANG_INCLUDE_PATH}/
@@ -2148,7 +2279,7 @@ lib/cmake/llvm/LLVMProcessSources.cmake
 lib/cmake/llvm/TableGen.cmake
 lib/cmake/llvm/VersionFromVCS.cmake
 lib/libLLVM-${LLVM_V}.so
-lib/libLLVM-7.so
+lib/libLLVM-8.so
 lib/libLLVM.so
 lib/libLLVMAggressiveInstCombine.a
 lib/libLLVMAnalysis.a
@@ -2179,13 +2310,17 @@ lib/libLLVMLibDriver.a
 lib/libLLVMLineEditor.a
 lib/libLLVMLinker.a
 lib/libLLVMMC.a
+lib/libLLVMMCA.a
 lib/libLLVMMCDisassembler.a
 lib/libLLVMMCJIT.a
 lib/libLLVMMCParser.a
 lib/libLLVMMIRParser.a
+lib/libLLVMMSP430AsmParser.a
+lib/libLLVMMSP430Disassembler.a
 lib/libLLVMObjCARCOpts.a
 lib/libLLVMObject.a
 lib/libLLVMObjectYAML.a
+lib/libLLVMOptRemarks.a
 lib/libLLVMOption.a
 lib/libLLVMOrcJIT.a
 lib/libLLVMPasses.a
@@ -2203,12 +2338,20 @@ lib/libLLVMSupport.a
 lib/libLLVMSymbolize.a
 lib/libLLVMTableGen.a
 lib/libLLVMTarget.a
+lib/libLLVMTextAPI.a
 lib/libLLVMTransformUtils.a
 lib/libLLVMVectorize.a
+lib/libLLVMWebAssemblyAsmParser.a
+lib/libLLVMWebAssemblyAsmPrinter.a
+lib/libLLVMWebAssemblyCodeGen.a
+lib/libLLVMWebAssemblyDesc.a
+lib/libLLVMWebAssemblyDisassembler.a
+lib/libLLVMWebAssemblyInfo.a
 lib/libLLVMWindowsManifest.a
 lib/libLLVMXRay.a
 lib/libLLVMipo.a
 @lib lib/libLTO.so.${LIBLTO_VERSION}
+lib/libOptRemarks.so.8
 @lib lib/libclang.so.${LIBclang_VERSION}
 lib/libclangARCMigrate.a
 lib/libclangAST.a
@@ -2265,6 +2408,7 @@ libexec/ccc-analyzer
 @man man/man1/llvm-build.1
 @man man/man1/llvm-config.1
 @man man/man1/llvm-cov.1
+@man man/man1/llvm-cxxmap.1
 @man man/man1/llvm-diff.1
 @man man/man1/llvm-dis.1
 @man man/man1/llvm-dwarfdump.1
@@ -2274,6 +2418,7 @@ libexec/ccc-analyzer
 @man man/man1/llvm-link.1
 @man man/man1/llvm-mca.1
 @man man/man1/llvm-nm.1
+@man man/man1/llvm-objdump.1
 @man man/man1/llvm-pdbutil.1
 @man man/man1/llvm-profdata.1
 @man man/man1/llvm-readobj.1
Index: lang/clang/clang.port.mk
===================================================================
RCS file: /cvs/ports/lang/clang/clang.port.mk,v
retrieving revision 1.32
diff -u -p -r1.32 clang.port.mk
--- lang/clang/clang.port.mk 28 Jan 2019 06:27:28 -0000 1.32
+++ lang/clang/clang.port.mk 29 Jun 2019 06:45:28 -0000
@@ -1,6 +1,6 @@
 # $OpenBSD: clang.port.mk,v 1.32 2019/01/28 06:27:28 jca Exp $
 
-MODCLANG_VERSION= 7.0.1
+MODCLANG_VERSION= 8.0.0
 
 MODCLANG_ARCHS ?= ${LLVM_ARCHS}
 MODCLANG_LANGS ?=



--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: [wip] devel/llvm 8.0.0

Sebastien Marie-3
On Sun, Jun 30, 2019 at 12:55:44AM +0200, Jeremie Courreges-Anglas wrote:
>
> Here's the diff I'm testing right now.  I have merged the llvm patches
> this morning and I did not double check them so far, but this lets llvm,
> include-what-you-use, rust and ripgrep build on amd64.  mozillas are
> building on amd64, llvm still compiling on sparc64.
>
> Sebastien, I guess we'll need to coordinate regarding rust-1.35 /
> rust-1.36 and llvm-7 / llvm-8.

I think you have more work than me to push a tested llvm-8. so you
should go first, and I will redo a part of my work for upgrading rust to
1.36, using llvm-8.

I will use the diff to prepare llvm-8 packages on my buildhosts and test
rust-1.36 with that.

Thanks.
--
Sebastien Marie

Reply | Threaded
Open this post in threaded view
|

Re: [wip] devel/llvm 8.0.0

Jeremie Courreges-Anglas-2
On Sun, Jun 30 2019, Sebastien Marie <[hidden email]> wrote:

> On Sun, Jun 30, 2019 at 12:55:44AM +0200, Jeremie Courreges-Anglas wrote:
>>
>> Here's the diff I'm testing right now.  I have merged the llvm patches
>> this morning and I did not double check them so far, but this lets llvm,
>> include-what-you-use, rust and ripgrep build on amd64.  mozillas are
>> building on amd64, llvm still compiling on sparc64.
>>
>> Sebastien, I guess we'll need to coordinate regarding rust-1.35 /
>> rust-1.36 and llvm-7 / llvm-8.
>
> I think you have more work than me to push a tested llvm-8. so you
> should go first, and I will redo a part of my work for upgrading rust to
> 1.36, using llvm-8.

I guess it's going to be easier for me this way, I'm not completely
sure.  After all, rust doesn't build on the slower archs that need to be
tested with llvm-8.  Anyway, the current rust version seems to cope fine
with llvm-8 so upgrading llvm first sound appealing.

> I will use the diff to prepare llvm-8 packages on my buildhosts and test
> rust-1.36 with that.

Please use this updated diff which adds py-recommonmark[0] as a build
dep.  Sorry for the obvious oversight!

[0] https://marc.info/?l=openbsd-ports&m=156189089024457&w=2


Index: devel/include-what-you-use/Makefile
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/Makefile,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile
--- devel/include-what-you-use/Makefile 17 Jun 2019 21:33:45 -0000 1.16
+++ devel/include-what-you-use/Makefile 30 Jun 2019 10:50:12 -0000
@@ -2,9 +2,8 @@
 
 COMMENT= tool to analyse \#includes in C and C++ source files
 CATEGORIES= devel
-DISTNAME= include-what-you-use-0.11.src
+DISTNAME= include-what-you-use-0.12.src
 PKGNAME= ${DISTNAME:.src=}
-REVISION= 1
 
 HOMEPAGE= https://include-what-you-use.org
 MASTER_SITES= ${HOMEPAGE}/downloads/
@@ -16,7 +15,7 @@ MAINTAINER= Jonathan Gray <[hidden email]
 PERMIT_PACKAGE= Yes
 
 WANTLIB= ${COMPILER_LIBCXX} c m pthread
-LLVM_V= 7.0.1
+LLVM_V= 8.0.0
 BUILD_DEPENDS= devel/llvm>=${LLVM_V}
 RUN_DEPENDS= devel/llvm>=${LLVM_V}
 
Index: devel/include-what-you-use/distinfo
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/distinfo,v
retrieving revision 1.7
diff -u -p -r1.7 distinfo
--- devel/include-what-you-use/distinfo 28 Jan 2019 06:27:28 -0000 1.7
+++ devel/include-what-you-use/distinfo 30 Jun 2019 10:50:12 -0000
@@ -1,2 +1,2 @@
-SHA256 (include-what-you-use-0.11.src.tar.gz) = LSh3cmxK7ZUYy7N2c/+8K32pwjm/j+KUMto1wcDsNno=
-SIZE (include-what-you-use-0.11.src.tar.gz) = 541763
+SHA256 (include-what-you-use-0.12.src.tar.gz) = pYkvsKvMuCDDlOTiRcAO8w/JTkrligSLI/lAR8CBYCU=
+SIZE (include-what-you-use-0.12.src.tar.gz) = 545673
Index: devel/include-what-you-use/patches/patch-iwyu_include_picker_cc
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/patches/patch-iwyu_include_picker_cc,v
retrieving revision 1.5
diff -u -p -r1.5 patch-iwyu_include_picker_cc
--- devel/include-what-you-use/patches/patch-iwyu_include_picker_cc 28 Jan 2019 06:27:28 -0000 1.5
+++ devel/include-what-you-use/patches/patch-iwyu_include_picker_cc 30 Jun 2019 10:50:12 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-iwyu_include_picker_cc,v
 Index: iwyu_include_picker.cc
 --- iwyu_include_picker.cc.orig
 +++ iwyu_include_picker.cc
-@@ -116,8 +116,6 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -118,8 +118,6 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "gid_t", kPrivate, "<unistd.h>", kPublic },
    { "id_t", kPrivate, "<sys/types.h>", kPublic },
    { "id_t", kPrivate, "<sys/resource.h>", kPublic },
@@ -12,7 +12,7 @@ Index: iwyu_include_picker.cc
    { "ino_t", kPrivate, "<sys/types.h>", kPublic },
    { "ino_t", kPrivate, "<dirent.h>", kPublic },
    { "ino_t", kPrivate, "<sys/stat.h>", kPublic },
-@@ -133,8 +131,6 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -143,8 +141,6 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "mode_t", kPrivate, "<sys/mman.h>", kPublic },
    { "nlink_t", kPrivate, "<sys/types.h>", kPublic },
    { "nlink_t", kPrivate, "<sys/stat.h>", kPublic },
@@ -21,7 +21,7 @@ Index: iwyu_include_picker.cc
    { "off_t", kPrivate, "<sys/types.h>", kPublic },
    { "off_t", kPrivate, "<unistd.h>", kPublic },
    { "off_t", kPrivate, "<sys/stat.h>", kPublic },
-@@ -148,11 +144,8 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -158,11 +154,8 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "pid_t", kPrivate, "<time.h>", kPublic },
    { "pid_t", kPrivate, "<utmpx.h>", kPublic },
    { "sigset_t", kPrivate, "<signal.h>", kPublic },
@@ -34,7 +34,7 @@ Index: iwyu_include_picker.cc
    { "ssize_t", kPrivate, "<sys/types.h>", kPublic },
    { "ssize_t", kPrivate, "<unistd.h>", kPublic },
    { "ssize_t", kPrivate, "<monetary.h>", kPublic },
-@@ -181,6 +174,7 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -195,6 +188,7 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "size_t", kPrivate, "<time.h>", kPublic },
    { "size_t", kPrivate, "<uchar.h>", kPublic },
    { "size_t", kPrivate, "<wchar.h>", kPublic },
@@ -42,7 +42,7 @@ Index: iwyu_include_picker.cc
    // Macros that can be defined in more than one file, don't have the
    // same __foo_defined guard that other types do, so the grep above
    // doesn't discover them.  Until I figure out a better way, I just
-@@ -195,6 +189,10 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -209,6 +203,10 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "calloc", kPrivate, "<stdlib.h>", kPublic },
    { "realloc", kPrivate, "<stdlib.h>", kPublic },
    { "free", kPrivate, "<stdlib.h>", kPublic },
@@ -53,7 +53,7 @@ Index: iwyu_include_picker.cc
    // Entries for NULL
    { "NULL", kPrivate, "<stddef.h>", kPublic },  // 'canonical' location for NULL
    { "NULL", kPrivate, "<clocale>", kPublic },
-@@ -240,7 +238,7 @@ const IncludeMapEntry libstdcpp_symbol_map[] = {
+@@ -254,7 +252,7 @@ const IncludeMapEntry libstdcpp_symbol_map[] = {
  };
 
  // Private -> public include mappings for GNU libc
@@ -62,7 +62,7 @@ Index: iwyu_include_picker.cc
    // ( cd /usr/include && grep '^ *# *include' {sys/,net/,}* | perl -nle 'm/^([^:]+).*<([^>]+)>/ && print qq@    { "<$2>", kPrivate, "<$1>", kPublic },@' | grep bits/ | sort )
    // When I saw more than one mapping for these, I typically picked
    // what I thought was the "best" one.
-@@ -443,6 +441,42 @@ const IncludeMapEntry libc_include_map[] = {
+@@ -457,6 +455,42 @@ const IncludeMapEntry libc_include_map[] = {
    { "<linux/limits.h>", kPrivate, "<limits.h>", kPublic },   // PATH_MAX
    { "<linux/prctl.h>", kPrivate, "<sys/prctl.h>", kPublic },
    { "<sys/ucontext.h>", kPrivate, "<ucontext.h>", kPublic },
Index: devel/include-what-you-use/pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -r1.3 PLIST
--- devel/include-what-you-use/pkg/PLIST 17 Jun 2019 21:33:45 -0000 1.3
+++ devel/include-what-you-use/pkg/PLIST 30 Jun 2019 10:50:12 -0000
@@ -24,4 +24,3 @@ share/include-what-you-use/libcxx.imp
 share/include-what-you-use/qt4.imp
 share/include-what-you-use/qt5_4.imp
 share/include-what-you-use/stl.c.headers.imp
-share/include-what-you-use/third_party.imp
Index: devel/llvm/Makefile
===================================================================
RCS file: /cvs/ports/devel/llvm/Makefile,v
retrieving revision 1.227
diff -u -p -r1.227 Makefile
--- devel/llvm/Makefile 22 Jun 2019 22:44:06 -0000 1.227
+++ devel/llvm/Makefile 30 Jun 2019 10:50:12 -0000
@@ -11,15 +11,13 @@ COMMENT-python = Python bindings for Cla
 
 # XXX: Remember to bump MODCLANG_VERSION in lang/clang/clang.port.mk when
 # updating this port.
-LLVM_V = 7.0.1
+LLVM_V = 8.0.0
 DISTNAME = llvm-${LLVM_V}.src
 PKGNAME = llvm-${LLVM_V}
 PKGSPEC-main = llvm-=${LLVM_V}
 PKGNAME-main = llvm-${LLVM_V}
 PKGNAME-python = py-llvm-${LLVM_V}
 PKGNAME-lldb = lldb-${LLVM_V}
-REVISION-main = 13
-REVISION-lldb = 3
 
 CATEGORIES = devel
 
@@ -51,7 +49,8 @@ MODULES = devel/cmake \
 TEST_DEPENDS = devel/dejagnu \
  shells/bash
 BUILD_DEPENDS += devel/swig \
- textproc/py-sphinx
+ textproc/py-sphinx \
+ textproc/py-recommonmark
 RUN_DEPENDS += devel/gtest
 
 .include <bsd.port.arch.mk>
Index: devel/llvm/distinfo
===================================================================
RCS file: /cvs/ports/devel/llvm/distinfo,v
retrieving revision 1.32
diff -u -p -r1.32 distinfo
--- devel/llvm/distinfo 8 May 2019 22:34:02 -0000 1.32
+++ devel/llvm/distinfo 30 Jun 2019 10:50:12 -0000
@@ -1,8 +1,8 @@
-SHA256 (cfe-7.0.1.src.tar.xz) = pFti3eXX1f3N+odrCvkvFk1DSwbp6JtdCxy8Zd/j9Bg=
-SHA256 (lld-7.0.1.src.tar.xz) = iGmqst0tjgDWmUM1LTFm0VnX6uJhX2amhPSgmZ/HQDE=
-SHA256 (lldb-7.0.1.src.tar.xz) = drRr51tBKj0i8NJieTBq5+J0/k15iKIYTFKcOKanaYI=
-SHA256 (llvm-7.0.1.src.tar.xz) = o438TbRxAux53MKqYek3IsX28G8KlhBzvYS3j7lJQZs=
-SIZE (cfe-7.0.1.src.tar.xz) = 12488668
-SIZE (lld-7.0.1.src.tar.xz) = 912812
-SIZE (lldb-7.0.1.src.tar.xz) = 19384628
-SIZE (llvm-7.0.1.src.tar.xz) = 28311056
+SHA256 (cfe-8.0.0.src.tar.xz) = CEwRWqsAhOY7I+7owjOrtnOcOZ4plm6uzPxuCI4Lc2s=
+SHA256 (lld-8.0.0.src.tar.xz) = nK7I7JIuMv+hMPD7COTFokLX5oznV2MeQl6eui4abjc=
+SHA256 (lldb-8.0.0.src.tar.xz) = SZGLnwmBZVSiCsRMX4WjLcCnoAdZsyWeeAZNZ06sA3M=
+SHA256 (llvm-8.0.0.src.tar.xz) = iHK+GxLGFFDKzIKz0VPqsCviVG7zT6NYDtFBN7smIkw=
+SIZE (cfe-8.0.0.src.tar.xz) = 12868468
+SIZE (lld-8.0.0.src.tar.xz) = 999864
+SIZE (lldb-8.0.0.src.tar.xz) = 19602332
+SIZE (llvm-8.0.0.src.tar.xz) = 30503732
Index: devel/llvm/patches/patch-include_llvm_ADT_Optional_h
===================================================================
RCS file: devel/llvm/patches/patch-include_llvm_ADT_Optional_h
diff -N devel/llvm/patches/patch-include_llvm_ADT_Optional_h
--- devel/llvm/patches/patch-include_llvm_ADT_Optional_h 28 Jan 2019 06:27:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,35 +0,0 @@
-$OpenBSD: patch-include_llvm_ADT_Optional_h,v 1.1 2019/01/28 06:27:28 jca Exp $
-
-[ADT] Drop llvm::Optional clang-specific optmization for trivially copyable types
-
-This fixes libLLVM.so ABI mismatches between llvm compiled with clang
-and llvm compiled with gcc (PR39427).
-
-Index: include/llvm/ADT/Optional.h
---- include/llvm/ADT/Optional.h.orig
-+++ include/llvm/ADT/Optional.h
-@@ -108,24 +108,6 @@ template <typename T, bool IsPodLike> struct OptionalS
-   }
- };
-
--#if !defined(__GNUC__) || defined(__clang__) // GCC up to GCC7 miscompiles this.
--/// Storage for trivially copyable types only.
--template <typename T> struct OptionalStorage<T, true> {
--  AlignedCharArrayUnion<T> storage;
--  bool hasVal = false;
--
--  OptionalStorage() = default;
--
--  OptionalStorage(const T &y) : hasVal(true) { new (storage.buffer) T(y); }
--  OptionalStorage &operator=(const T &y) {
--    *reinterpret_cast<T *>(storage.buffer) = y;
--    hasVal = true;
--    return *this;
--  }
--
--  void reset() { hasVal = false; }
--};
--#endif
- } // namespace optional_detail
-
- template <typename T> class Optional {
Index: devel/llvm/patches/patch-include_llvm_BinaryFormat_Dwarf_def
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-include_llvm_BinaryFormat_Dwarf_def,v
retrieving revision 1.3
diff -u -p -r1.3 patch-include_llvm_BinaryFormat_Dwarf_def
--- devel/llvm/patches/patch-include_llvm_BinaryFormat_Dwarf_def 11 Feb 2019 05:24:16 -0000 1.3
+++ devel/llvm/patches/patch-include_llvm_BinaryFormat_Dwarf_def 30 Jun 2019 10:50:12 -0000
@@ -5,7 +5,7 @@ implement -msave-args in clang/llvm, lik
 Index: include/llvm/BinaryFormat/Dwarf.def
 --- include/llvm/BinaryFormat/Dwarf.def.orig
 +++ include/llvm/BinaryFormat/Dwarf.def
-@@ -355,6 +355,8 @@ HANDLE_DW_AT(0x2133, GNU_addr_base, 0, GNU)
+@@ -365,6 +365,8 @@ HANDLE_DW_AT(0x2133, GNU_addr_base, 0, GNU)
  HANDLE_DW_AT(0x2134, GNU_pubnames, 0, GNU)
  HANDLE_DW_AT(0x2135, GNU_pubtypes, 0, GNU)
  HANDLE_DW_AT(0x2136, GNU_discriminator, 0, GNU)
Index: devel/llvm/patches/patch-include_llvm_CodeGen_AsmPrinter_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-include_llvm_CodeGen_AsmPrinter_h,v
retrieving revision 1.4
diff -u -p -r1.4 patch-include_llvm_CodeGen_AsmPrinter_h
--- devel/llvm/patches/patch-include_llvm_CodeGen_AsmPrinter_h 28 Jan 2019 06:27:28 -0000 1.4
+++ devel/llvm/patches/patch-include_llvm_CodeGen_AsmPrinter_h 30 Jun 2019 10:50:12 -0000
@@ -5,7 +5,7 @@ Use int3 trap padding between functions
 Index: include/llvm/CodeGen/AsmPrinter.h
 --- include/llvm/CodeGen/AsmPrinter.h.orig
 +++ include/llvm/CodeGen/AsmPrinter.h
-@@ -344,6 +344,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
+@@ -348,6 +348,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
    /// correctness.
    void EmitAlignment(unsigned NumBits, const GlobalObject *GV = nullptr) const;
 
@@ -17,7 +17,7 @@ Index: include/llvm/CodeGen/AsmPrinter.h
    /// Lower the specified LLVM Constant to an MCExpr.
    virtual const MCExpr *lowerConstant(const Constant *CV);
 
-@@ -401,6 +406,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
+@@ -408,6 +413,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
    virtual void EmitInstruction(const MachineInstr *) {
      llvm_unreachable("EmitInstruction not implemented");
    }
Index: devel/llvm/patches/patch-include_llvm_CodeGen_MachineFrameInfo_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-include_llvm_CodeGen_MachineFrameInfo_h,v
retrieving revision 1.3
diff -u -p -r1.3 patch-include_llvm_CodeGen_MachineFrameInfo_h
--- devel/llvm/patches/patch-include_llvm_CodeGen_MachineFrameInfo_h 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-include_llvm_CodeGen_MachineFrameInfo_h 30 Jun 2019 10:50:12 -0000
@@ -22,7 +22,7 @@ $OpenBSD: patch-include_llvm_CodeGen_Mac
 Index: include/llvm/CodeGen/MachineFrameInfo.h
 --- include/llvm/CodeGen/MachineFrameInfo.h.orig
 +++ include/llvm/CodeGen/MachineFrameInfo.h
-@@ -257,6 +257,13 @@ class MachineFrameInfo { (private)
+@@ -274,6 +274,15 @@ class MachineFrameInfo { (private)
    /// The frame index for the stack protector.
    int StackProtectorIdx = -1;
 
@@ -31,12 +31,14 @@ Index: include/llvm/CodeGen/MachineFrame
 +    unsigned Register = 0;
 +    /// Set to true if this function needs return protectors
 +    bool Needed = false;
++    /// Does the return protector cookie need to be stored in frame
++    bool NeedsStore = true;
 +  } RPI;
 +
    /// The frame index for the function context. Used for SjLj exceptions.
    int FunctionContextIdx = -1;
 
-@@ -333,6 +340,14 @@ class MachineFrameInfo { (private)
+@@ -354,6 +363,17 @@ class MachineFrameInfo { (private)
    int getStackProtectorIndex() const { return StackProtectorIdx; }
    void setStackProtectorIndex(int I) { StackProtectorIdx = I; }
    bool hasStackProtectorIndex() const { return StackProtectorIdx != -1; }
@@ -48,6 +50,9 @@ Index: include/llvm/CodeGen/MachineFrame
 +  /// Get / Set if this frame needs a return protector
 +  void setReturnProtectorNeeded(bool I) { RPI.Needed = I; }
 +  bool getReturnProtectorNeeded() const { return RPI.Needed; }
++  /// Get / Set if the return protector cookie needs to be stored in frame
++  void setReturnProtectorNeedsStore(bool I) { RPI.NeedsStore = I; }
++  bool getReturnProtectorNeedsStore() const { return RPI.NeedsStore; }
 
    /// Return the index for the function context object.
    /// This object is used for SjLj exceptions.
Index: devel/llvm/patches/patch-include_llvm_InitializePasses_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-include_llvm_InitializePasses_h,v
retrieving revision 1.2
diff -u -p -r1.2 patch-include_llvm_InitializePasses_h
--- devel/llvm/patches/patch-include_llvm_InitializePasses_h 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-include_llvm_InitializePasses_h 30 Jun 2019 10:50:12 -0000
@@ -21,7 +21,7 @@ remove these gadgets will continue throu
 Index: include/llvm/InitializePasses.h
 --- include/llvm/InitializePasses.h.orig
 +++ include/llvm/InitializePasses.h
-@@ -339,6 +339,7 @@ void initializeRegionViewerPass(PassRegistry&);
+@@ -345,6 +345,7 @@ void initializeRegionViewerPass(PassRegistry&);
  void initializeRegisterCoalescerPass(PassRegistry&);
  void initializeRenameIndependentSubregsPass(PassRegistry&);
  void initializeResetMachineFunctionPass(PassRegistry&);
Index: devel/llvm/patches/patch-lib_Bitcode_Reader_MetadataLoader_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Bitcode_Reader_MetadataLoader_cpp
diff -N devel/llvm/patches/patch-lib_Bitcode_Reader_MetadataLoader_cpp
--- devel/llvm/patches/patch-lib_Bitcode_Reader_MetadataLoader_cpp 30 Jan 2019 07:36:06 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-lib_Bitcode_Reader_MetadataLoader_cpp,v 1.1 2019/01/30 07:36:06 semarie Exp $
-https://github.com/llvm-mirror/llvm/commit/da1fb72bb305d6bc1f3899d541414146934bf80f
-Index: lib/Bitcode/Reader/MetadataLoader.cpp
---- lib/Bitcode/Reader/MetadataLoader.cpp.orig
-+++ lib/Bitcode/Reader/MetadataLoader.cpp
-@@ -1308,7 +1308,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMeta
-                            (Context, Tag, Name, File, Line, Scope, BaseType,
-                             SizeInBits, AlignInBits, OffsetInBits, Flags,
-                             Elements, RuntimeLang, VTableHolder, TemplateParams,
--                            Identifier));
-+                            Identifier, Discriminator));
-     if (!IsNotUsedInTypeRef && Identifier)
-       MetadataList.addTypeRef(*Identifier, *cast<DICompositeType>(CT));
-
Index: devel/llvm/patches/patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp,v
retrieving revision 1.7
diff -u -p -r1.7 patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp
--- devel/llvm/patches/patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp 28 Jan 2019 06:27:28 -0000 1.7
+++ devel/llvm/patches/patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp 30 Jun 2019 10:50:12 -0000
@@ -8,7 +8,7 @@ $OpenBSD: patch-lib_CodeGen_AsmPrinter_A
 Index: lib/CodeGen/AsmPrinter/AsmPrinter.cpp
 --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp.orig
 +++ lib/CodeGen/AsmPrinter/AsmPrinter.cpp
-@@ -651,7 +651,7 @@ void AsmPrinter::EmitFunctionHeader() {
+@@ -653,7 +653,7 @@ void AsmPrinter::EmitFunctionHeader() {
 
    EmitLinkage(&F, CurrentFnSym);
    if (MAI->hasFunctionAlignment())
@@ -17,7 +17,7 @@ Index: lib/CodeGen/AsmPrinter/AsmPrinter
 
    if (MAI->hasDotTypeDotSizeDirective())
      OutStreamer->EmitSymbolAttribute(CurrentFnSym, MCSA_ELF_TypeFunction);
-@@ -2036,6 +2036,31 @@ void AsmPrinter::EmitAlignment(unsigned NumBits, const
+@@ -2112,6 +2112,31 @@ void AsmPrinter::EmitAlignment(unsigned NumBits, const
  }
 
  //===----------------------------------------------------------------------===//
@@ -49,7 +49,7 @@ Index: lib/CodeGen/AsmPrinter/AsmPrinter
  // Constant emission.
  //===----------------------------------------------------------------------===//
 
-@@ -2803,11 +2828,15 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasi
+@@ -2879,11 +2904,15 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasi
      }
    }
 
Index: devel/llvm/patches/patch-lib_CodeGen_PrologEpilogInserter_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_CodeGen_PrologEpilogInserter_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_CodeGen_PrologEpilogInserter_cpp
--- devel/llvm/patches/patch-lib_CodeGen_PrologEpilogInserter_cpp 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-lib_CodeGen_PrologEpilogInserter_cpp 30 Jun 2019 10:50:12 -0000
@@ -22,7 +22,7 @@ $OpenBSD: patch-lib_CodeGen_PrologEpilog
 Index: lib/CodeGen/PrologEpilogInserter.cpp
 --- lib/CodeGen/PrologEpilogInserter.cpp.orig
 +++ lib/CodeGen/PrologEpilogInserter.cpp
-@@ -171,7 +171,11 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
+@@ -176,7 +176,11 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
    const Function &F = MF.getFunction();
    const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
    const TargetFrameLowering *TFI = MF.getSubtarget().getFrameLowering();
@@ -34,7 +34,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
    RS = TRI->requiresRegisterScavenging(MF) ? new RegScavenger() : nullptr;
    FrameIndexVirtualScavenging = TRI->requiresFrameIndexScavenging(MF);
    FrameIndexEliminationScavenging = (RS && !FrameIndexVirtualScavenging) ||
-@@ -206,6 +210,10 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
+@@ -211,6 +215,10 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
    if (!F.hasFnAttribute(Attribute::Naked))
      insertPrologEpilogCode(MF);
 
@@ -45,7 +45,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
    // Replace all MO_FrameIndex operands with physical register references
    // and actual offsets.
    //
-@@ -296,7 +304,9 @@ void PEI::calculateCallFrameInfo(MachineFunction &MF)
+@@ -301,7 +309,9 @@ void PEI::calculateCallFrameInfo(MachineFunction &MF)
  /// Compute the sets of entry and return blocks for saving and restoring
  /// callee-saved registers, and placing prolog and epilog code.
  void PEI::calculateSaveRestoreBlocks(MachineFunction &MF) {
@@ -56,7 +56,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
 
    // Even when we do not change any CSR, we still want to insert the
    // prologue and epilogue of the function.
-@@ -312,7 +322,18 @@ void PEI::calculateSaveRestoreBlocks(MachineFunction &
+@@ -317,7 +327,18 @@ void PEI::calculateSaveRestoreBlocks(MachineFunction &
      // epilogue.
      if (!RestoreBlock->succ_empty() || RestoreBlock->isReturnBlock())
        RestoreBlocks.push_back(RestoreBlock);
@@ -76,7 +76,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
    }
 
    // Save refs to entry and return blocks.
-@@ -323,6 +344,9 @@ void PEI::calculateSaveRestoreBlocks(MachineFunction &
+@@ -328,6 +349,9 @@ void PEI::calculateSaveRestoreBlocks(MachineFunction &
      if (MBB.isReturnBlock())
        RestoreBlocks.push_back(&MBB);
    }
@@ -86,7 +86,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
  }
 
  static void assignCalleeSavedSpillSlots(MachineFunction &F,
-@@ -344,6 +368,10 @@ static void assignCalleeSavedSpillSlots(MachineFunctio
+@@ -349,6 +373,10 @@ static void assignCalleeSavedSpillSlots(MachineFunctio
 
    const TargetFrameLowering *TFI = F.getSubtarget().getFrameLowering();
    MachineFrameInfo &MFI = F.getFrameInfo();
Index: devel/llvm/patches/patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp
diff -N devel/llvm/patches/patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp
--- devel/llvm/patches/patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp 28 Jan 2019 06:27:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-$OpenBSD: patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp,v 1.1 2019/01/28 06:27:28 jca Exp $
-
-Revert "Revert r342183 "[DAGCombine] Fix crash when store merging created an
-extract_subvector with invalid index.""
-
-Index: lib/CodeGen/SelectionDAG/DAGCombiner.cpp
---- lib/CodeGen/SelectionDAG/DAGCombiner.cpp.orig
-+++ lib/CodeGen/SelectionDAG/DAGCombiner.cpp
-@@ -13727,17 +13727,24 @@ bool DAGCombiner::MergeStoresOfConstantsOrVecElts(
-              Val.getOpcode() == ISD::EXTRACT_SUBVECTOR)) {
-           SDValue Vec = Val.getOperand(0);
-           EVT MemVTScalarTy = MemVT.getScalarType();
-+          SDValue Idx = Val.getOperand(1);
-           // We may need to add a bitcast here to get types to line up.
-           if (MemVTScalarTy != Vec.getValueType()) {
-             unsigned Elts = Vec.getValueType().getSizeInBits() /
-                             MemVTScalarTy.getSizeInBits();
-+            if (Val.getValueType().isVector() && MemVT.isVector()) {
-+              unsigned IdxC = cast<ConstantSDNode>(Idx)->getZExtValue();
-+              unsigned NewIdx =
-+                  ((uint64_t)IdxC * MemVT.getVectorNumElements()) / Elts;
-+              Idx = DAG.getConstant(NewIdx, SDLoc(Val), Idx.getValueType());
-+            }
-             EVT NewVecTy =
-                 EVT::getVectorVT(*DAG.getContext(), MemVTScalarTy, Elts);
-             Vec = DAG.getBitcast(NewVecTy, Vec);
-           }
-           auto OpC = (MemVT.isVector()) ? ISD::EXTRACT_SUBVECTOR
-                                         : ISD::EXTRACT_VECTOR_ELT;
--          Val = DAG.getNode(OpC, SDLoc(Val), MemVT, Vec, Val.getOperand(1));
-+          Val = DAG.getNode(OpC, SDLoc(Val), MemVT, Vec, Idx);
-         }
-         Ops.push_back(Val);
-       }
Index: devel/llvm/patches/patch-lib_CodeGen_TargetLoweringBase_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_CodeGen_TargetLoweringBase_cpp,v
retrieving revision 1.5
diff -u -p -r1.5 patch-lib_CodeGen_TargetLoweringBase_cpp
--- devel/llvm/patches/patch-lib_CodeGen_TargetLoweringBase_cpp 28 Jan 2019 06:27:28 -0000 1.5
+++ devel/llvm/patches/patch-lib_CodeGen_TargetLoweringBase_cpp 30 Jun 2019 10:50:12 -0000
@@ -7,7 +7,7 @@ solve the crashes in the previous code.
 Index: lib/CodeGen/TargetLoweringBase.cpp
 --- lib/CodeGen/TargetLoweringBase.cpp.orig
 +++ lib/CodeGen/TargetLoweringBase.cpp
-@@ -1624,7 +1624,10 @@ Value *TargetLoweringBase::getIRStackGuard(IRBuilder<>
+@@ -1636,7 +1636,10 @@ Value *TargetLoweringBase::getIRStackGuard(IRBuilder<>
    if (getTargetMachine().getTargetTriple().isOSOpenBSD()) {
      Module &M = *IRB.GetInsertBlock()->getParent()->getParent();
      PointerType *PtrTy = Type::getInt8PtrTy(M.getContext());
Index: devel/llvm/patches/patch-lib_CodeGen_TargetPassConfig_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_CodeGen_TargetPassConfig_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_CodeGen_TargetPassConfig_cpp
--- devel/llvm/patches/patch-lib_CodeGen_TargetPassConfig_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_CodeGen_TargetPassConfig_cpp 30 Jun 2019 10:50:12 -0000
@@ -21,7 +21,7 @@ remove these gadgets will continue throu
 Index: lib/CodeGen/TargetPassConfig.cpp
 --- lib/CodeGen/TargetPassConfig.cpp.orig
 +++ lib/CodeGen/TargetPassConfig.cpp
-@@ -696,6 +696,8 @@ void TargetPassConfig::addISelPrepare() {
+@@ -737,6 +737,8 @@ void TargetPassConfig::addISelPrepare() {
    if (requiresCodeGenSCCOrder())
      addPass(new DummyCGSCCPass);
 
Index: devel/llvm/patches/patch-lib_MC_MCParser_AsmParser_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_MC_MCParser_AsmParser_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-lib_MC_MCParser_AsmParser_cpp
--- devel/llvm/patches/patch-lib_MC_MCParser_AsmParser_cpp 28 Jan 2019 15:34:22 -0000 1.6
+++ devel/llvm/patches/patch-lib_MC_MCParser_AsmParser_cpp 30 Jun 2019 10:50:12 -0000
@@ -11,7 +11,7 @@ a file directive.
 Index: lib/MC/MCParser/AsmParser.cpp
 --- lib/MC/MCParser/AsmParser.cpp.orig
 +++ lib/MC/MCParser/AsmParser.cpp
-@@ -874,6 +874,10 @@ bool AsmParser::Run(bool NoInitialTextSection, bool No
+@@ -878,6 +878,10 @@ bool AsmParser::Run(bool NoInitialTextSection, bool No
      (void)InsertResult;
    }
 
Index: devel/llvm/patches/patch-lib_Support_Unix_Threading_inc
===================================================================
RCS file: devel/llvm/patches/patch-lib_Support_Unix_Threading_inc
diff -N devel/llvm/patches/patch-lib_Support_Unix_Threading_inc
--- devel/llvm/patches/patch-lib_Support_Unix_Threading_inc 11 Feb 2019 05:24:16 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
-$OpenBSD: patch-lib_Support_Unix_Threading_inc,v 1.3 2019/02/11 05:24:16 jca Exp $
-
-Add OpenBSD support to be able to get the thread name
-
-Index: lib/Support/Unix/Threading.inc
---- lib/Support/Unix/Threading.inc.orig
-+++ lib/Support/Unix/Threading.inc
-@@ -203,6 +203,12 @@ void llvm::get_thread_name(SmallVectorImpl<char> &Name
-   ::pthread_getname_np(::pthread_self(), buf, len);
-
-   Name.append(buf, buf + strlen(buf));
-+#elif defined(__OpenBSD__)
-+  constexpr uint32_t len = get_max_thread_name_length_impl();
-+  char buf[len];
-+  ::pthread_get_name_np(::pthread_self(), buf, len);
-+
-+  Name.append(buf, buf + strlen(buf));
- #elif defined(__linux__)
- #if HAVE_PTHREAD_GETNAME_NP
-   constexpr uint32_t len = get_max_thread_name_length_impl();
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64AsmPrinter_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64AsmPrinter_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_AArch64_AArch64AsmPrinter_cpp
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64AsmPrinter_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64AsmPrinter_cpp 30 Jun 2019 10:50:12 -0000
@@ -5,9 +5,9 @@ Add retguard for arm64.
 Index: lib/Target/AArch64/AArch64AsmPrinter.cpp
 --- lib/Target/AArch64/AArch64AsmPrinter.cpp.orig
 +++ lib/Target/AArch64/AArch64AsmPrinter.cpp
-@@ -683,6 +683,19 @@ void AArch64AsmPrinter::EmitInstruction(const MachineI
-   case TargetOpcode::PATCHABLE_TAIL_CALL:
-     LowerPATCHABLE_TAIL_CALL(*MI);
+@@ -986,6 +986,19 @@ void AArch64AsmPrinter::EmitInstruction(const MachineI
+   case AArch64::SEH_EpilogEnd:
+     TS->EmitARM64WinCFIEpilogEnd();
      return;
 +
 +  case AArch64::RETGUARD_JMP_TRAP:
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64FrameLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64FrameLowering_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_AArch64_AArch64FrameLowering_cpp
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64FrameLowering_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64FrameLowering_cpp 30 Jun 2019 10:50:12 -0000
@@ -13,23 +13,41 @@ Index: lib/Target/AArch64/AArch64FrameLo
  #include "AArch64Subtarget.h"
  #include "AArch64TargetMachine.h"
  #include "MCTargetDesc/AArch64AddressingModes.h"
-@@ -1421,6 +1422,12 @@ void AArch64FrameLowering::determineCalleeSaves(Machin
-     if (produceCompactUnwindFrame(MF) && !SavedRegs.test(PairedReg))
-       SpillEstimate++;
-   }
+@@ -1975,6 +1976,30 @@ void AArch64FrameLowering::determineCalleeSaves(Machin
+                                 ? RegInfo->getBaseRegister()
+                                 : (unsigned)AArch64::NoRegister;
+
++  unsigned SpillEstimate = SavedRegs.count();
++  for (unsigned i = 0; CSRegs[i]; ++i) {
++    unsigned Reg = CSRegs[i];
++    unsigned PairedReg = CSRegs[i ^ 1];
++    if (Reg == BasePointerReg)
++      SpillEstimate++;
++    if (produceCompactUnwindFrame(MF) && !SavedRegs.test(PairedReg))
++      SpillEstimate++;
++  }
 +
-+  if (MFI.hasReturnProtectorRegister()) {
++  if (MFI.hasReturnProtectorRegister() && MFI.getReturnProtectorNeedsStore()) {
 +    SavedRegs.set(MFI.getReturnProtectorRegister());
 +    SpillEstimate++;
 +  }
 +
-   SpillEstimate += 2; // Conservatively include FP+LR in the estimate
-   unsigned StackEstimate = MFI.estimateStackSize(MF) + 8 * SpillEstimate;
-
-@@ -1523,4 +1530,8 @@ bool AArch64FrameLowering::enableStackSlotScavenging(
-     const MachineFunction &MF) const {
-   const AArch64FunctionInfo *AFI = MF.getInfo<AArch64FunctionInfo>();
-   return AFI->hasCalleeSaveStackFreeSpace();
++  SpillEstimate += 2; // Conservatively include FP+LR in the estimate
++  unsigned StackEstimate = MFI.estimateStackSize(MF) + 8 * SpillEstimate;
++
++  // The frame record needs to be created by saving the appropriate registers
++  if (hasFP(MF) || windowsRequiresStackProbe(MF, StackEstimate)) {
++    SavedRegs.set(AArch64::FP);
++    SavedRegs.set(AArch64::LR);
++  }
++
+   unsigned ExtraCSSpill = 0;
+   // Figure out which callee-saved registers to save/restore.
+   for (unsigned i = 0; CSRegs[i]; ++i) {
+@@ -2156,4 +2181,8 @@ unsigned AArch64FrameLowering::getWinEHFuncletFrameSiz
+   // This is the amount of stack a funclet needs to allocate.
+   return alignTo(CSSize + MF.getFrameInfo().getMaxCallFrameSize(),
+                  getStackAlignment());
 +}
 +
 +const ReturnProtectorLowering *AArch64FrameLowering::getReturnProtector() const {
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64ISelLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64ISelLowering_cpp,v
retrieving revision 1.9
diff -u -p -r1.9 patch-lib_Target_AArch64_AArch64ISelLowering_cpp
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64ISelLowering_cpp 28 Jan 2019 06:27:28 -0000 1.9
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64ISelLowering_cpp 30 Jun 2019 10:50:12 -0000
@@ -7,7 +7,7 @@ IR Stack Guard.
 Index: lib/Target/AArch64/AArch64ISelLowering.cpp
 --- lib/Target/AArch64/AArch64ISelLowering.cpp.orig
 +++ lib/Target/AArch64/AArch64ISelLowering.cpp
-@@ -11298,7 +11298,8 @@ void AArch64TargetLowering::ReplaceNodeResults(
+@@ -11559,7 +11559,8 @@ void AArch64TargetLowering::ReplaceNodeResults(
  }
 
  bool AArch64TargetLowering::useLoadStackGuardNode() const {
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64InstrInfo_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64InstrInfo_td,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_AArch64_AArch64InstrInfo_td
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64InstrInfo_td 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64InstrInfo_td 30 Jun 2019 10:50:12 -0000
@@ -5,7 +5,7 @@ Add retguard for arm64.
 Index: lib/Target/AArch64/AArch64InstrInfo.td
 --- lib/Target/AArch64/AArch64InstrInfo.td.orig
 +++ lib/Target/AArch64/AArch64InstrInfo.td
-@@ -418,6 +418,12 @@ def ADDlowTLS
+@@ -491,6 +491,12 @@ def ADDlowTLS
 
  } // isReMaterializable, isCodeGenOnly
 
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64Subtarget_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64Subtarget_h,v
retrieving revision 1.4
diff -u -p -r1.4 patch-lib_Target_AArch64_AArch64Subtarget_h
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64Subtarget_h 28 Jan 2019 06:27:28 -0000 1.4
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64Subtarget_h 30 Jun 2019 10:50:12 -0000
@@ -7,7 +7,7 @@ IR Stack Guard.
 Index: lib/Target/AArch64/AArch64Subtarget.h
 --- lib/Target/AArch64/AArch64Subtarget.h.orig
 +++ lib/Target/AArch64/AArch64Subtarget.h
-@@ -302,6 +302,7 @@ class AArch64Subtarget final : public AArch64GenSubtar
+@@ -371,6 +371,7 @@ class AArch64Subtarget final : public AArch64GenSubtar
    bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
    bool isTargetIOS() const { return TargetTriple.isiOS(); }
    bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
Index: devel/llvm/patches/patch-lib_Target_AArch64_CMakeLists_txt
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_CMakeLists_txt,v
retrieving revision 1.1
diff -u -p -r1.1 patch-lib_Target_AArch64_CMakeLists_txt
--- devel/llvm/patches/patch-lib_Target_AArch64_CMakeLists_txt 21 Aug 2018 06:56:09 -0000 1.1
+++ devel/llvm/patches/patch-lib_Target_AArch64_CMakeLists_txt 30 Jun 2019 10:50:12 -0000
@@ -5,11 +5,11 @@ Add retguard for arm64.
 Index: lib/Target/AArch64/CMakeLists.txt
 --- lib/Target/AArch64/CMakeLists.txt.orig
 +++ lib/Target/AArch64/CMakeLists.txt
-@@ -47,6 +47,7 @@ add_llvm_target(AArch64CodeGen
+@@ -51,6 +51,7 @@ add_llvm_target(AArch64CodeGen
    AArch64PBQPRegAlloc.cpp
    AArch64RegisterBankInfo.cpp
    AArch64RegisterInfo.cpp
 +  AArch64ReturnProtectorLowering.cpp
    AArch64SelectionDAGInfo.cpp
+   AArch64SpeculationHardening.cpp
    AArch64StorePairSuppress.cpp
-   AArch64Subtarget.cpp
Index: devel/llvm/patches/patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp
diff -N devel/llvm/patches/patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp
--- devel/llvm/patches/patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp 28 Jan 2019 06:27:28 -0000 1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-$OpenBSD: patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp,v 1.8 2019/01/28 06:27:28 jca Exp $
-
-[mips] Enable using of integrated assembler in all cases.
-
-Index: lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
---- lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp.orig
-+++ lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
-@@ -50,21 +50,5 @@ MipsMCAsmInfo::MipsMCAsmInfo(const Triple &TheTriple)
-   ExceptionsType = ExceptionHandling::DwarfCFI;
-   DwarfRegNumForCFI = true;
-   HasMipsExpressions = true;
--
--  // Enable IAS by default for O32.
--  if (TheTriple.isMIPS32())
--    UseIntegratedAssembler = true;
--
--  // Enable IAS by default for Debian mips64/mips64el.
--  if (TheTriple.getEnvironment() == Triple::GNUABI64)
--    UseIntegratedAssembler = true;
--
--  // Enable IAS by default for Android mips64el that uses N64 ABI.
--  if (TheTriple.getArch() == Triple::mips64el && TheTriple.isAndroid())
--    UseIntegratedAssembler = true;
--
--  // Enable IAS by default for FreeBSD / OpenBSD mips64/mips64el.
--  if (TheTriple.isOSFreeBSD() ||
--      TheTriple.isOSOpenBSD())
--    UseIntegratedAssembler = true;
-+  UseIntegratedAssembler = true;
- }
Index: devel/llvm/patches/patch-lib_Target_PowerPC_PPCISelLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_PowerPC_PPCISelLowering_cpp,v
retrieving revision 1.4
diff -u -p -r1.4 patch-lib_Target_PowerPC_PPCISelLowering_cpp
--- devel/llvm/patches/patch-lib_Target_PowerPC_PPCISelLowering_cpp 20 Feb 2019 00:24:11 -0000 1.4
+++ devel/llvm/patches/patch-lib_Target_PowerPC_PPCISelLowering_cpp 30 Jun 2019 10:50:12 -0000
@@ -10,7 +10,7 @@ compiler generate code that only uses al
 Index: lib/Target/PowerPC/PPCISelLowering.cpp
 --- lib/Target/PowerPC/PPCISelLowering.cpp.orig
 +++ lib/Target/PowerPC/PPCISelLowering.cpp
-@@ -13921,6 +13921,14 @@ bool PPCTargetLowering::allowsMisalignedMemoryAccesses
+@@ -14204,6 +14204,14 @@ bool PPCTargetLowering::allowsMisalignedMemoryAccesses
    if (VT == MVT::ppcf128)
      return false;
 
Index: devel/llvm/patches/patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp
diff -N devel/llvm/patches/patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp
--- devel/llvm/patches/patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp 28 Jan 2019 06:27:28 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,84 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp,v 1.6 2019/01/28 06:27:28 jca Exp $
-
-[Sparc] Add membar assembler tags
-
-Index: lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
---- lib/Target/Sparc/AsmParser/SparcAsmParser.cpp.orig
-+++ lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
-@@ -78,6 +78,8 @@ class SparcAsmParser : public MCTargetAsmParser {
-   // Custom parse functions for Sparc specific operands.
-   OperandMatchResultTy parseMEMOperand(OperandVector &Operands);
-
-+  OperandMatchResultTy parseMembarTag(OperandVector &Operands);
-+
-   OperandMatchResultTy parseOperand(OperandVector &Operands, StringRef Name);
-
-   OperandMatchResultTy
-@@ -256,6 +258,7 @@ class SparcOperand : public MCParsedAsmOperand { (publ
-   bool isMem() const override { return isMEMrr() || isMEMri(); }
-   bool isMEMrr() const { return Kind == k_MemoryReg; }
-   bool isMEMri() const { return Kind == k_MemoryImm; }
-+  bool isMembarTag() const { return Kind == k_Immediate; }
-
-   bool isIntReg() const {
-     return (Kind == k_Register && Reg.Kind == rk_IntReg);
-@@ -366,6 +369,12 @@ class SparcOperand : public MCParsedAsmOperand { (publ
-     addExpr(Inst, Expr);
-   }
-
-+  void addMembarTagOperands(MCInst &Inst, unsigned N) const {
-+    assert(N == 1 && "Invalid number of operands!");
-+    const MCExpr *Expr = getImm();
-+    addExpr(Inst, Expr);
-+  }
-+
-   static std::unique_ptr<SparcOperand> CreateToken(StringRef Str, SMLoc S) {
-     auto Op = make_unique<SparcOperand>(k_Token);
-     Op->Tok.Data = Str.data();
-@@ -739,6 +748,46 @@ SparcAsmParser::parseMEMOperand(OperandVector &Operand
-       Offset->isImm() ? SparcOperand::MorphToMEMri(BaseReg, std::move(Offset))
-                       : SparcOperand::MorphToMEMrr(BaseReg, std::move(Offset)));
-
-+  return MatchOperand_Success;
-+}
-+
-+OperandMatchResultTy SparcAsmParser::parseMembarTag(OperandVector &Operands) {
-+  SMLoc S = Parser.getTok().getLoc();
-+  const MCExpr *EVal;
-+  unsigned ImmVal = 0;
-+
-+  while (getLexer().getKind() == AsmToken::Hash) {
-+    SMLoc TagStart = getLexer().getLoc();
-+    Parser.Lex(); // Eat the '#'.
-+    unsigned MaskVal = StringSwitch<unsigned>(Parser.getTok().getString())
-+      .Case("LoadLoad", 0x1)
-+      .Case("StoreLoad", 0x2)
-+      .Case("LoadStore", 0x4)
-+      .Case("StoreStore", 0x8)
-+      .Case("Lookaside", 0x10)
-+      .Case("MemIssue", 0x20)
-+      .Case("Sync", 0x40)
-+      .Default(0);
-+
-+    Parser.Lex(); // Eat the identifier token.
-+
-+    if (!MaskVal) {
-+      Error(TagStart, "unknown membar tag");
-+      return MatchOperand_ParseFail;
-+    }
-+
-+    ImmVal |= MaskVal;
-+
-+    if (getLexer().getKind() == AsmToken::Pipe)
-+      Parser.Lex(); // Eat the '|'.
-+  }
-+
-+  if (!ImmVal)
-+    return MatchOperand_NoMatch;
-+
-+  EVal = MCConstantExpr::create(ImmVal, getContext());
-+  SMLoc E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1);
-+  Operands.push_back(SparcOperand::CreateImm(EVal, S, E));
-   return MatchOperand_Success;
- }
-
Index: devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp
diff -N devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp
--- devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp 28 Jan 2019 06:27:28 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp,v 1.4 2019/01/28 06:27:28 jca Exp $
-
-[Sparc] Add membar assembler tags
-
-Index: lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp
---- lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp.orig
-+++ lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp
-@@ -195,3 +195,26 @@ bool SparcInstPrinter::printGetPCX(const MCInst *MI, u
-   llvm_unreachable("FIXME: Implement SparcInstPrinter::printGetPCX.");
-   return true;
- }
-+
-+void SparcInstPrinter::printMembarTag(const MCInst *MI, int opNum,
-+                                      const MCSubtargetInfo &STI,
-+                                      raw_ostream &O) {
-+  static const char *const TagNames[] = {
-+      "#LoadLoad",  "#StoreLoad", "#LoadStore", "#StoreStore",
-+      "#Lookaside", "#MemIssue",  "#Sync"};
-+
-+  unsigned Imm = MI->getOperand(opNum).getImm();
-+
-+  if (Imm > 127) {
-+    O << Imm;
-+    return;
-+  }
-+
-+  bool First = true;
-+  for (unsigned i = 0; i < sizeof(TagNames) / sizeof(char *); i++) {
-+    if (Imm & (1 << i)) {
-+      O << (First ? "" : " | ") << TagNames[i];
-+      First = false;
-+    }
-+  }
-+}
Index: devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h
diff -N devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h
--- devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h 14 Nov 2018 09:07:41 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h,v 1.3 2018/11/14 09:07:41 ajacoutot Exp $
-
-[Sparc] Add membar assembler tags
-
-Index: lib/Target/Sparc/InstPrinter/SparcInstPrinter.h
---- lib/Target/Sparc/InstPrinter/SparcInstPrinter.h.orig
-+++ lib/Target/Sparc/InstPrinter/SparcInstPrinter.h
-@@ -49,6 +49,8 @@ class SparcInstPrinter : public MCInstPrinter { (publi
-                       raw_ostream &OS);
-   bool printGetPCX(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
-                    raw_ostream &OS);
-+  void printMembarTag(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
-+                      raw_ostream &O);
- };
- } // end namespace llvm
-
Index: devel/llvm/patches/patch-lib_Target_Sparc_SparcISelLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_Sparc_SparcISelLowering_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_Target_Sparc_SparcISelLowering_cpp
--- devel/llvm/patches/patch-lib_Target_Sparc_SparcISelLowering_cpp 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-lib_Target_Sparc_SparcISelLowering_cpp 30 Jun 2019 10:50:12 -0000
@@ -1,51 +1,16 @@
 $OpenBSD: patch-lib_Target_Sparc_SparcISelLowering_cpp,v 1.3 2019/01/28 06:27:28 jca Exp $
 
 - Use a 64-bit register when required
-- [Sparc] Use float register for integer constrained with "f" in inline asm
-
-  Constraining an integer value to a floating point register using "f"
-  causes an llvm_unreachable to trigger. This patch allows i32 integers
-  to be placed in a single precision float register and i64 integers to
-  be placed in a double precision float register. This matches the behavior
-  of GCC.
 
 Index: lib/Target/Sparc/SparcISelLowering.cpp
 --- lib/Target/Sparc/SparcISelLowering.cpp.orig
 +++ lib/Target/Sparc/SparcISelLowering.cpp
-@@ -3491,26 +3491,28 @@ SparcTargetLowering::getRegForInlineAsmConstraint(cons
+@@ -3258,6 +3258,8 @@ SparcTargetLowering::getRegForInlineAsmConstraint(cons
      case 'r':
        if (VT == MVT::v2i32)
          return std::make_pair(0U, &SP::IntPairRegClass);
 +      else if (VT == MVT::i64 && Subtarget->is64Bit())
-+       return std::make_pair(0U, &SP::I64RegsRegClass);
++ return std::make_pair(0U, &SP::I64RegsRegClass);
        else
          return std::make_pair(0U, &SP::IntRegsRegClass);
      case 'f':
--      if (VT == MVT::f32)
-+      if (VT == MVT::f32 || VT == MVT::i32)
-         return std::make_pair(0U, &SP::FPRegsRegClass);
--      else if (VT == MVT::f64)
-+      else if (VT == MVT::f64 || VT == MVT::i64)
-         return std::make_pair(0U, &SP::LowDFPRegsRegClass);
-       else if (VT == MVT::f128)
-         return std::make_pair(0U, &SP::LowQFPRegsRegClass);
--      llvm_unreachable("Unknown ValueType for f-register-type!");
--      break;
-+      // This will generate an error message
-+      return std::make_pair(0U, nullptr);
-     case 'e':
--      if (VT == MVT::f32)
-+      if (VT == MVT::f32 || VT == MVT::i32)
-         return std::make_pair(0U, &SP::FPRegsRegClass);
--      else if (VT == MVT::f64)
-+      else if (VT == MVT::f64 || VT == MVT::i64 )
-         return std::make_pair(0U, &SP::DFPRegsRegClass);
-       else if (VT == MVT::f128)
-         return std::make_pair(0U, &SP::QFPRegsRegClass);
--      llvm_unreachable("Unknown ValueType for e-register-type!");
--      break;
-+      // This will generate an error message
-+      return std::make_pair(0U, nullptr);
-     }
-   } else if (!Constraint.empty() && Constraint.size() <= 5
-               && Constraint[0] == '{' && *(Constraint.end()-1) == '}') {
Index: devel/llvm/patches/patch-lib_Target_Sparc_SparcInstr64Bit_td
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_SparcInstr64Bit_td
diff -N devel/llvm/patches/patch-lib_Target_Sparc_SparcInstr64Bit_td
--- devel/llvm/patches/patch-lib_Target_Sparc_SparcInstr64Bit_td 26 Oct 2017 10:05:55 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_SparcInstr64Bit_td,v 1.5 2017/10/26 10:05:55 ajacoutot Exp $
-
-[Sparc] allow tls_add/tls_call syntax in assembler parser
-
-Index: lib/Target/Sparc/SparcInstr64Bit.td
---- lib/Target/Sparc/SparcInstr64Bit.td.orig
-+++ lib/Target/Sparc/SparcInstr64Bit.td
-@@ -239,7 +239,7 @@ let Predicates = [Is64Bit] in {
- let DecoderMethod = "DecodeLoadInt" in
-   defm LDX   : Load<"ldx", 0b001011, load, I64Regs, i64>;
-
--let mayLoad = 1, isCodeGenOnly = 1, isAsmParserOnly = 1 in
-+let mayLoad = 1, isAsmParserOnly = 1 in
-   def TLS_LDXrr : F3_1<3, 0b001011,
-                        (outs IntRegs:$dst), (ins MEMrr:$addr, TLSSym:$sym),
-                        "ldx [$addr], $dst, $sym",
Index: devel/llvm/patches/patch-lib_Target_Sparc_SparcInstrInfo_td
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_SparcInstrInfo_td
diff -N devel/llvm/patches/patch-lib_Target_Sparc_SparcInstrInfo_td
--- devel/llvm/patches/patch-lib_Target_Sparc_SparcInstrInfo_td 28 Jan 2019 06:27:28 -0000 1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,43 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_SparcInstrInfo_td,v 1.8 2019/01/28 06:27:28 jca Exp $
-
-- [Sparc] allow tls_add/tls_call syntax in assembler parser
-- [Sparc] Add membar assembler tags
-
-Index: lib/Target/Sparc/SparcInstrInfo.td
---- lib/Target/Sparc/SparcInstrInfo.td.orig
-+++ lib/Target/Sparc/SparcInstrInfo.td
-@@ -121,6 +121,16 @@ def MEMri : Operand<iPTR> {
-
- def TLSSym : Operand<iPTR>;
-
-+def SparcMembarTagAsmOperand : AsmOperandClass {
-+  let Name = "MembarTag";
-+  let ParserMethod = "parseMembarTag";
-+}
-+
-+def MembarTag : Operand<i32> {
-+  let PrintMethod = "printMembarTag";
-+  let ParserMatchClass = SparcMembarTagAsmOperand;
-+}
-+
- // Branch targets have OtherVT type.
- def brtarget : Operand<OtherVT> {
-   let EncoderMethod = "getBranchTargetOpValue";
-@@ -1316,7 +1326,7 @@ let Defs = [FCC0], rd = 0, isCodeGenOnly = 1 in {
- //===----------------------------------------------------------------------===//
- // Instructions for Thread Local Storage(TLS).
- //===----------------------------------------------------------------------===//
--let isCodeGenOnly = 1, isAsmParserOnly = 1 in {
-+let isAsmParserOnly = 1 in {
- def TLS_ADDrr : F3_1<2, 0b000000,
-                     (outs IntRegs:$rd),
-                     (ins IntRegs:$rs1, IntRegs:$rs2, TLSSym:$sym),
-@@ -1511,7 +1521,7 @@ def : Pat<(ctpop i32:$src),
-           (POPCrr (SRLri $src, 0))>;
-
- let Predicates = [HasV9], hasSideEffects = 1, rd = 0, rs1 = 0b01111 in
-- def MEMBARi : F3_2<2, 0b101000, (outs), (ins simm13Op:$simm13),
-+ def MEMBARi : F3_2<2, 0b101000, (outs), (ins MembarTag:$simm13),
-                     "membar $simm13", []>;
-
- // The CAS instruction, unlike other instructions, only comes in a
Index: devel/llvm/patches/patch-lib_Target_X86_AsmParser_X86AsmParser_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_AsmParser_X86AsmParser_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_AsmParser_X86AsmParser_cpp
--- devel/llvm/patches/patch-lib_Target_X86_AsmParser_X86AsmParser_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_AsmParser_X86AsmParser_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/AsmParser/X86AsmParser.cpp
---- lib/Target/X86/AsmParser/X86AsmParser.cpp.orig
-+++ lib/Target/X86/AsmParser/X86AsmParser.cpp
-@@ -1109,8 +1109,7 @@ bool X86AsmParser::ParseRegister(unsigned &RegNo,
-   }
-
-   // Parse "%st" as "%st(0)" and "%st(1)", which is multiple tokens.
--  if (RegNo == 0 && (Tok.getString() == "st" || Tok.getString() == "ST")) {
--    RegNo = X86::ST0;
-+  if (RegNo == X86::ST0) {
-     Parser.Lex(); // Eat 'st'
-
-     // Check to see if we have '(4)' after %st.
Index: devel/llvm/patches/patch-lib_Target_X86_CMakeLists_txt
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_CMakeLists_txt,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_Target_X86_CMakeLists_txt
--- devel/llvm/patches/patch-lib_Target_X86_CMakeLists_txt 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-lib_Target_X86_CMakeLists_txt 30 Jun 2019 10:50:12 -0000
@@ -10,7 +10,7 @@ $OpenBSD: patch-lib_Target_X86_CMakeList
 Index: lib/Target/X86/CMakeLists.txt
 --- lib/Target/X86/CMakeLists.txt.orig
 +++ lib/Target/X86/CMakeLists.txt
-@@ -31,6 +31,7 @@ set(sources
+@@ -34,6 +34,7 @@ set(sources
    X86ExpandPseudo.cpp
    X86FastISel.cpp
    X86FixupBWInsts.cpp
@@ -18,7 +18,7 @@ Index: lib/Target/X86/CMakeLists.txt
    X86FixupLEAs.cpp
    X86AvoidStoreForwardingBlocks.cpp
    X86FixupSetCC.cpp
-@@ -55,6 +56,7 @@ set(sources
+@@ -59,6 +60,7 @@ set(sources
    X86RegisterBankInfo.cpp
    X86RegisterInfo.cpp
    X86RetpolineThunks.cpp
Index: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp
--- devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
---- lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp.orig
-+++ lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
-@@ -200,3 +200,14 @@ void X86ATTInstPrinter::printU8Imm(const MCInst *MI, u
-   O << markup("<imm:") << '$' << formatImm(MI->getOperand(Op).getImm() & 0xff)
-     << markup(">");
- }
-+
-+void X86ATTInstPrinter::printSTiRegOperand(const MCInst *MI, unsigned OpNo,
-+                                           raw_ostream &OS) {
-+  const MCOperand &Op = MI->getOperand(OpNo);
-+  unsigned Reg = Op.getReg();
-+  // Override the default printing to print st(0) instead st.
-+  if (Reg == X86::ST0)
-+    OS << markup("<reg:") << "%st(0)" << markup(">");
-+  else
-+    printRegName(OS, Reg);
-+}
Index: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h
diff -N devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h
--- devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/InstPrinter/X86ATTInstPrinter.h
---- lib/Target/X86/InstPrinter/X86ATTInstPrinter.h.orig
-+++ lib/Target/X86/InstPrinter/X86ATTInstPrinter.h
-@@ -44,6 +44,7 @@ class X86ATTInstPrinter final : public X86InstPrinterC
-   void printSrcIdx(const MCInst *MI, unsigned Op, raw_ostream &O);
-   void printDstIdx(const MCInst *MI, unsigned Op, raw_ostream &O);
-   void printU8Imm(const MCInst *MI, unsigned Op, raw_ostream &OS);
-+  void printSTiRegOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
-
-   void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
-     printMemReference(MI, OpNo, O);
Index: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp
--- devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
---- lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp.orig
-+++ lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
-@@ -160,3 +160,14 @@ void X86IntelInstPrinter::printU8Imm(const MCInst *MI,
-
-   O << formatImm(MI->getOperand(Op).getImm() & 0xff);
- }
-+
-+void X86IntelInstPrinter::printSTiRegOperand(const MCInst *MI, unsigned OpNo,
-+                                            raw_ostream &OS) {
-+  const MCOperand &Op = MI->getOperand(OpNo);
-+  unsigned Reg = Op.getReg();
-+  // Override the default printing to print st(0) instead st.
-+  if (Reg == X86::ST0)
-+    OS << "st(0)";
-+  else
-+    printRegName(OS, Reg);
-+}
Index: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h
diff -N devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h
--- devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/InstPrinter/X86IntelInstPrinter.h
---- lib/Target/X86/InstPrinter/X86IntelInstPrinter.h.orig
-+++ lib/Target/X86/InstPrinter/X86IntelInstPrinter.h
-@@ -39,6 +39,7 @@ class X86IntelInstPrinter final : public X86InstPrinte
-   void printSrcIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
-   void printDstIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
-   void printU8Imm(const MCInst *MI, unsigned Op, raw_ostream &O);
-+  void printSTiRegOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
-
-   void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
-     printMemReference(MI, OpNo, O);
Index: devel/llvm/patches/patch-lib_Target_X86_X86FixupGadgets_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86FixupGadgets_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_Target_X86_X86FixupGadgets_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86FixupGadgets_cpp 24 Feb 2019 20:53:56 -0000 1.3
+++ devel/llvm/patches/patch-lib_Target_X86_X86FixupGadgets_cpp 30 Jun 2019 10:50:12 -0000
@@ -10,7 +10,7 @@ $OpenBSD: patch-lib_Target_X86_X86FixupG
 Index: lib/Target/X86/X86FixupGadgets.cpp
 --- lib/Target/X86/X86FixupGadgets.cpp.orig
 +++ lib/Target/X86/X86FixupGadgets.cpp
-@@ -0,0 +1,720 @@
+@@ -0,0 +1,670 @@
 +//===-- X86FixupGadgets.cpp - Fixup Instructions that make ROP Gadgets ----===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -212,53 +212,6 @@ Index: lib/Target/X86/X86FixupGadgets.cp
 +    case X86::ADD32rr_DB:
 +    case X86::ADD16rr_DB:
 +      goto Handle_MRMDestReg;
-+    case X86::ACQUIRE_MOV8rm:
-+    case X86::ACQUIRE_MOV16rm:
-+    case X86::ACQUIRE_MOV32rm:
-+    case X86::ACQUIRE_MOV64rm:
-+      goto Handle_MRMSrcMem;
-+    case X86::RELEASE_MOV8mr:
-+    case X86::RELEASE_MOV16mr:
-+    case X86::RELEASE_MOV32mr:
-+    case X86::RELEASE_MOV64mr:
-+    case X86::RELEASE_ADD8mr:
-+    case X86::RELEASE_ADD32mr:
-+    case X86::RELEASE_ADD64mr:
-+    case X86::RELEASE_AND8mr:
-+    case X86::RELEASE_AND32mr:
-+    case X86::RELEASE_AND64mr:
-+    case X86::RELEASE_OR8mr:
-+    case X86::RELEASE_OR32mr:
-+    case X86::RELEASE_OR64mr:
-+    case X86::RELEASE_XOR8mr:
-+    case X86::RELEASE_XOR32mr:
-+    case X86::RELEASE_XOR64mr:
-+      goto Handle_MRMDestMem;
-+    case X86::RELEASE_MOV8mi:
-+    case X86::RELEASE_MOV16mi:
-+    case X86::RELEASE_MOV32mi:
-+    case X86::RELEASE_ADD8mi:
-+    case X86::RELEASE_MOV64mi32:
-+    case X86::RELEASE_ADD32mi:
-+    case X86::RELEASE_ADD64mi32:
-+    case X86::RELEASE_AND8mi:
-+    case X86::RELEASE_AND32mi:
-+    case X86::RELEASE_AND64mi32:
-+    case X86::RELEASE_OR8mi:
-+    case X86::RELEASE_OR32mi:
-+    case X86::RELEASE_OR64mi32:
-+    case X86::RELEASE_XOR8mi:
-+    case X86::RELEASE_XOR32mi:
-+    case X86::RELEASE_XOR64mi32:
-+    case X86::RELEASE_INC8m:
-+    case X86::RELEASE_INC16m:
-+    case X86::RELEASE_INC32m:
-+    case X86::RELEASE_INC64m:
-+    case X86::RELEASE_DEC8m:
-+    case X86::RELEASE_DEC16m:
-+    case X86::RELEASE_DEC32m:
-+    case X86::RELEASE_DEC64m:
-+      goto Handle_MRMXm;
 +    case X86::ADD16ri_DB:
 +    case X86::ADD32ri_DB:
 +    case X86::ADD64ri32_DB:
@@ -281,7 +234,6 @@ Index: lib/Target/X86/X86FixupGadgets.cp
 +    break;
 +  }
 +  case X86II::MRMDestMem: {
-+  Handle_MRMDestMem:
 +    checkSIB(MI, CurOp, info);
 +    unsigned opcode = MI.getOpcode();
 +    if (opcode == X86::MOVNTImr || opcode == X86::MOVNTI_64mr)
@@ -289,7 +241,6 @@ Index: lib/Target/X86/X86FixupGadgets.cp
 +    break;
 +  }
 +  case X86II::MRMSrcMem: {
-+  Handle_MRMSrcMem:
 +    CurOp += 1;
 +    if (HasVEX_4V)
 +      CurOp += 1;
@@ -317,7 +268,6 @@ Index: lib/Target/X86/X86FixupGadgets.cp
 +  case X86II::MRM5m:
 +  case X86II::MRM6m:
 +  case X86II::MRM7m: {
-+  Handle_MRMXm:
 +    if (HasVEX_4V)
 +      CurOp += 1;
 +    if (HasEVEX_K)
Index: devel/llvm/patches/patch-lib_Target_X86_X86FrameLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86FrameLowering_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-lib_Target_X86_X86FrameLowering_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86FrameLowering_cpp 11 Feb 2019 05:24:16 -0000 1.6
+++ devel/llvm/patches/patch-lib_Target_X86_X86FrameLowering_cpp 30 Jun 2019 10:50:12 -0000
@@ -58,7 +58,7 @@ Index: lib/Target/X86/X86FrameLowering.c
  }
 
  static unsigned getSUBriOpcode(unsigned IsLP64, int64_t Imm) {
-@@ -871,6 +874,24 @@ void X86FrameLowering::BuildStackAlignAND(MachineBasic
+@@ -872,6 +875,24 @@ void X86FrameLowering::BuildStackAlignAND(MachineBasic
    MI->getOperand(3).setIsDead();
  }
 
@@ -83,7 +83,7 @@ Index: lib/Target/X86/X86FrameLowering.c
  /// emitPrologue - Push callee-saved registers onto the stack, which
  /// automatically adjust the stack pointer. Adjust the stack pointer to allocate
  /// space for local variables. Also emit labels used by the exception handler to
-@@ -1153,6 +1174,43 @@ void X86FrameLowering::emitPrologue(MachineFunction &M
+@@ -1145,6 +1166,43 @@ void X86FrameLowering::emitPrologue(MachineFunction &M
                                      nullptr, DwarfFramePtr));
        }
 
@@ -127,7 +127,7 @@ Index: lib/Target/X86/X86FrameLowering.c
        if (NeedsWinFPO) {
          // .cv_fpo_setframe $FramePtr
          HasWinCFI = true;
-@@ -1618,20 +1676,6 @@ void X86FrameLowering::emitEpilogue(MachineFunction &M
+@@ -1626,20 +1684,6 @@ void X86FrameLowering::emitEpilogue(MachineFunction &M
    }
    uint64_t SEHStackAllocAmt = NumBytes;
 
@@ -148,7 +148,7 @@ Index: lib/Target/X86/X86FrameLowering.c
    MachineBasicBlock::iterator FirstCSPop = MBBI;
    // Skip the callee-saved pop instructions.
    while (MBBI != MBB.begin()) {
-@@ -1701,6 +1745,28 @@ void X86FrameLowering::emitEpilogue(MachineFunction &M
+@@ -1709,6 +1753,28 @@ void X86FrameLowering::emitEpilogue(MachineFunction &M
      --MBBI;
    }
 
@@ -177,7 +177,7 @@ Index: lib/Target/X86/X86FrameLowering.c
    // Windows unwinder will not invoke function's exception handler if IP is
    // either in prologue or in epilogue.  This behavior causes a problem when a
    // call immediately precedes an epilogue, because the return address points
-@@ -1789,6 +1855,8 @@ int X86FrameLowering::getFrameIndexReference(const Mac
+@@ -1797,6 +1863,8 @@ int X86FrameLowering::getFrameIndexReference(const Mac
             "FPDelta isn't aligned per the Win64 ABI!");
    }
 
@@ -186,7 +186,7 @@ Index: lib/Target/X86/X86FrameLowering.c
 
    if (TRI->hasBasePointer(MF)) {
      assert(HasFP && "VLAs and dynamic stack realign, but no FP?!");
-@@ -3153,4 +3221,8 @@ void X86FrameLowering::processFunctionBeforeFrameFinal
+@@ -3168,4 +3236,8 @@ void X86FrameLowering::processFunctionBeforeFrameFinal
    addFrameReference(BuildMI(MBB, MBBI, DL, TII.get(X86::MOV64mi32)),
                      UnwindHelpFI)
        .addImm(-2);
Index: devel/llvm/patches/patch-lib_Target_X86_X86ISelLowering_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_X86ISelLowering_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_X86ISelLowering_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86ISelLowering_cpp 20 Feb 2019 00:24:11 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_X86ISelLowering_cpp,v 1.6 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/X86ISelLowering.cpp
---- lib/Target/X86/X86ISelLowering.cpp.orig
-+++ lib/Target/X86/X86ISelLowering.cpp
-@@ -40619,6 +40619,20 @@ X86TargetLowering::getRegForInlineAsmConstraint(const
-       return Res;
-     }
-
-+    // dirflag -> DF
-+    if (StringRef("{dirflag}").equals_lower(Constraint)) {
-+      Res.first = X86::DF;
-+      Res.second = &X86::DFCCRRegClass;
-+      return Res;
-+    }
-+
-+    // fpsr -> FPSW
-+    if (StringRef("{fpsr}").equals_lower(Constraint)) {
-+      Res.first = X86::FPSW;
-+      Res.second = &X86::FPCCRRegClass;
-+      return Res;
-+    }
-+
-     // 'A' means [ER]AX + [ER]DX.
-     if (Constraint == "A") {
-       if (Subtarget.is64Bit()) {
Index: devel/llvm/patches/patch-lib_Target_X86_X86InstrCompiler_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86InstrCompiler_td,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_X86_X86InstrCompiler_td
--- devel/llvm/patches/patch-lib_Target_X86_X86InstrCompiler_td 24 Feb 2019 20:53:56 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_X86_X86InstrCompiler_td 30 Jun 2019 10:50:12 -0000
@@ -22,7 +22,7 @@ $OpenBSD: patch-lib_Target_X86_X86InstrC
 Index: lib/Target/X86/X86InstrCompiler.td
 --- lib/Target/X86/X86InstrCompiler.td.orig
 +++ lib/Target/X86/X86InstrCompiler.td
-@@ -267,6 +267,25 @@ def MORESTACK_RET_RESTORE_R10 : I<0, Pseudo, (outs), (
+@@ -264,6 +264,25 @@ def MORESTACK_RET_RESTORE_R10 : I<0, Pseudo, (outs), (
  }
 
  //===----------------------------------------------------------------------===//
Index: devel/llvm/patches/patch-lib_Target_X86_X86InstrFPStack_td
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_X86InstrFPStack_td
diff -N devel/llvm/patches/patch-lib_Target_X86_X86InstrFPStack_td
--- devel/llvm/patches/patch-lib_Target_X86_X86InstrFPStack_td 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,300 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_X86InstrFPStack_td,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/X86InstrFPStack.td
---- lib/Target/X86/X86InstrFPStack.td.orig
-+++ lib/Target/X86/X86InstrFPStack.td
-@@ -230,7 +230,7 @@ def _FI32m  : FPI<0xDA, fp, (outs), (ins i32mem:$src),
- } // mayLoad = 1, hasSideEffects = 1
- }
-
--let Defs = [FPSW] in {
-+let Defs = [FPSW], Uses = [FPCW] in {
- // FPBinary_rr just defines pseudo-instructions, no need to set a scheduling
- // resources.
- let hasNoSchedulingInfo = 1 in {
-@@ -258,42 +258,42 @@ defm DIVR: FPBinary<fdiv, MRM7m, "divr", 0>;
- } // Defs = [FPSW]
-
- class FPST0rInst<Format fp, string asm>
--  : FPI<0xD8, fp, (outs), (ins RST:$op), asm>;
-+  : FPI<0xD8, fp, (outs), (ins RSTi:$op), asm>;
- class FPrST0Inst<Format fp, string asm>
--  : FPI<0xDC, fp, (outs), (ins RST:$op), asm>;
-+  : FPI<0xDC, fp, (outs), (ins RSTi:$op), asm>;
- class FPrST0PInst<Format fp, string asm>
--  : FPI<0xDE, fp, (outs), (ins RST:$op), asm>;
-+  : FPI<0xDE, fp, (outs), (ins RSTi:$op), asm>;
-
- // NOTE: GAS and apparently all other AT&T style assemblers have a broken notion
- // of some of the 'reverse' forms of the fsub and fdiv instructions.  As such,
- // we have to put some 'r's in and take them out of weird places.
--let SchedRW = [WriteFAdd] in {
--def ADD_FST0r   : FPST0rInst <MRM0r, "fadd\t$op">;
--def ADD_FrST0   : FPrST0Inst <MRM0r, "fadd\t{%st(0), $op|$op, st(0)}">;
--def ADD_FPrST0  : FPrST0PInst<MRM0r, "faddp\t$op">;
--def SUBR_FST0r  : FPST0rInst <MRM5r, "fsubr\t$op">;
--def SUB_FrST0   : FPrST0Inst <MRM5r, "fsub{r}\t{%st(0), $op|$op, st(0)}">;
--def SUB_FPrST0  : FPrST0PInst<MRM5r, "fsub{r}p\t$op">;
--def SUB_FST0r   : FPST0rInst <MRM4r, "fsub\t$op">;
--def SUBR_FrST0  : FPrST0Inst <MRM4r, "fsub{|r}\t{%st(0), $op|$op, st(0)}">;
--def SUBR_FPrST0 : FPrST0PInst<MRM4r, "fsub{|r}p\t$op">;
-+let SchedRW = [WriteFAdd], Defs = [FPSW], Uses = [FPCW] in {
-+def ADD_FST0r   : FPST0rInst <MRM0r, "fadd\t{$op, %st|st, $op}">;
-+def ADD_FrST0   : FPrST0Inst <MRM0r, "fadd\t{%st, $op|$op, st}">;
-+def ADD_FPrST0  : FPrST0PInst<MRM0r, "faddp\t{%st, $op|$op, st}">;
-+def SUBR_FST0r  : FPST0rInst <MRM5r, "fsubr\t{$op, %st|st, $op}">;
-+def SUB_FrST0   : FPrST0Inst <MRM5r, "fsub{r}\t{%st, $op|$op, st}">;
-+def SUB_FPrST0  : FPrST0PInst<MRM5r, "fsub{r}p\t{%st, $op|$op, st}">;
-+def SUB_FST0r   : FPST0rInst <MRM4r, "fsub\t{$op, %st|st, $op}">;
-+def SUBR_FrST0  : FPrST0Inst <MRM4r, "fsub{|r}\t{%st, $op|$op, st}">;
-+def SUBR_FPrST0 : FPrST0PInst<MRM4r, "fsub{|r}p\t{%st, $op|$op, st}">;
- } // SchedRW
--let SchedRW = [WriteFCom] in {
-+let SchedRW = [WriteFCom], Defs = [FPSW], Uses = [FPCW] in {
- def COM_FST0r   : FPST0rInst <MRM2r, "fcom\t$op">;
- def COMP_FST0r  : FPST0rInst <MRM3r, "fcomp\t$op">;
- } // SchedRW
--let SchedRW = [WriteFMul] in {
--def MUL_FST0r   : FPST0rInst <MRM1r, "fmul\t$op">;
--def MUL_FrST0   : FPrST0Inst <MRM1r, "fmul\t{%st(0), $op|$op, st(0)}">;
--def MUL_FPrST0  : FPrST0PInst<MRM1r, "fmulp\t$op">;
-+let SchedRW = [WriteFMul], Defs = [FPSW], Uses = [FPCW] in {
-+def MUL_FST0r   : FPST0rInst <MRM1r, "fmul\t{$op, %st|st, $op}">;
-+def MUL_FrST0   : FPrST0Inst <MRM1r, "fmul\t{%st, $op|$op, st}">;
-+def MUL_FPrST0  : FPrST0PInst<MRM1r, "fmulp\t{%st, $op|$op, st}">;
- } // SchedRW
--let SchedRW = [WriteFDiv] in {
--def DIVR_FST0r  : FPST0rInst <MRM7r, "fdivr\t$op">;
--def DIV_FrST0   : FPrST0Inst <MRM7r, "fdiv{r}\t{%st(0), $op|$op, st(0)}">;
--def DIV_FPrST0  : FPrST0PInst<MRM7r, "fdiv{r}p\t$op">;
--def DIV_FST0r   : FPST0rInst <MRM6r, "fdiv\t$op">;
--def DIVR_FrST0  : FPrST0Inst <MRM6r, "fdiv{|r}\t{%st(0), $op|$op, st(0)}">;
--def DIVR_FPrST0 : FPrST0PInst<MRM6r, "fdiv{|r}p\t$op">;
-+let SchedRW = [WriteFDiv], Defs = [FPSW], Uses = [FPCW] in {
-+def DIVR_FST0r  : FPST0rInst <MRM7r, "fdivr\t{$op, %st|st, $op}">;
-+def DIV_FrST0   : FPrST0Inst <MRM7r, "fdiv{r}\t{%st, $op|$op, st}">;
-+def DIV_FPrST0  : FPrST0PInst<MRM7r, "fdiv{r}p\t{%st, $op|$op, st}">;
-+def DIV_FST0r   : FPST0rInst <MRM6r, "fdiv\t{$op, %st|st, $op}">;
-+def DIVR_FrST0  : FPrST0Inst <MRM6r, "fdiv{|r}\t{%st, $op|$op, st}">;
-+def DIVR_FPrST0 : FPrST0PInst<MRM6r, "fdiv{|r}p\t{%st, $op|$op, st}">;
- } // SchedRW
-
- // Unary operations.
-@@ -307,7 +307,7 @@ def _Fp80  : FpI_<(outs RFP80:$dst), (ins RFP80:$src),
- def _F     : FPI<0xD9, fp, (outs), (ins), asmstring>;
- }
-
--let Defs = [FPSW] in {
-+let Defs = [FPSW], Uses = [FPCW] in {
-
- let SchedRW = [WriteFSign] in {
- defm CHS : FPUnary<fneg, MRM_E0, "fchs">;
-@@ -335,7 +335,7 @@ def TST_F  : FPI<0xD9, MRM_E4, (outs), (ins), "ftst">;
-
- // Versions of FP instructions that take a single memory operand.  Added for the
- //   disassembler; remove as they are included with patterns elsewhere.
--let SchedRW = [WriteFComLd] in {
-+let SchedRW = [WriteFComLd], Defs = [FPSW], Uses = [FPCW] in {
- def FCOM32m  : FPI<0xD8, MRM2m, (outs), (ins f32mem:$src), "fcom{s}\t$src">;
- def FCOMP32m : FPI<0xD8, MRM3m, (outs), (ins f32mem:$src), "fcomp{s}\t$src">;
-
-@@ -398,22 +398,22 @@ defm CMOVNP : FPCMov<X86_COND_NP>;
-
- let Predicates = [HasCMov] in {
- // These are not factored because there's no clean way to pass DA/DB.
--def CMOVB_F  : FPI<0xDA, MRM0r, (outs), (ins RST:$op),
--                  "fcmovb\t{$op, %st(0)|st(0), $op}">;
--def CMOVBE_F : FPI<0xDA, MRM2r, (outs), (ins RST:$op),
--                  "fcmovbe\t{$op, %st(0)|st(0), $op}">;
--def CMOVE_F  : FPI<0xDA, MRM1r, (outs), (ins RST:$op),
--                  "fcmove\t{$op, %st(0)|st(0), $op}">;
--def CMOVP_F  : FPI<0xDA, MRM3r, (outs), (ins RST:$op),
--                  "fcmovu\t{$op, %st(0)|st(0), $op}">;
--def CMOVNB_F : FPI<0xDB, MRM0r, (outs), (ins RST:$op),
--                  "fcmovnb\t{$op, %st(0)|st(0), $op}">;
--def CMOVNBE_F: FPI<0xDB, MRM2r, (outs), (ins RST:$op),
--                  "fcmovnbe\t{$op, %st(0)|st(0), $op}">;
--def CMOVNE_F : FPI<0xDB, MRM1r, (outs), (ins RST:$op),
--                  "fcmovne\t{$op, %st(0)|st(0), $op}">;
--def CMOVNP_F : FPI<0xDB, MRM3r, (outs), (ins RST:$op),
--                  "fcmovnu\t{$op, %st(0)|st(0), $op}">;
-+def CMOVB_F  : FPI<0xDA, MRM0r, (outs), (ins RSTi:$op),
-+                  "fcmovb\t{$op, %st|st, $op}">;
-+def CMOVBE_F : FPI<0xDA, MRM2r, (outs), (ins RSTi:$op),
-+                  "fcmovbe\t{$op, %st|st, $op}">;
-+def CMOVE_F  : FPI<0xDA, MRM1r, (outs), (ins RSTi:$op),
-+                  "fcmove\t{$op, %st|st, $op}">;
-+def CMOVP_F  : FPI<0xDA, MRM3r, (outs), (ins RSTi:$op),
-+                  "fcmovu\t{$op, %st|st, $op}">;
-+def CMOVNB_F : FPI<0xDB, MRM0r, (outs), (ins RSTi:$op),
-+                  "fcmovnb\t{$op, %st|st, $op}">;
-+def CMOVNBE_F: FPI<0xDB, MRM2r, (outs), (ins RSTi:$op),
-+                  "fcmovnbe\t{$op, %st|st, $op}">;
-+def CMOVNE_F : FPI<0xDB, MRM1r, (outs), (ins RSTi:$op),
-+                  "fcmovne\t{$op, %st|st, $op}">;
-+def CMOVNP_F : FPI<0xDB, MRM3r, (outs), (ins RSTi:$op),
-+                  "fcmovnu\t{$op, %st|st, $op}">;
- } // Predicates = [HasCMov]
- } // SchedRW
-
-@@ -454,7 +454,7 @@ def ILD_Fp64m80: FpI_<(outs RFP80:$dst), (ins i64mem:$
-                   [(set RFP80:$dst, (X86fild addr:$src, i64))]>;
- } // SchedRW
-
--let SchedRW = [WriteStore] in {
-+let SchedRW = [WriteStore], Uses = [FPCW] in {
- def ST_Fp32m   : FpIf32<(outs), (ins f32mem:$op, RFP32:$src), OneArgFP,
-                   [(store RFP32:$src, addr:$op)]>;
- def ST_Fp64m32 : FpIf64<(outs), (ins f32mem:$op, RFP64:$src), OneArgFP,
-@@ -489,7 +489,7 @@ def IST_Fp16m80  : FpI_<(outs), (ins i16mem:$op, RFP80
- def IST_Fp32m80  : FpI_<(outs), (ins i32mem:$op, RFP80:$src), OneArgFP, []>;
- def IST_Fp64m80  : FpI_<(outs), (ins i64mem:$op, RFP80:$src), OneArgFP, []>;
- } // mayStore
--} // SchedRW
-+} // SchedRW, Uses = [FPCW]
-
- let mayLoad = 1, SchedRW = [WriteLoad] in {
- def LD_F32m   : FPI<0xD9, MRM0m, (outs), (ins f32mem:$src), "fld{s}\t$src">;
-@@ -499,7 +499,7 @@ def ILD_F16m  : FPI<0xDF, MRM0m, (outs), (ins i16mem:$
- def ILD_F32m  : FPI<0xDB, MRM0m, (outs), (ins i32mem:$src), "fild{l}\t$src">;
- def ILD_F64m  : FPI<0xDF, MRM5m, (outs), (ins i64mem:$src), "fild{ll}\t$src">;
- }
--let mayStore = 1, SchedRW = [WriteStore] in {
-+let mayStore = 1, SchedRW = [WriteStore], Uses = [FPCW] in {
- def ST_F32m   : FPI<0xD9, MRM2m, (outs), (ins f32mem:$dst), "fst{s}\t$dst">;
- def ST_F64m   : FPI<0xDD, MRM2m, (outs), (ins f64mem:$dst), "fst{l}\t$dst">;
- def ST_FP32m  : FPI<0xD9, MRM3m, (outs), (ins f32mem:$dst), "fstp{s}\t$dst">;
-@@ -513,7 +513,7 @@ def IST_FP64m : FPI<0xDF, MRM7m, (outs), (ins i64mem:$
- }
-
- // FISTTP requires SSE3 even though it's a FPStack op.
--let Predicates = [HasSSE3], SchedRW = [WriteStore] in {
-+let Predicates = [HasSSE3], SchedRW = [WriteStore], Uses = [FPCW] in {
- def ISTT_Fp16m32 : FpI_<(outs), (ins i16mem:$op, RFP32:$src), OneArgFP,
-                     [(X86fp_to_i16mem RFP32:$src, addr:$op)]>;
- def ISTT_Fp32m32 : FpI_<(outs), (ins i32mem:$op, RFP32:$src), OneArgFP,
-@@ -534,7 +534,7 @@ def ISTT_Fp64m80 : FpI_<(outs), (ins i64mem:$op, RFP80
-                     [(X86fp_to_i64mem RFP80:$src, addr:$op)]>;
- } // Predicates = [HasSSE3]
-
--let mayStore = 1, SchedRW = [WriteStore] in {
-+let mayStore = 1, SchedRW = [WriteStore], Uses = [FPCW] in {
- def ISTT_FP16m : FPI<0xDF, MRM1m, (outs), (ins i16mem:$dst), "fisttp{s}\t$dst">;
- def ISTT_FP32m : FPI<0xDB, MRM1m, (outs), (ins i32mem:$dst), "fisttp{l}\t$dst">;
- def ISTT_FP64m : FPI<0xDD, MRM1m, (outs), (ins i64mem:$dst), "fisttp{ll}\t$dst">;
-@@ -542,10 +542,10 @@ def ISTT_FP64m : FPI<0xDD, MRM1m, (outs), (ins i64mem:
-
- // FP Stack manipulation instructions.
- let SchedRW = [WriteMove] in {
--def LD_Frr   : FPI<0xD9, MRM0r, (outs), (ins RST:$op), "fld\t$op">;
--def ST_Frr   : FPI<0xDD, MRM2r, (outs), (ins RST:$op), "fst\t$op">;
--def ST_FPrr  : FPI<0xDD, MRM3r, (outs), (ins RST:$op), "fstp\t$op">;
--def XCH_F    : FPI<0xD9, MRM1r, (outs), (ins RST:$op), "fxch\t$op">;
-+def LD_Frr   : FPI<0xD9, MRM0r, (outs), (ins RSTi:$op), "fld\t$op">;
-+def ST_Frr   : FPI<0xDD, MRM2r, (outs), (ins RSTi:$op), "fst\t$op">;
-+def ST_FPrr  : FPI<0xDD, MRM3r, (outs), (ins RSTi:$op), "fstp\t$op">;
-+def XCH_F    : FPI<0xD9, MRM1r, (outs), (ins RSTi:$op), "fxch\t$op">;
- }
-
- // Floating point constant loads.
-@@ -570,7 +570,7 @@ def LD_F0 : FPI<0xD9, MRM_EE, (outs), (ins), "fldz">;
- let SchedRW = [WriteFLD1] in
- def LD_F1 : FPI<0xD9, MRM_E8, (outs), (ins), "fld1">;
-
--let SchedRW = [WriteFLDC], Defs = [FPSW] in {
-+let SchedRW = [WriteFLDC] in {
- def FLDL2T : I<0xD9, MRM_E9, (outs), (ins), "fldl2t", []>;
- def FLDL2E : I<0xD9, MRM_EA, (outs), (ins), "fldl2e", []>;
- def FLDPI : I<0xD9, MRM_EB, (outs), (ins), "fldpi", []>;
-@@ -579,7 +579,7 @@ def FLDLN2 : I<0xD9, MRM_ED, (outs), (ins), "fldln2",
- } // SchedRW
-
- // Floating point compares.
--let SchedRW = [WriteFCom] in {
-+let SchedRW = [WriteFCom], Uses = [FPCW] in {
- def UCOM_Fpr32 : FpIf32<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP,
-                         [(set FPSW, (trunc (X86cmp RFP32:$lhs, RFP32:$rhs)))]>;
- def UCOM_Fpr64 : FpIf64<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP,
-@@ -591,34 +591,37 @@ def UCOM_Fpr80 : FpI_  <(outs), (ins RFP80:$lhs, RFP80
-
- let SchedRW = [WriteFCom] in {
- // CC = ST(0) cmp ST(i)
--let Defs = [EFLAGS, FPSW] in {
--def UCOM_FpIr32: FpIf32<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP,
--                  [(set EFLAGS, (X86cmp RFP32:$lhs, RFP32:$rhs))]>;
--def UCOM_FpIr64: FpIf64<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP,
--                  [(set EFLAGS, (X86cmp RFP64:$lhs, RFP64:$rhs))]>;
-+let Defs = [EFLAGS, FPSW], Uses = [FPCW] in {
-+def UCOM_FpIr32: FpI_<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP,
-+                  [(set EFLAGS, (X86cmp RFP32:$lhs, RFP32:$rhs))]>,
-+                  Requires<[FPStackf32, HasCMov]>;
-+def UCOM_FpIr64: FpI_<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP,
-+                  [(set EFLAGS, (X86cmp RFP64:$lhs, RFP64:$rhs))]>,
-+                  Requires<[FPStackf64, HasCMov]>;
- def UCOM_FpIr80: FpI_<(outs), (ins RFP80:$lhs, RFP80:$rhs), CompareFP,
--                  [(set EFLAGS, (X86cmp RFP80:$lhs, RFP80:$rhs))]>;
-+                  [(set EFLAGS, (X86cmp RFP80:$lhs, RFP80:$rhs))]>,
-+                  Requires<[HasCMov]>;
- }
-
--let Defs = [FPSW], Uses = [ST0] in {
-+let Defs = [FPSW], Uses = [ST0, FPCW] in {
- def UCOM_Fr    : FPI<0xDD, MRM4r,    // FPSW = cmp ST(0) with ST(i)
--                    (outs), (ins RST:$reg), "fucom\t$reg">;
-+                    (outs), (ins RSTi:$reg), "fucom\t$reg">;
- def UCOM_FPr   : FPI<0xDD, MRM5r,    // FPSW = cmp ST(0) with ST(i), pop
--                    (outs), (ins RST:$reg), "fucomp\t$reg">;
-+                    (outs), (ins RSTi:$reg), "fucomp\t$reg">;
- def UCOM_FPPr  : FPI<0xDA, MRM_E9,       // cmp ST(0) with ST(1), pop, pop
-                     (outs), (ins), "fucompp">;
- }
-
--let Defs = [EFLAGS, FPSW], Uses = [ST0] in {
-+let Defs = [EFLAGS, FPSW], Uses = [ST0, FPCW] in {
- def UCOM_FIr   : FPI<0xDB, MRM5r,     // CC = cmp ST(0) with ST(i)
--                    (outs), (ins RST:$reg), "fucomi\t$reg">;
-+                    (outs), (ins RSTi:$reg), "fucomi\t{$reg, %st|st, $reg}">;
- def UCOM_FIPr  : FPI<0xDF, MRM5r,     // CC = cmp ST(0) with ST(i), pop
--                    (outs), (ins RST:$reg), "fucompi\t$reg">;
--}
-+                    (outs), (ins RSTi:$reg), "fucompi\t{$reg, %st|st, $reg}">;
-
--let Defs = [EFLAGS, FPSW] in {
--def COM_FIr : FPI<0xDB, MRM6r, (outs), (ins RST:$reg), "fcomi\t$reg">;
--def COM_FIPr : FPI<0xDF, MRM6r, (outs), (ins RST:$reg), "fcompi\t$reg">;
-+def COM_FIr : FPI<0xDB, MRM6r, (outs), (ins RSTi:$reg),
-+                  "fcomi\t{$reg, %st|st, $reg}">;
-+def COM_FIPr : FPI<0xDF, MRM6r, (outs), (ins RSTi:$reg),
-+                   "fcompi\t{$reg, %st|st, $reg}">;
- }
- } // SchedRW
-
-@@ -628,12 +631,12 @@ let Defs = [AX], Uses = [FPSW] in
- def FNSTSW16r : I<0xDF, MRM_E0,                  // AX = fp flags
-                   (outs), (ins), "fnstsw\t{%ax|ax}",
-                   [(set AX, (X86fp_stsw FPSW))]>;
--let Defs = [FPSW] in
-+let Defs = [FPSW], Uses = [FPCW] in
- def FNSTCW16m : I<0xD9, MRM7m,                   // [mem16] = X87 control world
-                   (outs), (ins i16mem:$dst), "fnstcw\t$dst",
-                   [(X86fp_cwd_get16 addr:$dst)]>;
- } // SchedRW
--let Defs = [FPSW], mayLoad = 1 in
-+let Defs = [FPSW,FPCW], mayLoad = 1 in
- def FLDCW16m  : I<0xD9, MRM5m,                   // X87 control world = [mem16]
-                   (outs), (ins i16mem:$dst), "fldcw\t$dst", []>,
-                 Sched<[WriteLoad]>;
-@@ -642,8 +645,8 @@ def FLDCW16m  : I<0xD9, MRM5m,                   // X8
- let SchedRW = [WriteMicrocoded] in {
- let Defs = [FPSW] in {
- def FNINIT : I<0xDB, MRM_E3, (outs), (ins), "fninit", []>;
--def FFREE : FPI<0xDD, MRM0r, (outs), (ins RST:$reg), "ffree\t$reg">;
--def FFREEP : FPI<0xDF, MRM0r, (outs), (ins RST:$reg), "ffreep\t$reg">;
-+def FFREE : FPI<0xDD, MRM0r, (outs), (ins RSTi:$reg), "ffree\t$reg">;
-+def FFREEP : FPI<0xDF, MRM0r, (outs), (ins RSTi:$reg), "ffreep\t$reg">;
-
- // Clear exceptions
- def FNCLEX : I<0xDB, MRM_E2, (outs), (ins), "fnclex", []>;
Index: devel/llvm/patches/patch-lib_Target_X86_X86InstrInfo_td
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_X86InstrInfo_td
diff -N devel/llvm/patches/patch-lib_Target_X86_X86InstrInfo_td
--- devel/llvm/patches/patch-lib_Target_X86_X86InstrInfo_td 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,71 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_X86InstrInfo_td,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/X86InstrInfo.td
---- lib/Target/X86/X86InstrInfo.td.orig
-+++ lib/Target/X86/X86InstrInfo.td
-@@ -3259,39 +3259,39 @@ def : InstAlias<"fucompi",      (UCOM_FIPr   ST1), 0>;
- // instructions like "fadd %st(0), %st(0)" as "fadd %st(0)" for consistency with
- // gas.
- multiclass FpUnaryAlias<string Mnemonic, Instruction Inst, bit EmitAlias = 1> {
-- def : InstAlias<!strconcat(Mnemonic, "\t{$op, %st(0)|st(0), $op}"),
--                 (Inst RST:$op), EmitAlias>;
-- def : InstAlias<!strconcat(Mnemonic, "\t{%st(0), %st(0)|st(0), st(0)}"),
-+ def : InstAlias<!strconcat(Mnemonic, "\t$op"),
-+                 (Inst RSTi:$op), EmitAlias>;
-+ def : InstAlias<!strconcat(Mnemonic, "\t{%st, %st|st, st}"),
-                  (Inst ST0), EmitAlias>;
- }
-
--defm : FpUnaryAlias<"fadd",   ADD_FST0r>;
-+defm : FpUnaryAlias<"fadd",   ADD_FST0r, 0>;
- defm : FpUnaryAlias<"faddp",  ADD_FPrST0, 0>;
--defm : FpUnaryAlias<"fsub",   SUB_FST0r>;
--defm : FpUnaryAlias<"fsub{|r}p",  SUBR_FPrST0>;
--defm : FpUnaryAlias<"fsubr",  SUBR_FST0r>;
--defm : FpUnaryAlias<"fsub{r|}p", SUB_FPrST0>;
--defm : FpUnaryAlias<"fmul",   MUL_FST0r>;
--defm : FpUnaryAlias<"fmulp",  MUL_FPrST0>;
--defm : FpUnaryAlias<"fdiv",   DIV_FST0r>;
--defm : FpUnaryAlias<"fdiv{|r}p",  DIVR_FPrST0>;
--defm : FpUnaryAlias<"fdivr",  DIVR_FST0r>;
--defm : FpUnaryAlias<"fdiv{r|}p", DIV_FPrST0>;
-+defm : FpUnaryAlias<"fsub",   SUB_FST0r, 0>;
-+defm : FpUnaryAlias<"fsub{|r}p",  SUBR_FPrST0, 0>;
-+defm : FpUnaryAlias<"fsubr",  SUBR_FST0r, 0>;
-+defm : FpUnaryAlias<"fsub{r|}p", SUB_FPrST0, 0>;
-+defm : FpUnaryAlias<"fmul",   MUL_FST0r, 0>;
-+defm : FpUnaryAlias<"fmulp",  MUL_FPrST0, 0>;
-+defm : FpUnaryAlias<"fdiv",   DIV_FST0r, 0>;
-+defm : FpUnaryAlias<"fdiv{|r}p",  DIVR_FPrST0, 0>;
-+defm : FpUnaryAlias<"fdivr",  DIVR_FST0r, 0>;
-+defm : FpUnaryAlias<"fdiv{r|}p", DIV_FPrST0, 0>;
- defm : FpUnaryAlias<"fcomi",   COM_FIr, 0>;
- defm : FpUnaryAlias<"fucomi",  UCOM_FIr, 0>;
--defm : FpUnaryAlias<"fcompi",   COM_FIPr>;
--defm : FpUnaryAlias<"fucompi",  UCOM_FIPr>;
-+defm : FpUnaryAlias<"fcompi",   COM_FIPr, 0>;
-+defm : FpUnaryAlias<"fucompi",  UCOM_FIPr, 0>;
-
-
--// Handle "f{mulp,addp} st(0), $op" the same as "f{mulp,addp} $op", since they
-+// Handle "f{mulp,addp} $op, %st(0)" the same as "f{mulp,addp} $op", since they
- // commute.  We also allow fdiv[r]p/fsubrp even though they don't commute,
- // solely because gas supports it.
--def : InstAlias<"faddp\t{%st(0), $op|$op, st(0)}", (ADD_FPrST0 RST:$op), 0>;
--def : InstAlias<"fmulp\t{%st(0), $op|$op, st(0)}", (MUL_FPrST0 RST:$op)>;
--def : InstAlias<"fsub{|r}p\t{%st(0), $op|$op, st(0)}", (SUBR_FPrST0 RST:$op)>;
--def : InstAlias<"fsub{r|}p\t{%st(0), $op|$op, st(0)}", (SUB_FPrST0 RST:$op)>;
--def : InstAlias<"fdiv{|r}p\t{%st(0), $op|$op, st(0)}", (DIVR_FPrST0 RST:$op)>;
--def : InstAlias<"fdiv{r|}p\t{%st(0), $op|$op, st(0)}", (DIV_FPrST0 RST:$op)>;
-+def : InstAlias<"faddp\t{$op, %st|st, $op}", (ADD_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fmulp\t{$op, %st|st, $op}", (MUL_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fsub{|r}p\t{$op, %st|st, $op}", (SUBR_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fsub{r|}p\t{$op, %st|st, $op}", (SUB_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fdiv{|r}p\t{$op, %st|st, $op}", (DIVR_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fdiv{r|}p\t{$op, %st|st, $op}", (DIV_FPrST0 RSTi:$op), 0>;
-
- def : InstAlias<"fnstsw"     , (FNSTSW16r), 0>;
-
Index: devel/llvm/patches/patch-lib_Target_X86_X86MCInstLower_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86MCInstLower_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-lib_Target_X86_X86MCInstLower_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86MCInstLower_cpp 24 Feb 2019 20:53:56 -0000 1.6
+++ devel/llvm/patches/patch-lib_Target_X86_X86MCInstLower_cpp 30 Jun 2019 10:50:12 -0000
@@ -22,7 +22,7 @@ $OpenBSD: patch-lib_Target_X86_X86MCInst
 Index: lib/Target/X86/X86MCInstLower.cpp
 --- lib/Target/X86/X86MCInstLower.cpp.orig
 +++ lib/Target/X86/X86MCInstLower.cpp
-@@ -1831,6 +1831,27 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr
+@@ -1786,6 +1786,27 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr
          MCInstBuilder(X86::MOV64rr).addReg(X86::R10).addReg(X86::RAX));
      return;
 
@@ -50,7 +50,7 @@ Index: lib/Target/X86/X86MCInstLower.cpp
    case X86::SEH_PushReg:
    case X86::SEH_SaveReg:
    case X86::SEH_SaveXMM:
-@@ -2257,4 +2278,10 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr
+@@ -2223,4 +2244,10 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr
    }
 
    EmitAndCountInstruction(TmpInst);
Index: devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_X86RegisterInfo_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/X86RegisterInfo.cpp
---- lib/Target/X86/X86RegisterInfo.cpp.orig
-+++ lib/Target/X86/X86RegisterInfo.cpp
-@@ -497,6 +497,9 @@ BitVector X86RegisterInfo::getReservedRegs(const Machi
-   BitVector Reserved(getNumRegs());
-   const X86FrameLowering *TFI = getFrameLowering(MF);
-
-+  // Set the floating point control register as reserved.
-+  Reserved.set(X86::FPCW);
-+
-   // Set the stack-pointer register and its aliases as reserved.
-   for (MCSubRegIterator I(X86::RSP, this, /*IncludeSelf=*/true); I.isValid();
-        ++I)
Index: devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_td,v
retrieving revision 1.5
diff -u -p -r1.5 patch-lib_Target_X86_X86RegisterInfo_td
--- devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_td 20 Feb 2019 00:24:11 -0000 1.5
+++ devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_td 30 Jun 2019 10:50:13 -0000
@@ -19,35 +19,11 @@ $OpenBSD: patch-lib_Target_X86_X86Regist
   There are other possible changes in this direction. BX/BL are obvious next
   targets for avoidance, and MM3/XMM3 may also be useful to try to avoid if
   possible.
-- Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-  to fix a regression in floating point operations.
 
 Index: lib/Target/X86/X86RegisterInfo.td
 --- lib/Target/X86/X86RegisterInfo.td.orig
 +++ lib/Target/X86/X86RegisterInfo.td
-@@ -278,7 +278,7 @@ def K7 : X86Reg<"k7", 7>, DwarfRegNum<[125, 100, 100]>
- // pseudo registers, but we still mark them as aliasing FP registers. That
- // way both kinds can be live without exceeding the stack depth. ST registers
- // are only live around inline assembly.
--def ST0 : X86Reg<"st(0)", 0>, DwarfRegNum<[33, 12, 11]>;
-+def ST0 : X86Reg<"st", 0>, DwarfRegNum<[33, 12, 11]>;
- def ST1 : X86Reg<"st(1)", 1>, DwarfRegNum<[34, 13, 12]>;
- def ST2 : X86Reg<"st(2)", 2>, DwarfRegNum<[35, 14, 13]>;
- def ST3 : X86Reg<"st(3)", 3>, DwarfRegNum<[36, 15, 14]>;
-@@ -288,8 +288,11 @@ def ST6 : X86Reg<"st(6)", 6>, DwarfRegNum<[39, 18, 17]
- def ST7 : X86Reg<"st(7)", 7>, DwarfRegNum<[40, 19, 18]>;
-
- // Floating-point status word
--def FPSW : X86Reg<"fpsw", 0>;
-+def FPSW : X86Reg<"fpsr", 0>;
-
-+// Floating-point control word
-+def FPCW : X86Reg<"fpcr", 0>;
-+
- // Status flags register.
- //
- // Note that some flags that are commonly thought of as part of the status
-@@ -402,8 +405,8 @@ def GRH16 : RegisterClass<"X86", [i16], 16,
+@@ -405,8 +405,8 @@ def GRH16 : RegisterClass<"X86", [i16], 16,
                                 R15WH)>;
 
  def GR32 : RegisterClass<"X86", [i32], 32,
@@ -58,7 +34,7 @@ Index: lib/Target/X86/X86RegisterInfo.td
 
  // GR64 - 64-bit GPRs. This oddly includes RIP, which isn't accurate, since
  // RIP isn't really a register and it can't be used anywhere except in an
-@@ -412,7 +415,7 @@ def GR32 : RegisterClass<"X86", [i32], 32,
+@@ -415,7 +415,7 @@ def GR32 : RegisterClass<"X86", [i32], 32,
  // tests because of the inclusion of RIP in this register class.
  def GR64 : RegisterClass<"X86", [i64], 64,
                           (add RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11,
@@ -67,13 +43,3 @@ Index: lib/Target/X86/X86RegisterInfo.td
 
  // Segment registers for use by MOV instructions (and others) that have a
  //   segment register as one operand.  Always contain a 16-bit segment
-@@ -521,6 +524,9 @@ def RFP80 : RegisterClass<"X86",[f80], 32, (add RFP32)
- def RST : RegisterClass<"X86", [f80, f64, f32], 32, (sequence "ST%u", 0, 7)> {
-   let isAllocatable = 0;
- }
-+
-+// Helper to allow %st to print as %st(0) when its encoded in the instruction.
-+def RSTi : RegisterOperand<RST, "printSTiRegOperand">;
-
- // Generic vector registers: VR64 and VR128.
- // Ensure that float types are declared first - only float is legal on SSE1.
Index: devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_X86_X86Subtarget_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_cpp 30 Jun 2019 10:50:13 -0000
@@ -5,7 +5,7 @@ Turn on -mretpoline by default in clang
 Index: lib/Target/X86/X86Subtarget.cpp
 --- lib/Target/X86/X86Subtarget.cpp.orig
 +++ lib/Target/X86/X86Subtarget.cpp
-@@ -238,6 +238,14 @@ void X86Subtarget::initSubtargetFeatures(StringRef CPU
+@@ -251,6 +251,14 @@ void X86Subtarget::initSubtargetFeatures(StringRef CPU
        FullFS = "+sahf";
    }
 
Index: devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h,v
retrieving revision 1.5
diff -u -p -r1.5 patch-lib_Target_X86_X86Subtarget_h
--- devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h 11 Feb 2019 05:24:16 -0000 1.5
+++ devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h 30 Jun 2019 10:50:13 -0000
@@ -6,7 +6,7 @@ $OpenBSD: patch-lib_Target_X86_X86Subtar
 Index: lib/Target/X86/X86Subtarget.h
 --- lib/Target/X86/X86Subtarget.h.orig
 +++ lib/Target/X86/X86Subtarget.h
-@@ -400,6 +400,9 @@ class X86Subtarget final : public X86GenSubtargetInfo
+@@ -411,6 +411,9 @@ class X86Subtarget final : public X86GenSubtargetInfo
    /// entry to the function and which must be maintained by every function.
    unsigned stackAlignment = 4;
 
@@ -16,7 +16,7 @@ Index: lib/Target/X86/X86Subtarget.h
    /// 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?
-@@ -478,6 +481,8 @@ class X86Subtarget final : public X86GenSubtargetInfo
+@@ -492,6 +495,8 @@ class X86Subtarget final : public X86GenSubtargetInfo
      return &getInstrInfo()->getRegisterInfo();
    }
 
@@ -25,7 +25,7 @@ Index: lib/Target/X86/X86Subtarget.h
    /// 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.
-@@ -699,6 +704,7 @@ class X86Subtarget final : public X86GenSubtargetInfo
+@@ -722,6 +727,7 @@ class X86Subtarget final : public X86GenSubtargetInfo
 
    bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
    bool isTargetFreeBSD() const { return TargetTriple.isOSFreeBSD(); }
Index: devel/llvm/patches/patch-lib_Target_X86_X86TargetMachine_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86TargetMachine_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_X86_X86TargetMachine_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86TargetMachine_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_X86_X86TargetMachine_cpp 30 Jun 2019 10:50:13 -0000
@@ -9,10 +9,10 @@ this framework.
 Index: lib/Target/X86/X86TargetMachine.cpp
 --- lib/Target/X86/X86TargetMachine.cpp.orig
 +++ lib/Target/X86/X86TargetMachine.cpp
-@@ -508,6 +508,7 @@ void X86PassConfig::addPreEmitPass() {
-     addPass(createX86FixupLEAs());
-     addPass(createX86EvexToVexInsts());
+@@ -504,6 +504,7 @@ void X86PassConfig::addPreEmitPass() {
    }
+   addPass(createX86DiscriminateMemOpsPass());
+   addPass(createX86InsertPrefetchPass());
 +  addPass(createX86FixupGadgetsPass());
  }
 
Index: devel/llvm/patches/patch-lib_Target_X86_X86_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86_h,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_X86_X86_h
--- devel/llvm/patches/patch-lib_Target_X86_X86_h 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_X86_X86_h 30 Jun 2019 10:50:13 -0000
@@ -9,9 +9,9 @@ this framework.
 Index: lib/Target/X86/X86.h
 --- lib/Target/X86/X86.h.orig
 +++ lib/Target/X86/X86.h
-@@ -114,6 +114,10 @@ FunctionPass *createX86DomainReassignmentPass();
-
- void initializeFixupBWInstPassPass(PassRegistry &);
+@@ -115,6 +115,10 @@ FunctionPass *createX86FixupBWInsts();
+ /// to another, when profitable.
+ FunctionPass *createX86DomainReassignmentPass();
 
 +/// Return a Machine Function pass that attempts to replace
 +/// ROP friendly instructions with alternatives.
Index: devel/llvm/patches/patch-lib_Target_X86_X86_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86_td,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_Target_X86_X86_td
--- devel/llvm/patches/patch-lib_Target_X86_X86_td 11 Feb 2019 05:24:16 -0000 1.3
+++ devel/llvm/patches/patch-lib_Target_X86_X86_td 30 Jun 2019 10:50:13 -0000
@@ -5,7 +5,7 @@ implement -msave-args in clang/llvm, lik
 Index: lib/Target/X86/X86.td
 --- lib/Target/X86/X86.td.orig
 +++ lib/Target/X86/X86.td
-@@ -284,6 +284,9 @@ def FeatureLZCNTFalseDeps : SubtargetFeature<"false-de
+@@ -283,6 +283,9 @@ def FeatureLZCNTFalseDeps : SubtargetFeature<"false-de
                                       "LZCNT/TZCNT have a false dependency on dest register">;
  def FeaturePCONFIG : SubtargetFeature<"pconfig", "HasPCONFIG", "true",
                                        "platform configuration instruction">;
Index: devel/llvm/patches/patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp,v
retrieving revision 1.4
diff -u -p -r1.4 patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp
--- devel/llvm/patches/patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp 28 Jan 2019 06:27:28 -0000 1.4
+++ devel/llvm/patches/patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp 30 Jun 2019 10:50:13 -0000
@@ -8,7 +8,7 @@ recursion.
 Index: lib/Transforms/Scalar/LoopIdiomRecognize.cpp
 --- lib/Transforms/Scalar/LoopIdiomRecognize.cpp.orig
 +++ lib/Transforms/Scalar/LoopIdiomRecognize.cpp
-@@ -280,6 +280,8 @@ bool LoopIdiomRecognize::runOnLoop(Loop *L) {
+@@ -282,6 +282,8 @@ bool LoopIdiomRecognize::runOnLoop(Loop *L) {
    StringRef Name = L->getHeader()->getParent()->getName();
    if (Name == "memset" || Name == "memcpy")
      return false;
Index: devel/llvm/patches/patch-test_Assembler_debug-info_ll
===================================================================
RCS file: devel/llvm/patches/patch-test_Assembler_debug-info_ll
diff -N devel/llvm/patches/patch-test_Assembler_debug-info_ll
--- devel/llvm/patches/patch-test_Assembler_debug-info_ll 30 Jan 2019 07:36:06 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-test_Assembler_debug-info_ll,v 1.1 2019/01/30 07:36:06 semarie Exp $
-https://github.com/llvm-mirror/llvm/commit/da1fb72bb305d6bc1f3899d541414146934bf80f
-Index: test/Assembler/debug-info.ll
---- test/Assembler/debug-info.ll.orig
-+++ test/Assembler/debug-info.ll
-@@ -83,7 +83,7 @@
- ; CHECK-NEXT: !32 = !DIFile(filename: "file", directory: "dir", checksumkind: CSK_MD5, checksum: "000102030405060708090a0b0c0d0e0f")
- !35 = !DIFile(filename: "file", directory: "dir", checksumkind: CSK_MD5, checksum: "000102030405060708090a0b0c0d0e0f")
-
--; CHECK-NEXT: !33 = !DICompositeType(tag: DW_TAG_variant_part, name: "A", scope: !14, size: 64)
-+; CHECK-NEXT: !33 = !DICompositeType(tag: DW_TAG_variant_part, name: "A", scope: !14, size: 64, discriminator: !34)
- ; CHECK-NEXT: !34 = !DIDerivedType(tag: DW_TAG_member, scope: !33, baseType: !35, size: 64, align: 64, flags: DIFlagArtificial)
- ; CHECK-NEXT: !35 = !DIBasicType(name: "u64", size: 64, encoding: DW_ATE_unsigned)
- !36 = !DICompositeType(tag: DW_TAG_variant_part, name: "A", scope: !16, size: 64, discriminator: !37)
Index: devel/llvm/patches/patch-test_Assembler_debug-variant-discriminator_ll
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-test_Assembler_debug-variant-discriminator_ll,v
retrieving revision 1.1
diff -u -p -r1.1 patch-test_Assembler_debug-variant-discriminator_ll
--- devel/llvm/patches/patch-test_Assembler_debug-variant-discriminator_ll 30 Jan 2019 07:36:06 -0000 1.1
+++ devel/llvm/patches/patch-test_Assembler_debug-variant-discriminator_ll 30 Jun 2019 10:50:13 -0000
@@ -3,7 +3,10 @@ https://github.com/llvm-mirror/llvm/comm
 Index: test/Assembler/debug-variant-discriminator.ll
 --- test/Assembler/debug-variant-discriminator.ll.orig
 +++ test/Assembler/debug-variant-discriminator.ll
-@@ -0,0 +1,14 @@
+@@ -12,3 +12,17 @@
+ !1 = !DICompositeType(tag: DW_TAG_variant_part, scope: !0, size: 64, discriminator: !2)
+ !2 = !DIDerivedType(tag: DW_TAG_member, scope: !1, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial)
+ !3 = !DIBasicType(name: "u64", size: 64, encoding: DW_ATE_unsigned)
 +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
 +; RUN: verify-uselistorder %s
 +
Index: devel/llvm/patches/patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h
diff -N devel/llvm/patches/patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h
--- devel/llvm/patches/patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h 14 Jan 2019 16:08:45 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-$OpenBSD: patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h,v 1.1 2019/01/14 16:08:45 jca Exp $
-
-The %b printf extension in the kernel is not fixed to a int type. On sparc64
-there are various %llb formats. Adjust the code to handle the length specifiers
-and type check like it is used by the regular case.
-
-Index: tools/clang/include/clang/Analysis/Analyses/FormatString.h
---- tools/clang/include/clang/Analysis/Analyses/FormatString.h.orig
-+++ tools/clang/include/clang/Analysis/Analyses/FormatString.h
-@@ -227,8 +227,10 @@ class ConversionSpecifier { (public)
-
-   bool isIntArg() const { return (kind >= IntArgBeg && kind <= IntArgEnd) ||
-     kind == FreeBSDrArg || kind == FreeBSDyArg; }
--  bool isUIntArg() const { return kind >= UIntArgBeg && kind <= UIntArgEnd; }
--  bool isAnyIntArg() const { return kind >= IntArgBeg && kind <= UIntArgEnd; }
-+  bool isUIntArg() const { return (kind >= UIntArgBeg && kind <= UIntArgEnd) ||
-+    kind == FreeBSDbArg; }
-+  bool isAnyIntArg() const { return (kind >= IntArgBeg && kind <= UIntArgEnd) ||
-+    kind == FreeBSDbArg; }
-   bool isDoubleArg() const {
-     return kind >= DoubleArgBeg && kind <= DoubleArgEnd;
-   }
Index: devel/llvm/patches/patch-tools_clang_include_clang_Basic_CodeGenOptions_def
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_include_clang_Basic_CodeGenOptions_def
diff -N devel/llvm/patches/patch-tools_clang_include_clang_Basic_CodeGenOptions_def
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ devel/llvm/patches/patch-tools_clang_include_clang_Basic_CodeGenOptions_def 30 Jun 2019 10:50:13 -0000
@@ -0,0 +1,33 @@
+$OpenBSD$
+
+Add RETGUARD to clang for amd64. This security mechanism uses per-function
+random cookies to protect access to function return instructions, with the
+effect that the integrity of the return address is protected, and function
+return instructions are harder to use in ROP gadgets.
+
+On function entry the return address is combined with a per-function random
+cookie and stored in the stack frame. The integrity of this value is verified
+before function return, and if this check fails, the program aborts. In this way
+RETGUARD is an improved stack protector, since the cookies are per-function. The
+verification routine is constructed such that the binary space immediately
+before each ret instruction is padded with int03 instructions, which makes these
+return instructions difficult to use in ROP gadgets. In the kernel, this has the
+effect of removing approximately 50% of total ROP gadgets, and 15% of unique
+ROP gadgets compared to the 6.3 release kernel. Function epilogues are
+essentially gadget free, leaving only the polymorphic gadgets that result from
+jumping into the instruction stream partway through other instructions. Work to
+remove these gadgets will continue through other mechanisms.
+
+Index: tools/clang/include/clang/Basic/CodeGenOptions.def
+--- tools/clang/include/clang/Basic/CodeGenOptions.def.orig
++++ tools/clang/include/clang/Basic/CodeGenOptions.def
+@@ -286,6 +286,9 @@ VALUE_CODEGENOPT(NumRegisterParameters, 32, 0)
+ /// The lower bound for a buffer to be considered for stack protection.
+ VALUE_CODEGENOPT(SSPBufferSize, 32, 0)
+
++/// Whether to use return protectors
++CODEGENOPT(ReturnProtector, 1, 0)
++
+ /// The kind of generated debug info.
+ ENUM_CODEGENOPT(DebugInfo, codegenoptions::DebugInfoKind, 3, codegenoptions::NoDebugInfo)
+
Index: devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td,v
retrieving revision 1.6
diff -u -p -r1.6 patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td
--- devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td 28 Jan 2019 06:27:28 -0000 1.6
+++ devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td 30 Jun 2019 10:50:13 -0000
@@ -2,7 +2,7 @@ $OpenBSD: patch-tools_clang_include_clan
 
 - Disable -Waddress-of-packed-member by default.
 
-While these warnings have the potential to be useful, there are too manu
+While these warnings have the potential to be useful, there are too many
 false positives right now.
 
 - Disable -Wpointer-sign warnings per default
@@ -12,7 +12,7 @@ base gcc does the same.
 Index: tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
 --- tools/clang/include/clang/Basic/DiagnosticSemaKinds.td.orig
 +++ tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
-@@ -5827,7 +5827,7 @@ def warn_pointer_indirection_from_incompatible_type :
+@@ -5857,7 +5857,7 @@ def warn_pointer_indirection_from_incompatible_type :
    InGroup<UndefinedReinterpretCast>, DefaultIgnore;
  def warn_taking_address_of_packed_member : Warning<
    "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
@@ -21,7 +21,7 @@ Index: tools/clang/include/clang/Basic/D
 
  def err_objc_object_assignment : Error<
    "cannot assign to class object (%0 invalid)">;
-@@ -6804,7 +6804,7 @@ def ext_typecheck_convert_incompatible_pointer_sign :
+@@ -6841,7 +6841,7 @@ def ext_typecheck_convert_incompatible_pointer_sign :
    "sending to parameter of different type}0,1"
    "|%diff{casting $ to type $|casting between types}0,1}2"
    " converts between pointers to integer types with different sign">,
Index: devel/llvm/patches/patch-tools_clang_include_clang_Driver_CC1Options_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_include_clang_Driver_CC1Options_td,v
retrieving revision 1.2
diff -u -p -r1.2 patch-tools_clang_include_clang_Driver_CC1Options_td
--- devel/llvm/patches/patch-tools_clang_include_clang_Driver_CC1Options_td 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-tools_clang_include_clang_Driver_CC1Options_td 30 Jun 2019 10:50:13 -0000
@@ -21,7 +21,7 @@ remove these gadgets will continue throu
 Index: tools/clang/include/clang/Driver/CC1Options.td
 --- tools/clang/include/clang/Driver/CC1Options.td.orig
 +++ tools/clang/include/clang/Driver/CC1Options.td
-@@ -676,6 +676,8 @@ def stack_protector : Separate<["-"], "stack-protector
+@@ -699,6 +699,8 @@ def stack_protector : Separate<["-"], "stack-protector
    HelpText<"Enable stack protectors">;
  def stack_protector_buffer_size : Separate<["-"], "stack-protector-buffer-size">,
    HelpText<"Lower bound for a buffer to be considered for stack protection">;
Index: devel/llvm/patches/patch-tools_clang_include_clang_Driver_Options_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_include_clang_Driver_Options_td,v
retrieving revision 1.18
diff -u -p -r1.18 patch-tools_clang_include_clang_Driver_Options_td
--- devel/llvm/patches/patch-tools_clang_include_clang_Driver_Options_td 24 Feb 2019 20:53:56 -0000 1.18
+++ devel/llvm/patches/patch-tools_clang_include_clang_Driver_Options_td 30 Jun 2019 10:50:13 -0000
@@ -8,10 +8,10 @@ $OpenBSD: patch-tools_clang_include_clan
 Index: tools/clang/include/clang/Driver/Options.td
 --- tools/clang/include/clang/Driver/Options.td.orig
 +++ tools/clang/include/clang/Driver/Options.td
-@@ -1595,6 +1595,14 @@ def fstack_protector_strong : Flag<["-"], "fstack-prot
-   HelpText<"Use a strong heuristic to apply stack protectors to functions">;
- def fstack_protector : Flag<["-"], "fstack-protector">, Group<f_Group>,
-   HelpText<"Enable stack protectors for functions potentially vulnerable to stack smashing">;
+@@ -1665,6 +1665,14 @@ def ftrivial_auto_var_init : Joined<["-"], "ftrivial-a
+ def enable_trivial_var_init_zero : Joined<["-"], "enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang">,
+   Flags<[CC1Option]>,
+   HelpText<"Trivial automatic variable initialization to zero is only here for benchmarks, it'll eventually be removed, and I'm OK with that because I'm only using it to benchmark">;
 +def fno_ret_protector : Flag<["-"], "fno-ret-protector">, Group<f_Group>,
 +  HelpText<"Disable return protector">;
 +def fret_protector : Flag<["-"], "fret-protector">, Group<f_Group>,
@@ -23,7 +23,7 @@ Index: tools/clang/include/clang/Driver/
  def fstandalone_debug : Flag<["-"], "fstandalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
    HelpText<"Emit full debug info for all types used by the program">;
  def fno_standalone_debug : Flag<["-"], "fno-standalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
-@@ -2359,7 +2367,7 @@ def pthreads : Flag<["-"], "pthreads">;
+@@ -2500,7 +2508,7 @@ def pthreads : Flag<["-"], "pthreads">;
  def pthread : Flag<["-"], "pthread">, Flags<[CC1Option]>,
    HelpText<"Support POSIX threads in generated code">;
  def no_pthread : Flag<["-"], "no-pthread">, Flags<[CC1Option]>;
@@ -32,8 +32,8 @@ Index: tools/clang/include/clang/Driver/
  def pie : Flag<["-"], "pie">;
  def read__only__relocs : Separate<["-"], "read_only_relocs">;
  def remap : Flag<["-"], "remap">;
-@@ -2810,6 +2818,8 @@ def mretpoline : Flag<["-"], "mretpoline">, Group<m_x8
- def mno_retpoline : Flag<["-"], "mno-retpoline">, Group<m_x86_Features_Group>;
+@@ -2949,6 +2957,8 @@ def mshstk : Flag<["-"], "mshstk">, Group<m_x86_Featur
+ def mno_shstk : Flag<["-"], "mno-shstk">, Group<m_x86_Features_Group>;
  def mretpoline_external_thunk : Flag<["-"], "mretpoline-external-thunk">, Group<m_x86_Features_Group>;
  def mno_retpoline_external_thunk : Flag<["-"], "mno-retpoline-external-thunk">, Group<m_x86_Features_Group>;
 +def msave_args : Flag<["-"], "msave-args">, Group<m_x86_Features_Group>;
Index: devel/llvm/patches/patch-tools_clang_include_clang_Frontend_CodeGenOptions_def
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_include_clang_Frontend_CodeGenOptions_def
diff -N devel/llvm/patches/patch-tools_clang_include_clang_Frontend_CodeGenOptions_def
--- devel/llvm/patches/patch-tools_clang_include_clang_Frontend_CodeGenOptions_def 28 Jan 2019 06:27:28 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-$OpenBSD: patch-tools_clang_include_clang_Frontend_CodeGenOptions_def,v 1.2 2019/01/28 06:27:28 jca Exp $
-
-Add RETGUARD to clang for amd64. This security mechanism uses per-function
-random cookies to protect access to function return instructions, with the
-effect that the integrity of the return address is protected, and function
-return instructions are harder to use in ROP gadgets.
-
-On function entry the return address is combined with a per-function random
-cookie and stored in the stack frame. The integrity of this value is verified
-before function return, and if this check fails, the program aborts. In this way
-RETGUARD is an improved stack protector, since the cookies are per-function. The
-verification routine is constructed such that the binary space immediately
-before each ret instruction is padded with int03 instructions, which makes these
-return instructions difficult to use in ROP gadgets. In the kernel, this has the
-effect of removing approximately 50% of total ROP gadgets, and 15% of unique
-ROP gadgets compared to the 6.3 release kernel. Function epilogues are
-essentially gadget free, leaving only the polymorphic gadgets that result from
-jumping into the instruction stream partway through other instructions. Work to
-remove these gadgets will continue through other mechanisms.
-
-Index: tools/clang/include/clang/Frontend/CodeGenOptions.def
---- tools/clang/include/clang/Frontend/CodeGenOptions.def.orig
-+++ tools/clang/include/clang/Frontend/CodeGenOptions.def
-@@ -274,6 +274,9 @@ VALUE_CODEGENOPT(NumRegisterParameters, 32, 0)
- /// The lower bound for a buffer to be considered for stack protection.
- VALUE_CODEGENOPT(SSPBufferSize, 32, 0)
-
-+/// Whether to use return protectors
-+CODEGENOPT(ReturnProtector, 1, 0)
-+
- /// The kind of generated debug info.
- ENUM_CODEGENOPT(DebugInfo, codegenoptions::DebugInfoKind, 3, codegenoptions::NoDebugInfo)
-
Index: devel/llvm/patches/patch-tools_clang_include_clang_Sema_Sema_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_include_clang_Sema_Sema_h,v
retrieving revision 1.4
diff -u -p -r1.4 patch-tools_clang_include_clang_Sema_Sema_h
--- devel/llvm/patches/patch-tools_clang_include_clang_Sema_Sema_h 28 Jan 2019 06:27:28 -0000 1.4
+++ devel/llvm/patches/patch-tools_clang_include_clang_Sema_Sema_h 30 Jun 2019 10:50:13 -0000
@@ -5,7 +5,7 @@ Teach Clang about syslog format attribut
 Index: tools/clang/include/clang/Sema/Sema.h
 --- tools/clang/include/clang/Sema/Sema.h.orig
 +++ tools/clang/include/clang/Sema/Sema.h
-@@ -10454,6 +10454,7 @@ class Sema { (public)
+@@ -10561,6 +10561,7 @@ class Sema { (public)
      FST_FreeBSDKPrintf,
      FST_OSTrace,
      FST_OSLog,
Index: devel/llvm/patches/patch-tools_clang_lib_Analysis_FormatString_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Analysis_FormatString_cpp
diff -N devel/llvm/patches/patch-tools_clang_lib_Analysis_FormatString_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Analysis_FormatString_cpp 14 Jan 2019 16:08:45 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,39 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Analysis_FormatString_cpp,v 1.1 2019/01/14 16:08:45 jca Exp $
-
-The %b printf extension in the kernel is not fixed to a int type. On sparc64
-there are various %llb formats. Adjust the code to handle the length specifiers
-and type check like it is used by the regular case.
-
-Index: tools/clang/lib/Analysis/FormatString.cpp
---- tools/clang/lib/Analysis/FormatString.cpp.orig
-+++ tools/clang/lib/Analysis/FormatString.cpp
-@@ -706,6 +706,10 @@ bool FormatSpecifier::hasValidLengthModifier(const Tar
-         case ConversionSpecifier::XArg:
-         case ConversionSpecifier::nArg:
-           return true;
-+        case ConversionSpecifier::FreeBSDbArg:
-+          return Target.getTriple().isOSFreeBSD() ||
-+                 Target.getTriple().isPS4() ||
-+                 Target.getTriple().isOSOpenBSD();
-         case ConversionSpecifier::FreeBSDrArg:
-         case ConversionSpecifier::FreeBSDyArg:
-           return Target.getTriple().isOSFreeBSD() || Target.getTriple().isPS4();
-@@ -739,6 +743,10 @@ bool FormatSpecifier::hasValidLengthModifier(const Tar
-         case ConversionSpecifier::ScanListArg:
-         case ConversionSpecifier::ZArg:
-           return true;
-+        case ConversionSpecifier::FreeBSDbArg:
-+          return Target.getTriple().isOSFreeBSD() ||
-+                 Target.getTriple().isPS4() ||
-+                 Target.getTriple().isOSOpenBSD();
-         case ConversionSpecifier::FreeBSDrArg:
-         case ConversionSpecifier::FreeBSDyArg:
-           return Target.getTriple().isOSFreeBSD() || Target.getTriple().isPS4();
-@@ -897,6 +905,7 @@ bool FormatSpecifier::hasStandardLengthConversionCombi
-         case ConversionSpecifier::uArg:
-         case ConversionSpecifier::xArg:
-         case ConversionSpecifier::XArg:
-+        case ConversionSpecifier::FreeBSDbArg:
-           return false;
-         default:
-           return true;
Index: devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_PPC_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_PPC_h
diff -N devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_PPC_h
--- devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_PPC_h 11 Feb 2019 05:33:57 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Basic_Targets_PPC_h,v 1.1 2019/02/11 05:33:57 jca Exp $
-
-long double is double on OpenBSD/NetBSD/PPC.
-
-Index: tools/clang/lib/Basic/Targets/PPC.h
---- tools/clang/lib/Basic/Targets/PPC.h.orig
-+++ tools/clang/lib/Basic/Targets/PPC.h
-@@ -328,9 +328,15 @@ class LLVM_LIBRARY_VISIBILITY PPC32TargetInfo : public
-       break;
-     }
-
--    if (getTriple().getOS() == llvm::Triple::FreeBSD) {
-+    switch (getTriple().getOS()) {
-+    case llvm::Triple::FreeBSD:
-+    case llvm::Triple::NetBSD:
-+    case llvm::Triple::OpenBSD:
-       LongDoubleWidth = LongDoubleAlign = 64;
-       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
-+      break;
-+    default:
-+      break;
-     }
-
-     // PPC32 supports atomics up to 4 bytes.
Index: devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_clang_lib_Basic_Targets_X86_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_cpp 11 Feb 2019 05:24:16 -0000 1.3
+++ devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_cpp 30 Jun 2019 10:50:13 -0000
@@ -5,7 +5,7 @@ implement -msave-args in clang/llvm, lik
 Index: tools/clang/lib/Basic/Targets/X86.cpp
 --- tools/clang/lib/Basic/Targets/X86.cpp.orig
 +++ tools/clang/lib/Basic/Targets/X86.cpp
-@@ -814,6 +814,8 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<s
+@@ -817,6 +817,8 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<s
        HasPTWRITE = true;
      } else if (Feature == "+invpcid") {
        HasINVPCID = true;
@@ -14,7 +14,7 @@ Index: tools/clang/lib/Basic/Targets/X86
      }
 
      X86SSEEnum Level = llvm::StringSwitch<X86SSEEnum>(Feature)
-@@ -1386,6 +1388,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) cons
+@@ -1398,6 +1400,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) cons
        .Case("movdiri", HasMOVDIRI)
        .Case("movdir64b", HasMOVDIR64B)
        .Case("mpx", HasMPX)
Index: devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_h,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_clang_lib_Basic_Targets_X86_h
--- devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_h 11 Feb 2019 05:24:16 -0000 1.3
+++ devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_h 30 Jun 2019 10:50:13 -0000
@@ -5,7 +5,7 @@ implement -msave-args in clang/llvm, lik
 Index: tools/clang/lib/Basic/Targets/X86.h
 --- tools/clang/lib/Basic/Targets/X86.h.orig
 +++ tools/clang/lib/Basic/Targets/X86.h
-@@ -107,6 +107,7 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public T
+@@ -106,6 +106,7 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public T
    bool HasMOVDIR64B = false;
    bool HasPTWRITE = false;
    bool HasINVPCID = false;
Index: devel/llvm/patches/patch-tools_clang_lib_CodeGen_CGCall_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_CodeGen_CGCall_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-tools_clang_lib_CodeGen_CGCall_cpp
--- devel/llvm/patches/patch-tools_clang_lib_CodeGen_CGCall_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-tools_clang_lib_CodeGen_CGCall_cpp 30 Jun 2019 10:50:13 -0000
@@ -21,14 +21,13 @@ remove these gadgets will continue throu
 Index: tools/clang/lib/CodeGen/CGCall.cpp
 --- tools/clang/lib/CodeGen/CGCall.cpp.orig
 +++ tools/clang/lib/CodeGen/CGCall.cpp
-@@ -1936,6 +1936,10 @@ void CodeGenModule::ConstructAttributeList(
-
+@@ -1958,6 +1958,9 @@ void CodeGenModule::ConstructAttributeList(
      FuncAttrs.addAttribute("disable-tail-calls",
                             llvm::toStringRef(DisableTailCalls));
+     GetCPUAndFeaturesAttributes(CalleeInfo.getCalleeDecl(), FuncAttrs);
 +
 +    if (CodeGenOpts.ReturnProtector)
 +      FuncAttrs.addAttribute("ret-protector");
-+
-     GetCPUAndFeaturesAttributes(TargetDecl, FuncAttrs);
    }
 
+   ClangToLLVMArgMapping IRFunctionArgs(getContext(), FI);
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp 30 Jun 2019 10:50:13 -0000
@@ -5,17 +5,7 @@ Make LLVM create strict aligned code for
 Index: tools/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
 --- tools/clang/lib/Driver/ToolChains/Arch/AArch64.cpp.orig
 +++ tools/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
-@@ -152,7 +152,8 @@ getAArch64MicroArchFeaturesFromMcpu(const Driver &D, S
-   return getAArch64MicroArchFeaturesFromMtune(D, CPU, Args, Features);
- }
-
--void aarch64::getAArch64TargetFeatures(const Driver &D, const ArgList &Args,
-+void aarch64::getAArch64TargetFeatures(const Driver &D, const llvm::Triple &Triple,
-+                                       const ArgList &Args,
-                                        std::vector<StringRef> &Features) {
-   Arg *A;
-   bool success = true;
-@@ -194,9 +195,11 @@ void aarch64::getAArch64TargetFeatures(const Driver &D
+@@ -311,9 +311,11 @@ fp16_fml_fallthrough:
    }
 
    if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access,
@@ -26,5 +16,5 @@ Index: tools/clang/lib/Driver/ToolChains
 +  } else if (Triple.isOSOpenBSD())
 +    Features.push_back("+strict-align");
 
-   if (Args.hasArg(options::OPT_ffixed_x18))
-     Features.push_back("+reserve-x18");
+   if (Args.hasArg(options::OPT_ffixed_x1))
+     Features.push_back("+reserve-x1");
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h
diff -N devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h 1 Sep 2017 06:40:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h,v 1.1 2017/09/01 06:40:28 ajacoutot Exp $
-
-Make LLVM create strict aligned code for OpenBSD/arm64.
-
---- tools/clang/lib/Driver/ToolChains/Arch/AArch64.h.orig Sun Apr  2 02:26:33 2017
-+++ tools/clang/lib/Driver/ToolChains/Arch/AArch64.h Sun Apr  2 02:29:49 2017
-@@ -21,7 +21,8 @@ namespace driver {
- namespace tools {
- namespace aarch64 {
-
--void getAArch64TargetFeatures(const Driver &D, const llvm::opt::ArgList &Args,
-+void getAArch64TargetFeatures(const Driver &D, const llvm::Triple &Triple,
-+                              const llvm::opt::ArgList &Args,
-                               std::vector<llvm::StringRef> &Features);
-
- std::string getAArch64TargetCPU(const llvm::opt::ArgList &Args,
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Clang_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Clang_cpp,v
retrieving revision 1.8
diff -u -p -r1.8 patch-tools_clang_lib_Driver_ToolChains_Clang_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Clang_cpp 24 Feb 2019 20:53:56 -0000 1.8
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Clang_cpp 30 Jun 2019 10:50:13 -0000
@@ -32,16 +32,7 @@ $OpenBSD: patch-tools_clang_lib_Driver_T
 Index: tools/clang/lib/Driver/ToolChains/Clang.cpp
 --- tools/clang/lib/Driver/ToolChains/Clang.cpp.orig
 +++ tools/clang/lib/Driver/ToolChains/Clang.cpp
-@@ -341,7 +341,7 @@ static void getTargetFeatures(const ToolChain &TC, con
-     break;
-   case llvm::Triple::aarch64:
-   case llvm::Triple::aarch64_be:
--    aarch64::getAArch64TargetFeatures(D, Args, Features);
-+    aarch64::getAArch64TargetFeatures(D, Triple, Args, Features);
-     break;
-   case llvm::Triple::x86:
-   case llvm::Triple::x86_64:
-@@ -3478,9 +3478,12 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+@@ -3893,9 +3893,12 @@ void Clang::ConstructJob(Compilation &C, const JobActi
        OFastEnabled ? options::OPT_Ofast : options::OPT_fstrict_aliasing;
    // We turn strict aliasing off by default if we're in CL mode, since MSVC
    // doesn't do any TBAA.
@@ -56,19 +47,22 @@ Index: tools/clang/lib/Driver/ToolChains
      CmdArgs.push_back("-relaxed-aliasing");
    if (!Args.hasFlag(options::OPT_fstruct_path_tbaa,
                      options::OPT_fno_struct_path_tbaa))
-@@ -4086,7 +4089,8 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+@@ -4521,7 +4524,8 @@ void Clang::ConstructJob(Compilation &C, const JobActi
                                        options::OPT_fno_strict_overflow)) {
      if (A->getOption().matches(options::OPT_fno_strict_overflow))
        CmdArgs.push_back("-fwrapv");
 -  }
 +  } else if (getToolChain().getTriple().isOSOpenBSD())
-+      CmdArgs.push_back("-fwrapv");
++    CmdArgs.push_back("-fwrapv");
 
    if (Arg *A = Args.getLastArg(options::OPT_freroll_loops,
                                 options::OPT_fno_reroll_loops))
-@@ -4101,6 +4105,34 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+@@ -4538,9 +4542,44 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+                    false))
+     CmdArgs.push_back(Args.MakeArgString("-mspeculative-load-hardening"));
 
-   RenderSSPOptions(getToolChain(), Args, CmdArgs, KernelOrKext);
+-  RenderSSPOptions(TC, Args, CmdArgs, KernelOrKext);
+   RenderTrivialAutoVarInitOptions(D, TC, Args, CmdArgs);
 
 +  // -ret-protector
 +  unsigned RetProtector = 1;
@@ -85,7 +79,15 @@ Index: tools/clang/lib/Driver/ToolChains
 +      !Args.hasArg(options::OPT_fno_stack_protector) &&
 +      !Args.hasArg(options::OPT_pg)) {
 +    CmdArgs.push_back(Args.MakeArgString("-D_RET_PROTECTOR"));
-+    CmdArgs.push_back(Args.MakeArgString(Twine("-ret-protector")));
++    CmdArgs.push_back(Args.MakeArgString("-ret-protector"));
++    // Consume the stack protector arguments to prevent warning
++    Args.getLastArg(options::OPT_fstack_protector_all,
++        options::OPT_fstack_protector_strong,
++        options::OPT_fstack_protector,
++        options::OPT__param); // ssp-buffer-size
++  } else {
++    // If we're not using retguard, then do the usual stack protector
++    RenderSSPOptions(getToolChain(), Args, CmdArgs, KernelOrKext);
 +  }
 +
 +  // -fixup-gadgets
@@ -101,11 +103,10 @@ Index: tools/clang/lib/Driver/ToolChains
    // Translate -mstackrealign
    if (Args.hasFlag(options::OPT_mstackrealign, options::OPT_mno_stackrealign,
                     false))
-@@ -4579,6 +4611,18 @@ void Clang::ConstructJob(Compilation &C, const JobActi
-       llvm::sys::path::replace_extension(F, "opt.yaml");
-       CmdArgs.push_back(Args.MakeArgString(F));
-     }
-+  }
+@@ -5023,6 +5062,18 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+                                      options::OPT_fno_rewrite_imports, false);
+   if (RewriteImports)
+     CmdArgs.push_back("-frewrite-imports");
 +
 +  // Disable some builtins on OpenBSD because they are just not
 +  // right...
@@ -117,6 +118,7 @@ Index: tools/clang/lib/Driver/ToolChains
 +    CmdArgs.push_back("-fno-builtin-free");
 +    CmdArgs.push_back("-fno-builtin-strdup");
 +    CmdArgs.push_back("-fno-builtin-strndup");
-   }
++  }
 
-   bool RewriteImports = Args.hasFlag(options::OPT_frewrite_imports,
+   // Enable rewrite includes if the user's asked for it or if we're generating
+   // diagnostics.
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp 28 Jan 2019 06:27:28 -0000 1.6
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp 30 Jun 2019 10:50:13 -0000
@@ -1,30 +1,16 @@
 $OpenBSD: patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp,v 1.6 2019/01/28 06:27:28 jca Exp $
 
-- [mips] Enable using of integrated assembler in all cases.
-- Enable IAS for OpenBSD SPARC.
+- Disable IAS for OpenBSD SPARC.
 
 Index: tools/clang/lib/Driver/ToolChains/Gnu.cpp
 --- tools/clang/lib/Driver/ToolChains/Gnu.cpp.orig
 +++ tools/clang/lib/Driver/ToolChains/Gnu.cpp
-@@ -2412,16 +2412,13 @@ bool Generic_GCC::IsIntegratedAssemblerDefault() const
-   case llvm::Triple::systemz:
-   case llvm::Triple::mips:
-   case llvm::Triple::mipsel:
--    return true;
-   case llvm::Triple::mips64:
-   case llvm::Triple::mips64el:
--    // Enabled for Debian, Android, FreeBSD and OpenBSD mips64/mipsel, as they
--    // can precisely identify the ABI in use (Debian) or only use N64 for MIPS64
--    // (Android). Other targets are unable to distinguish N32 from N64.
--    if (getTriple().getEnvironment() == llvm::Triple::GNUABI64 ||
--        getTriple().isAndroid() ||
--        getTriple().isOSFreeBSD() ||
--        getTriple().isOSOpenBSD())
-+    return true;
-+  case llvm::Triple::sparc:
-+  case llvm::Triple::sparcel:
-+  case llvm::Triple::sparcv9:
-+    if (getTriple().isOSSolaris() || getTriple().isOSOpenBSD())
+@@ -2512,7 +2512,7 @@ bool Generic_GCC::IsIntegratedAssemblerDefault() const
+   case llvm::Triple::sparc:
+   case llvm::Triple::sparcel:
+   case llvm::Triple::sparcv9:
+-    if (getTriple().isOSSolaris() || getTriple().isOSOpenBSD())
++    if (getTriple().isOSSolaris())
        return true;
      return false;
    default:
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp,v
retrieving revision 1.8
diff -u -p -r1.8 patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp 28 Jan 2019 15:34:22 -0000 1.8
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp 30 Jun 2019 10:50:13 -0000
@@ -14,161 +14,27 @@ Index: tools/clang/lib/Driver/ToolChains
  #include "clang/Driver/Options.h"
  #include "clang/Driver/SanitizerArgs.h"
  #include "llvm/Option/ArgList.h"
-@@ -111,9 +113,9 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
-   // handled somewhere else.
-   Args.ClaimAllArgs(options::OPT_w);
-
--  if (getToolChain().getArch() == llvm::Triple::mips64)
-+  if (ToolChain.getArch() == llvm::Triple::mips64)
-     CmdArgs.push_back("-EB");
--  else if (getToolChain().getArch() == llvm::Triple::mips64el)
-+  else if (ToolChain.getArch() == llvm::Triple::mips64el)
-     CmdArgs.push_back("-EL");
-
-   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_shared)) {
-@@ -149,44 +151,50 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
-   }
-
-   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
-+    const char *crt0 = nullptr;
-+    const char *crtbegin = nullptr;
-     if (!Args.hasArg(options::OPT_shared)) {
-       if (Args.hasArg(options::OPT_pg))
--        CmdArgs.push_back(
--            Args.MakeArgString(getToolChain().GetFilePath("gcrt0.o")));
-+        crt0 = "gcrt0.o";
-       else if (Args.hasArg(options::OPT_static) &&
-                !Args.hasArg(options::OPT_nopie))
--        CmdArgs.push_back(
--            Args.MakeArgString(getToolChain().GetFilePath("rcrt0.o")));
-+        crt0 = "rcrt0.o";
-       else
--        CmdArgs.push_back(
--            Args.MakeArgString(getToolChain().GetFilePath("crt0.o")));
--      CmdArgs.push_back(
--          Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
-+        crt0 = "crt0.o";
-+      crtbegin = "crtbegin.o";
-     } else {
--      CmdArgs.push_back(
--          Args.MakeArgString(getToolChain().GetFilePath("crtbeginS.o")));
-+      crtbegin = "crtbeginS.o";
-     }
-+
-+    if (crt0)
-+      CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt0)));
-+    CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
-   }
-
--  std::string Triple = getToolChain().getTripleString();
--  if (Triple.substr(0, 6) == "x86_64")
--    Triple.replace(0, 6, "amd64");
--  CmdArgs.push_back(
--      Args.MakeArgString("-L/usr/lib/gcc-lib/" + Triple + "/4.2.1"));
--  CmdArgs.push_back(Args.MakeArgString("-L/usr/lib"));
-+  if (ToolChain.GetCXXStdlibType(Args) == ToolChain::CST_Libstdcxx) {
-+    std::string Triple = ToolChain.getTripleString();
-+    if (Triple.substr(0, 6) == "x86_64")
-+      Triple.replace(0, 6, "amd64");
-+    CmdArgs.push_back(
-+        Args.MakeArgString("-L${LOCALBASE}/lib/gcc/" + Triple + "/${GCC_VER}"));
-+    CmdArgs.push_back(
-+        Args.MakeArgString("-L${LOCALBASE}/lib"));
-+  }
-
--  Args.AddAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group,
--                            options::OPT_e, options::OPT_s, options::OPT_t,
-+  Args.AddAllArgs(CmdArgs, options::OPT_L);
-+  ToolChain.AddFilePathLibArgs(Args, CmdArgs);
-+  Args.AddAllArgs(CmdArgs, {options::OPT_T_Group, options::OPT_e,
-+                            options::OPT_s, options::OPT_t,
-                             options::OPT_Z_Flag, options::OPT_r});
-
-   bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
-   bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
--  AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
-+  AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
-
-   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
-     if (D.CCCIsCXX()) {
--      if (getToolChain().ShouldLinkCXXStdlib(Args))
--        getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
-+      if (ToolChain.ShouldLinkCXXStdlib(Args))
-+        ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
-       if (Args.hasArg(options::OPT_pg))
-         CmdArgs.push_back("-lm_p");
-       else
-@@ -202,7 +210,10 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
-     }
-     // FIXME: For some reason GCC passes -lgcc before adding
-     // the default system libraries. Just mimic this for now.
--    CmdArgs.push_back("-lgcc");
-+    if (ToolChain.GetCXXStdlibType(Args) == ToolChain::CST_Libcxx)
-+      CmdArgs.push_back("-lcompiler_rt");
-+    else
-+      CmdArgs.push_back("-lgcc");
-
-     if (Args.hasArg(options::OPT_pthread)) {
-       if (!Args.hasArg(options::OPT_shared) && Args.hasArg(options::OPT_pg))
-@@ -218,21 +229,25 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
-         CmdArgs.push_back("-lc");
-     }
-
--    CmdArgs.push_back("-lgcc");
-+    if (ToolChain.GetCXXStdlibType(Args) == ToolChain::CST_Libcxx)
-+      CmdArgs.push_back("-lcompiler_rt");
-+    else
-+      CmdArgs.push_back("-lgcc");
-   }
-
-   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
-+    const char *crtend = nullptr;
-     if (!Args.hasArg(options::OPT_shared))
--      CmdArgs.push_back(
--          Args.MakeArgString(getToolChain().GetFilePath("crtend.o")));
-+      crtend = "crtend.o";
-     else
--      CmdArgs.push_back(
--          Args.MakeArgString(getToolChain().GetFilePath("crtendS.o")));
-+      crtend = "crtendS.o";
-+
-+    CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));
-   }
-
-   const char *Exec = Args.MakeArgString(
--      !NeedsSanitizerDeps ? getToolChain().GetLinkerPath()
--                          : getToolChain().GetProgramPath("ld.lld"));
-+      !NeedsSanitizerDeps ? ToolChain.GetLinkerPath()
-+                          : ToolChain.GetProgramPath("ld.lld"));
-   C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
- }
-
-@@ -257,16 +272,60 @@ SanitizerMask OpenBSD::getSupportedSanitizers() const
+@@ -252,19 +254,82 @@ SanitizerMask OpenBSD::getSupportedSanitizers() const
  OpenBSD::OpenBSD(const Driver &D, const llvm::Triple &Triple,
                   const ArgList &Args)
      : Generic_ELF(D, Triple, Args) {
--  getFilePaths().push_back(getDriver().Dir + "/../lib");
--  getFilePaths().push_back("/usr/lib");
-+  getFilePaths().push_back(getDriver().SysRoot + "/usr/lib");
++  getFilePaths().push_back(getDriver().Dir + "/../lib");
+   getFilePaths().push_back(getDriver().SysRoot + "/usr/lib");
  }
 
- void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
-                                   ArgStringList &CmdArgs) const {
-   bool Profiling = Args.hasArg(options::OPT_pg);
-
+-void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
+-                                  ArgStringList &CmdArgs) const {
+-  bool Profiling = Args.hasArg(options::OPT_pg);
+-
 -  CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
 -  CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi");
-+  switch (GetCXXStdlibType(Args)) {
-+  case ToolChain::CST_Libcxx:
-+    CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
-+    CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi");
-+    CmdArgs.push_back(Profiling ? "-lpthread_p" : "-lpthread");
-+    break;
-+  case ToolChain::CST_Libstdcxx:
-+    CmdArgs.push_back("-lestdc++");
-+    break;
-+  }
-+}
+-}
+-
+ Tool *OpenBSD::buildAssembler() const {
+   return new tools::openbsd::Assembler(*this);
+ }
+
+ Tool *OpenBSD::buildLinker() const { return new tools::openbsd::Linker(*this); }
 +
 +ToolChain::CXXStdlibType OpenBSD::GetCXXStdlibType(const ArgList &Args) const {
 +  if (Arg *A = Args.getLastArg(options::OPT_stdlib_EQ)) {
@@ -178,10 +44,10 @@ Index: tools/clang/lib/Driver/ToolChains
 +    if (Value == "libc++")
 +      return ToolChain::CST_Libcxx;
 +
-+    getDriver().Diag(diag::err_drv_invalid_stdlib_name) << A->getAsString(Args);
++    getDriver().Diag(clang::diag::err_drv_invalid_stdlib_name)
++        << A->getAsString(Args);
 +  }
-+
-+  switch (getArch()) {
++  switch (getTriple().getArch()) {
 +  case llvm::Triple::arm:
 +  case llvm::Triple::aarch64:
 +  case llvm::Triple::x86:
@@ -194,17 +60,48 @@ Index: tools/clang/lib/Driver/ToolChains
 +  }
 +}
 +
-+void OpenBSD::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
-+                                       llvm::opt::ArgStringList &CC1Args) const {
-+  addLibStdCXXIncludePaths(getDriver().SysRoot,
-+      "${LOCALBASE}/include/c++/${GCC_VER}",
-+      "", "", "", "", DriverArgs, CC1Args);
-+  addLibStdCXXIncludePaths(getDriver().SysRoot,
-+      "${LOCALBASE}/include/c++/${GCC_VER}/${GCC_CONFIG}",
-+      "", "", "", "", DriverArgs, CC1Args);
-+  addLibStdCXXIncludePaths(getDriver().SysRoot,
-+      "${LOCALBASE}/include/c++/${GCC_VER}/backward",
-+      "", "", "", "", DriverArgs, CC1Args);
- }
-
- Tool *OpenBSD::buildAssembler() const {
++void OpenBSD::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
++                                          ArgStringList &CC1Args) const {
++  if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||
++      DriverArgs.hasArg(options::OPT_nostdincxx))
++    return;
++
++  switch (GetCXXStdlibType(DriverArgs)) {
++  case ToolChain::CST_Libcxx:
++    addSystemInclude(DriverArgs, CC1Args,
++                     getDriver().SysRoot + "/usr/include/c++/v1");
++    break;
++  case ToolChain::CST_Libstdcxx:
++    std::string Triple = getTriple().str();
++    if (Triple.substr(0, 6) == "x86_64")
++      Triple.replace(0, 6, "amd64");
++    addSystemInclude(DriverArgs, CC1Args,
++                     getDriver().SysRoot + "${LOCALBASE}/include/c++/${GCC_VER}");
++    addSystemInclude(DriverArgs, CC1Args,
++                     getDriver().SysRoot + "${LOCALBASE}/include/c++/${GCC_VER}/" + Triple);
++    addSystemInclude(DriverArgs, CC1Args,
++                     getDriver().SysRoot + "${LOCALBASE}/include/c++/${GCC_VER}/backward");
++    break;
++  }
++}
++
++void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
++                                 ArgStringList &CmdArgs) const {
++  bool Profiling = Args.hasArg(options::OPT_pg);
++
++  switch (GetCXXStdlibType(Args)) {
++  case ToolChain::CST_Libcxx:
++    CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
++    CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi");
++    CmdArgs.push_back(Profiling ? "-lpthread_p" : "-lpthread");
++    break;
++  case ToolChain::CST_Libstdcxx:
++    std::string Triple = getTriple().str();
++    if (Triple.substr(0, 6) == "x86_64")
++      Triple.replace(0, 6, "amd64");
++    CmdArgs.push_back(Args.MakeArgString("-L${LOCALBASE}/lib/gcc/" + Triple + "/${GCC_VER}"));
++    CmdArgs.push_back(Args.MakeArgString("-L${LOCALBASE}/lib"));
++    CmdArgs.push_back("-lestdc++");
++    break;
++  }
++}
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h 30 Jun 2019 10:50:13 -0000
@@ -2,17 +2,15 @@ $OpenBSD: patch-tools_clang_lib_Driver_T
 Index: tools/clang/lib/Driver/ToolChains/OpenBSD.h
 --- tools/clang/lib/Driver/ToolChains/OpenBSD.h.orig
 +++ tools/clang/lib/Driver/ToolChains/OpenBSD.h
-@@ -58,8 +58,13 @@ class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic
-   bool IsMathErrnoDefault() const override { return false; }
-   bool IsObjCNonFragileABIDefault() const override { return true; }
-   bool isPIEDefault() const override { return true; }
-+
+@@ -69,6 +69,11 @@ class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic
    void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
                             llvm::opt::ArgStringList &CmdArgs) const override;
+
 +  CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
-+  void addLibStdCxxIncludePaths(
++  void AddClangCXXStdlibIncludeArgs(
 +      const llvm::opt::ArgList &DriverArgs,
 +      llvm::opt::ArgStringList &CC1Args) const override;
-
++
    unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
      return 2;
+   }
Index: devel/llvm/patches/patch-tools_clang_lib_Frontend_CompilerInvocation_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Frontend_CompilerInvocation_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-tools_clang_lib_Frontend_CompilerInvocation_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Frontend_CompilerInvocation_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-tools_clang_lib_Frontend_CompilerInvocation_cpp 30 Jun 2019 10:50:13 -0000
@@ -21,7 +21,7 @@ remove these gadgets will continue throu
 Index: tools/clang/lib/Frontend/CompilerInvocation.cpp
 --- tools/clang/lib/Frontend/CompilerInvocation.cpp.orig
 +++ tools/clang/lib/Frontend/CompilerInvocation.cpp
-@@ -978,6 +978,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, Arg
+@@ -1133,6 +1133,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, Arg
      Opts.StackAlignment = StackAlignment;
    }
 
Index: devel/llvm/patches/patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp
diff -N devel/llvm/patches/patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp 28 Jan 2019 15:34:22 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp,v 1.6 2019/01/28 15:34:22 jca Exp $
-
-Index: tools/clang/lib/Frontend/InitHeaderSearch.cpp
---- tools/clang/lib/Frontend/InitHeaderSearch.cpp.orig
-+++ tools/clang/lib/Frontend/InitHeaderSearch.cpp
-@@ -431,14 +431,6 @@ void InitHeaderSearch::AddDefaultCPlusPlusIncludePaths
-   case llvm::Triple::DragonFly:
-     AddPath("/usr/include/c++/5.0", CXXSystem, false);
-     break;
--  case llvm::Triple::OpenBSD: {
--    std::string t = triple.getTriple();
--    if (t.substr(0, 6) == "x86_64")
--      t.replace(0, 6, "amd64");
--    AddGnuCPlusPlusIncludePaths("/usr/include/g++",
--                                t, "", "", triple);
--    break;
--  }
-   case llvm::Triple::Minix:
-     AddGnuCPlusPlusIncludePaths("/usr/gnu/include/c++/4.4.3",
-                                 "", "", "", triple);
Index: devel/llvm/patches/patch-tools_clang_lib_Parse_ParseStmtAsm_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Parse_ParseStmtAsm_cpp
diff -N devel/llvm/patches/patch-tools_clang_lib_Parse_ParseStmtAsm_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Parse_ParseStmtAsm_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,17 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Parse_ParseStmtAsm_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: tools/clang/lib/Parse/ParseStmtAsm.cpp
---- tools/clang/lib/Parse/ParseStmtAsm.cpp.orig
-+++ tools/clang/lib/Parse/ParseStmtAsm.cpp
-@@ -637,7 +637,7 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLo
-   // Filter out "fpsw" and "mxcsr". They aren't valid GCC asm clobber
-   // constraints. Clang always adds fpsr to the clobber list anyway.
-   llvm::erase_if(Clobbers, [](const std::string &C) {
--    return C == "fpsw" || C == "mxcsr";
-+    return C == "fpsr" || C == "mxcsr";
-   });
-
-   // Build the vector of clobber StringRefs.
Index: devel/llvm/patches/patch-tools_clang_lib_Sema_SemaChecking_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Sema_SemaChecking_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-tools_clang_lib_Sema_SemaChecking_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Sema_SemaChecking_cpp 28 Jan 2019 06:27:28 -0000 1.6
+++ devel/llvm/patches/patch-tools_clang_lib_Sema_SemaChecking_cpp 30 Jun 2019 10:50:13 -0000
@@ -9,7 +9,7 @@ $OpenBSD: patch-tools_clang_lib_Sema_Sem
 Index: tools/clang/lib/Sema/SemaChecking.cpp
 --- tools/clang/lib/Sema/SemaChecking.cpp.orig
 +++ tools/clang/lib/Sema/SemaChecking.cpp
-@@ -6431,7 +6431,7 @@ checkFormatStringExpr(Sema &S, const Expr *E, ArrayRef
+@@ -6608,7 +6608,7 @@ checkFormatStringExpr(Sema &S, const Expr *E, ArrayRef
  Sema::FormatStringType Sema::GetFormatStringType(const FormatAttr *Format) {
    return llvm::StringSwitch<FormatStringType>(Format->getType()->getName())
        .Case("scanf", FST_Scanf)
@@ -18,7 +18,7 @@ Index: tools/clang/lib/Sema/SemaChecking
        .Cases("NSString", "CFString", FST_NSString)
        .Case("strftime", FST_Strftime)
        .Case("strfmon", FST_Strfmon)
-@@ -6528,6 +6528,7 @@ bool Sema::CheckFormatArguments(ArrayRef<const Expr *>
+@@ -6705,6 +6705,7 @@ bool Sema::CheckFormatArguments(ArrayRef<const Expr *>
      case FST_Kprintf:
      case FST_FreeBSDKPrintf:
      case FST_Printf:
@@ -26,7 +26,7 @@ Index: tools/clang/lib/Sema/SemaChecking
        Diag(FormatLoc, diag::note_format_security_fixit)
          << FixItHint::CreateInsertion(FormatLoc, "\"%s\", ");
        break;
-@@ -7348,19 +7349,33 @@ CheckPrintfHandler::HandlePrintfSpecifier(const analyz
+@@ -7530,19 +7531,33 @@ CheckPrintfHandler::HandlePrintfSpecifier(const analyz
      // Claim the second argument.
      CoveredArgs.set(argIndex + 1);
 
@@ -37,21 +37,19 @@ Index: tools/clang/lib/Sema/SemaChecking
 -        ArgType(S.Context.IntTy) : ArgType::CPointerTy;
 -    if (AT.isValid() && !AT.matchesType(S.Context, Ex->getType()))
 -      EmitFormatDiagnostic(
--        S.PDiag(diag::warn_format_conversion_argument_type_mismatch)
--        << AT.getRepresentativeTypeName(S.Context) << Ex->getType()
--        << false << Ex->getSourceRange(),
--        Ex->getLocStart(), /*IsStringLocation*/false,
--        getSpecifierRange(startSpecifier, specifierLen));
 +    if (CS.getKind() == ConversionSpecifier::FreeBSDDArg) {
 +      // Type check the first argument (pointer for %D)
 +      const analyze_printf::ArgType &AT = ArgType::CPointerTy;
 +      if (AT.isValid() && !AT.matchesType(S.Context, Ex->getType()))
 +        EmitFormatDiagnostic(
-+          S.PDiag(diag::warn_format_conversion_argument_type_mismatch)
+           S.PDiag(diag::warn_format_conversion_argument_type_mismatch)
+-              << AT.getRepresentativeTypeName(S.Context) << Ex->getType()
+-              << false << Ex->getSourceRange(),
+-          Ex->getBeginLoc(), /*IsStringLocation*/ false,
 +          << AT.getRepresentativeTypeName(S.Context) << Ex->getType()
 +          << false << Ex->getSourceRange(),
-+          Ex->getLocStart(), /*IsStringLocation*/false,
-+          getSpecifierRange(startSpecifier, specifierLen));
++          Ex->getBeginLoc(), /*IsStringLocation*/false,
+           getSpecifierRange(startSpecifier, specifierLen));
 +    } else {
 +      // Check the length modifier for %b
 +      if (!FS.hasValidLengthModifier(S.getASTContext().getTargetInfo()))
@@ -71,7 +69,7 @@ Index: tools/clang/lib/Sema/SemaChecking
      // Type check the second argument (char * for both %b and %D)
      Ex = getDataArg(argIndex + 1);
      const analyze_printf::ArgType &AT2 = ArgType::CStrTy;
-@@ -8079,8 +8094,9 @@ static void CheckFormatString(Sema &S, const FormatStr
+@@ -8277,8 +8292,9 @@ static void CheckFormatString(Sema &S, const FormatStr
    }
 
    if (Type == Sema::FST_Printf || Type == Sema::FST_NSString ||
@@ -83,7 +81,7 @@ Index: tools/clang/lib/Sema/SemaChecking
      CheckPrintfHandler H(
          S, FExpr, OrigFormatExpr, Type, firstDataArg, numDataArgs,
          (Type == Sema::FST_NSString || Type == Sema::FST_OSTrace), Str,
-@@ -8090,7 +8106,7 @@ static void CheckFormatString(Sema &S, const FormatStr
+@@ -8288,7 +8304,7 @@ static void CheckFormatString(Sema &S, const FormatStr
      if (!analyze_format_string::ParsePrintfString(H, Str, Str + StrLen,
                                                    S.getLangOpts(),
                                                    S.Context.getTargetInfo(),
Index: devel/llvm/patches/patch-tools_clang_lib_Sema_SemaDeclAttr_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Sema_SemaDeclAttr_cpp,v
retrieving revision 1.9
diff -u -p -r1.9 patch-tools_clang_lib_Sema_SemaDeclAttr_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Sema_SemaDeclAttr_cpp 28 Jan 2019 06:27:28 -0000 1.9
+++ devel/llvm/patches/patch-tools_clang_lib_Sema_SemaDeclAttr_cpp 30 Jun 2019 10:50:13 -0000
@@ -5,7 +5,7 @@ Teach Clang about syslog format attribut
 Index: tools/clang/lib/Sema/SemaDeclAttr.cpp
 --- tools/clang/lib/Sema/SemaDeclAttr.cpp.orig
 +++ tools/clang/lib/Sema/SemaDeclAttr.cpp
-@@ -3179,6 +3179,7 @@ static FormatAttrKind getFormatAttrKind(StringRef Form
+@@ -3290,6 +3290,7 @@ static FormatAttrKind getFormatAttrKind(StringRef Form
        .Case("freebsd_kprintf", SupportedFormat) // FreeBSD.
        .Case("os_trace", SupportedFormat)
        .Case("os_log", SupportedFormat)
Index: devel/llvm/patches/patch-tools_lld_ELF_Config_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_lld_ELF_Config_h
diff -N devel/llvm/patches/patch-tools_lld_ELF_Config_h
--- devel/llvm/patches/patch-tools_lld_ELF_Config_h 28 Jan 2019 15:34:22 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-tools_lld_ELF_Config_h,v 1.6 2019/01/28 15:34:22 jca Exp $
-
-lld: add -z interpose support
-
-Index: tools/lld/ELF/Config.h
---- tools/lld/ELF/Config.h.orig
-+++ tools/lld/ELF/Config.h
-@@ -182,6 +182,7 @@ struct Configuration {
-   bool ZExecstack;
-   bool ZHazardplt;
-   bool ZInitfirst;
-+  bool ZInterpose;
-   bool ZKeepTextSectionPrefix;
-   bool ZNodelete;
-   bool ZNodlopen;
Index: devel/llvm/patches/patch-tools_lld_ELF_DriverUtils_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_DriverUtils_cpp,v
retrieving revision 1.8
diff -u -p -r1.8 patch-tools_lld_ELF_DriverUtils_cpp
--- devel/llvm/patches/patch-tools_lld_ELF_DriverUtils_cpp 28 Jan 2019 06:27:28 -0000 1.8
+++ devel/llvm/patches/patch-tools_lld_ELF_DriverUtils_cpp 30 Jun 2019 10:50:13 -0000
@@ -5,7 +5,7 @@ Handle the OpenBSD-style major/minor sha
 Index: tools/lld/ELF/DriverUtils.cpp
 --- tools/lld/ELF/DriverUtils.cpp.orig
 +++ tools/lld/ELF/DriverUtils.cpp
-@@ -218,9 +218,35 @@ Optional<std::string> elf::searchLibrary(StringRef Nam
+@@ -219,9 +219,35 @@ Optional<std::string> elf::searchLibrary(StringRef Nam
      return findFromSearchPaths(Name.substr(1));
 
    for (StringRef Dir : Config->SearchPaths) {
Index: devel/llvm/patches/patch-tools_lld_ELF_Driver_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_Driver_cpp,v
retrieving revision 1.12
diff -u -p -r1.12 patch-tools_lld_ELF_Driver_cpp
--- devel/llvm/patches/patch-tools_lld_ELF_Driver_cpp 28 Jan 2019 15:34:22 -0000 1.12
+++ devel/llvm/patches/patch-tools_lld_ELF_Driver_cpp 30 Jun 2019 10:50:13 -0000
@@ -1,38 +1,62 @@
 $OpenBSD: patch-tools_lld_ELF_Driver_cpp,v 1.12 2019/01/28 15:34:22 jca Exp $
 
 - Enable PIE by default.
-- lld: add -z interpose support
+- XXX retpoline, EM_SPARCV9, ???
 
 Index: tools/lld/ELF/Driver.cpp
 --- tools/lld/ELF/Driver.cpp.orig
 +++ tools/lld/ELF/Driver.cpp
-@@ -339,8 +339,9 @@ static bool getZFlag(opt::InputArgList &Args, StringRe
- static bool isKnown(StringRef S) {
-   return S == "combreloc" || S == "copyreloc" || S == "defs" ||
-          S == "execstack" || S == "hazardplt" || S == "initfirst" ||
--         S == "keep-text-section-prefix" || S == "lazy" || S == "muldefs" ||
--         S == "nocombreloc" || S == "nocopyreloc" || S == "nodelete" ||
-+         S == "interpose" || S == "keep-text-section-prefix" ||
-+         S == "lazy" || S == "muldefs" || S == "nocombreloc" ||
-+         S == "nocopyreloc" || S == "nodelete" ||
-          S == "nodlopen" || S == "noexecstack" ||
-          S == "nokeep-text-section-prefix" || S == "norelro" || S == "notext" ||
+@@ -131,6 +131,7 @@ static std::tuple<ELFKind, uint16_t, uint8_t> parseEmu
+           .Cases("elf32ltsmip", "elf32ltsmipn32", {ELF32LEKind, EM_MIPS})
+           .Case("elf32lriscv", {ELF32LEKind, EM_RISCV})
+           .Cases("elf32ppc", "elf32ppclinux", {ELF32BEKind, EM_PPC})
++          .Case("elf64_sparc", {ELF64BEKind, EM_SPARCV9})
+           .Case("elf64btsmip", {ELF64BEKind, EM_MIPS})
+           .Case("elf64ltsmip", {ELF64LEKind, EM_MIPS})
+           .Case("elf64lriscv", {ELF64LEKind, EM_RISCV})
+@@ -352,7 +353,8 @@ static bool isKnownZFlag(StringRef S) {
+          S == "keep-text-section-prefix" || S == "lazy" || S == "muldefs" ||
+          S == "nocombreloc" || S == "nocopyreloc" || S == "nodefaultlib" ||
+          S == "nodelete" || S == "nodlopen" || S == "noexecstack" ||
+-         S == "nokeep-text-section-prefix" || S == "norelro" || S == "notext" ||
++         S == "nokeep-text-section-prefix" || S == "norelro" ||
++         S == "noretpolineplt" || S == "notext" ||
           S == "now" || S == "origin" || S == "relro" || S == "retpolineplt" ||
-@@ -794,7 +795,8 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
+          S == "rodynamic" || S == "text" || S == "wxneeded" ||
+          S.startswith("max-page-size=") || S.startswith("stack-size=");
+@@ -795,7 +797,8 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
+   Config->IgnoreDataAddressEquality =
+       Args.hasArg(OPT_ignore_data_address_equality);
+   Config->IgnoreFunctionAddressEquality =
+-      Args.hasArg(OPT_ignore_function_address_equality);
++      Args.hasFlag(OPT_ignore_function_address_equality,
++      OPT_no_ignore_function_address_equality, true);
+   Config->Init = Args.getLastArgValue(OPT_init, "_init");
+   Config->LTOAAPipeline = Args.getLastArgValue(OPT_lto_aa_pipeline);
+   Config->LTODebugPassManager = Args.hasArg(OPT_lto_debug_pass_manager);
+@@ -818,7 +821,12 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
    Config->Optimize = args::getInteger(Args, OPT_O, 1);
    Config->OrphanHandling = getOrphanHandling(Args);
    Config->OutputFile = Args.getLastArgValue(OPT_o);
--  Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie, false);
++#ifdef __OpenBSD__
 +  Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie,
 +      !Args.hasArg(OPT_shared) && !Args.hasArg(OPT_relocatable));
++#else
+   Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie, false);
++#endif
    Config->PrintIcfSections =
        Args.hasFlag(OPT_print_icf_sections, OPT_no_print_icf_sections, false);
    Config->PrintGcSections =
-@@ -844,6 +846,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
-   Config->ZExecstack = getZFlag(Args, "execstack", "noexecstack", false);
-   Config->ZHazardplt = hasZOption(Args, "hazardplt");
-   Config->ZInitfirst = hasZOption(Args, "initfirst");
-+  Config->ZInterpose = hasZOption(Args, "interpose");
-   Config->ZKeepTextSectionPrefix = getZFlag(
-       Args, "keep-text-section-prefix", "nokeep-text-section-prefix", false);
-   Config->ZNodelete = hasZOption(Args, "nodelete");
+@@ -881,7 +889,11 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
+   Config->ZNow = getZFlag(Args, "now", "lazy", false);
+   Config->ZOrigin = hasZOption(Args, "origin");
+   Config->ZRelro = getZFlag(Args, "relro", "norelro", true);
+-  Config->ZRetpolineplt = hasZOption(Args, "retpolineplt");
++#ifndef __OpenBSD__
++  Config->ZRetpolineplt = getZFlag(Args, "retpolineplt", "noretpolineplt", false);
++#else
++  Config->ZRetpolineplt = getZFlag(Args, "retpolineplt", "noretpolineplt", true);
++#endif
+   Config->ZRodynamic = hasZOption(Args, "rodynamic");
+   Config->ZStackSize = args::getZOptionValue(Args, OPT_z, "stack-size", 0);
+   Config->ZText = getZFlag(Args, "text", "notext", true);
Index: devel/llvm/patches/patch-tools_lld_ELF_Options_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_Options_td,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_lld_ELF_Options_td
--- devel/llvm/patches/patch-tools_lld_ELF_Options_td 28 Jan 2019 15:34:22 -0000 1.3
+++ devel/llvm/patches/patch-tools_lld_ELF_Options_td 30 Jun 2019 10:50:13 -0000
@@ -5,7 +5,7 @@ $OpenBSD: patch-tools_lld_ELF_Options_td
 Index: tools/lld/ELF/Options.td
 --- tools/lld/ELF/Options.td.orig
 +++ tools/lld/ELF/Options.td
-@@ -178,8 +178,9 @@ def icf_safe: F<"icf=safe">, HelpText<"Enable safe ide
+@@ -188,8 +188,9 @@ def icf_safe: F<"icf=safe">, HelpText<"Enable safe ide
 
  def icf_none: F<"icf=none">, HelpText<"Disable identical code folding (default)">;
 
@@ -17,7 +17,7 @@ Index: tools/lld/ELF/Options.td
 
  def ignore_data_address_equality: F<"ignore-data-address-equality">,
    HelpText<"lld can break the address equality of data">;
-@@ -386,6 +387,7 @@ def: Separate<["-"], "b">, Alias<format>, HelpText<"Al
+@@ -407,6 +408,7 @@ def: Separate<["-"], "b">, Alias<format>, HelpText<"Al
  def: JoinedOrSeparate<["-"], "l">, Alias<library>, HelpText<"Alias for --library">;
  def: JoinedOrSeparate<["-"], "L">, Alias<library_path>, HelpText<"Alias for --library-path">;
  def: F<"no-pic-executable">, Alias<no_pie>, HelpText<"Alias for --no-pie">;
Index: devel/llvm/patches/patch-tools_lld_ELF_Symbols_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_Symbols_h,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_lld_ELF_Symbols_h
--- devel/llvm/patches/patch-tools_lld_ELF_Symbols_h 28 Jan 2019 15:34:22 -0000 1.3
+++ devel/llvm/patches/patch-tools_lld_ELF_Symbols_h 30 Jun 2019 10:50:13 -0000
@@ -6,7 +6,7 @@ is referenced from code being linked.
 Index: tools/lld/ELF/Symbols.h
 --- tools/lld/ELF/Symbols.h.orig
 +++ tools/lld/ELF/Symbols.h
-@@ -308,6 +308,9 @@ struct ElfSym {
+@@ -330,6 +330,9 @@ struct ElfSym {
    // __bss_start
    static Defined *Bss;
 
Index: devel/llvm/patches/patch-tools_lld_ELF_SyntheticSections_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_lld_ELF_SyntheticSections_cpp
diff -N devel/llvm/patches/patch-tools_lld_ELF_SyntheticSections_cpp
--- devel/llvm/patches/patch-tools_lld_ELF_SyntheticSections_cpp 28 Jan 2019 15:34:22 -0000 1.10
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-$OpenBSD: patch-tools_lld_ELF_SyntheticSections_cpp,v 1.10 2019/01/28 15:34:22 jca Exp $
-
-- lld: add -z interpose support
-- When merging sections into the output, lld tries to adjust the alignment of
-  the section to be at least as large as the entry size of the section.
-  This causes a later check that validates the alignment to fail if the
-  entry size isn't a power of two.  This happens when building some of the
-  java support code in ports gcc.  Fix this by sticking to the original
-  alignment if the entry size isn't a power of two.
-
-Index: tools/lld/ELF/SyntheticSections.cpp
---- tools/lld/ELF/SyntheticSections.cpp.orig
-+++ tools/lld/ELF/SyntheticSections.cpp
-@@ -1266,6 +1266,8 @@ template <class ELFT> void DynamicSection<ELFT>::final
-     DtFlags |= DF_SYMBOLIC;
-   if (Config->ZInitfirst)
-     DtFlags1 |= DF_1_INITFIRST;
-+  if (Config->ZInterpose)
-+    DtFlags1 |= DF_1_INTERPOSE;
-   if (Config->ZNodelete)
-     DtFlags1 |= DF_1_NODELETE;
-   if (Config->ZNodlopen)
-@@ -2935,7 +2937,9 @@ void elf::mergeSections() {
-     }
-
-     StringRef OutsecName = getOutputSectionName(MS);
--    uint32_t Alignment = std::max<uint32_t>(MS->Alignment, MS->Entsize);
-+    uint32_t Alignment = MS->Alignment;
-+    if (isPowerOf2_32(MS->Entsize))
-+        Alignment = std::max<uint32_t>(Alignment, MS->Entsize);
-
-     auto I = llvm::find_if(MergeSections, [=](MergeSyntheticSection *Sec) {
-       // While we could create a single synthetic section for two different
Index: devel/llvm/patches/patch-tools_lld_ELF_Writer_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_Writer_cpp,v
retrieving revision 1.10
diff -u -p -r1.10 patch-tools_lld_ELF_Writer_cpp
--- devel/llvm/patches/patch-tools_lld_ELF_Writer_cpp 28 Jan 2019 15:34:22 -0000 1.10
+++ devel/llvm/patches/patch-tools_lld_ELF_Writer_cpp 30 Jun 2019 10:50:13 -0000
@@ -14,13 +14,13 @@ Index: tools/lld/ELF/Writer.cpp
    for (StringRef V :
         {".text.", ".rodata.", ".data.rel.ro.", ".data.", ".bss.rel.ro.",
          ".bss.", ".init_array.", ".fini_array.", ".ctors.", ".dtors.", ".tbss.",
--        ".gcc_except_table.", ".tdata.", ".ARM.exidx.", ".ARM.extab."}) {
+-        ".gcc_except_table.", ".tdata.", ".ARM.exidx.", ".ARM.extab."})
 +        ".gcc_except_table.", ".tdata.", ".ARM.exidx.", ".ARM.extab.",
-+        ".openbsd.randomdata."}) {
++        ".openbsd.randomdata."})
      if (isSectionPrefix(V, S->Name))
        return V.drop_back();
-   }
-@@ -239,6 +240,7 @@ void elf::addReservedSymbols() {
+
+@@ -251,6 +252,7 @@ void elf::addReservedSymbols() {
    };
 
    ElfSym::Bss = Add("__bss_start", 0);
@@ -28,10 +28,10 @@ Index: tools/lld/ELF/Writer.cpp
    ElfSym::End1 = Add("end", -1);
    ElfSym::End2 = Add("_end", -1);
    ElfSym::Etext1 = Add("etext", -1);
-@@ -673,7 +675,11 @@ static bool isRelroSection(const OutputSection *Sec) {
+@@ -703,7 +705,11 @@ static bool isRelroSection(const OutputSection *Sec) {
    // However, if "-z now" is given, the lazy symbol resolution is
    // disabled, which enables us to put it into RELRO.
-   if (Sec == InX::GotPlt->getParent())
+   if (Sec == In.GotPlt->getParent())
 +#ifndef __OpenBSD__
      return Config->ZNow;
 +#else
@@ -40,7 +40,7 @@ Index: tools/lld/ELF/Writer.cpp
 
    // .dynamic section contains data for the dynamic linker, and
    // there's no need to write to it at runtime, so it's better to put
-@@ -962,6 +968,9 @@ template <class ELFT> void Writer<ELFT>::setReservedSy
+@@ -1006,6 +1012,9 @@ template <class ELFT> void Writer<ELFT>::setReservedSy
    if (ElfSym::Bss)
      ElfSym::Bss->Section = findSection(".bss");
 
@@ -50,7 +50,7 @@ Index: tools/lld/ELF/Writer.cpp
    // Setup MIPS _gp_disp/__gnu_local_gp symbols which should
    // be equal to the _gp symbol's value.
    if (ElfSym::MipsGp) {
-@@ -1937,6 +1946,23 @@ template <class ELFT> void Writer<ELFT>::fixSectionAli
+@@ -2042,6 +2051,23 @@ template <class ELFT> void Writer<ELFT>::fixSectionAli
          return alignTo(Script->getDot(), Config->MaxPageSize);
        };
    };
Index: devel/llvm/patches/patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h
diff -N devel/llvm/patches/patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h
--- devel/llvm/patches/patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h 28 Jan 2019 06:27:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-$OpenBSD: patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h,v 1.1 2019/01/28 06:27:28 jca Exp $
-
-Use llvm::VersionTuple instead of manual version marshalling
-
-Index: tools/lldb/include/lldb/Host/openbsd/HostInfoOpenBSD.h
---- tools/lldb/include/lldb/Host/openbsd/HostInfoOpenBSD.h.orig
-+++ tools/lldb/include/lldb/Host/openbsd/HostInfoOpenBSD.h
-@@ -12,12 +12,13 @@
-
- #include "lldb/Host/posix/HostInfoPosix.h"
- #include "lldb/Utility/FileSpec.h"
-+#include "llvm/Support/VersionTuple.h"
-
- namespace lldb_private {
-
- class HostInfoOpenBSD : public HostInfoPosix {
- public:
--  static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
-+  static llvm::VersionTuple GetOSVersion();
-   static bool GetOSBuildString(std::string &s);
-   static bool GetOSKernelDescription(std::string &s);
-   static FileSpec GetProgramFileSpec();
Index: devel/llvm/patches/patch-tools_lldb_scripts_utilsOsType_py
===================================================================
RCS file: devel/llvm/patches/patch-tools_lldb_scripts_utilsOsType_py
diff -N devel/llvm/patches/patch-tools_lldb_scripts_utilsOsType_py
--- devel/llvm/patches/patch-tools_lldb_scripts_utilsOsType_py 28 Jan 2019 06:27:28 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-$OpenBSD: patch-tools_lldb_scripts_utilsOsType_py,v 1.2 2019/01/28 06:27:28 jca Exp $
-
-Recognize OpenBSD.
-
-Index: tools/lldb/scripts/utilsOsType.py
---- tools/lldb/scripts/utilsOsType.py.orig
-+++ tools/lldb/scripts/utilsOsType.py
-@@ -35,8 +35,9 @@ if sys.version_info.major >= 3:
-         FreeBSD = 2
-         Linux = 3
-         NetBSD = 4
--        Windows = 5
--        kFreeBSD = 6
-+        OpenBSD = 5
-+        Windows = 6
-+        kFreeBSD = 7
- else:
-     class EnumOsType(object):
-         values = ["Unknown",
Index: devel/llvm/patches/patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp
diff -N devel/llvm/patches/patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp
--- devel/llvm/patches/patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp 28 Jan 2019 06:27:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-$OpenBSD: patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp,v 1.1 2019/01/28 06:27:28 jca Exp $
-
-Use llvm::VersionTuple instead of manual version marshalling
-
-Index: tools/lldb/source/Host/openbsd/HostInfoOpenBSD.cpp
---- tools/lldb/source/Host/openbsd/HostInfoOpenBSD.cpp.orig
-+++ tools/lldb/source/Host/openbsd/HostInfoOpenBSD.cpp
-@@ -17,16 +17,17 @@
-
- using namespace lldb_private;
-
--bool HostInfoOpenBSD::GetOSVersion(uint32_t &major, uint32_t &minor,
--                                   uint32_t &update) {
-+llvm::VersionTuple HostInfoOpenBSD::GetOSVersion() {
-   struct utsname un;
-
-   ::memset(&un, 0, sizeof(utsname));
-   if (uname(&un) < 0)
--    return false;
-+    return llvm::VersionTuple();
-
--  int status = sscanf(un.release, "%u.%u", &major, &minor);
--  return status == 2;
-+  unsigned major, minor;
-+  if (2 == sscanf(un.release, "%u.%u", &major, &minor))
-+    return llvm::VersionTuple(major, minor);
-+  return llvm::VersionTuple();
- }
-
- bool HostInfoOpenBSD::GetOSBuildString(std::string &s) {
Index: devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp,v
retrieving revision 1.1
diff -u -p -r1.1 patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp
--- devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp 30 Jun 2019 10:50:13 -0000
@@ -5,8 +5,8 @@ Skip retguard instructions in prologue d
 Index: tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
 --- tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp.orig
 +++ tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
-@@ -593,6 +593,18 @@ bool x86AssemblyInspectionEngine::ret_pattern_p() {
-   return false;
+@@ -672,6 +672,18 @@ bool x86AssemblyInspectionEngine::ret_pattern_p() {
+   return *p == 0xc9 || *p == 0xc2 || *p == 0xca || *p == 0xc3;
  }
 
 +// movq $0x????????(%rip), $reg [(0x4c || 0x48) 0x8b ?? ?? ?? ?? ??]
@@ -24,7 +24,7 @@ Index: tools/lldb/source/Plugins/UnwindA
  uint32_t x86AssemblyInspectionEngine::extract_4(uint8_t *b) {
    uint32_t v = 0;
    for (int i = 3; i >= 0; i--)
-@@ -1214,6 +1226,7 @@ bool x86AssemblyInspectionEngine::FindFirstNonPrologue
+@@ -1374,6 +1386,7 @@ bool x86AssemblyInspectionEngine::FindFirstNonPrologue
      if (push_rbp_pattern_p() || mov_rsp_rbp_pattern_p() ||
          sub_rsp_pattern_p(scratch) || push_reg_p(regno) ||
          mov_reg_to_local_stack_frame_p(regno, scratch) ||
Index: devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h,v
retrieving revision 1.1
diff -u -p -r1.1 patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h
--- devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h 20 Feb 2019 00:24:11 -0000 1.1
+++ devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h 30 Jun 2019 10:50:13 -0000
@@ -5,7 +5,7 @@ Skip retguard instructions in prologue d
 Index: tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h
 --- tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h.orig
 +++ tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h
-@@ -110,6 +110,7 @@ class x86AssemblyInspectionEngine { (private)
+@@ -115,6 +115,7 @@ class x86AssemblyInspectionEngine { (private)
    bool call_next_insn_pattern_p();
    bool mov_reg_to_local_stack_frame_p(int &regno, int &rbp_offset);
    bool ret_pattern_p();
Index: devel/llvm/patches/patch-unittests_ADT_OptionalTest_cpp
===================================================================
RCS file: devel/llvm/patches/patch-unittests_ADT_OptionalTest_cpp
diff -N devel/llvm/patches/patch-unittests_ADT_OptionalTest_cpp
--- devel/llvm/patches/patch-unittests_ADT_OptionalTest_cpp 22 Apr 2019 17:24:26 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-$OpenBSD: patch-unittests_ADT_OptionalTest_cpp,v 1.1 2019/04/22 17:24:26 jca Exp $
-
-XXX disable failing static_assert to let other tests run.
-
-Index: unittests/ADT/OptionalTest.cpp
---- unittests/ADT/OptionalTest.cpp.orig
-+++ unittests/ADT/OptionalTest.cpp
-@@ -519,8 +519,8 @@ TEST_F(OptionalTest, OperatorGreaterEqual) {
- }
-
- #if __has_feature(is_trivially_copyable) && defined(_LIBCPP_VERSION)
--static_assert(std::is_trivially_copyable<Optional<int>>::value,
--              "Should be trivially copyable");
-+//static_assert(std::is_trivially_copyable<Optional<int>>::value,
-+//              "Should be trivially copyable");
- static_assert(
-     !std::is_trivially_copyable<Optional<NonDefaultConstructible>>::value,
-     "Shouldn't be trivially copyable");
Index: devel/llvm/patches/patch-utils_TableGen_X86RecognizableInstr_cpp
===================================================================
RCS file: devel/llvm/patches/patch-utils_TableGen_X86RecognizableInstr_cpp
diff -N devel/llvm/patches/patch-utils_TableGen_X86RecognizableInstr_cpp
--- devel/llvm/patches/patch-utils_TableGen_X86RecognizableInstr_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-$OpenBSD: patch-utils_TableGen_X86RecognizableInstr_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: utils/TableGen/X86RecognizableInstr.cpp
---- utils/TableGen/X86RecognizableInstr.cpp.orig
-+++ utils/TableGen/X86RecognizableInstr.cpp
-@@ -842,6 +842,7 @@ OperandType RecognizableInstr::typeFromString(const st
-   TYPE("f32mem",              TYPE_M)
-   TYPE("ssmem",               TYPE_M)
-   TYPE("RST",                 TYPE_ST)
-+  TYPE("RSTi",                TYPE_ST)
-   TYPE("i128mem",             TYPE_M)
-   TYPE("i256mem",             TYPE_M)
-   TYPE("i512mem",             TYPE_M)
-@@ -964,6 +965,7 @@ OperandEncoding
- RecognizableInstr::rmRegisterEncodingFromString(const std::string &s,
-                                                 uint8_t OpSize) {
-   ENCODING("RST",             ENCODING_FP)
-+  ENCODING("RSTi",            ENCODING_FP)
-   ENCODING("GR16",            ENCODING_RM)
-   ENCODING("GR32",            ENCODING_RM)
-   ENCODING("GR32orGR64",      ENCODING_RM)
Index: devel/llvm/pkg/PLIST-lldb
===================================================================
RCS file: /cvs/ports/devel/llvm/pkg/PLIST-lldb,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST-lldb
--- devel/llvm/pkg/PLIST-lldb 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/pkg/PLIST-lldb 30 Jun 2019 10:50:13 -0000
@@ -5,6 +5,7 @@
 @bin bin/lldb-argdumper
 @bin bin/lldb-mi
 @bin bin/lldb-test
+@bin bin/lldb-vscode
 include/lldb/
 include/lldb/API/
 include/lldb/API/LLDB.h
@@ -32,6 +33,7 @@ include/lldb/API/SBFileSpecList.h
 include/lldb/API/SBFrame.h
 include/lldb/API/SBFunction.h
 include/lldb/API/SBHostOS.h
+include/lldb/API/SBInitializerOptions.h
 include/lldb/API/SBInstruction.h
 include/lldb/API/SBInstructionList.h
 include/lldb/API/SBLanguageRuntime.h
@@ -89,6 +91,7 @@ include/lldb/Breakpoint/BreakpointResolv
 include/lldb/Breakpoint/BreakpointResolverFileLine.h
 include/lldb/Breakpoint/BreakpointResolverFileRegex.h
 include/lldb/Breakpoint/BreakpointResolverName.h
+include/lldb/Breakpoint/BreakpointResolverScripted.h
 include/lldb/Breakpoint/BreakpointSite.h
 include/lldb/Breakpoint/BreakpointSiteList.h
 include/lldb/Breakpoint/Stoppoint.h
@@ -104,7 +107,6 @@ include/lldb/Core/AddressResolver.h
 include/lldb/Core/AddressResolverFileLine.h
 include/lldb/Core/AddressResolverName.h
 include/lldb/Core/Architecture.h
-include/lldb/Core/Broadcaster.h
 include/lldb/Core/ClangForward.h
 include/lldb/Core/Communication.h
 include/lldb/Core/Debugger.h
@@ -112,13 +114,12 @@ include/lldb/Core/Disassembler.h
 include/lldb/Core/DumpDataExtractor.h
 include/lldb/Core/DumpRegisterValue.h
 include/lldb/Core/EmulateInstruction.h
-include/lldb/Core/Event.h
 include/lldb/Core/FileLineResolver.h
 include/lldb/Core/FileSpecList.h
 include/lldb/Core/FormatEntity.h
+include/lldb/Core/Highlighter.h
 include/lldb/Core/IOHandler.h
 include/lldb/Core/IOStreamMacros.h
-include/lldb/Core/Listener.h
 include/lldb/Core/LoadedModuleInfoList.h
 include/lldb/Core/Mangled.h
 include/lldb/Core/MappedHash.h
@@ -130,13 +131,11 @@ include/lldb/Core/Opcode.h
 include/lldb/Core/PluginInterface.h
 include/lldb/Core/PluginManager.h
 include/lldb/Core/RangeMap.h
-include/lldb/Core/RegisterValue.h
+include/lldb/Core/RichManglingContext.h
 include/lldb/Core/STLUtils.h
-include/lldb/Core/Scalar.h
 include/lldb/Core/SearchFilter.h
 include/lldb/Core/Section.h
 include/lldb/Core/SourceManager.h
-include/lldb/Core/State.h
 include/lldb/Core/StreamAsynchronousIO.h
 include/lldb/Core/StreamBuffer.h
 include/lldb/Core/StreamFile.h
@@ -229,10 +228,10 @@ include/lldb/Host/OptionParser.h
 include/lldb/Host/Pipe.h
 include/lldb/Host/PipeBase.h
 include/lldb/Host/PosixApi.h
-include/lldb/Host/Predicate.h
 include/lldb/Host/ProcessLauncher.h
 include/lldb/Host/ProcessRunLock.h
 include/lldb/Host/PseudoTerminal.h
+include/lldb/Host/SafeMachO.h
 include/lldb/Host/Socket.h
 include/lldb/Host/SocketAddress.h
 include/lldb/Host/StringConvert.h
@@ -246,13 +245,11 @@ include/lldb/Host/android/
 include/lldb/Host/android/HostInfoAndroid.h
 include/lldb/Host/common/
 include/lldb/Host/common/GetOptInc.h
-include/lldb/Host/common/NativeBreakpoint.h
 include/lldb/Host/common/NativeBreakpointList.h
 include/lldb/Host/common/NativeProcessProtocol.h
 include/lldb/Host/common/NativeRegisterContext.h
 include/lldb/Host/common/NativeThreadProtocol.h
 include/lldb/Host/common/NativeWatchpointList.h
-include/lldb/Host/common/SoftwareBreakpoint.h
 include/lldb/Host/common/TCPSocket.h
 include/lldb/Host/common/UDPSocket.h
 include/lldb/Host/freebsd/
@@ -362,11 +359,8 @@ include/lldb/Symbol/DeclVendor.h
 include/lldb/Symbol/Declaration.h
 include/lldb/Symbol/FuncUnwinders.h
 include/lldb/Symbol/Function.h
-include/lldb/Symbol/GoASTContext.h
-include/lldb/Symbol/JavaASTContext.h
 include/lldb/Symbol/LineEntry.h
 include/lldb/Symbol/LineTable.h
-include/lldb/Symbol/OCamlASTContext.h
 include/lldb/Symbol/ObjectContainer.h
 include/lldb/Symbol/ObjectFile.h
 include/lldb/Symbol/Symbol.h
@@ -420,6 +414,7 @@ include/lldb/Target/SectionLoadHistory.h
 include/lldb/Target/SectionLoadList.h
 include/lldb/Target/StackFrame.h
 include/lldb/Target/StackFrameList.h
+include/lldb/Target/StackFrameRecognizer.h
 include/lldb/Target/StackID.h
 include/lldb/Target/StopInfo.h
 include/lldb/Target/StructuredDataPlugin.h
@@ -456,6 +451,7 @@ include/lldb/Utility/AnsiTerminal.h
 include/lldb/Utility/ArchSpec.h
 include/lldb/Utility/Args.h
 include/lldb/Utility/Baton.h
+include/lldb/Utility/Broadcaster.h
 include/lldb/Utility/CleanUp.h
 include/lldb/Utility/CompletionRequest.h
 include/lldb/Utility/Connection.h
@@ -465,25 +461,28 @@ include/lldb/Utility/DataBufferHeap.h
 include/lldb/Utility/DataBufferLLVM.h
 include/lldb/Utility/DataEncoder.h
 include/lldb/Utility/DataExtractor.h
-include/lldb/Utility/Either.h
 include/lldb/Utility/Endian.h
 include/lldb/Utility/Environment.h
-include/lldb/Utility/FastDemangle.h
+include/lldb/Utility/Event.h
 include/lldb/Utility/FileSpec.h
 include/lldb/Utility/Flags.h
 include/lldb/Utility/IOObject.h
 include/lldb/Utility/Iterable.h
 include/lldb/Utility/JSON.h
 include/lldb/Utility/LLDBAssert.h
+include/lldb/Utility/Listener.h
 include/lldb/Utility/Log.h
 include/lldb/Utility/Logging.h
 include/lldb/Utility/NameMatches.h
-include/lldb/Utility/Range.h
+include/lldb/Utility/Predicate.h
+include/lldb/Utility/RegisterValue.h
 include/lldb/Utility/RegularExpression.h
-include/lldb/Utility/SafeMachO.h
+include/lldb/Utility/Reproducer.h
+include/lldb/Utility/Scalar.h
 include/lldb/Utility/SelectHelper.h
 include/lldb/Utility/SharedCluster.h
 include/lldb/Utility/SharingPtr.h
+include/lldb/Utility/State.h
 include/lldb/Utility/Status.h
 include/lldb/Utility/Stream.h
 include/lldb/Utility/StreamCallback.h
@@ -542,9 +541,11 @@ lib/liblldbPluginABISysV_s390x.a
 lib/liblldbPluginABISysV_x86_64.a
 lib/liblldbPluginAppleObjCRuntime.a
 lib/liblldbPluginArchitectureArm.a
+lib/liblldbPluginArchitectureMips.a
 lib/liblldbPluginArchitecturePPC64.a
 lib/liblldbPluginCPlusPlusLanguage.a
 lib/liblldbPluginCXXItaniumABI.a
+lib/liblldbPluginClangCommon.a
 lib/liblldbPluginDisassemblerLLVM.a
 lib/liblldbPluginDynamicLoaderDarwinKernel.a
 lib/liblldbPluginDynamicLoaderHexagonDYLD.a
@@ -553,8 +554,6 @@ lib/liblldbPluginDynamicLoaderPosixDYLD.
 lib/liblldbPluginDynamicLoaderStatic.a
 lib/liblldbPluginDynamicLoaderWindowsDYLD.a
 lib/liblldbPluginExpressionParserClang.a
-lib/liblldbPluginExpressionParserGo.a
-lib/liblldbPluginGoLanguage.a
 lib/liblldbPluginInstructionARM.a
 lib/liblldbPluginInstructionARM64.a
 lib/liblldbPluginInstructionMIPS.a
@@ -565,17 +564,13 @@ lib/liblldbPluginInstrumentationRuntimeM
 lib/liblldbPluginInstrumentationRuntimeTSan.a
 lib/liblldbPluginInstrumentationRuntimeUBSan.a
 lib/liblldbPluginJITLoaderGDB.a
-lib/liblldbPluginJavaLanguage.a
-lib/liblldbPluginLanguageRuntimeGo.a
-lib/liblldbPluginLanguageRuntimeJava.a
 lib/liblldbPluginMemoryHistoryASan.a
-lib/liblldbPluginOCamlLanguage.a
-lib/liblldbPluginOSGo.a
 lib/liblldbPluginOSPython.a
 lib/liblldbPluginObjCLanguage.a
 lib/liblldbPluginObjCPlusPlusLanguage.a
 lib/liblldbPluginObjectContainerBSDArchive.a
 lib/liblldbPluginObjectContainerMachOArchive.a
+lib/liblldbPluginObjectFileBreakpad.a
 lib/liblldbPluginObjectFileELF.a
 lib/liblldbPluginObjectFileJIT.a
 lib/liblldbPluginObjectFileMachO.a
@@ -599,7 +594,9 @@ lib/liblldbPluginRenderScriptRuntime.a
 lib/liblldbPluginScriptInterpreterNone.a
 lib/liblldbPluginScriptInterpreterPython.a
 lib/liblldbPluginStructuredDataDarwinLog.a
+lib/liblldbPluginSymbolFileBreakpad.a
 lib/liblldbPluginSymbolFileDWARF.a
+lib/liblldbPluginSymbolFileNativePDB.a
 lib/liblldbPluginSymbolFilePDB.a
 lib/liblldbPluginSymbolFileSymtab.a
 lib/liblldbPluginSymbolVendorELF.a
Index: devel/llvm/pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/devel/llvm/pkg/PLIST-main,v
retrieving revision 1.12
diff -u -p -r1.12 PLIST-main
--- devel/llvm/pkg/PLIST-main 9 Mar 2019 06:18:11 -0000 1.12
+++ devel/llvm/pkg/PLIST-main 30 Jun 2019 10:50:13 -0000
@@ -4,12 +4,12 @@
 @bin bin/c-index-test
 bin/clang
 bin/clang++
-@bin bin/clang-7
+@bin bin/clang-8
 @bin bin/clang-check
 bin/clang-cl
 bin/clang-cpp
+@bin bin/clang-extdef-mapping
 @bin bin/clang-format
-@bin bin/clang-func-mapping
 @bin bin/clang-import-test
 @bin bin/clang-offload-bundler
 @bin bin/clang-refactor
@@ -35,11 +35,13 @@ bin/lld-link
 @bin bin/llvm-cvtres
 @bin bin/llvm-cxxdump
 @bin bin/llvm-cxxfilt
+@bin bin/llvm-cxxmap
 @bin bin/llvm-diff
 @bin bin/llvm-dis
 bin/llvm-dlltool
 @bin bin/llvm-dwarfdump
 @bin bin/llvm-dwp
+@bin bin/llvm-elfabi
 @bin bin/llvm-exegesis
 @bin bin/llvm-extract
 bin/llvm-lib
@@ -97,9 +99,12 @@ include/clang/AST/APValue.h
 include/clang/AST/AST.h
 include/clang/AST/ASTConsumer.h
 include/clang/AST/ASTContext.h
+include/clang/AST/ASTContextAllocate.h
 include/clang/AST/ASTDiagnostic.h
+include/clang/AST/ASTDumperUtils.h
 include/clang/AST/ASTFwd.h
 include/clang/AST/ASTImporter.h
+include/clang/AST/ASTImporterLookupTable.h
 include/clang/AST/ASTLambda.h
 include/clang/AST/ASTMutationListener.h
 include/clang/AST/ASTStructuralEquivalence.h
@@ -107,9 +112,11 @@ include/clang/AST/ASTTypeTraits.h
 include/clang/AST/ASTUnresolvedSet.h
 include/clang/AST/ASTVector.h
 include/clang/AST/Attr.h
-include/clang/AST/AttrDump.inc
 include/clang/AST/AttrImpl.inc
 include/clang/AST/AttrIterator.h
+include/clang/AST/AttrNodeTraverse.inc
+include/clang/AST/AttrTextNodeDump.inc
+include/clang/AST/AttrVisitor.h
 include/clang/AST/AttrVisitor.inc
 include/clang/AST/Attrs.inc
 include/clang/AST/Availability.h
@@ -156,6 +163,7 @@ include/clang/AST/ExprObjC.h
 include/clang/AST/ExprOpenMP.h
 include/clang/AST/ExternalASTMerger.h
 include/clang/AST/ExternalASTSource.h
+include/clang/AST/FormatString.h
 include/clang/AST/GlobalDecl.h
 include/clang/AST/LambdaCapture.h
 include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h
@@ -166,6 +174,7 @@ include/clang/AST/NSAPI.h
 include/clang/AST/NestedNameSpecifier.h
 include/clang/AST/NonTrivialTypeVisitor.h
 include/clang/AST/ODRHash.h
+include/clang/AST/OSLog.h
 include/clang/AST/OpenMPClause.h
 include/clang/AST/OperationKinds.def
 include/clang/AST/OperationKinds.h
@@ -187,8 +196,10 @@ include/clang/AST/StmtNodes.inc
 include/clang/AST/StmtObjC.h
 include/clang/AST/StmtOpenMP.h
 include/clang/AST/StmtVisitor.h
+include/clang/AST/TemplateArgumentVisitor.h
 include/clang/AST/TemplateBase.h
 include/clang/AST/TemplateName.h
+include/clang/AST/TextNodeDumper.h
 include/clang/AST/Type.h
 include/clang/AST/TypeLoc.h
 include/clang/AST/TypeLocNodes.def
@@ -214,11 +225,9 @@ include/clang/Analysis/Analyses/
 include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h
 include/clang/Analysis/Analyses/Consumed.h
 include/clang/Analysis/Analyses/Dominators.h
-include/clang/Analysis/Analyses/FormatString.h
+include/clang/Analysis/Analyses/ExprMutationAnalyzer.h
 include/clang/Analysis/Analyses/LiveVariables.h
-include/clang/Analysis/Analyses/OSLog.h
 include/clang/Analysis/Analyses/PostOrderCFGView.h
-include/clang/Analysis/Analyses/PseudoConstantAnalysis.h
 include/clang/Analysis/Analyses/ReachableCode.h
 include/clang/Analysis/Analyses/ThreadSafety.h
 include/clang/Analysis/Analyses/ThreadSafetyCommon.h
@@ -243,6 +252,7 @@ include/clang/Analysis/DomainSpecific/Ob
 include/clang/Analysis/FlowSensitive/
 include/clang/Analysis/FlowSensitive/DataflowValues.h
 include/clang/Analysis/ProgramPoint.h
+include/clang/Analysis/SelectorExtras.h
 include/clang/Analysis/Support/
 include/clang/Analysis/Support/BumpVector.h
 include/clang/Basic/
@@ -267,7 +277,6 @@ include/clang/Basic/BuiltinsLe64.def
 include/clang/Basic/BuiltinsMips.def
 include/clang/Basic/BuiltinsNEON.def
 include/clang/Basic/BuiltinsNVPTX.def
-include/clang/Basic/BuiltinsNios2.def
 include/clang/Basic/BuiltinsPPC.def
 include/clang/Basic/BuiltinsSystemZ.def
 include/clang/Basic/BuiltinsWebAssembly.def
@@ -276,28 +285,41 @@ include/clang/Basic/BuiltinsX86_64.def
 include/clang/Basic/BuiltinsXCore.def
 include/clang/Basic/CapturedStmt.h
 include/clang/Basic/CharInfo.h
+include/clang/Basic/CodeGenOptions.def
+include/clang/Basic/CodeGenOptions.h
 include/clang/Basic/CommentOptions.h
 include/clang/Basic/Cuda.h
 include/clang/Basic/DebugInfoOptions.h
 include/clang/Basic/Diagnostic.h
+include/clang/Basic/DiagnosticAST.h
 include/clang/Basic/DiagnosticASTKinds.inc
+include/clang/Basic/DiagnosticAnalysis.h
 include/clang/Basic/DiagnosticAnalysisKinds.inc
 include/clang/Basic/DiagnosticCategories.h
+include/clang/Basic/DiagnosticComment.h
 include/clang/Basic/DiagnosticCommentKinds.inc
 include/clang/Basic/DiagnosticCommonKinds.inc
+include/clang/Basic/DiagnosticCrossTU.h
 include/clang/Basic/DiagnosticCrossTUKinds.inc
+include/clang/Basic/DiagnosticDriver.h
 include/clang/Basic/DiagnosticDriverKinds.inc
 include/clang/Basic/DiagnosticError.h
+include/clang/Basic/DiagnosticFrontend.h
 include/clang/Basic/DiagnosticFrontendKinds.inc
 include/clang/Basic/DiagnosticGroups.inc
 include/clang/Basic/DiagnosticIDs.h
 include/clang/Basic/DiagnosticIndexName.inc
+include/clang/Basic/DiagnosticLex.h
 include/clang/Basic/DiagnosticLexKinds.inc
 include/clang/Basic/DiagnosticOptions.def
 include/clang/Basic/DiagnosticOptions.h
+include/clang/Basic/DiagnosticParse.h
 include/clang/Basic/DiagnosticParseKinds.inc
+include/clang/Basic/DiagnosticRefactoring.h
 include/clang/Basic/DiagnosticRefactoringKinds.inc
+include/clang/Basic/DiagnosticSema.h
 include/clang/Basic/DiagnosticSemaKinds.inc
+include/clang/Basic/DiagnosticSerialization.h
 include/clang/Basic/DiagnosticSerializationKinds.inc
 include/clang/Basic/ExceptionSpecificationType.h
 include/clang/Basic/ExpressionTraits.h
@@ -305,16 +327,19 @@ include/clang/Basic/Features.def
 include/clang/Basic/FileManager.h
 include/clang/Basic/FileSystemOptions.h
 include/clang/Basic/FileSystemStatCache.h
+include/clang/Basic/FixedPoint.h
 include/clang/Basic/IdentifierTable.h
 include/clang/Basic/LLVM.h
 include/clang/Basic/Lambda.h
 include/clang/Basic/LangOptions.def
 include/clang/Basic/LangOptions.h
 include/clang/Basic/Linkage.h
+include/clang/Basic/MSP430Target.def
 include/clang/Basic/MacroBuilder.h
 include/clang/Basic/MemoryBufferCache.h
 include/clang/Basic/Module.h
 include/clang/Basic/ObjCRuntime.h
+include/clang/Basic/OpenCLExtensionTypes.def
 include/clang/Basic/OpenCLExtensions.def
 include/clang/Basic/OpenCLImageTypes.def
 include/clang/Basic/OpenCLOptions.h
@@ -347,7 +372,6 @@ include/clang/Basic/TokenKinds.h
 include/clang/Basic/TypeTraits.h
 include/clang/Basic/Version.h
 include/clang/Basic/Version.inc
-include/clang/Basic/VirtualFileSystem.h
 include/clang/Basic/Visibility.h
 include/clang/Basic/X86Target.def
 include/clang/Basic/XRayInstr.h
@@ -372,6 +396,7 @@ include/clang/CrossTU/CrossTranslationUn
 include/clang/Driver/
 include/clang/Driver/Action.h
 include/clang/Driver/Compilation.h
+include/clang/Driver/DarwinSDKInfo.h
 include/clang/Driver/Distro.h
 include/clang/Driver/Driver.h
 include/clang/Driver/DriverDiagnostic.h
@@ -399,8 +424,6 @@ include/clang/Frontend/
 include/clang/Frontend/ASTConsumers.h
 include/clang/Frontend/ASTUnit.h
 include/clang/Frontend/ChainedDiagnosticConsumer.h
-include/clang/Frontend/CodeGenOptions.def
-include/clang/Frontend/CodeGenOptions.h
 include/clang/Frontend/CommandLineSourceLoc.h
 include/clang/Frontend/CompilerInstance.h
 include/clang/Frontend/CompilerInvocation.h
@@ -455,8 +478,6 @@ include/clang/Lex/ModuleMap.h
 include/clang/Lex/MultipleIncludeOpt.h
 include/clang/Lex/PPCallbacks.h
 include/clang/Lex/PPConditionalDirectiveRecord.h
-include/clang/Lex/PTHLexer.h
-include/clang/Lex/PTHManager.h
 include/clang/Lex/Pragma.h
 include/clang/Lex/PreprocessingRecord.h
 include/clang/Lex/Preprocessor.h
@@ -470,6 +491,7 @@ include/clang/Lex/VariadicMacroSupport.h
 include/clang/Parse/
 include/clang/Parse/AttrParserStringSwitches.inc
 include/clang/Parse/AttrSubMatchRulesParserStringSwitches.inc
+include/clang/Parse/LoopHint.h
 include/clang/Parse/ParseAST.h
 include/clang/Parse/ParseDiagnostic.h
 include/clang/Parse/Parser.h
@@ -505,7 +527,6 @@ include/clang/Sema/ExternalSemaSource.h
 include/clang/Sema/IdentifierResolver.h
 include/clang/Sema/Initialization.h
 include/clang/Sema/Lookup.h
-include/clang/Sema/LoopHint.h
 include/clang/Sema/MultiplexExternalSemaSource.h
 include/clang/Sema/ObjCMethodList.h
 include/clang/Sema/Overload.h
@@ -537,17 +558,18 @@ include/clang/Serialization/GlobalModule
 include/clang/Serialization/Module.h
 include/clang/Serialization/ModuleFileExtension.h
 include/clang/Serialization/ModuleManager.h
+include/clang/Serialization/PCHContainerOperations.h
 include/clang/Serialization/SerializationDiagnostic.h
 include/clang/StaticAnalyzer/
 include/clang/StaticAnalyzer/Checkers/
+include/clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h
 include/clang/StaticAnalyzer/Checkers/Checkers.inc
-include/clang/StaticAnalyzer/Checkers/ClangCheckers.h
 include/clang/StaticAnalyzer/Checkers/LocalCheckers.h
 include/clang/StaticAnalyzer/Checkers/MPIFunctionClassifier.h
-include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h
 include/clang/StaticAnalyzer/Checkers/SValExplainer.h
 include/clang/StaticAnalyzer/Core/
 include/clang/StaticAnalyzer/Core/Analyses.def
+include/clang/StaticAnalyzer/Core/AnalyzerOptions.def
 include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
 include/clang/StaticAnalyzer/Core/BugReporter/
 include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
@@ -557,8 +579,6 @@ include/clang/StaticAnalyzer/Core/BugRep
 include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
 include/clang/StaticAnalyzer/Core/Checker.h
 include/clang/StaticAnalyzer/Core/CheckerManager.h
-include/clang/StaticAnalyzer/Core/CheckerOptInfo.h
-include/clang/StaticAnalyzer/Core/CheckerRegistry.h
 include/clang/StaticAnalyzer/Core/IssueHash.h
 include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h
 include/clang/StaticAnalyzer/Core/PathSensitive/
@@ -586,7 +606,7 @@ include/clang/StaticAnalyzer/Core/PathSe
 include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h
 include/clang/StaticAnalyzer/Core/PathSensitive/Regions.def
 include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h
-include/clang/StaticAnalyzer/Core/PathSensitive/SMTContext.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SMTConv.h
 include/clang/StaticAnalyzer/Core/PathSensitive/SMTExpr.h
 include/clang/StaticAnalyzer/Core/PathSensitive/SMTSolver.h
 include/clang/StaticAnalyzer/Core/PathSensitive/SMTSort.h
@@ -605,9 +625,11 @@ include/clang/StaticAnalyzer/Core/PathSe
 include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h
 include/clang/StaticAnalyzer/Core/PathSensitive/TaintTag.h
 include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h
+include/clang/StaticAnalyzer/Core/RetainSummaryManager.h
 include/clang/StaticAnalyzer/Frontend/
 include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h
 include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h
+include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
 include/clang/StaticAnalyzer/Frontend/FrontendActions.h
 include/clang/StaticAnalyzer/Frontend/ModelConsumer.h
 include/clang/Tooling/
@@ -709,6 +731,7 @@ include/llvm-c/DataTypes.h
 include/llvm-c/DebugInfo.h
 include/llvm-c/Disassembler.h
 include/llvm-c/DisassemblerTypes.h
+include/llvm-c/Error.h
 include/llvm-c/ErrorHandling.h
 include/llvm-c/ExecutionEngine.h
 include/llvm-c/IRReader.h
@@ -716,11 +739,14 @@ include/llvm-c/Initialization.h
 include/llvm-c/LinkTimeOptimizer.h
 include/llvm-c/Linker.h
 include/llvm-c/Object.h
+include/llvm-c/OptRemarks.h
 include/llvm-c/OrcBindings.h
 include/llvm-c/Support.h
 include/llvm-c/Target.h
 include/llvm-c/TargetMachine.h
 include/llvm-c/Transforms/
+include/llvm-c/Transforms/AggressiveInstCombine.h
+include/llvm-c/Transforms/Coroutines.h
 include/llvm-c/Transforms/IPO.h
 include/llvm-c/Transforms/InstCombine.h
 include/llvm-c/Transforms/PassManagerBuilder.h
@@ -796,6 +822,7 @@ include/llvm/ADT/Triple.h
 include/llvm/ADT/Twine.h
 include/llvm/ADT/UniqueVector.h
 include/llvm/ADT/VariadicFunction.h
+include/llvm/ADT/bit.h
 include/llvm/ADT/edit_distance.h
 include/llvm/ADT/ilist.h
 include/llvm/ADT/ilist_base.h
@@ -837,10 +864,13 @@ include/llvm/Analysis/DominanceFrontier.
 include/llvm/Analysis/DominanceFrontierImpl.h
 include/llvm/Analysis/EHPersonalities.h
 include/llvm/Analysis/GlobalsModRef.h
+include/llvm/Analysis/GuardUtils.h
+include/llvm/Analysis/IVDescriptors.h
 include/llvm/Analysis/IVUsers.h
 include/llvm/Analysis/IndirectCallPromotionAnalysis.h
-include/llvm/Analysis/IndirectCallSiteVisitor.h
+include/llvm/Analysis/IndirectCallVisitor.h
 include/llvm/Analysis/InlineCost.h
+include/llvm/Analysis/InstructionPrecedenceTracking.h
 include/llvm/Analysis/InstructionSimplify.h
 include/llvm/Analysis/Interval.h
 include/llvm/Analysis/IntervalIterator.h
@@ -850,6 +880,7 @@ include/llvm/Analysis/LazyBlockFrequency
 include/llvm/Analysis/LazyBranchProbabilityInfo.h
 include/llvm/Analysis/LazyCallGraph.h
 include/llvm/Analysis/LazyValueInfo.h
+include/llvm/Analysis/LegacyDivergenceAnalysis.h
 include/llvm/Analysis/Lint.h
 include/llvm/Analysis/Loads.h
 include/llvm/Analysis/LoopAccessAnalysis.h
@@ -871,6 +902,7 @@ include/llvm/Analysis/ObjCARCAnalysisUti
 include/llvm/Analysis/ObjCARCInstKind.h
 include/llvm/Analysis/OptimizationRemarkEmitter.h
 include/llvm/Analysis/OrderedBasicBlock.h
+include/llvm/Analysis/OrderedInstructions.h
 include/llvm/Analysis/PHITransAddr.h
 include/llvm/Analysis/Passes.h
 include/llvm/Analysis/PhiValues.h
@@ -889,6 +921,8 @@ include/llvm/Analysis/ScalarEvolutionExp
 include/llvm/Analysis/ScalarEvolutionNormalization.h
 include/llvm/Analysis/ScopedNoAliasAA.h
 include/llvm/Analysis/SparsePropagation.h
+include/llvm/Analysis/StackSafetyAnalysis.h
+include/llvm/Analysis/SyncDependenceAnalysis.h
 include/llvm/Analysis/SyntheticCountsUtils.h
 include/llvm/Analysis/TargetFolder.h
 include/llvm/Analysis/TargetLibraryInfo.def
@@ -908,6 +942,7 @@ include/llvm/AsmParser/
 include/llvm/AsmParser/Parser.h
 include/llvm/AsmParser/SlotMapping.h
 include/llvm/BinaryFormat/
+include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
 include/llvm/BinaryFormat/COFF.h
 include/llvm/BinaryFormat/Dwarf.def
 include/llvm/BinaryFormat/Dwarf.h
@@ -922,6 +957,7 @@ include/llvm/BinaryFormat/ELFRelocs/AVR.
 include/llvm/BinaryFormat/ELFRelocs/BPF.def
 include/llvm/BinaryFormat/ELFRelocs/Hexagon.def
 include/llvm/BinaryFormat/ELFRelocs/Lanai.def
+include/llvm/BinaryFormat/ELFRelocs/MSP430.def
 include/llvm/BinaryFormat/ELFRelocs/Mips.def
 include/llvm/BinaryFormat/ELFRelocs/PowerPC.def
 include/llvm/BinaryFormat/ELFRelocs/PowerPC64.def
@@ -933,6 +969,11 @@ include/llvm/BinaryFormat/ELFRelocs/x86_
 include/llvm/BinaryFormat/MachO.def
 include/llvm/BinaryFormat/MachO.h
 include/llvm/BinaryFormat/Magic.h
+include/llvm/BinaryFormat/MsgPack.def
+include/llvm/BinaryFormat/MsgPack.h
+include/llvm/BinaryFormat/MsgPackReader.h
+include/llvm/BinaryFormat/MsgPackTypes.h
+include/llvm/BinaryFormat/MsgPackWriter.h
 include/llvm/BinaryFormat/Wasm.h
 include/llvm/BinaryFormat/WasmRelocs/
 include/llvm/BinaryFormat/WasmRelocs.def
@@ -948,8 +989,10 @@ include/llvm/CodeGen/
 include/llvm/CodeGen/AccelTable.h
 include/llvm/CodeGen/Analysis.h
 include/llvm/CodeGen/AsmPrinter.h
+include/llvm/CodeGen/AsmPrinterHandler.h
 include/llvm/CodeGen/AtomicExpandUtils.h
 include/llvm/CodeGen/BasicTTIImpl.h
+include/llvm/CodeGen/BuiltinGCs.h
 include/llvm/CodeGen/CalcSpillWeights.h
 include/llvm/CodeGen/CallingConvLower.h
 include/llvm/CodeGen/CommandFlags.inc
@@ -958,6 +1001,8 @@ include/llvm/CodeGen/DAGCombine.h
 include/llvm/CodeGen/DFAPacketizer.h
 include/llvm/CodeGen/DIE.h
 include/llvm/CodeGen/DIEValue.def
+include/llvm/CodeGen/DbgEntityHistoryCalculator.h
+include/llvm/CodeGen/DebugHandlerBase.h
 include/llvm/CodeGen/DwarfStringPoolEntry.h
 include/llvm/CodeGen/EdgeBundles.h
 include/llvm/CodeGen/ExecutionDomainFix.h
@@ -968,13 +1013,15 @@ include/llvm/CodeGen/FunctionLoweringInf
 include/llvm/CodeGen/GCMetadata.h
 include/llvm/CodeGen/GCMetadataPrinter.h
 include/llvm/CodeGen/GCStrategy.h
-include/llvm/CodeGen/GCs.h
 include/llvm/CodeGen/GlobalISel/
+include/llvm/CodeGen/GlobalISel/CSEInfo.h
+include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h
 include/llvm/CodeGen/GlobalISel/CallLowering.h
 include/llvm/CodeGen/GlobalISel/Combiner.h
 include/llvm/CodeGen/GlobalISel/CombinerHelper.h
 include/llvm/CodeGen/GlobalISel/CombinerInfo.h
 include/llvm/CodeGen/GlobalISel/ConstantFoldingMIRBuilder.h
+include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h
 include/llvm/CodeGen/GlobalISel/GISelWorkList.h
 include/llvm/CodeGen/GlobalISel/IRTranslator.h
 include/llvm/CodeGen/GlobalISel/InstructionSelect.h
@@ -1038,6 +1085,7 @@ include/llvm/CodeGen/MachineOperand.h
 include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h
 include/llvm/CodeGen/MachineOutliner.h
 include/llvm/CodeGen/MachinePassRegistry.h
+include/llvm/CodeGen/MachinePipeliner.h
 include/llvm/CodeGen/MachinePostDominators.h
 include/llvm/CodeGen/MachineRegionInfo.h
 include/llvm/CodeGen/MachineRegisterInfo.h
@@ -1148,6 +1196,7 @@ include/llvm/DebugInfo/CodeView/SymbolDe
 include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h
 include/llvm/DebugInfo/CodeView/SymbolDumper.h
 include/llvm/DebugInfo/CodeView/SymbolRecord.h
+include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h
 include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
 include/llvm/DebugInfo/CodeView/SymbolSerializer.h
 include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h
@@ -1160,6 +1209,7 @@ include/llvm/DebugInfo/CodeView/TypeHash
 include/llvm/DebugInfo/CodeView/TypeIndex.h
 include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h
 include/llvm/DebugInfo/CodeView/TypeRecord.h
+include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h
 include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
 include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
 include/llvm/DebugInfo/CodeView/TypeSymbolEmitter.h
@@ -1210,6 +1260,7 @@ include/llvm/DebugInfo/PDB/ConcreteSymbo
 include/llvm/DebugInfo/PDB/DIA/
 include/llvm/DebugInfo/PDB/DIA/DIADataStream.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h
+include/llvm/DebugInfo/PDB/DIA/DIAEnumFrameData.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h
@@ -1217,6 +1268,7 @@ include/llvm/DebugInfo/PDB/DIA/DIAEnumSo
 include/llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h
 include/llvm/DebugInfo/PDB/DIA/DIAError.h
+include/llvm/DebugInfo/PDB/DIA/DIAFrameData.h
 include/llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h
 include/llvm/DebugInfo/PDB/DIA/DIALineNumber.h
 include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h
@@ -1229,6 +1281,7 @@ include/llvm/DebugInfo/PDB/DIA/DIAUtils.
 include/llvm/DebugInfo/PDB/GenericError.h
 include/llvm/DebugInfo/PDB/IPDBDataStream.h
 include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
+include/llvm/DebugInfo/PDB/IPDBFrameData.h
 include/llvm/DebugInfo/PDB/IPDBInjectedSource.h
 include/llvm/DebugInfo/PDB/IPDBLineNumber.h
 include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
@@ -1253,14 +1306,22 @@ include/llvm/DebugInfo/PDB/Native/InfoSt
 include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
 include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
 include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
-include/llvm/DebugInfo/PDB/Native/NativeBuiltinSymbol.h
 include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
+include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
 include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
-include/llvm/DebugInfo/PDB/Native/NativeEnumSymbol.h
 include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
 include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
 include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
 include/llvm/DebugInfo/PDB/Native/NativeSession.h
+include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
+include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
 include/llvm/DebugInfo/PDB/Native/PDBFile.h
 include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
 include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
@@ -1269,6 +1330,7 @@ include/llvm/DebugInfo/PDB/Native/Public
 include/llvm/DebugInfo/PDB/Native/RawConstants.h
 include/llvm/DebugInfo/PDB/Native/RawError.h
 include/llvm/DebugInfo/PDB/Native/RawTypes.h
+include/llvm/DebugInfo/PDB/Native/SymbolCache.h
 include/llvm/DebugInfo/PDB/Native/SymbolStream.h
 include/llvm/DebugInfo/PDB/Native/TpiHashing.h
 include/llvm/DebugInfo/PDB/Native/TpiStream.h
@@ -1316,7 +1378,13 @@ include/llvm/DebugInfo/Symbolize/DIPrint
 include/llvm/DebugInfo/Symbolize/SymbolizableModule.h
 include/llvm/DebugInfo/Symbolize/Symbolize.h
 include/llvm/Demangle/
+include/llvm/Demangle/Compiler.h
 include/llvm/Demangle/Demangle.h
+include/llvm/Demangle/ItaniumDemangle.h
+include/llvm/Demangle/MicrosoftDemangle.h
+include/llvm/Demangle/MicrosoftDemangleNodes.h
+include/llvm/Demangle/StringView.h
+include/llvm/Demangle/Utility.h
 include/llvm/ExecutionEngine/
 include/llvm/ExecutionEngine/ExecutionEngine.h
 include/llvm/ExecutionEngine/GenericValue.h
@@ -1335,10 +1403,12 @@ include/llvm/ExecutionEngine/Orc/GlobalM
 include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
 include/llvm/ExecutionEngine/Orc/IRTransformLayer.h
 include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
+include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
 include/llvm/ExecutionEngine/Orc/LLJIT.h
 include/llvm/ExecutionEngine/Orc/LambdaResolver.h
 include/llvm/ExecutionEngine/Orc/Layer.h
 include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
+include/llvm/ExecutionEngine/Orc/LazyReexports.h
 include/llvm/ExecutionEngine/Orc/Legacy.h
 include/llvm/ExecutionEngine/Orc/NullResolver.h
 include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h
@@ -1353,6 +1423,7 @@ include/llvm/ExecutionEngine/Orc/RTDyldO
 include/llvm/ExecutionEngine/Orc/RawByteChannel.h
 include/llvm/ExecutionEngine/Orc/RemoteObjectLayer.h
 include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
+include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h
 include/llvm/ExecutionEngine/OrcMCJITReplacement.h
 include/llvm/ExecutionEngine/RTDyldMemoryManager.h
 include/llvm/ExecutionEngine/RuntimeDyld.h
@@ -1374,6 +1445,7 @@ include/llvm/IR/Attributes.td
 include/llvm/IR/AutoUpgrade.h
 include/llvm/IR/BasicBlock.h
 include/llvm/IR/CFG.h
+include/llvm/IR/CFGDiff.h
 include/llvm/IR/CallSite.h
 include/llvm/IR/CallingConv.h
 include/llvm/IR/Comdat.h
@@ -1425,6 +1497,7 @@ include/llvm/IR/IntrinsicsHexagon.td
 include/llvm/IR/IntrinsicsMips.td
 include/llvm/IR/IntrinsicsNVVM.td
 include/llvm/IR/IntrinsicsPowerPC.td
+include/llvm/IR/IntrinsicsRISCV.td
 include/llvm/IR/IntrinsicsSystemZ.td
 include/llvm/IR/IntrinsicsWebAssembly.td
 include/llvm/IR/IntrinsicsX86.td
@@ -1445,8 +1518,10 @@ include/llvm/IR/NoFolder.h
 include/llvm/IR/OperandTraits.h
 include/llvm/IR/Operator.h
 include/llvm/IR/OptBisect.h
+include/llvm/IR/PassInstrumentation.h
 include/llvm/IR/PassManager.h
 include/llvm/IR/PassManagerInternal.h
+include/llvm/IR/PassTimingInfo.h
 include/llvm/IR/PatternMatch.h
 include/llvm/IR/PredIteratorCache.h
 include/llvm/IR/ProfileSummary.h
@@ -1456,7 +1531,6 @@ include/llvm/IR/Statepoint.h
 include/llvm/IR/SymbolTableListTraits.h
 include/llvm/IR/TrackingMDRef.h
 include/llvm/IR/Type.h
-include/llvm/IR/TypeBuilder.h
 include/llvm/IR/TypeFinder.h
 include/llvm/IR/Use.h
 include/llvm/IR/UseListOrder.h
@@ -1475,6 +1549,7 @@ include/llvm/LTO/Caching.h
 include/llvm/LTO/Config.h
 include/llvm/LTO/LTO.h
 include/llvm/LTO/LTOBackend.h
+include/llvm/LTO/SummaryBasedOptimizations.h
 include/llvm/LTO/legacy/
 include/llvm/LTO/legacy/LTOCodeGenerator.h
 include/llvm/LTO/legacy/LTOModule.h
@@ -1567,6 +1642,28 @@ include/llvm/MC/MachineLocation.h
 include/llvm/MC/SectionKind.h
 include/llvm/MC/StringTableBuilder.h
 include/llvm/MC/SubtargetFeature.h
+include/llvm/MCA/
+include/llvm/MCA/Context.h
+include/llvm/MCA/HWEventListener.h
+include/llvm/MCA/HardwareUnits/
+include/llvm/MCA/HardwareUnits/HardwareUnit.h
+include/llvm/MCA/HardwareUnits/LSUnit.h
+include/llvm/MCA/HardwareUnits/RegisterFile.h
+include/llvm/MCA/HardwareUnits/ResourceManager.h
+include/llvm/MCA/HardwareUnits/RetireControlUnit.h
+include/llvm/MCA/HardwareUnits/Scheduler.h
+include/llvm/MCA/InstrBuilder.h
+include/llvm/MCA/Instruction.h
+include/llvm/MCA/Pipeline.h
+include/llvm/MCA/SourceMgr.h
+include/llvm/MCA/Stages/
+include/llvm/MCA/Stages/DispatchStage.h
+include/llvm/MCA/Stages/EntryStage.h
+include/llvm/MCA/Stages/ExecuteStage.h
+include/llvm/MCA/Stages/InstructionTables.h
+include/llvm/MCA/Stages/RetireStage.h
+include/llvm/MCA/Stages/Stage.h
+include/llvm/MCA/Support.h
 include/llvm/Object/
 include/llvm/Object/Archive.h
 include/llvm/Object/ArchiveWriter.h
@@ -1621,6 +1718,7 @@ include/llvm/PassSupport.h
 include/llvm/Passes/
 include/llvm/Passes/PassBuilder.h
 include/llvm/Passes/PassPlugin.h
+include/llvm/Passes/StandardInstrumentations.h
 include/llvm/ProfileData/
 include/llvm/ProfileData/Coverage/
 include/llvm/ProfileData/Coverage/CoverageMapping.h
@@ -1637,12 +1735,14 @@ include/llvm/ProfileData/SampleProfReade
 include/llvm/ProfileData/SampleProfWriter.h
 include/llvm/Support/
 include/llvm/Support/AArch64TargetParser.def
+include/llvm/Support/AArch64TargetParser.h
 include/llvm/Support/AMDGPUMetadata.h
 include/llvm/Support/AMDHSAKernelDescriptor.h
 include/llvm/Support/ARMAttributeParser.h
 include/llvm/Support/ARMBuildAttributes.h
 include/llvm/Support/ARMEHABI.h
 include/llvm/Support/ARMTargetParser.def
+include/llvm/Support/ARMTargetParser.h
 include/llvm/Support/ARMWinEH.h
 include/llvm/Support/AlignOf.h
 include/llvm/Support/Allocator.h
@@ -1659,7 +1759,9 @@ include/llvm/Support/BinaryStreamRef.h
 include/llvm/Support/BinaryStreamWriter.h
 include/llvm/Support/BlockFrequency.h
 include/llvm/Support/BranchProbability.h
+include/llvm/Support/BuryPointer.h
 include/llvm/Support/CBindingWrapping.h
+include/llvm/Support/CFGUpdate.h
 include/llvm/Support/COM.h
 include/llvm/Support/CachePruning.h
 include/llvm/Support/Capacity.h
@@ -1687,6 +1789,7 @@ include/llvm/Support/Errno.h
 include/llvm/Support/Error.h
 include/llvm/Support/ErrorHandling.h
 include/llvm/Support/ErrorOr.h
+include/llvm/Support/FileCheck.h
 include/llvm/Support/FileOutputBuffer.h
 include/llvm/Support/FileSystem.h
 include/llvm/Support/FileUtilities.h
@@ -1703,6 +1806,7 @@ include/llvm/Support/GlobPattern.h
 include/llvm/Support/GraphWriter.h
 include/llvm/Support/Host.h
 include/llvm/Support/InitLLVM.h
+include/llvm/Support/ItaniumManglingCanonicalizer.h
 include/llvm/Support/JSON.h
 include/llvm/Support/JamCRC.h
 include/llvm/Support/KnownBits.h
@@ -1713,6 +1817,7 @@ include/llvm/Support/Locale.h
 include/llvm/Support/LockFileManager.h
 include/llvm/Support/LowLevelTypeImpl.h
 include/llvm/Support/MD5.h
+include/llvm/Support/MSVCErrorWorkarounds.h
 include/llvm/Support/MachineValueType.h
 include/llvm/Support/ManagedStatic.h
 include/llvm/Support/MathExtras.h
@@ -1755,6 +1860,7 @@ include/llvm/Support/SpecialCaseList.h
 include/llvm/Support/StringPool.h
 include/llvm/Support/StringSaver.h
 include/llvm/Support/SwapByteOrder.h
+include/llvm/Support/SymbolRemappingReader.h
 include/llvm/Support/SystemUtils.h
 include/llvm/Support/TarWriter.h
 include/llvm/Support/TargetOpcodes.def
@@ -1776,6 +1882,7 @@ include/llvm/Support/UniqueLock.h
 include/llvm/Support/VCSRevision.h
 include/llvm/Support/Valgrind.h
 include/llvm/Support/VersionTuple.h
+include/llvm/Support/VirtualFileSystem.h
 include/llvm/Support/Watchdog.h
 include/llvm/Support/Win64EH.h
 include/llvm/Support/WindowsError.h
@@ -1815,12 +1922,18 @@ include/llvm/Target/TargetItinerary.td
 include/llvm/Target/TargetLoweringObjectFile.h
 include/llvm/Target/TargetMachine.h
 include/llvm/Target/TargetOptions.h
+include/llvm/Target/TargetPfmCounters.td
 include/llvm/Target/TargetSchedule.td
 include/llvm/Target/TargetSelectionDAG.td
 include/llvm/Testing/
 include/llvm/Testing/Support/
 include/llvm/Testing/Support/Error.h
 include/llvm/Testing/Support/SupportHelpers.h
+include/llvm/TextAPI/
+include/llvm/TextAPI/ELF/
+include/llvm/TextAPI/ELF/ELFStub.h
+include/llvm/TextAPI/ELF/TBEHandler.h
+include/llvm/TextAPI/MachO/
 include/llvm/ToolDrivers/
 include/llvm/ToolDrivers/llvm-dlltool/
 include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h
@@ -1845,6 +1958,7 @@ include/llvm/Transforms/IPO/FunctionImpo
 include/llvm/Transforms/IPO/GlobalDCE.h
 include/llvm/Transforms/IPO/GlobalOpt.h
 include/llvm/Transforms/IPO/GlobalSplit.h
+include/llvm/Transforms/IPO/HotColdSplitting.h
 include/llvm/Transforms/IPO/InferFunctionAttrs.h
 include/llvm/Transforms/IPO/Inliner.h
 include/llvm/Transforms/IPO/Internalize.h
@@ -1864,9 +1978,12 @@ include/llvm/Transforms/Instrumentation/
 include/llvm/Transforms/Instrumentation.h
 include/llvm/Transforms/Instrumentation/BoundsChecking.h
 include/llvm/Transforms/Instrumentation/CGProfile.h
+include/llvm/Transforms/Instrumentation/ControlHeightReduction.h
 include/llvm/Transforms/Instrumentation/GCOVProfiler.h
 include/llvm/Transforms/Instrumentation/InstrProfiling.h
+include/llvm/Transforms/Instrumentation/MemorySanitizer.h
 include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
+include/llvm/Transforms/Instrumentation/ThreadSanitizer.h
 include/llvm/Transforms/ObjCARC.h
 include/llvm/Transforms/Scalar/
 include/llvm/Transforms/Scalar.h
@@ -1908,6 +2025,7 @@ include/llvm/Transforms/Scalar/LoopUnrol
 include/llvm/Transforms/Scalar/LowerAtomic.h
 include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h
 include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h
+include/llvm/Transforms/Scalar/MakeGuardsExplicit.h
 include/llvm/Transforms/Scalar/MemCpyOptimizer.h
 include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h
 include/llvm/Transforms/Scalar/NaryReassociate.h
@@ -1917,12 +2035,14 @@ include/llvm/Transforms/Scalar/Reassocia
 include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h
 include/llvm/Transforms/Scalar/SCCP.h
 include/llvm/Transforms/Scalar/SROA.h
+include/llvm/Transforms/Scalar/Scalarizer.h
 include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h
 include/llvm/Transforms/Scalar/SimplifyCFG.h
 include/llvm/Transforms/Scalar/Sink.h
 include/llvm/Transforms/Scalar/SpeculateAroundPHIs.h
 include/llvm/Transforms/Scalar/SpeculativeExecution.h
 include/llvm/Transforms/Scalar/TailRecursionElimination.h
+include/llvm/Transforms/Scalar/WarnMissedTransforms.h
 include/llvm/Transforms/Utils/
 include/llvm/Transforms/Utils.h
 include/llvm/Transforms/Utils/ASanStackFrameLayout.h
@@ -1932,6 +2052,7 @@ include/llvm/Transforms/Utils/BreakCriti
 include/llvm/Transforms/Utils/BuildLibCalls.h
 include/llvm/Transforms/Utils/BypassSlowDivision.h
 include/llvm/Transforms/Utils/CallPromotionUtils.h
+include/llvm/Transforms/Utils/CanonicalizeAliases.h
 include/llvm/Transforms/Utils/Cloning.h
 include/llvm/Transforms/Utils/CodeExtractor.h
 include/llvm/Transforms/Utils/CtorUtils.h
@@ -1941,6 +2062,7 @@ include/llvm/Transforms/Utils/Evaluator.
 include/llvm/Transforms/Utils/FunctionComparator.h
 include/llvm/Transforms/Utils/FunctionImportUtils.h
 include/llvm/Transforms/Utils/GlobalStatus.h
+include/llvm/Transforms/Utils/GuardUtils.h
 include/llvm/Transforms/Utils/ImportedFunctionsInliningStatistics.h
 include/llvm/Transforms/Utils/IntegerDivision.h
 include/llvm/Transforms/Utils/LCSSA.h
@@ -1955,7 +2077,6 @@ include/llvm/Transforms/Utils/LowerMemIn
 include/llvm/Transforms/Utils/Mem2Reg.h
 include/llvm/Transforms/Utils/ModuleUtils.h
 include/llvm/Transforms/Utils/NameAnonGlobals.h
-include/llvm/Transforms/Utils/OrderedInstructions.h
 include/llvm/Transforms/Utils/PredicateInfo.h
 include/llvm/Transforms/Utils/PromoteMemToReg.h
 include/llvm/Transforms/Utils/SSAUpdater.h
@@ -1972,6 +2093,7 @@ include/llvm/Transforms/Utils/VNCoercion
 include/llvm/Transforms/Utils/ValueMapper.h
 include/llvm/Transforms/Vectorize/
 include/llvm/Transforms/Vectorize.h
+include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h
 include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
 include/llvm/Transforms/Vectorize/LoopVectorize.h
 include/llvm/Transforms/Vectorize/SLPVectorizer.h
@@ -1982,14 +2104,23 @@ include/llvm/WindowsResource/ResourcePro
 include/llvm/WindowsResource/ResourceScriptToken.h
 include/llvm/WindowsResource/ResourceScriptTokenList.h
 include/llvm/XRay/
+include/llvm/XRay/BlockIndexer.h
+include/llvm/XRay/BlockPrinter.h
+include/llvm/XRay/BlockVerifier.h
+include/llvm/XRay/FDRLogBuilder.h
+include/llvm/XRay/FDRRecordConsumer.h
+include/llvm/XRay/FDRRecordProducer.h
+include/llvm/XRay/FDRRecords.h
+include/llvm/XRay/FDRTraceExpander.h
+include/llvm/XRay/FDRTraceWriter.h
+include/llvm/XRay/FileHeaderReader.h
 include/llvm/XRay/Graph.h
 include/llvm/XRay/InstrumentationMap.h
+include/llvm/XRay/Profile.h
+include/llvm/XRay/RecordPrinter.h
 include/llvm/XRay/Trace.h
 include/llvm/XRay/XRayRecord.h
 include/llvm/XRay/YAMLXRayRecord.h
-lib/BugpointPasses.so
-lib/LLVMHello.so
-lib/TestPlugin.so
 lib/clang/
 lib/clang/${LLVM_V}/
 ${CLANG_INCLUDE_PATH}/
@@ -2148,7 +2279,7 @@ lib/cmake/llvm/LLVMProcessSources.cmake
 lib/cmake/llvm/TableGen.cmake
 lib/cmake/llvm/VersionFromVCS.cmake
 lib/libLLVM-${LLVM_V}.so
-lib/libLLVM-7.so
+lib/libLLVM-8.so
 lib/libLLVM.so
 lib/libLLVMAggressiveInstCombine.a
 lib/libLLVMAnalysis.a
@@ -2179,13 +2310,17 @@ lib/libLLVMLibDriver.a
 lib/libLLVMLineEditor.a
 lib/libLLVMLinker.a
 lib/libLLVMMC.a
+lib/libLLVMMCA.a
 lib/libLLVMMCDisassembler.a
 lib/libLLVMMCJIT.a
 lib/libLLVMMCParser.a
 lib/libLLVMMIRParser.a
+lib/libLLVMMSP430AsmParser.a
+lib/libLLVMMSP430Disassembler.a
 lib/libLLVMObjCARCOpts.a
 lib/libLLVMObject.a
 lib/libLLVMObjectYAML.a
+lib/libLLVMOptRemarks.a
 lib/libLLVMOption.a
 lib/libLLVMOrcJIT.a
 lib/libLLVMPasses.a
@@ -2203,12 +2338,20 @@ lib/libLLVMSupport.a
 lib/libLLVMSymbolize.a
 lib/libLLVMTableGen.a
 lib/libLLVMTarget.a
+lib/libLLVMTextAPI.a
 lib/libLLVMTransformUtils.a
 lib/libLLVMVectorize.a
+lib/libLLVMWebAssemblyAsmParser.a
+lib/libLLVMWebAssemblyAsmPrinter.a
+lib/libLLVMWebAssemblyCodeGen.a
+lib/libLLVMWebAssemblyDesc.a
+lib/libLLVMWebAssemblyDisassembler.a
+lib/libLLVMWebAssemblyInfo.a
 lib/libLLVMWindowsManifest.a
 lib/libLLVMXRay.a
 lib/libLLVMipo.a
 @lib lib/libLTO.so.${LIBLTO_VERSION}
+lib/libOptRemarks.so.8
 @lib lib/libclang.so.${LIBclang_VERSION}
 lib/libclangARCMigrate.a
 lib/libclangAST.a
@@ -2265,6 +2408,7 @@ libexec/ccc-analyzer
 @man man/man1/llvm-build.1
 @man man/man1/llvm-config.1
 @man man/man1/llvm-cov.1
+@man man/man1/llvm-cxxmap.1
 @man man/man1/llvm-diff.1
 @man man/man1/llvm-dis.1
 @man man/man1/llvm-dwarfdump.1
@@ -2274,6 +2418,7 @@ libexec/ccc-analyzer
 @man man/man1/llvm-link.1
 @man man/man1/llvm-mca.1
 @man man/man1/llvm-nm.1
+@man man/man1/llvm-objdump.1
 @man man/man1/llvm-pdbutil.1
 @man man/man1/llvm-profdata.1
 @man man/man1/llvm-readobj.1
Index: lang/clang/clang.port.mk
===================================================================
RCS file: /cvs/ports/lang/clang/clang.port.mk,v
retrieving revision 1.32
diff -u -p -r1.32 clang.port.mk
--- lang/clang/clang.port.mk 28 Jan 2019 06:27:28 -0000 1.32
+++ lang/clang/clang.port.mk 30 Jun 2019 10:50:13 -0000
@@ -1,6 +1,6 @@
 # $OpenBSD: clang.port.mk,v 1.32 2019/01/28 06:27:28 jca Exp $
 
-MODCLANG_VERSION= 7.0.1
+MODCLANG_VERSION= 8.0.0
 
 MODCLANG_ARCHS ?= ${LLVM_ARCHS}
 MODCLANG_LANGS ?=


--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: [wip] devel/llvm 8.0.0

Charlene Wendling
Hi!

> On Sun, Jun 30 2019, Sebastien Marie <[hidden email]> wrote:
> > On Sun, Jun 30, 2019 at 12:55:44AM +0200, Jeremie Courreges-Anglas
> > wrote:
> >>
> >> Here's the diff I'm testing right now.  I have merged the llvm
> >> patches this morning and I did not double check them so far, but
> >> this lets llvm, include-what-you-use, rust and ripgrep build on
> >> amd64.  mozillas are building on amd64, llvm still compiling on
> >> sparc64.
> >>
> >> Sebastien, I guess we'll need to coordinate regarding rust-1.35 /
> >> rust-1.36 and llvm-7 / llvm-8.
> >
> > I think you have more work than me to push a tested llvm-8. so you
> > should go first, and I will redo a part of my work for upgrading rust
> > to 1.36, using llvm-8.
>
> I guess it's going to be easier for me this way, I'm not completely
> sure.  After all, rust doesn't build on the slower archs that need to be
> tested with llvm-8.  Anyway, the current rust version seems to cope fine
> with llvm-8 so upgrading llvm first sound appealing.
>
> > I will use the diff to prepare llvm-8 packages on my buildhosts and
> > test rust-1.36 with that.
>
> Please use this updated diff which adds py-recommonmark[0] as a build
> dep.  Sorry for the obvious oversight!
>
> [0] https://marc.info/?l=openbsd-ports&m=156189089024457&w=2
On macppc it fails while packaging [1] because some .a aren't built,
as such i've modified a bit the PLISTs.

I guess it's because on macppc only the powerpc target is built.

devel/include-what-you-use still doesn't build with the same error
llvm-7 has [2], probably for the same reason.

I'm sending the diff with only the PLIST changes done. sysutils/free
builds and runs fine with forced COMPILER. I'll report any arising issues.

Charlène.

[1] https://bin.charlenew.xyz/llvm-8.0.0.log
[2] http://build-failures.rhaalovely.net/powerpc/last/devel/include-what-you-use.log

llvm.diff (296K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [wip] devel/llvm 8.0.0

Krystian Lewandowski-2
In reply to this post by Jeremie Courreges-Anglas-2
This LLVM version has the same problem as snapshot base LLVM 8.
LLVM 7 port was not affected.

https://bugs.llvm.org/show_bug.cgi?id=42478


--
Krystian

Reply | Threaded
Open this post in threaded view
|

Re: [wip] devel/llvm 8.0.0

Jeremie Courreges-Anglas-2
In reply to this post by Charlene Wendling
On Tue, Jul 02 2019, Charlene Wendling <[hidden email]> wrote:

> Hi!
>
>> On Sun, Jun 30 2019, Sebastien Marie <[hidden email]> wrote:
>> > On Sun, Jun 30, 2019 at 12:55:44AM +0200, Jeremie Courreges-Anglas
>> > wrote:
>> >>
>> >> Here's the diff I'm testing right now.  I have merged the llvm
>> >> patches this morning and I did not double check them so far, but
>> >> this lets llvm, include-what-you-use, rust and ripgrep build on
>> >> amd64.  mozillas are building on amd64, llvm still compiling on
>> >> sparc64.
>> >>
>> >> Sebastien, I guess we'll need to coordinate regarding rust-1.35 /
>> >> rust-1.36 and llvm-7 / llvm-8.
>> >
>> > I think you have more work than me to push a tested llvm-8. so you
>> > should go first, and I will redo a part of my work for upgrading rust
>> > to 1.36, using llvm-8.
>>
>> I guess it's going to be easier for me this way, I'm not completely
>> sure.  After all, rust doesn't build on the slower archs that need to be
>> tested with llvm-8.  Anyway, the current rust version seems to cope fine
>> with llvm-8 so upgrading llvm first sound appealing.
>>
>> > I will use the diff to prepare llvm-8 packages on my buildhosts and
>> > test rust-1.36 with that.
>>
>> Please use this updated diff which adds py-recommonmark[0] as a build
>> dep.  Sorry for the obvious oversight!
>>
>> [0] https://marc.info/?l=openbsd-ports&m=156189089024457&w=2
>
> On macppc it fails while packaging [1] because some .a aren't built,
> as such i've modified a bit the PLISTs.

Thanks (again) for this.

> I guess it's because on macppc only the powerpc target is built.

Yep.

> devel/include-what-you-use still doesn't build with the same error
> llvm-7 has [2], probably for the same reason.

I had missed that one.  iwyu.cc:

--8<--
int main(int argc, char **argv) {
  // Must initialize X86 target to be able to parse Microsoft inline
  // assembly. We do this unconditionally, because it allows an IWYU
  // built for non-X86 targets to parse MS inline asm without choking.
  LLVMInitializeX86TargetInfo();
  LLVMInitializeX86TargetMC();
  LLVMInitializeX86AsmParser();
-->8--

For the ports tree I guess an #ifndef __powerpc__ would be enough.

> I'm sending the diff with only the PLIST changes done. sysutils/free
> builds and runs fine with forced COMPILER. I'll report any arising issues.

As discussed privately PLIST/PFRAG were still not right but that was easy
to fix.  On top of this I had missed some bits when doing the merge of
OpenBSD.cpp, which resulted in -lcompiler_rt being incorrectly used
instead of libgcc on sparc64 (rather, where libestdc++ is used).
I spotted this thanks to a failure in devel/cbmc.

Here's the latest diff.  It still doesn't merge all the changes from
base but the differences don't seem to matter for the correctness of the
compiled code, so I might address this later.  Hopefully this version
can go in soonish so that semarie@ can proceed to updating lang/rust.

Feedback, reviews, tests, oks etc welcome, as usual.


Index: devel/include-what-you-use/Makefile
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/Makefile,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile
--- devel/include-what-you-use/Makefile 17 Jun 2019 21:33:45 -0000 1.16
+++ devel/include-what-you-use/Makefile 4 Jul 2019 15:26:11 -0000
@@ -2,9 +2,8 @@
 
 COMMENT= tool to analyse \#includes in C and C++ source files
 CATEGORIES= devel
-DISTNAME= include-what-you-use-0.11.src
+DISTNAME= include-what-you-use-0.12.src
 PKGNAME= ${DISTNAME:.src=}
-REVISION= 1
 
 HOMEPAGE= https://include-what-you-use.org
 MASTER_SITES= ${HOMEPAGE}/downloads/
@@ -16,7 +15,7 @@ MAINTAINER= Jonathan Gray <[hidden email]
 PERMIT_PACKAGE= Yes
 
 WANTLIB= ${COMPILER_LIBCXX} c m pthread
-LLVM_V= 7.0.1
+LLVM_V= 8.0.0
 BUILD_DEPENDS= devel/llvm>=${LLVM_V}
 RUN_DEPENDS= devel/llvm>=${LLVM_V}
 
Index: devel/include-what-you-use/distinfo
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/distinfo,v
retrieving revision 1.7
diff -u -p -r1.7 distinfo
--- devel/include-what-you-use/distinfo 28 Jan 2019 06:27:28 -0000 1.7
+++ devel/include-what-you-use/distinfo 4 Jul 2019 15:26:11 -0000
@@ -1,2 +1,2 @@
-SHA256 (include-what-you-use-0.11.src.tar.gz) = LSh3cmxK7ZUYy7N2c/+8K32pwjm/j+KUMto1wcDsNno=
-SIZE (include-what-you-use-0.11.src.tar.gz) = 541763
+SHA256 (include-what-you-use-0.12.src.tar.gz) = pYkvsKvMuCDDlOTiRcAO8w/JTkrligSLI/lAR8CBYCU=
+SIZE (include-what-you-use-0.12.src.tar.gz) = 545673
Index: devel/include-what-you-use/patches/patch-iwyu_include_picker_cc
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/patches/patch-iwyu_include_picker_cc,v
retrieving revision 1.5
diff -u -p -r1.5 patch-iwyu_include_picker_cc
--- devel/include-what-you-use/patches/patch-iwyu_include_picker_cc 28 Jan 2019 06:27:28 -0000 1.5
+++ devel/include-what-you-use/patches/patch-iwyu_include_picker_cc 4 Jul 2019 15:26:11 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-iwyu_include_picker_cc,v
 Index: iwyu_include_picker.cc
 --- iwyu_include_picker.cc.orig
 +++ iwyu_include_picker.cc
-@@ -116,8 +116,6 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -118,8 +118,6 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "gid_t", kPrivate, "<unistd.h>", kPublic },
    { "id_t", kPrivate, "<sys/types.h>", kPublic },
    { "id_t", kPrivate, "<sys/resource.h>", kPublic },
@@ -12,7 +12,7 @@ Index: iwyu_include_picker.cc
    { "ino_t", kPrivate, "<sys/types.h>", kPublic },
    { "ino_t", kPrivate, "<dirent.h>", kPublic },
    { "ino_t", kPrivate, "<sys/stat.h>", kPublic },
-@@ -133,8 +131,6 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -143,8 +141,6 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "mode_t", kPrivate, "<sys/mman.h>", kPublic },
    { "nlink_t", kPrivate, "<sys/types.h>", kPublic },
    { "nlink_t", kPrivate, "<sys/stat.h>", kPublic },
@@ -21,7 +21,7 @@ Index: iwyu_include_picker.cc
    { "off_t", kPrivate, "<sys/types.h>", kPublic },
    { "off_t", kPrivate, "<unistd.h>", kPublic },
    { "off_t", kPrivate, "<sys/stat.h>", kPublic },
-@@ -148,11 +144,8 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -158,11 +154,8 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "pid_t", kPrivate, "<time.h>", kPublic },
    { "pid_t", kPrivate, "<utmpx.h>", kPublic },
    { "sigset_t", kPrivate, "<signal.h>", kPublic },
@@ -34,7 +34,7 @@ Index: iwyu_include_picker.cc
    { "ssize_t", kPrivate, "<sys/types.h>", kPublic },
    { "ssize_t", kPrivate, "<unistd.h>", kPublic },
    { "ssize_t", kPrivate, "<monetary.h>", kPublic },
-@@ -181,6 +174,7 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -195,6 +188,7 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "size_t", kPrivate, "<time.h>", kPublic },
    { "size_t", kPrivate, "<uchar.h>", kPublic },
    { "size_t", kPrivate, "<wchar.h>", kPublic },
@@ -42,7 +42,7 @@ Index: iwyu_include_picker.cc
    // Macros that can be defined in more than one file, don't have the
    // same __foo_defined guard that other types do, so the grep above
    // doesn't discover them.  Until I figure out a better way, I just
-@@ -195,6 +189,10 @@ const IncludeMapEntry libc_symbol_map[] = {
+@@ -209,6 +203,10 @@ const IncludeMapEntry libc_symbol_map[] = {
    { "calloc", kPrivate, "<stdlib.h>", kPublic },
    { "realloc", kPrivate, "<stdlib.h>", kPublic },
    { "free", kPrivate, "<stdlib.h>", kPublic },
@@ -53,7 +53,7 @@ Index: iwyu_include_picker.cc
    // Entries for NULL
    { "NULL", kPrivate, "<stddef.h>", kPublic },  // 'canonical' location for NULL
    { "NULL", kPrivate, "<clocale>", kPublic },
-@@ -240,7 +238,7 @@ const IncludeMapEntry libstdcpp_symbol_map[] = {
+@@ -254,7 +252,7 @@ const IncludeMapEntry libstdcpp_symbol_map[] = {
  };
 
  // Private -> public include mappings for GNU libc
@@ -62,7 +62,7 @@ Index: iwyu_include_picker.cc
    // ( cd /usr/include && grep '^ *# *include' {sys/,net/,}* | perl -nle 'm/^([^:]+).*<([^>]+)>/ && print qq@    { "<$2>", kPrivate, "<$1>", kPublic },@' | grep bits/ | sort )
    // When I saw more than one mapping for these, I typically picked
    // what I thought was the "best" one.
-@@ -443,6 +441,42 @@ const IncludeMapEntry libc_include_map[] = {
+@@ -457,6 +455,42 @@ const IncludeMapEntry libc_include_map[] = {
    { "<linux/limits.h>", kPrivate, "<limits.h>", kPublic },   // PATH_MAX
    { "<linux/prctl.h>", kPrivate, "<sys/prctl.h>", kPublic },
    { "<sys/ucontext.h>", kPrivate, "<ucontext.h>", kPublic },
Index: devel/include-what-you-use/pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -r1.3 PLIST
--- devel/include-what-you-use/pkg/PLIST 17 Jun 2019 21:33:45 -0000 1.3
+++ devel/include-what-you-use/pkg/PLIST 4 Jul 2019 15:26:11 -0000
@@ -24,4 +24,3 @@ share/include-what-you-use/libcxx.imp
 share/include-what-you-use/qt4.imp
 share/include-what-you-use/qt5_4.imp
 share/include-what-you-use/stl.c.headers.imp
-share/include-what-you-use/third_party.imp
Index: devel/llvm/Makefile
===================================================================
RCS file: /cvs/ports/devel/llvm/Makefile,v
retrieving revision 1.227
diff -u -p -r1.227 Makefile
--- devel/llvm/Makefile 22 Jun 2019 22:44:06 -0000 1.227
+++ devel/llvm/Makefile 4 Jul 2019 15:26:11 -0000
@@ -11,15 +11,13 @@ COMMENT-python = Python bindings for Cla
 
 # XXX: Remember to bump MODCLANG_VERSION in lang/clang/clang.port.mk when
 # updating this port.
-LLVM_V = 7.0.1
+LLVM_V = 8.0.0
 DISTNAME = llvm-${LLVM_V}.src
 PKGNAME = llvm-${LLVM_V}
 PKGSPEC-main = llvm-=${LLVM_V}
 PKGNAME-main = llvm-${LLVM_V}
 PKGNAME-python = py-llvm-${LLVM_V}
 PKGNAME-lldb = lldb-${LLVM_V}
-REVISION-main = 13
-REVISION-lldb = 3
 
 CATEGORIES = devel
 
@@ -51,7 +49,8 @@ MODULES = devel/cmake \
 TEST_DEPENDS = devel/dejagnu \
  shells/bash
 BUILD_DEPENDS += devel/swig \
- textproc/py-sphinx
+ textproc/py-sphinx \
+ textproc/py-recommonmark
 RUN_DEPENDS += devel/gtest
 
 .include <bsd.port.arch.mk>
Index: devel/llvm/distinfo
===================================================================
RCS file: /cvs/ports/devel/llvm/distinfo,v
retrieving revision 1.32
diff -u -p -r1.32 distinfo
--- devel/llvm/distinfo 8 May 2019 22:34:02 -0000 1.32
+++ devel/llvm/distinfo 4 Jul 2019 15:26:11 -0000
@@ -1,8 +1,8 @@
-SHA256 (cfe-7.0.1.src.tar.xz) = pFti3eXX1f3N+odrCvkvFk1DSwbp6JtdCxy8Zd/j9Bg=
-SHA256 (lld-7.0.1.src.tar.xz) = iGmqst0tjgDWmUM1LTFm0VnX6uJhX2amhPSgmZ/HQDE=
-SHA256 (lldb-7.0.1.src.tar.xz) = drRr51tBKj0i8NJieTBq5+J0/k15iKIYTFKcOKanaYI=
-SHA256 (llvm-7.0.1.src.tar.xz) = o438TbRxAux53MKqYek3IsX28G8KlhBzvYS3j7lJQZs=
-SIZE (cfe-7.0.1.src.tar.xz) = 12488668
-SIZE (lld-7.0.1.src.tar.xz) = 912812
-SIZE (lldb-7.0.1.src.tar.xz) = 19384628
-SIZE (llvm-7.0.1.src.tar.xz) = 28311056
+SHA256 (cfe-8.0.0.src.tar.xz) = CEwRWqsAhOY7I+7owjOrtnOcOZ4plm6uzPxuCI4Lc2s=
+SHA256 (lld-8.0.0.src.tar.xz) = nK7I7JIuMv+hMPD7COTFokLX5oznV2MeQl6eui4abjc=
+SHA256 (lldb-8.0.0.src.tar.xz) = SZGLnwmBZVSiCsRMX4WjLcCnoAdZsyWeeAZNZ06sA3M=
+SHA256 (llvm-8.0.0.src.tar.xz) = iHK+GxLGFFDKzIKz0VPqsCviVG7zT6NYDtFBN7smIkw=
+SIZE (cfe-8.0.0.src.tar.xz) = 12868468
+SIZE (lld-8.0.0.src.tar.xz) = 999864
+SIZE (lldb-8.0.0.src.tar.xz) = 19602332
+SIZE (llvm-8.0.0.src.tar.xz) = 30503732
Index: devel/llvm/patches/patch-include_llvm_ADT_Optional_h
===================================================================
RCS file: devel/llvm/patches/patch-include_llvm_ADT_Optional_h
diff -N devel/llvm/patches/patch-include_llvm_ADT_Optional_h
--- devel/llvm/patches/patch-include_llvm_ADT_Optional_h 28 Jan 2019 06:27:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,35 +0,0 @@
-$OpenBSD: patch-include_llvm_ADT_Optional_h,v 1.1 2019/01/28 06:27:28 jca Exp $
-
-[ADT] Drop llvm::Optional clang-specific optmization for trivially copyable types
-
-This fixes libLLVM.so ABI mismatches between llvm compiled with clang
-and llvm compiled with gcc (PR39427).
-
-Index: include/llvm/ADT/Optional.h
---- include/llvm/ADT/Optional.h.orig
-+++ include/llvm/ADT/Optional.h
-@@ -108,24 +108,6 @@ template <typename T, bool IsPodLike> struct OptionalS
-   }
- };
-
--#if !defined(__GNUC__) || defined(__clang__) // GCC up to GCC7 miscompiles this.
--/// Storage for trivially copyable types only.
--template <typename T> struct OptionalStorage<T, true> {
--  AlignedCharArrayUnion<T> storage;
--  bool hasVal = false;
--
--  OptionalStorage() = default;
--
--  OptionalStorage(const T &y) : hasVal(true) { new (storage.buffer) T(y); }
--  OptionalStorage &operator=(const T &y) {
--    *reinterpret_cast<T *>(storage.buffer) = y;
--    hasVal = true;
--    return *this;
--  }
--
--  void reset() { hasVal = false; }
--};
--#endif
- } // namespace optional_detail
-
- template <typename T> class Optional {
Index: devel/llvm/patches/patch-include_llvm_BinaryFormat_Dwarf_def
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-include_llvm_BinaryFormat_Dwarf_def,v
retrieving revision 1.3
diff -u -p -r1.3 patch-include_llvm_BinaryFormat_Dwarf_def
--- devel/llvm/patches/patch-include_llvm_BinaryFormat_Dwarf_def 11 Feb 2019 05:24:16 -0000 1.3
+++ devel/llvm/patches/patch-include_llvm_BinaryFormat_Dwarf_def 4 Jul 2019 15:26:11 -0000
@@ -5,7 +5,7 @@ implement -msave-args in clang/llvm, lik
 Index: include/llvm/BinaryFormat/Dwarf.def
 --- include/llvm/BinaryFormat/Dwarf.def.orig
 +++ include/llvm/BinaryFormat/Dwarf.def
-@@ -355,6 +355,8 @@ HANDLE_DW_AT(0x2133, GNU_addr_base, 0, GNU)
+@@ -365,6 +365,8 @@ HANDLE_DW_AT(0x2133, GNU_addr_base, 0, GNU)
  HANDLE_DW_AT(0x2134, GNU_pubnames, 0, GNU)
  HANDLE_DW_AT(0x2135, GNU_pubtypes, 0, GNU)
  HANDLE_DW_AT(0x2136, GNU_discriminator, 0, GNU)
Index: devel/llvm/patches/patch-include_llvm_CodeGen_AsmPrinter_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-include_llvm_CodeGen_AsmPrinter_h,v
retrieving revision 1.4
diff -u -p -r1.4 patch-include_llvm_CodeGen_AsmPrinter_h
--- devel/llvm/patches/patch-include_llvm_CodeGen_AsmPrinter_h 28 Jan 2019 06:27:28 -0000 1.4
+++ devel/llvm/patches/patch-include_llvm_CodeGen_AsmPrinter_h 4 Jul 2019 15:26:11 -0000
@@ -5,7 +5,7 @@ Use int3 trap padding between functions
 Index: include/llvm/CodeGen/AsmPrinter.h
 --- include/llvm/CodeGen/AsmPrinter.h.orig
 +++ include/llvm/CodeGen/AsmPrinter.h
-@@ -344,6 +344,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
+@@ -348,6 +348,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
    /// correctness.
    void EmitAlignment(unsigned NumBits, const GlobalObject *GV = nullptr) const;
 
@@ -17,7 +17,7 @@ Index: include/llvm/CodeGen/AsmPrinter.h
    /// Lower the specified LLVM Constant to an MCExpr.
    virtual const MCExpr *lowerConstant(const Constant *CV);
 
-@@ -401,6 +406,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
+@@ -408,6 +413,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
    virtual void EmitInstruction(const MachineInstr *) {
      llvm_unreachable("EmitInstruction not implemented");
    }
Index: devel/llvm/patches/patch-include_llvm_CodeGen_MachineFrameInfo_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-include_llvm_CodeGen_MachineFrameInfo_h,v
retrieving revision 1.3
diff -u -p -r1.3 patch-include_llvm_CodeGen_MachineFrameInfo_h
--- devel/llvm/patches/patch-include_llvm_CodeGen_MachineFrameInfo_h 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-include_llvm_CodeGen_MachineFrameInfo_h 4 Jul 2019 15:26:11 -0000
@@ -22,7 +22,7 @@ $OpenBSD: patch-include_llvm_CodeGen_Mac
 Index: include/llvm/CodeGen/MachineFrameInfo.h
 --- include/llvm/CodeGen/MachineFrameInfo.h.orig
 +++ include/llvm/CodeGen/MachineFrameInfo.h
-@@ -257,6 +257,13 @@ class MachineFrameInfo { (private)
+@@ -274,6 +274,15 @@ class MachineFrameInfo { (private)
    /// The frame index for the stack protector.
    int StackProtectorIdx = -1;
 
@@ -31,12 +31,14 @@ Index: include/llvm/CodeGen/MachineFrame
 +    unsigned Register = 0;
 +    /// Set to true if this function needs return protectors
 +    bool Needed = false;
++    /// Does the return protector cookie need to be stored in frame
++    bool NeedsStore = true;
 +  } RPI;
 +
    /// The frame index for the function context. Used for SjLj exceptions.
    int FunctionContextIdx = -1;
 
-@@ -333,6 +340,14 @@ class MachineFrameInfo { (private)
+@@ -354,6 +363,17 @@ class MachineFrameInfo { (private)
    int getStackProtectorIndex() const { return StackProtectorIdx; }
    void setStackProtectorIndex(int I) { StackProtectorIdx = I; }
    bool hasStackProtectorIndex() const { return StackProtectorIdx != -1; }
@@ -48,6 +50,9 @@ Index: include/llvm/CodeGen/MachineFrame
 +  /// Get / Set if this frame needs a return protector
 +  void setReturnProtectorNeeded(bool I) { RPI.Needed = I; }
 +  bool getReturnProtectorNeeded() const { return RPI.Needed; }
++  /// Get / Set if the return protector cookie needs to be stored in frame
++  void setReturnProtectorNeedsStore(bool I) { RPI.NeedsStore = I; }
++  bool getReturnProtectorNeedsStore() const { return RPI.NeedsStore; }
 
    /// Return the index for the function context object.
    /// This object is used for SjLj exceptions.
Index: devel/llvm/patches/patch-include_llvm_InitializePasses_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-include_llvm_InitializePasses_h,v
retrieving revision 1.2
diff -u -p -r1.2 patch-include_llvm_InitializePasses_h
--- devel/llvm/patches/patch-include_llvm_InitializePasses_h 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-include_llvm_InitializePasses_h 4 Jul 2019 15:26:11 -0000
@@ -21,7 +21,7 @@ remove these gadgets will continue throu
 Index: include/llvm/InitializePasses.h
 --- include/llvm/InitializePasses.h.orig
 +++ include/llvm/InitializePasses.h
-@@ -339,6 +339,7 @@ void initializeRegionViewerPass(PassRegistry&);
+@@ -345,6 +345,7 @@ void initializeRegionViewerPass(PassRegistry&);
  void initializeRegisterCoalescerPass(PassRegistry&);
  void initializeRenameIndependentSubregsPass(PassRegistry&);
  void initializeResetMachineFunctionPass(PassRegistry&);
Index: devel/llvm/patches/patch-lib_Bitcode_Reader_MetadataLoader_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Bitcode_Reader_MetadataLoader_cpp
diff -N devel/llvm/patches/patch-lib_Bitcode_Reader_MetadataLoader_cpp
--- devel/llvm/patches/patch-lib_Bitcode_Reader_MetadataLoader_cpp 30 Jan 2019 07:36:06 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-lib_Bitcode_Reader_MetadataLoader_cpp,v 1.1 2019/01/30 07:36:06 semarie Exp $
-https://github.com/llvm-mirror/llvm/commit/da1fb72bb305d6bc1f3899d541414146934bf80f
-Index: lib/Bitcode/Reader/MetadataLoader.cpp
---- lib/Bitcode/Reader/MetadataLoader.cpp.orig
-+++ lib/Bitcode/Reader/MetadataLoader.cpp
-@@ -1308,7 +1308,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMeta
-                            (Context, Tag, Name, File, Line, Scope, BaseType,
-                             SizeInBits, AlignInBits, OffsetInBits, Flags,
-                             Elements, RuntimeLang, VTableHolder, TemplateParams,
--                            Identifier));
-+                            Identifier, Discriminator));
-     if (!IsNotUsedInTypeRef && Identifier)
-       MetadataList.addTypeRef(*Identifier, *cast<DICompositeType>(CT));
-
Index: devel/llvm/patches/patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp,v
retrieving revision 1.7
diff -u -p -r1.7 patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp
--- devel/llvm/patches/patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp 28 Jan 2019 06:27:28 -0000 1.7
+++ devel/llvm/patches/patch-lib_CodeGen_AsmPrinter_AsmPrinter_cpp 4 Jul 2019 15:26:11 -0000
@@ -8,7 +8,7 @@ $OpenBSD: patch-lib_CodeGen_AsmPrinter_A
 Index: lib/CodeGen/AsmPrinter/AsmPrinter.cpp
 --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp.orig
 +++ lib/CodeGen/AsmPrinter/AsmPrinter.cpp
-@@ -651,7 +651,7 @@ void AsmPrinter::EmitFunctionHeader() {
+@@ -653,7 +653,7 @@ void AsmPrinter::EmitFunctionHeader() {
 
    EmitLinkage(&F, CurrentFnSym);
    if (MAI->hasFunctionAlignment())
@@ -17,7 +17,7 @@ Index: lib/CodeGen/AsmPrinter/AsmPrinter
 
    if (MAI->hasDotTypeDotSizeDirective())
      OutStreamer->EmitSymbolAttribute(CurrentFnSym, MCSA_ELF_TypeFunction);
-@@ -2036,6 +2036,31 @@ void AsmPrinter::EmitAlignment(unsigned NumBits, const
+@@ -2112,6 +2112,31 @@ void AsmPrinter::EmitAlignment(unsigned NumBits, const
  }
 
  //===----------------------------------------------------------------------===//
@@ -49,7 +49,7 @@ Index: lib/CodeGen/AsmPrinter/AsmPrinter
  // Constant emission.
  //===----------------------------------------------------------------------===//
 
-@@ -2803,11 +2828,15 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasi
+@@ -2879,11 +2904,15 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasi
      }
    }
 
Index: devel/llvm/patches/patch-lib_CodeGen_PrologEpilogInserter_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_CodeGen_PrologEpilogInserter_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_CodeGen_PrologEpilogInserter_cpp
--- devel/llvm/patches/patch-lib_CodeGen_PrologEpilogInserter_cpp 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-lib_CodeGen_PrologEpilogInserter_cpp 4 Jul 2019 15:26:11 -0000
@@ -22,7 +22,7 @@ $OpenBSD: patch-lib_CodeGen_PrologEpilog
 Index: lib/CodeGen/PrologEpilogInserter.cpp
 --- lib/CodeGen/PrologEpilogInserter.cpp.orig
 +++ lib/CodeGen/PrologEpilogInserter.cpp
-@@ -171,7 +171,11 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
+@@ -176,7 +176,11 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
    const Function &F = MF.getFunction();
    const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
    const TargetFrameLowering *TFI = MF.getSubtarget().getFrameLowering();
@@ -34,7 +34,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
    RS = TRI->requiresRegisterScavenging(MF) ? new RegScavenger() : nullptr;
    FrameIndexVirtualScavenging = TRI->requiresFrameIndexScavenging(MF);
    FrameIndexEliminationScavenging = (RS && !FrameIndexVirtualScavenging) ||
-@@ -206,6 +210,10 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
+@@ -211,6 +215,10 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
    if (!F.hasFnAttribute(Attribute::Naked))
      insertPrologEpilogCode(MF);
 
@@ -45,7 +45,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
    // Replace all MO_FrameIndex operands with physical register references
    // and actual offsets.
    //
-@@ -296,7 +304,9 @@ void PEI::calculateCallFrameInfo(MachineFunction &MF)
+@@ -301,7 +309,9 @@ void PEI::calculateCallFrameInfo(MachineFunction &MF)
  /// Compute the sets of entry and return blocks for saving and restoring
  /// callee-saved registers, and placing prolog and epilog code.
  void PEI::calculateSaveRestoreBlocks(MachineFunction &MF) {
@@ -56,7 +56,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
 
    // Even when we do not change any CSR, we still want to insert the
    // prologue and epilogue of the function.
-@@ -312,7 +322,18 @@ void PEI::calculateSaveRestoreBlocks(MachineFunction &
+@@ -317,7 +327,18 @@ void PEI::calculateSaveRestoreBlocks(MachineFunction &
      // epilogue.
      if (!RestoreBlock->succ_empty() || RestoreBlock->isReturnBlock())
        RestoreBlocks.push_back(RestoreBlock);
@@ -76,7 +76,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
    }
 
    // Save refs to entry and return blocks.
-@@ -323,6 +344,9 @@ void PEI::calculateSaveRestoreBlocks(MachineFunction &
+@@ -328,6 +349,9 @@ void PEI::calculateSaveRestoreBlocks(MachineFunction &
      if (MBB.isReturnBlock())
        RestoreBlocks.push_back(&MBB);
    }
@@ -86,7 +86,7 @@ Index: lib/CodeGen/PrologEpilogInserter.
  }
 
  static void assignCalleeSavedSpillSlots(MachineFunction &F,
-@@ -344,6 +368,10 @@ static void assignCalleeSavedSpillSlots(MachineFunctio
+@@ -349,6 +373,10 @@ static void assignCalleeSavedSpillSlots(MachineFunctio
 
    const TargetFrameLowering *TFI = F.getSubtarget().getFrameLowering();
    MachineFrameInfo &MFI = F.getFrameInfo();
Index: devel/llvm/patches/patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp
diff -N devel/llvm/patches/patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp
--- devel/llvm/patches/patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp 28 Jan 2019 06:27:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-$OpenBSD: patch-lib_CodeGen_SelectionDAG_DAGCombiner_cpp,v 1.1 2019/01/28 06:27:28 jca Exp $
-
-Revert "Revert r342183 "[DAGCombine] Fix crash when store merging created an
-extract_subvector with invalid index.""
-
-Index: lib/CodeGen/SelectionDAG/DAGCombiner.cpp
---- lib/CodeGen/SelectionDAG/DAGCombiner.cpp.orig
-+++ lib/CodeGen/SelectionDAG/DAGCombiner.cpp
-@@ -13727,17 +13727,24 @@ bool DAGCombiner::MergeStoresOfConstantsOrVecElts(
-              Val.getOpcode() == ISD::EXTRACT_SUBVECTOR)) {
-           SDValue Vec = Val.getOperand(0);
-           EVT MemVTScalarTy = MemVT.getScalarType();
-+          SDValue Idx = Val.getOperand(1);
-           // We may need to add a bitcast here to get types to line up.
-           if (MemVTScalarTy != Vec.getValueType()) {
-             unsigned Elts = Vec.getValueType().getSizeInBits() /
-                             MemVTScalarTy.getSizeInBits();
-+            if (Val.getValueType().isVector() && MemVT.isVector()) {
-+              unsigned IdxC = cast<ConstantSDNode>(Idx)->getZExtValue();
-+              unsigned NewIdx =
-+                  ((uint64_t)IdxC * MemVT.getVectorNumElements()) / Elts;
-+              Idx = DAG.getConstant(NewIdx, SDLoc(Val), Idx.getValueType());
-+            }
-             EVT NewVecTy =
-                 EVT::getVectorVT(*DAG.getContext(), MemVTScalarTy, Elts);
-             Vec = DAG.getBitcast(NewVecTy, Vec);
-           }
-           auto OpC = (MemVT.isVector()) ? ISD::EXTRACT_SUBVECTOR
-                                         : ISD::EXTRACT_VECTOR_ELT;
--          Val = DAG.getNode(OpC, SDLoc(Val), MemVT, Vec, Val.getOperand(1));
-+          Val = DAG.getNode(OpC, SDLoc(Val), MemVT, Vec, Idx);
-         }
-         Ops.push_back(Val);
-       }
Index: devel/llvm/patches/patch-lib_CodeGen_TargetLoweringBase_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_CodeGen_TargetLoweringBase_cpp,v
retrieving revision 1.5
diff -u -p -r1.5 patch-lib_CodeGen_TargetLoweringBase_cpp
--- devel/llvm/patches/patch-lib_CodeGen_TargetLoweringBase_cpp 28 Jan 2019 06:27:28 -0000 1.5
+++ devel/llvm/patches/patch-lib_CodeGen_TargetLoweringBase_cpp 4 Jul 2019 15:26:11 -0000
@@ -7,7 +7,7 @@ solve the crashes in the previous code.
 Index: lib/CodeGen/TargetLoweringBase.cpp
 --- lib/CodeGen/TargetLoweringBase.cpp.orig
 +++ lib/CodeGen/TargetLoweringBase.cpp
-@@ -1624,7 +1624,10 @@ Value *TargetLoweringBase::getIRStackGuard(IRBuilder<>
+@@ -1636,7 +1636,10 @@ Value *TargetLoweringBase::getIRStackGuard(IRBuilder<>
    if (getTargetMachine().getTargetTriple().isOSOpenBSD()) {
      Module &M = *IRB.GetInsertBlock()->getParent()->getParent();
      PointerType *PtrTy = Type::getInt8PtrTy(M.getContext());
Index: devel/llvm/patches/patch-lib_CodeGen_TargetPassConfig_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_CodeGen_TargetPassConfig_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_CodeGen_TargetPassConfig_cpp
--- devel/llvm/patches/patch-lib_CodeGen_TargetPassConfig_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_CodeGen_TargetPassConfig_cpp 4 Jul 2019 15:26:11 -0000
@@ -21,7 +21,7 @@ remove these gadgets will continue throu
 Index: lib/CodeGen/TargetPassConfig.cpp
 --- lib/CodeGen/TargetPassConfig.cpp.orig
 +++ lib/CodeGen/TargetPassConfig.cpp
-@@ -696,6 +696,8 @@ void TargetPassConfig::addISelPrepare() {
+@@ -737,6 +737,8 @@ void TargetPassConfig::addISelPrepare() {
    if (requiresCodeGenSCCOrder())
      addPass(new DummyCGSCCPass);
 
Index: devel/llvm/patches/patch-lib_MC_MCParser_AsmParser_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_MC_MCParser_AsmParser_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-lib_MC_MCParser_AsmParser_cpp
--- devel/llvm/patches/patch-lib_MC_MCParser_AsmParser_cpp 28 Jan 2019 15:34:22 -0000 1.6
+++ devel/llvm/patches/patch-lib_MC_MCParser_AsmParser_cpp 4 Jul 2019 15:26:11 -0000
@@ -11,7 +11,7 @@ a file directive.
 Index: lib/MC/MCParser/AsmParser.cpp
 --- lib/MC/MCParser/AsmParser.cpp.orig
 +++ lib/MC/MCParser/AsmParser.cpp
-@@ -874,6 +874,10 @@ bool AsmParser::Run(bool NoInitialTextSection, bool No
+@@ -878,6 +878,10 @@ bool AsmParser::Run(bool NoInitialTextSection, bool No
      (void)InsertResult;
    }
 
Index: devel/llvm/patches/patch-lib_Support_Unix_Threading_inc
===================================================================
RCS file: devel/llvm/patches/patch-lib_Support_Unix_Threading_inc
diff -N devel/llvm/patches/patch-lib_Support_Unix_Threading_inc
--- devel/llvm/patches/patch-lib_Support_Unix_Threading_inc 11 Feb 2019 05:24:16 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
-$OpenBSD: patch-lib_Support_Unix_Threading_inc,v 1.3 2019/02/11 05:24:16 jca Exp $
-
-Add OpenBSD support to be able to get the thread name
-
-Index: lib/Support/Unix/Threading.inc
---- lib/Support/Unix/Threading.inc.orig
-+++ lib/Support/Unix/Threading.inc
-@@ -203,6 +203,12 @@ void llvm::get_thread_name(SmallVectorImpl<char> &Name
-   ::pthread_getname_np(::pthread_self(), buf, len);
-
-   Name.append(buf, buf + strlen(buf));
-+#elif defined(__OpenBSD__)
-+  constexpr uint32_t len = get_max_thread_name_length_impl();
-+  char buf[len];
-+  ::pthread_get_name_np(::pthread_self(), buf, len);
-+
-+  Name.append(buf, buf + strlen(buf));
- #elif defined(__linux__)
- #if HAVE_PTHREAD_GETNAME_NP
-   constexpr uint32_t len = get_max_thread_name_length_impl();
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64AsmPrinter_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64AsmPrinter_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_AArch64_AArch64AsmPrinter_cpp
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64AsmPrinter_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64AsmPrinter_cpp 4 Jul 2019 15:26:11 -0000
@@ -5,9 +5,9 @@ Add retguard for arm64.
 Index: lib/Target/AArch64/AArch64AsmPrinter.cpp
 --- lib/Target/AArch64/AArch64AsmPrinter.cpp.orig
 +++ lib/Target/AArch64/AArch64AsmPrinter.cpp
-@@ -683,6 +683,19 @@ void AArch64AsmPrinter::EmitInstruction(const MachineI
-   case TargetOpcode::PATCHABLE_TAIL_CALL:
-     LowerPATCHABLE_TAIL_CALL(*MI);
+@@ -986,6 +986,19 @@ void AArch64AsmPrinter::EmitInstruction(const MachineI
+   case AArch64::SEH_EpilogEnd:
+     TS->EmitARM64WinCFIEpilogEnd();
      return;
 +
 +  case AArch64::RETGUARD_JMP_TRAP:
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64FrameLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64FrameLowering_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_AArch64_AArch64FrameLowering_cpp
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64FrameLowering_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64FrameLowering_cpp 4 Jul 2019 15:26:11 -0000
@@ -13,23 +13,41 @@ Index: lib/Target/AArch64/AArch64FrameLo
  #include "AArch64Subtarget.h"
  #include "AArch64TargetMachine.h"
  #include "MCTargetDesc/AArch64AddressingModes.h"
-@@ -1421,6 +1422,12 @@ void AArch64FrameLowering::determineCalleeSaves(Machin
-     if (produceCompactUnwindFrame(MF) && !SavedRegs.test(PairedReg))
-       SpillEstimate++;
-   }
+@@ -1975,6 +1976,30 @@ void AArch64FrameLowering::determineCalleeSaves(Machin
+                                 ? RegInfo->getBaseRegister()
+                                 : (unsigned)AArch64::NoRegister;
+
++  unsigned SpillEstimate = SavedRegs.count();
++  for (unsigned i = 0; CSRegs[i]; ++i) {
++    unsigned Reg = CSRegs[i];
++    unsigned PairedReg = CSRegs[i ^ 1];
++    if (Reg == BasePointerReg)
++      SpillEstimate++;
++    if (produceCompactUnwindFrame(MF) && !SavedRegs.test(PairedReg))
++      SpillEstimate++;
++  }
 +
-+  if (MFI.hasReturnProtectorRegister()) {
++  if (MFI.hasReturnProtectorRegister() && MFI.getReturnProtectorNeedsStore()) {
 +    SavedRegs.set(MFI.getReturnProtectorRegister());
 +    SpillEstimate++;
 +  }
 +
-   SpillEstimate += 2; // Conservatively include FP+LR in the estimate
-   unsigned StackEstimate = MFI.estimateStackSize(MF) + 8 * SpillEstimate;
-
-@@ -1523,4 +1530,8 @@ bool AArch64FrameLowering::enableStackSlotScavenging(
-     const MachineFunction &MF) const {
-   const AArch64FunctionInfo *AFI = MF.getInfo<AArch64FunctionInfo>();
-   return AFI->hasCalleeSaveStackFreeSpace();
++  SpillEstimate += 2; // Conservatively include FP+LR in the estimate
++  unsigned StackEstimate = MFI.estimateStackSize(MF) + 8 * SpillEstimate;
++
++  // The frame record needs to be created by saving the appropriate registers
++  if (hasFP(MF) || windowsRequiresStackProbe(MF, StackEstimate)) {
++    SavedRegs.set(AArch64::FP);
++    SavedRegs.set(AArch64::LR);
++  }
++
+   unsigned ExtraCSSpill = 0;
+   // Figure out which callee-saved registers to save/restore.
+   for (unsigned i = 0; CSRegs[i]; ++i) {
+@@ -2156,4 +2181,8 @@ unsigned AArch64FrameLowering::getWinEHFuncletFrameSiz
+   // This is the amount of stack a funclet needs to allocate.
+   return alignTo(CSSize + MF.getFrameInfo().getMaxCallFrameSize(),
+                  getStackAlignment());
 +}
 +
 +const ReturnProtectorLowering *AArch64FrameLowering::getReturnProtector() const {
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64ISelLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64ISelLowering_cpp,v
retrieving revision 1.9
diff -u -p -r1.9 patch-lib_Target_AArch64_AArch64ISelLowering_cpp
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64ISelLowering_cpp 28 Jan 2019 06:27:28 -0000 1.9
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64ISelLowering_cpp 4 Jul 2019 15:26:11 -0000
@@ -7,7 +7,7 @@ IR Stack Guard.
 Index: lib/Target/AArch64/AArch64ISelLowering.cpp
 --- lib/Target/AArch64/AArch64ISelLowering.cpp.orig
 +++ lib/Target/AArch64/AArch64ISelLowering.cpp
-@@ -11298,7 +11298,8 @@ void AArch64TargetLowering::ReplaceNodeResults(
+@@ -11559,7 +11559,8 @@ void AArch64TargetLowering::ReplaceNodeResults(
  }
 
  bool AArch64TargetLowering::useLoadStackGuardNode() const {
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64InstrInfo_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64InstrInfo_td,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_AArch64_AArch64InstrInfo_td
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64InstrInfo_td 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64InstrInfo_td 4 Jul 2019 15:26:11 -0000
@@ -5,7 +5,7 @@ Add retguard for arm64.
 Index: lib/Target/AArch64/AArch64InstrInfo.td
 --- lib/Target/AArch64/AArch64InstrInfo.td.orig
 +++ lib/Target/AArch64/AArch64InstrInfo.td
-@@ -418,6 +418,12 @@ def ADDlowTLS
+@@ -491,6 +491,12 @@ def ADDlowTLS
 
  } // isReMaterializable, isCodeGenOnly
 
Index: devel/llvm/patches/patch-lib_Target_AArch64_AArch64Subtarget_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_AArch64Subtarget_h,v
retrieving revision 1.4
diff -u -p -r1.4 patch-lib_Target_AArch64_AArch64Subtarget_h
--- devel/llvm/patches/patch-lib_Target_AArch64_AArch64Subtarget_h 28 Jan 2019 06:27:28 -0000 1.4
+++ devel/llvm/patches/patch-lib_Target_AArch64_AArch64Subtarget_h 4 Jul 2019 15:26:11 -0000
@@ -7,7 +7,7 @@ IR Stack Guard.
 Index: lib/Target/AArch64/AArch64Subtarget.h
 --- lib/Target/AArch64/AArch64Subtarget.h.orig
 +++ lib/Target/AArch64/AArch64Subtarget.h
-@@ -302,6 +302,7 @@ class AArch64Subtarget final : public AArch64GenSubtar
+@@ -371,6 +371,7 @@ class AArch64Subtarget final : public AArch64GenSubtar
    bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
    bool isTargetIOS() const { return TargetTriple.isiOS(); }
    bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
Index: devel/llvm/patches/patch-lib_Target_AArch64_CMakeLists_txt
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_AArch64_CMakeLists_txt,v
retrieving revision 1.1
diff -u -p -r1.1 patch-lib_Target_AArch64_CMakeLists_txt
--- devel/llvm/patches/patch-lib_Target_AArch64_CMakeLists_txt 21 Aug 2018 06:56:09 -0000 1.1
+++ devel/llvm/patches/patch-lib_Target_AArch64_CMakeLists_txt 4 Jul 2019 15:26:11 -0000
@@ -5,11 +5,11 @@ Add retguard for arm64.
 Index: lib/Target/AArch64/CMakeLists.txt
 --- lib/Target/AArch64/CMakeLists.txt.orig
 +++ lib/Target/AArch64/CMakeLists.txt
-@@ -47,6 +47,7 @@ add_llvm_target(AArch64CodeGen
+@@ -51,6 +51,7 @@ add_llvm_target(AArch64CodeGen
    AArch64PBQPRegAlloc.cpp
    AArch64RegisterBankInfo.cpp
    AArch64RegisterInfo.cpp
 +  AArch64ReturnProtectorLowering.cpp
    AArch64SelectionDAGInfo.cpp
+   AArch64SpeculationHardening.cpp
    AArch64StorePairSuppress.cpp
-   AArch64Subtarget.cpp
Index: devel/llvm/patches/patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp
diff -N devel/llvm/patches/patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp
--- devel/llvm/patches/patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp 28 Jan 2019 06:27:28 -0000 1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-$OpenBSD: patch-lib_Target_Mips_MCTargetDesc_MipsMCAsmInfo_cpp,v 1.8 2019/01/28 06:27:28 jca Exp $
-
-[mips] Enable using of integrated assembler in all cases.
-
-Index: lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
---- lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp.orig
-+++ lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
-@@ -50,21 +50,5 @@ MipsMCAsmInfo::MipsMCAsmInfo(const Triple &TheTriple)
-   ExceptionsType = ExceptionHandling::DwarfCFI;
-   DwarfRegNumForCFI = true;
-   HasMipsExpressions = true;
--
--  // Enable IAS by default for O32.
--  if (TheTriple.isMIPS32())
--    UseIntegratedAssembler = true;
--
--  // Enable IAS by default for Debian mips64/mips64el.
--  if (TheTriple.getEnvironment() == Triple::GNUABI64)
--    UseIntegratedAssembler = true;
--
--  // Enable IAS by default for Android mips64el that uses N64 ABI.
--  if (TheTriple.getArch() == Triple::mips64el && TheTriple.isAndroid())
--    UseIntegratedAssembler = true;
--
--  // Enable IAS by default for FreeBSD / OpenBSD mips64/mips64el.
--  if (TheTriple.isOSFreeBSD() ||
--      TheTriple.isOSOpenBSD())
--    UseIntegratedAssembler = true;
-+  UseIntegratedAssembler = true;
- }
Index: devel/llvm/patches/patch-lib_Target_PowerPC_PPCISelLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_PowerPC_PPCISelLowering_cpp,v
retrieving revision 1.4
diff -u -p -r1.4 patch-lib_Target_PowerPC_PPCISelLowering_cpp
--- devel/llvm/patches/patch-lib_Target_PowerPC_PPCISelLowering_cpp 20 Feb 2019 00:24:11 -0000 1.4
+++ devel/llvm/patches/patch-lib_Target_PowerPC_PPCISelLowering_cpp 4 Jul 2019 15:26:11 -0000
@@ -10,7 +10,7 @@ compiler generate code that only uses al
 Index: lib/Target/PowerPC/PPCISelLowering.cpp
 --- lib/Target/PowerPC/PPCISelLowering.cpp.orig
 +++ lib/Target/PowerPC/PPCISelLowering.cpp
-@@ -13921,6 +13921,14 @@ bool PPCTargetLowering::allowsMisalignedMemoryAccesses
+@@ -14204,6 +14204,14 @@ bool PPCTargetLowering::allowsMisalignedMemoryAccesses
    if (VT == MVT::ppcf128)
      return false;
 
Index: devel/llvm/patches/patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp
diff -N devel/llvm/patches/patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp
--- devel/llvm/patches/patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp 28 Jan 2019 06:27:28 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,84 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_AsmParser_SparcAsmParser_cpp,v 1.6 2019/01/28 06:27:28 jca Exp $
-
-[Sparc] Add membar assembler tags
-
-Index: lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
---- lib/Target/Sparc/AsmParser/SparcAsmParser.cpp.orig
-+++ lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
-@@ -78,6 +78,8 @@ class SparcAsmParser : public MCTargetAsmParser {
-   // Custom parse functions for Sparc specific operands.
-   OperandMatchResultTy parseMEMOperand(OperandVector &Operands);
-
-+  OperandMatchResultTy parseMembarTag(OperandVector &Operands);
-+
-   OperandMatchResultTy parseOperand(OperandVector &Operands, StringRef Name);
-
-   OperandMatchResultTy
-@@ -256,6 +258,7 @@ class SparcOperand : public MCParsedAsmOperand { (publ
-   bool isMem() const override { return isMEMrr() || isMEMri(); }
-   bool isMEMrr() const { return Kind == k_MemoryReg; }
-   bool isMEMri() const { return Kind == k_MemoryImm; }
-+  bool isMembarTag() const { return Kind == k_Immediate; }
-
-   bool isIntReg() const {
-     return (Kind == k_Register && Reg.Kind == rk_IntReg);
-@@ -366,6 +369,12 @@ class SparcOperand : public MCParsedAsmOperand { (publ
-     addExpr(Inst, Expr);
-   }
-
-+  void addMembarTagOperands(MCInst &Inst, unsigned N) const {
-+    assert(N == 1 && "Invalid number of operands!");
-+    const MCExpr *Expr = getImm();
-+    addExpr(Inst, Expr);
-+  }
-+
-   static std::unique_ptr<SparcOperand> CreateToken(StringRef Str, SMLoc S) {
-     auto Op = make_unique<SparcOperand>(k_Token);
-     Op->Tok.Data = Str.data();
-@@ -739,6 +748,46 @@ SparcAsmParser::parseMEMOperand(OperandVector &Operand
-       Offset->isImm() ? SparcOperand::MorphToMEMri(BaseReg, std::move(Offset))
-                       : SparcOperand::MorphToMEMrr(BaseReg, std::move(Offset)));
-
-+  return MatchOperand_Success;
-+}
-+
-+OperandMatchResultTy SparcAsmParser::parseMembarTag(OperandVector &Operands) {
-+  SMLoc S = Parser.getTok().getLoc();
-+  const MCExpr *EVal;
-+  unsigned ImmVal = 0;
-+
-+  while (getLexer().getKind() == AsmToken::Hash) {
-+    SMLoc TagStart = getLexer().getLoc();
-+    Parser.Lex(); // Eat the '#'.
-+    unsigned MaskVal = StringSwitch<unsigned>(Parser.getTok().getString())
-+      .Case("LoadLoad", 0x1)
-+      .Case("StoreLoad", 0x2)
-+      .Case("LoadStore", 0x4)
-+      .Case("StoreStore", 0x8)
-+      .Case("Lookaside", 0x10)
-+      .Case("MemIssue", 0x20)
-+      .Case("Sync", 0x40)
-+      .Default(0);
-+
-+    Parser.Lex(); // Eat the identifier token.
-+
-+    if (!MaskVal) {
-+      Error(TagStart, "unknown membar tag");
-+      return MatchOperand_ParseFail;
-+    }
-+
-+    ImmVal |= MaskVal;
-+
-+    if (getLexer().getKind() == AsmToken::Pipe)
-+      Parser.Lex(); // Eat the '|'.
-+  }
-+
-+  if (!ImmVal)
-+    return MatchOperand_NoMatch;
-+
-+  EVal = MCConstantExpr::create(ImmVal, getContext());
-+  SMLoc E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1);
-+  Operands.push_back(SparcOperand::CreateImm(EVal, S, E));
-   return MatchOperand_Success;
- }
-
Index: devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp
diff -N devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp
--- devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp 28 Jan 2019 06:27:28 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_cpp,v 1.4 2019/01/28 06:27:28 jca Exp $
-
-[Sparc] Add membar assembler tags
-
-Index: lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp
---- lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp.orig
-+++ lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp
-@@ -195,3 +195,26 @@ bool SparcInstPrinter::printGetPCX(const MCInst *MI, u
-   llvm_unreachable("FIXME: Implement SparcInstPrinter::printGetPCX.");
-   return true;
- }
-+
-+void SparcInstPrinter::printMembarTag(const MCInst *MI, int opNum,
-+                                      const MCSubtargetInfo &STI,
-+                                      raw_ostream &O) {
-+  static const char *const TagNames[] = {
-+      "#LoadLoad",  "#StoreLoad", "#LoadStore", "#StoreStore",
-+      "#Lookaside", "#MemIssue",  "#Sync"};
-+
-+  unsigned Imm = MI->getOperand(opNum).getImm();
-+
-+  if (Imm > 127) {
-+    O << Imm;
-+    return;
-+  }
-+
-+  bool First = true;
-+  for (unsigned i = 0; i < sizeof(TagNames) / sizeof(char *); i++) {
-+    if (Imm & (1 << i)) {
-+      O << (First ? "" : " | ") << TagNames[i];
-+      First = false;
-+    }
-+  }
-+}
Index: devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h
diff -N devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h
--- devel/llvm/patches/patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h 14 Nov 2018 09:07:41 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_InstPrinter_SparcInstPrinter_h,v 1.3 2018/11/14 09:07:41 ajacoutot Exp $
-
-[Sparc] Add membar assembler tags
-
-Index: lib/Target/Sparc/InstPrinter/SparcInstPrinter.h
---- lib/Target/Sparc/InstPrinter/SparcInstPrinter.h.orig
-+++ lib/Target/Sparc/InstPrinter/SparcInstPrinter.h
-@@ -49,6 +49,8 @@ class SparcInstPrinter : public MCInstPrinter { (publi
-                       raw_ostream &OS);
-   bool printGetPCX(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
-                    raw_ostream &OS);
-+  void printMembarTag(const MCInst *MI, int opNum, const MCSubtargetInfo &STI,
-+                      raw_ostream &O);
- };
- } // end namespace llvm
-
Index: devel/llvm/patches/patch-lib_Target_Sparc_SparcISelLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_Sparc_SparcISelLowering_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_Target_Sparc_SparcISelLowering_cpp
--- devel/llvm/patches/patch-lib_Target_Sparc_SparcISelLowering_cpp 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-lib_Target_Sparc_SparcISelLowering_cpp 4 Jul 2019 15:26:11 -0000
@@ -1,51 +1,16 @@
 $OpenBSD: patch-lib_Target_Sparc_SparcISelLowering_cpp,v 1.3 2019/01/28 06:27:28 jca Exp $
 
 - Use a 64-bit register when required
-- [Sparc] Use float register for integer constrained with "f" in inline asm
-
-  Constraining an integer value to a floating point register using "f"
-  causes an llvm_unreachable to trigger. This patch allows i32 integers
-  to be placed in a single precision float register and i64 integers to
-  be placed in a double precision float register. This matches the behavior
-  of GCC.
 
 Index: lib/Target/Sparc/SparcISelLowering.cpp
 --- lib/Target/Sparc/SparcISelLowering.cpp.orig
 +++ lib/Target/Sparc/SparcISelLowering.cpp
-@@ -3491,26 +3491,28 @@ SparcTargetLowering::getRegForInlineAsmConstraint(cons
+@@ -3258,6 +3258,8 @@ SparcTargetLowering::getRegForInlineAsmConstraint(cons
      case 'r':
        if (VT == MVT::v2i32)
          return std::make_pair(0U, &SP::IntPairRegClass);
 +      else if (VT == MVT::i64 && Subtarget->is64Bit())
-+       return std::make_pair(0U, &SP::I64RegsRegClass);
++ return std::make_pair(0U, &SP::I64RegsRegClass);
        else
          return std::make_pair(0U, &SP::IntRegsRegClass);
      case 'f':
--      if (VT == MVT::f32)
-+      if (VT == MVT::f32 || VT == MVT::i32)
-         return std::make_pair(0U, &SP::FPRegsRegClass);
--      else if (VT == MVT::f64)
-+      else if (VT == MVT::f64 || VT == MVT::i64)
-         return std::make_pair(0U, &SP::LowDFPRegsRegClass);
-       else if (VT == MVT::f128)
-         return std::make_pair(0U, &SP::LowQFPRegsRegClass);
--      llvm_unreachable("Unknown ValueType for f-register-type!");
--      break;
-+      // This will generate an error message
-+      return std::make_pair(0U, nullptr);
-     case 'e':
--      if (VT == MVT::f32)
-+      if (VT == MVT::f32 || VT == MVT::i32)
-         return std::make_pair(0U, &SP::FPRegsRegClass);
--      else if (VT == MVT::f64)
-+      else if (VT == MVT::f64 || VT == MVT::i64 )
-         return std::make_pair(0U, &SP::DFPRegsRegClass);
-       else if (VT == MVT::f128)
-         return std::make_pair(0U, &SP::QFPRegsRegClass);
--      llvm_unreachable("Unknown ValueType for e-register-type!");
--      break;
-+      // This will generate an error message
-+      return std::make_pair(0U, nullptr);
-     }
-   } else if (!Constraint.empty() && Constraint.size() <= 5
-               && Constraint[0] == '{' && *(Constraint.end()-1) == '}') {
Index: devel/llvm/patches/patch-lib_Target_Sparc_SparcInstr64Bit_td
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_SparcInstr64Bit_td
diff -N devel/llvm/patches/patch-lib_Target_Sparc_SparcInstr64Bit_td
--- devel/llvm/patches/patch-lib_Target_Sparc_SparcInstr64Bit_td 26 Oct 2017 10:05:55 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_SparcInstr64Bit_td,v 1.5 2017/10/26 10:05:55 ajacoutot Exp $
-
-[Sparc] allow tls_add/tls_call syntax in assembler parser
-
-Index: lib/Target/Sparc/SparcInstr64Bit.td
---- lib/Target/Sparc/SparcInstr64Bit.td.orig
-+++ lib/Target/Sparc/SparcInstr64Bit.td
-@@ -239,7 +239,7 @@ let Predicates = [Is64Bit] in {
- let DecoderMethod = "DecodeLoadInt" in
-   defm LDX   : Load<"ldx", 0b001011, load, I64Regs, i64>;
-
--let mayLoad = 1, isCodeGenOnly = 1, isAsmParserOnly = 1 in
-+let mayLoad = 1, isAsmParserOnly = 1 in
-   def TLS_LDXrr : F3_1<3, 0b001011,
-                        (outs IntRegs:$dst), (ins MEMrr:$addr, TLSSym:$sym),
-                        "ldx [$addr], $dst, $sym",
Index: devel/llvm/patches/patch-lib_Target_Sparc_SparcInstrInfo_td
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_Sparc_SparcInstrInfo_td
diff -N devel/llvm/patches/patch-lib_Target_Sparc_SparcInstrInfo_td
--- devel/llvm/patches/patch-lib_Target_Sparc_SparcInstrInfo_td 28 Jan 2019 06:27:28 -0000 1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,43 +0,0 @@
-$OpenBSD: patch-lib_Target_Sparc_SparcInstrInfo_td,v 1.8 2019/01/28 06:27:28 jca Exp $
-
-- [Sparc] allow tls_add/tls_call syntax in assembler parser
-- [Sparc] Add membar assembler tags
-
-Index: lib/Target/Sparc/SparcInstrInfo.td
---- lib/Target/Sparc/SparcInstrInfo.td.orig
-+++ lib/Target/Sparc/SparcInstrInfo.td
-@@ -121,6 +121,16 @@ def MEMri : Operand<iPTR> {
-
- def TLSSym : Operand<iPTR>;
-
-+def SparcMembarTagAsmOperand : AsmOperandClass {
-+  let Name = "MembarTag";
-+  let ParserMethod = "parseMembarTag";
-+}
-+
-+def MembarTag : Operand<i32> {
-+  let PrintMethod = "printMembarTag";
-+  let ParserMatchClass = SparcMembarTagAsmOperand;
-+}
-+
- // Branch targets have OtherVT type.
- def brtarget : Operand<OtherVT> {
-   let EncoderMethod = "getBranchTargetOpValue";
-@@ -1316,7 +1326,7 @@ let Defs = [FCC0], rd = 0, isCodeGenOnly = 1 in {
- //===----------------------------------------------------------------------===//
- // Instructions for Thread Local Storage(TLS).
- //===----------------------------------------------------------------------===//
--let isCodeGenOnly = 1, isAsmParserOnly = 1 in {
-+let isAsmParserOnly = 1 in {
- def TLS_ADDrr : F3_1<2, 0b000000,
-                     (outs IntRegs:$rd),
-                     (ins IntRegs:$rs1, IntRegs:$rs2, TLSSym:$sym),
-@@ -1511,7 +1521,7 @@ def : Pat<(ctpop i32:$src),
-           (POPCrr (SRLri $src, 0))>;
-
- let Predicates = [HasV9], hasSideEffects = 1, rd = 0, rs1 = 0b01111 in
-- def MEMBARi : F3_2<2, 0b101000, (outs), (ins simm13Op:$simm13),
-+ def MEMBARi : F3_2<2, 0b101000, (outs), (ins MembarTag:$simm13),
-                     "membar $simm13", []>;
-
- // The CAS instruction, unlike other instructions, only comes in a
Index: devel/llvm/patches/patch-lib_Target_X86_AsmParser_X86AsmParser_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_AsmParser_X86AsmParser_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_AsmParser_X86AsmParser_cpp
--- devel/llvm/patches/patch-lib_Target_X86_AsmParser_X86AsmParser_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_AsmParser_X86AsmParser_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/AsmParser/X86AsmParser.cpp
---- lib/Target/X86/AsmParser/X86AsmParser.cpp.orig
-+++ lib/Target/X86/AsmParser/X86AsmParser.cpp
-@@ -1109,8 +1109,7 @@ bool X86AsmParser::ParseRegister(unsigned &RegNo,
-   }
-
-   // Parse "%st" as "%st(0)" and "%st(1)", which is multiple tokens.
--  if (RegNo == 0 && (Tok.getString() == "st" || Tok.getString() == "ST")) {
--    RegNo = X86::ST0;
-+  if (RegNo == X86::ST0) {
-     Parser.Lex(); // Eat 'st'
-
-     // Check to see if we have '(4)' after %st.
Index: devel/llvm/patches/patch-lib_Target_X86_CMakeLists_txt
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_CMakeLists_txt,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_Target_X86_CMakeLists_txt
--- devel/llvm/patches/patch-lib_Target_X86_CMakeLists_txt 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-lib_Target_X86_CMakeLists_txt 4 Jul 2019 15:26:11 -0000
@@ -10,7 +10,7 @@ $OpenBSD: patch-lib_Target_X86_CMakeList
 Index: lib/Target/X86/CMakeLists.txt
 --- lib/Target/X86/CMakeLists.txt.orig
 +++ lib/Target/X86/CMakeLists.txt
-@@ -31,6 +31,7 @@ set(sources
+@@ -34,6 +34,7 @@ set(sources
    X86ExpandPseudo.cpp
    X86FastISel.cpp
    X86FixupBWInsts.cpp
@@ -18,7 +18,7 @@ Index: lib/Target/X86/CMakeLists.txt
    X86FixupLEAs.cpp
    X86AvoidStoreForwardingBlocks.cpp
    X86FixupSetCC.cpp
-@@ -55,6 +56,7 @@ set(sources
+@@ -59,6 +60,7 @@ set(sources
    X86RegisterBankInfo.cpp
    X86RegisterInfo.cpp
    X86RetpolineThunks.cpp
Index: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp
--- devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
---- lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp.orig
-+++ lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
-@@ -200,3 +200,14 @@ void X86ATTInstPrinter::printU8Imm(const MCInst *MI, u
-   O << markup("<imm:") << '$' << formatImm(MI->getOperand(Op).getImm() & 0xff)
-     << markup(">");
- }
-+
-+void X86ATTInstPrinter::printSTiRegOperand(const MCInst *MI, unsigned OpNo,
-+                                           raw_ostream &OS) {
-+  const MCOperand &Op = MI->getOperand(OpNo);
-+  unsigned Reg = Op.getReg();
-+  // Override the default printing to print st(0) instead st.
-+  if (Reg == X86::ST0)
-+    OS << markup("<reg:") << "%st(0)" << markup(">");
-+  else
-+    printRegName(OS, Reg);
-+}
Index: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h
diff -N devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h
--- devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_InstPrinter_X86ATTInstPrinter_h,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/InstPrinter/X86ATTInstPrinter.h
---- lib/Target/X86/InstPrinter/X86ATTInstPrinter.h.orig
-+++ lib/Target/X86/InstPrinter/X86ATTInstPrinter.h
-@@ -44,6 +44,7 @@ class X86ATTInstPrinter final : public X86InstPrinterC
-   void printSrcIdx(const MCInst *MI, unsigned Op, raw_ostream &O);
-   void printDstIdx(const MCInst *MI, unsigned Op, raw_ostream &O);
-   void printU8Imm(const MCInst *MI, unsigned Op, raw_ostream &OS);
-+  void printSTiRegOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
-
-   void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
-     printMemReference(MI, OpNo, O);
Index: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp
--- devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
---- lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp.orig
-+++ lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
-@@ -160,3 +160,14 @@ void X86IntelInstPrinter::printU8Imm(const MCInst *MI,
-
-   O << formatImm(MI->getOperand(Op).getImm() & 0xff);
- }
-+
-+void X86IntelInstPrinter::printSTiRegOperand(const MCInst *MI, unsigned OpNo,
-+                                            raw_ostream &OS) {
-+  const MCOperand &Op = MI->getOperand(OpNo);
-+  unsigned Reg = Op.getReg();
-+  // Override the default printing to print st(0) instead st.
-+  if (Reg == X86::ST0)
-+    OS << "st(0)";
-+  else
-+    printRegName(OS, Reg);
-+}
Index: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h
diff -N devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h
--- devel/llvm/patches/patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_InstPrinter_X86IntelInstPrinter_h,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/InstPrinter/X86IntelInstPrinter.h
---- lib/Target/X86/InstPrinter/X86IntelInstPrinter.h.orig
-+++ lib/Target/X86/InstPrinter/X86IntelInstPrinter.h
-@@ -39,6 +39,7 @@ class X86IntelInstPrinter final : public X86InstPrinte
-   void printSrcIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
-   void printDstIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
-   void printU8Imm(const MCInst *MI, unsigned Op, raw_ostream &O);
-+  void printSTiRegOperand(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
-
-   void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
-     printMemReference(MI, OpNo, O);
Index: devel/llvm/patches/patch-lib_Target_X86_X86FixupGadgets_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86FixupGadgets_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_Target_X86_X86FixupGadgets_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86FixupGadgets_cpp 24 Feb 2019 20:53:56 -0000 1.3
+++ devel/llvm/patches/patch-lib_Target_X86_X86FixupGadgets_cpp 4 Jul 2019 15:26:11 -0000
@@ -10,7 +10,7 @@ $OpenBSD: patch-lib_Target_X86_X86FixupG
 Index: lib/Target/X86/X86FixupGadgets.cpp
 --- lib/Target/X86/X86FixupGadgets.cpp.orig
 +++ lib/Target/X86/X86FixupGadgets.cpp
-@@ -0,0 +1,720 @@
+@@ -0,0 +1,670 @@
 +//===-- X86FixupGadgets.cpp - Fixup Instructions that make ROP Gadgets ----===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -212,53 +212,6 @@ Index: lib/Target/X86/X86FixupGadgets.cp
 +    case X86::ADD32rr_DB:
 +    case X86::ADD16rr_DB:
 +      goto Handle_MRMDestReg;
-+    case X86::ACQUIRE_MOV8rm:
-+    case X86::ACQUIRE_MOV16rm:
-+    case X86::ACQUIRE_MOV32rm:
-+    case X86::ACQUIRE_MOV64rm:
-+      goto Handle_MRMSrcMem;
-+    case X86::RELEASE_MOV8mr:
-+    case X86::RELEASE_MOV16mr:
-+    case X86::RELEASE_MOV32mr:
-+    case X86::RELEASE_MOV64mr:
-+    case X86::RELEASE_ADD8mr:
-+    case X86::RELEASE_ADD32mr:
-+    case X86::RELEASE_ADD64mr:
-+    case X86::RELEASE_AND8mr:
-+    case X86::RELEASE_AND32mr:
-+    case X86::RELEASE_AND64mr:
-+    case X86::RELEASE_OR8mr:
-+    case X86::RELEASE_OR32mr:
-+    case X86::RELEASE_OR64mr:
-+    case X86::RELEASE_XOR8mr:
-+    case X86::RELEASE_XOR32mr:
-+    case X86::RELEASE_XOR64mr:
-+      goto Handle_MRMDestMem;
-+    case X86::RELEASE_MOV8mi:
-+    case X86::RELEASE_MOV16mi:
-+    case X86::RELEASE_MOV32mi:
-+    case X86::RELEASE_ADD8mi:
-+    case X86::RELEASE_MOV64mi32:
-+    case X86::RELEASE_ADD32mi:
-+    case X86::RELEASE_ADD64mi32:
-+    case X86::RELEASE_AND8mi:
-+    case X86::RELEASE_AND32mi:
-+    case X86::RELEASE_AND64mi32:
-+    case X86::RELEASE_OR8mi:
-+    case X86::RELEASE_OR32mi:
-+    case X86::RELEASE_OR64mi32:
-+    case X86::RELEASE_XOR8mi:
-+    case X86::RELEASE_XOR32mi:
-+    case X86::RELEASE_XOR64mi32:
-+    case X86::RELEASE_INC8m:
-+    case X86::RELEASE_INC16m:
-+    case X86::RELEASE_INC32m:
-+    case X86::RELEASE_INC64m:
-+    case X86::RELEASE_DEC8m:
-+    case X86::RELEASE_DEC16m:
-+    case X86::RELEASE_DEC32m:
-+    case X86::RELEASE_DEC64m:
-+      goto Handle_MRMXm;
 +    case X86::ADD16ri_DB:
 +    case X86::ADD32ri_DB:
 +    case X86::ADD64ri32_DB:
@@ -281,7 +234,6 @@ Index: lib/Target/X86/X86FixupGadgets.cp
 +    break;
 +  }
 +  case X86II::MRMDestMem: {
-+  Handle_MRMDestMem:
 +    checkSIB(MI, CurOp, info);
 +    unsigned opcode = MI.getOpcode();
 +    if (opcode == X86::MOVNTImr || opcode == X86::MOVNTI_64mr)
@@ -289,7 +241,6 @@ Index: lib/Target/X86/X86FixupGadgets.cp
 +    break;
 +  }
 +  case X86II::MRMSrcMem: {
-+  Handle_MRMSrcMem:
 +    CurOp += 1;
 +    if (HasVEX_4V)
 +      CurOp += 1;
@@ -317,7 +268,6 @@ Index: lib/Target/X86/X86FixupGadgets.cp
 +  case X86II::MRM5m:
 +  case X86II::MRM6m:
 +  case X86II::MRM7m: {
-+  Handle_MRMXm:
 +    if (HasVEX_4V)
 +      CurOp += 1;
 +    if (HasEVEX_K)
Index: devel/llvm/patches/patch-lib_Target_X86_X86FrameLowering_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86FrameLowering_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-lib_Target_X86_X86FrameLowering_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86FrameLowering_cpp 11 Feb 2019 05:24:16 -0000 1.6
+++ devel/llvm/patches/patch-lib_Target_X86_X86FrameLowering_cpp 4 Jul 2019 15:26:11 -0000
@@ -58,7 +58,7 @@ Index: lib/Target/X86/X86FrameLowering.c
  }
 
  static unsigned getSUBriOpcode(unsigned IsLP64, int64_t Imm) {
-@@ -871,6 +874,24 @@ void X86FrameLowering::BuildStackAlignAND(MachineBasic
+@@ -872,6 +875,24 @@ void X86FrameLowering::BuildStackAlignAND(MachineBasic
    MI->getOperand(3).setIsDead();
  }
 
@@ -83,7 +83,7 @@ Index: lib/Target/X86/X86FrameLowering.c
  /// emitPrologue - Push callee-saved registers onto the stack, which
  /// automatically adjust the stack pointer. Adjust the stack pointer to allocate
  /// space for local variables. Also emit labels used by the exception handler to
-@@ -1153,6 +1174,43 @@ void X86FrameLowering::emitPrologue(MachineFunction &M
+@@ -1145,6 +1166,43 @@ void X86FrameLowering::emitPrologue(MachineFunction &M
                                      nullptr, DwarfFramePtr));
        }
 
@@ -127,7 +127,7 @@ Index: lib/Target/X86/X86FrameLowering.c
        if (NeedsWinFPO) {
          // .cv_fpo_setframe $FramePtr
          HasWinCFI = true;
-@@ -1618,20 +1676,6 @@ void X86FrameLowering::emitEpilogue(MachineFunction &M
+@@ -1626,20 +1684,6 @@ void X86FrameLowering::emitEpilogue(MachineFunction &M
    }
    uint64_t SEHStackAllocAmt = NumBytes;
 
@@ -148,7 +148,7 @@ Index: lib/Target/X86/X86FrameLowering.c
    MachineBasicBlock::iterator FirstCSPop = MBBI;
    // Skip the callee-saved pop instructions.
    while (MBBI != MBB.begin()) {
-@@ -1701,6 +1745,28 @@ void X86FrameLowering::emitEpilogue(MachineFunction &M
+@@ -1709,6 +1753,28 @@ void X86FrameLowering::emitEpilogue(MachineFunction &M
      --MBBI;
    }
 
@@ -177,7 +177,7 @@ Index: lib/Target/X86/X86FrameLowering.c
    // Windows unwinder will not invoke function's exception handler if IP is
    // either in prologue or in epilogue.  This behavior causes a problem when a
    // call immediately precedes an epilogue, because the return address points
-@@ -1789,6 +1855,8 @@ int X86FrameLowering::getFrameIndexReference(const Mac
+@@ -1797,6 +1863,8 @@ int X86FrameLowering::getFrameIndexReference(const Mac
             "FPDelta isn't aligned per the Win64 ABI!");
    }
 
@@ -186,7 +186,7 @@ Index: lib/Target/X86/X86FrameLowering.c
 
    if (TRI->hasBasePointer(MF)) {
      assert(HasFP && "VLAs and dynamic stack realign, but no FP?!");
-@@ -3153,4 +3221,8 @@ void X86FrameLowering::processFunctionBeforeFrameFinal
+@@ -3168,4 +3236,8 @@ void X86FrameLowering::processFunctionBeforeFrameFinal
    addFrameReference(BuildMI(MBB, MBBI, DL, TII.get(X86::MOV64mi32)),
                      UnwindHelpFI)
        .addImm(-2);
Index: devel/llvm/patches/patch-lib_Target_X86_X86ISelLowering_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_X86ISelLowering_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_X86ISelLowering_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86ISelLowering_cpp 20 Feb 2019 00:24:11 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_X86ISelLowering_cpp,v 1.6 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/X86ISelLowering.cpp
---- lib/Target/X86/X86ISelLowering.cpp.orig
-+++ lib/Target/X86/X86ISelLowering.cpp
-@@ -40619,6 +40619,20 @@ X86TargetLowering::getRegForInlineAsmConstraint(const
-       return Res;
-     }
-
-+    // dirflag -> DF
-+    if (StringRef("{dirflag}").equals_lower(Constraint)) {
-+      Res.first = X86::DF;
-+      Res.second = &X86::DFCCRRegClass;
-+      return Res;
-+    }
-+
-+    // fpsr -> FPSW
-+    if (StringRef("{fpsr}").equals_lower(Constraint)) {
-+      Res.first = X86::FPSW;
-+      Res.second = &X86::FPCCRRegClass;
-+      return Res;
-+    }
-+
-     // 'A' means [ER]AX + [ER]DX.
-     if (Constraint == "A") {
-       if (Subtarget.is64Bit()) {
Index: devel/llvm/patches/patch-lib_Target_X86_X86InstrCompiler_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86InstrCompiler_td,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_X86_X86InstrCompiler_td
--- devel/llvm/patches/patch-lib_Target_X86_X86InstrCompiler_td 24 Feb 2019 20:53:56 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_X86_X86InstrCompiler_td 4 Jul 2019 15:26:11 -0000
@@ -22,7 +22,7 @@ $OpenBSD: patch-lib_Target_X86_X86InstrC
 Index: lib/Target/X86/X86InstrCompiler.td
 --- lib/Target/X86/X86InstrCompiler.td.orig
 +++ lib/Target/X86/X86InstrCompiler.td
-@@ -267,6 +267,25 @@ def MORESTACK_RET_RESTORE_R10 : I<0, Pseudo, (outs), (
+@@ -264,6 +264,25 @@ def MORESTACK_RET_RESTORE_R10 : I<0, Pseudo, (outs), (
  }
 
  //===----------------------------------------------------------------------===//
Index: devel/llvm/patches/patch-lib_Target_X86_X86InstrFPStack_td
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_X86InstrFPStack_td
diff -N devel/llvm/patches/patch-lib_Target_X86_X86InstrFPStack_td
--- devel/llvm/patches/patch-lib_Target_X86_X86InstrFPStack_td 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,300 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_X86InstrFPStack_td,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/X86InstrFPStack.td
---- lib/Target/X86/X86InstrFPStack.td.orig
-+++ lib/Target/X86/X86InstrFPStack.td
-@@ -230,7 +230,7 @@ def _FI32m  : FPI<0xDA, fp, (outs), (ins i32mem:$src),
- } // mayLoad = 1, hasSideEffects = 1
- }
-
--let Defs = [FPSW] in {
-+let Defs = [FPSW], Uses = [FPCW] in {
- // FPBinary_rr just defines pseudo-instructions, no need to set a scheduling
- // resources.
- let hasNoSchedulingInfo = 1 in {
-@@ -258,42 +258,42 @@ defm DIVR: FPBinary<fdiv, MRM7m, "divr", 0>;
- } // Defs = [FPSW]
-
- class FPST0rInst<Format fp, string asm>
--  : FPI<0xD8, fp, (outs), (ins RST:$op), asm>;
-+  : FPI<0xD8, fp, (outs), (ins RSTi:$op), asm>;
- class FPrST0Inst<Format fp, string asm>
--  : FPI<0xDC, fp, (outs), (ins RST:$op), asm>;
-+  : FPI<0xDC, fp, (outs), (ins RSTi:$op), asm>;
- class FPrST0PInst<Format fp, string asm>
--  : FPI<0xDE, fp, (outs), (ins RST:$op), asm>;
-+  : FPI<0xDE, fp, (outs), (ins RSTi:$op), asm>;
-
- // NOTE: GAS and apparently all other AT&T style assemblers have a broken notion
- // of some of the 'reverse' forms of the fsub and fdiv instructions.  As such,
- // we have to put some 'r's in and take them out of weird places.
--let SchedRW = [WriteFAdd] in {
--def ADD_FST0r   : FPST0rInst <MRM0r, "fadd\t$op">;
--def ADD_FrST0   : FPrST0Inst <MRM0r, "fadd\t{%st(0), $op|$op, st(0)}">;
--def ADD_FPrST0  : FPrST0PInst<MRM0r, "faddp\t$op">;
--def SUBR_FST0r  : FPST0rInst <MRM5r, "fsubr\t$op">;
--def SUB_FrST0   : FPrST0Inst <MRM5r, "fsub{r}\t{%st(0), $op|$op, st(0)}">;
--def SUB_FPrST0  : FPrST0PInst<MRM5r, "fsub{r}p\t$op">;
--def SUB_FST0r   : FPST0rInst <MRM4r, "fsub\t$op">;
--def SUBR_FrST0  : FPrST0Inst <MRM4r, "fsub{|r}\t{%st(0), $op|$op, st(0)}">;
--def SUBR_FPrST0 : FPrST0PInst<MRM4r, "fsub{|r}p\t$op">;
-+let SchedRW = [WriteFAdd], Defs = [FPSW], Uses = [FPCW] in {
-+def ADD_FST0r   : FPST0rInst <MRM0r, "fadd\t{$op, %st|st, $op}">;
-+def ADD_FrST0   : FPrST0Inst <MRM0r, "fadd\t{%st, $op|$op, st}">;
-+def ADD_FPrST0  : FPrST0PInst<MRM0r, "faddp\t{%st, $op|$op, st}">;
-+def SUBR_FST0r  : FPST0rInst <MRM5r, "fsubr\t{$op, %st|st, $op}">;
-+def SUB_FrST0   : FPrST0Inst <MRM5r, "fsub{r}\t{%st, $op|$op, st}">;
-+def SUB_FPrST0  : FPrST0PInst<MRM5r, "fsub{r}p\t{%st, $op|$op, st}">;
-+def SUB_FST0r   : FPST0rInst <MRM4r, "fsub\t{$op, %st|st, $op}">;
-+def SUBR_FrST0  : FPrST0Inst <MRM4r, "fsub{|r}\t{%st, $op|$op, st}">;
-+def SUBR_FPrST0 : FPrST0PInst<MRM4r, "fsub{|r}p\t{%st, $op|$op, st}">;
- } // SchedRW
--let SchedRW = [WriteFCom] in {
-+let SchedRW = [WriteFCom], Defs = [FPSW], Uses = [FPCW] in {
- def COM_FST0r   : FPST0rInst <MRM2r, "fcom\t$op">;
- def COMP_FST0r  : FPST0rInst <MRM3r, "fcomp\t$op">;
- } // SchedRW
--let SchedRW = [WriteFMul] in {
--def MUL_FST0r   : FPST0rInst <MRM1r, "fmul\t$op">;
--def MUL_FrST0   : FPrST0Inst <MRM1r, "fmul\t{%st(0), $op|$op, st(0)}">;
--def MUL_FPrST0  : FPrST0PInst<MRM1r, "fmulp\t$op">;
-+let SchedRW = [WriteFMul], Defs = [FPSW], Uses = [FPCW] in {
-+def MUL_FST0r   : FPST0rInst <MRM1r, "fmul\t{$op, %st|st, $op}">;
-+def MUL_FrST0   : FPrST0Inst <MRM1r, "fmul\t{%st, $op|$op, st}">;
-+def MUL_FPrST0  : FPrST0PInst<MRM1r, "fmulp\t{%st, $op|$op, st}">;
- } // SchedRW
--let SchedRW = [WriteFDiv] in {
--def DIVR_FST0r  : FPST0rInst <MRM7r, "fdivr\t$op">;
--def DIV_FrST0   : FPrST0Inst <MRM7r, "fdiv{r}\t{%st(0), $op|$op, st(0)}">;
--def DIV_FPrST0  : FPrST0PInst<MRM7r, "fdiv{r}p\t$op">;
--def DIV_FST0r   : FPST0rInst <MRM6r, "fdiv\t$op">;
--def DIVR_FrST0  : FPrST0Inst <MRM6r, "fdiv{|r}\t{%st(0), $op|$op, st(0)}">;
--def DIVR_FPrST0 : FPrST0PInst<MRM6r, "fdiv{|r}p\t$op">;
-+let SchedRW = [WriteFDiv], Defs = [FPSW], Uses = [FPCW] in {
-+def DIVR_FST0r  : FPST0rInst <MRM7r, "fdivr\t{$op, %st|st, $op}">;
-+def DIV_FrST0   : FPrST0Inst <MRM7r, "fdiv{r}\t{%st, $op|$op, st}">;
-+def DIV_FPrST0  : FPrST0PInst<MRM7r, "fdiv{r}p\t{%st, $op|$op, st}">;
-+def DIV_FST0r   : FPST0rInst <MRM6r, "fdiv\t{$op, %st|st, $op}">;
-+def DIVR_FrST0  : FPrST0Inst <MRM6r, "fdiv{|r}\t{%st, $op|$op, st}">;
-+def DIVR_FPrST0 : FPrST0PInst<MRM6r, "fdiv{|r}p\t{%st, $op|$op, st}">;
- } // SchedRW
-
- // Unary operations.
-@@ -307,7 +307,7 @@ def _Fp80  : FpI_<(outs RFP80:$dst), (ins RFP80:$src),
- def _F     : FPI<0xD9, fp, (outs), (ins), asmstring>;
- }
-
--let Defs = [FPSW] in {
-+let Defs = [FPSW], Uses = [FPCW] in {
-
- let SchedRW = [WriteFSign] in {
- defm CHS : FPUnary<fneg, MRM_E0, "fchs">;
-@@ -335,7 +335,7 @@ def TST_F  : FPI<0xD9, MRM_E4, (outs), (ins), "ftst">;
-
- // Versions of FP instructions that take a single memory operand.  Added for the
- //   disassembler; remove as they are included with patterns elsewhere.
--let SchedRW = [WriteFComLd] in {
-+let SchedRW = [WriteFComLd], Defs = [FPSW], Uses = [FPCW] in {
- def FCOM32m  : FPI<0xD8, MRM2m, (outs), (ins f32mem:$src), "fcom{s}\t$src">;
- def FCOMP32m : FPI<0xD8, MRM3m, (outs), (ins f32mem:$src), "fcomp{s}\t$src">;
-
-@@ -398,22 +398,22 @@ defm CMOVNP : FPCMov<X86_COND_NP>;
-
- let Predicates = [HasCMov] in {
- // These are not factored because there's no clean way to pass DA/DB.
--def CMOVB_F  : FPI<0xDA, MRM0r, (outs), (ins RST:$op),
--                  "fcmovb\t{$op, %st(0)|st(0), $op}">;
--def CMOVBE_F : FPI<0xDA, MRM2r, (outs), (ins RST:$op),
--                  "fcmovbe\t{$op, %st(0)|st(0), $op}">;
--def CMOVE_F  : FPI<0xDA, MRM1r, (outs), (ins RST:$op),
--                  "fcmove\t{$op, %st(0)|st(0), $op}">;
--def CMOVP_F  : FPI<0xDA, MRM3r, (outs), (ins RST:$op),
--                  "fcmovu\t{$op, %st(0)|st(0), $op}">;
--def CMOVNB_F : FPI<0xDB, MRM0r, (outs), (ins RST:$op),
--                  "fcmovnb\t{$op, %st(0)|st(0), $op}">;
--def CMOVNBE_F: FPI<0xDB, MRM2r, (outs), (ins RST:$op),
--                  "fcmovnbe\t{$op, %st(0)|st(0), $op}">;
--def CMOVNE_F : FPI<0xDB, MRM1r, (outs), (ins RST:$op),
--                  "fcmovne\t{$op, %st(0)|st(0), $op}">;
--def CMOVNP_F : FPI<0xDB, MRM3r, (outs), (ins RST:$op),
--                  "fcmovnu\t{$op, %st(0)|st(0), $op}">;
-+def CMOVB_F  : FPI<0xDA, MRM0r, (outs), (ins RSTi:$op),
-+                  "fcmovb\t{$op, %st|st, $op}">;
-+def CMOVBE_F : FPI<0xDA, MRM2r, (outs), (ins RSTi:$op),
-+                  "fcmovbe\t{$op, %st|st, $op}">;
-+def CMOVE_F  : FPI<0xDA, MRM1r, (outs), (ins RSTi:$op),
-+                  "fcmove\t{$op, %st|st, $op}">;
-+def CMOVP_F  : FPI<0xDA, MRM3r, (outs), (ins RSTi:$op),
-+                  "fcmovu\t{$op, %st|st, $op}">;
-+def CMOVNB_F : FPI<0xDB, MRM0r, (outs), (ins RSTi:$op),
-+                  "fcmovnb\t{$op, %st|st, $op}">;
-+def CMOVNBE_F: FPI<0xDB, MRM2r, (outs), (ins RSTi:$op),
-+                  "fcmovnbe\t{$op, %st|st, $op}">;
-+def CMOVNE_F : FPI<0xDB, MRM1r, (outs), (ins RSTi:$op),
-+                  "fcmovne\t{$op, %st|st, $op}">;
-+def CMOVNP_F : FPI<0xDB, MRM3r, (outs), (ins RSTi:$op),
-+                  "fcmovnu\t{$op, %st|st, $op}">;
- } // Predicates = [HasCMov]
- } // SchedRW
-
-@@ -454,7 +454,7 @@ def ILD_Fp64m80: FpI_<(outs RFP80:$dst), (ins i64mem:$
-                   [(set RFP80:$dst, (X86fild addr:$src, i64))]>;
- } // SchedRW
-
--let SchedRW = [WriteStore] in {
-+let SchedRW = [WriteStore], Uses = [FPCW] in {
- def ST_Fp32m   : FpIf32<(outs), (ins f32mem:$op, RFP32:$src), OneArgFP,
-                   [(store RFP32:$src, addr:$op)]>;
- def ST_Fp64m32 : FpIf64<(outs), (ins f32mem:$op, RFP64:$src), OneArgFP,
-@@ -489,7 +489,7 @@ def IST_Fp16m80  : FpI_<(outs), (ins i16mem:$op, RFP80
- def IST_Fp32m80  : FpI_<(outs), (ins i32mem:$op, RFP80:$src), OneArgFP, []>;
- def IST_Fp64m80  : FpI_<(outs), (ins i64mem:$op, RFP80:$src), OneArgFP, []>;
- } // mayStore
--} // SchedRW
-+} // SchedRW, Uses = [FPCW]
-
- let mayLoad = 1, SchedRW = [WriteLoad] in {
- def LD_F32m   : FPI<0xD9, MRM0m, (outs), (ins f32mem:$src), "fld{s}\t$src">;
-@@ -499,7 +499,7 @@ def ILD_F16m  : FPI<0xDF, MRM0m, (outs), (ins i16mem:$
- def ILD_F32m  : FPI<0xDB, MRM0m, (outs), (ins i32mem:$src), "fild{l}\t$src">;
- def ILD_F64m  : FPI<0xDF, MRM5m, (outs), (ins i64mem:$src), "fild{ll}\t$src">;
- }
--let mayStore = 1, SchedRW = [WriteStore] in {
-+let mayStore = 1, SchedRW = [WriteStore], Uses = [FPCW] in {
- def ST_F32m   : FPI<0xD9, MRM2m, (outs), (ins f32mem:$dst), "fst{s}\t$dst">;
- def ST_F64m   : FPI<0xDD, MRM2m, (outs), (ins f64mem:$dst), "fst{l}\t$dst">;
- def ST_FP32m  : FPI<0xD9, MRM3m, (outs), (ins f32mem:$dst), "fstp{s}\t$dst">;
-@@ -513,7 +513,7 @@ def IST_FP64m : FPI<0xDF, MRM7m, (outs), (ins i64mem:$
- }
-
- // FISTTP requires SSE3 even though it's a FPStack op.
--let Predicates = [HasSSE3], SchedRW = [WriteStore] in {
-+let Predicates = [HasSSE3], SchedRW = [WriteStore], Uses = [FPCW] in {
- def ISTT_Fp16m32 : FpI_<(outs), (ins i16mem:$op, RFP32:$src), OneArgFP,
-                     [(X86fp_to_i16mem RFP32:$src, addr:$op)]>;
- def ISTT_Fp32m32 : FpI_<(outs), (ins i32mem:$op, RFP32:$src), OneArgFP,
-@@ -534,7 +534,7 @@ def ISTT_Fp64m80 : FpI_<(outs), (ins i64mem:$op, RFP80
-                     [(X86fp_to_i64mem RFP80:$src, addr:$op)]>;
- } // Predicates = [HasSSE3]
-
--let mayStore = 1, SchedRW = [WriteStore] in {
-+let mayStore = 1, SchedRW = [WriteStore], Uses = [FPCW] in {
- def ISTT_FP16m : FPI<0xDF, MRM1m, (outs), (ins i16mem:$dst), "fisttp{s}\t$dst">;
- def ISTT_FP32m : FPI<0xDB, MRM1m, (outs), (ins i32mem:$dst), "fisttp{l}\t$dst">;
- def ISTT_FP64m : FPI<0xDD, MRM1m, (outs), (ins i64mem:$dst), "fisttp{ll}\t$dst">;
-@@ -542,10 +542,10 @@ def ISTT_FP64m : FPI<0xDD, MRM1m, (outs), (ins i64mem:
-
- // FP Stack manipulation instructions.
- let SchedRW = [WriteMove] in {
--def LD_Frr   : FPI<0xD9, MRM0r, (outs), (ins RST:$op), "fld\t$op">;
--def ST_Frr   : FPI<0xDD, MRM2r, (outs), (ins RST:$op), "fst\t$op">;
--def ST_FPrr  : FPI<0xDD, MRM3r, (outs), (ins RST:$op), "fstp\t$op">;
--def XCH_F    : FPI<0xD9, MRM1r, (outs), (ins RST:$op), "fxch\t$op">;
-+def LD_Frr   : FPI<0xD9, MRM0r, (outs), (ins RSTi:$op), "fld\t$op">;
-+def ST_Frr   : FPI<0xDD, MRM2r, (outs), (ins RSTi:$op), "fst\t$op">;
-+def ST_FPrr  : FPI<0xDD, MRM3r, (outs), (ins RSTi:$op), "fstp\t$op">;
-+def XCH_F    : FPI<0xD9, MRM1r, (outs), (ins RSTi:$op), "fxch\t$op">;
- }
-
- // Floating point constant loads.
-@@ -570,7 +570,7 @@ def LD_F0 : FPI<0xD9, MRM_EE, (outs), (ins), "fldz">;
- let SchedRW = [WriteFLD1] in
- def LD_F1 : FPI<0xD9, MRM_E8, (outs), (ins), "fld1">;
-
--let SchedRW = [WriteFLDC], Defs = [FPSW] in {
-+let SchedRW = [WriteFLDC] in {
- def FLDL2T : I<0xD9, MRM_E9, (outs), (ins), "fldl2t", []>;
- def FLDL2E : I<0xD9, MRM_EA, (outs), (ins), "fldl2e", []>;
- def FLDPI : I<0xD9, MRM_EB, (outs), (ins), "fldpi", []>;
-@@ -579,7 +579,7 @@ def FLDLN2 : I<0xD9, MRM_ED, (outs), (ins), "fldln2",
- } // SchedRW
-
- // Floating point compares.
--let SchedRW = [WriteFCom] in {
-+let SchedRW = [WriteFCom], Uses = [FPCW] in {
- def UCOM_Fpr32 : FpIf32<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP,
-                         [(set FPSW, (trunc (X86cmp RFP32:$lhs, RFP32:$rhs)))]>;
- def UCOM_Fpr64 : FpIf64<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP,
-@@ -591,34 +591,37 @@ def UCOM_Fpr80 : FpI_  <(outs), (ins RFP80:$lhs, RFP80
-
- let SchedRW = [WriteFCom] in {
- // CC = ST(0) cmp ST(i)
--let Defs = [EFLAGS, FPSW] in {
--def UCOM_FpIr32: FpIf32<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP,
--                  [(set EFLAGS, (X86cmp RFP32:$lhs, RFP32:$rhs))]>;
--def UCOM_FpIr64: FpIf64<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP,
--                  [(set EFLAGS, (X86cmp RFP64:$lhs, RFP64:$rhs))]>;
-+let Defs = [EFLAGS, FPSW], Uses = [FPCW] in {
-+def UCOM_FpIr32: FpI_<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP,
-+                  [(set EFLAGS, (X86cmp RFP32:$lhs, RFP32:$rhs))]>,
-+                  Requires<[FPStackf32, HasCMov]>;
-+def UCOM_FpIr64: FpI_<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP,
-+                  [(set EFLAGS, (X86cmp RFP64:$lhs, RFP64:$rhs))]>,
-+                  Requires<[FPStackf64, HasCMov]>;
- def UCOM_FpIr80: FpI_<(outs), (ins RFP80:$lhs, RFP80:$rhs), CompareFP,
--                  [(set EFLAGS, (X86cmp RFP80:$lhs, RFP80:$rhs))]>;
-+                  [(set EFLAGS, (X86cmp RFP80:$lhs, RFP80:$rhs))]>,
-+                  Requires<[HasCMov]>;
- }
-
--let Defs = [FPSW], Uses = [ST0] in {
-+let Defs = [FPSW], Uses = [ST0, FPCW] in {
- def UCOM_Fr    : FPI<0xDD, MRM4r,    // FPSW = cmp ST(0) with ST(i)
--                    (outs), (ins RST:$reg), "fucom\t$reg">;
-+                    (outs), (ins RSTi:$reg), "fucom\t$reg">;
- def UCOM_FPr   : FPI<0xDD, MRM5r,    // FPSW = cmp ST(0) with ST(i), pop
--                    (outs), (ins RST:$reg), "fucomp\t$reg">;
-+                    (outs), (ins RSTi:$reg), "fucomp\t$reg">;
- def UCOM_FPPr  : FPI<0xDA, MRM_E9,       // cmp ST(0) with ST(1), pop, pop
-                     (outs), (ins), "fucompp">;
- }
-
--let Defs = [EFLAGS, FPSW], Uses = [ST0] in {
-+let Defs = [EFLAGS, FPSW], Uses = [ST0, FPCW] in {
- def UCOM_FIr   : FPI<0xDB, MRM5r,     // CC = cmp ST(0) with ST(i)
--                    (outs), (ins RST:$reg), "fucomi\t$reg">;
-+                    (outs), (ins RSTi:$reg), "fucomi\t{$reg, %st|st, $reg}">;
- def UCOM_FIPr  : FPI<0xDF, MRM5r,     // CC = cmp ST(0) with ST(i), pop
--                    (outs), (ins RST:$reg), "fucompi\t$reg">;
--}
-+                    (outs), (ins RSTi:$reg), "fucompi\t{$reg, %st|st, $reg}">;
-
--let Defs = [EFLAGS, FPSW] in {
--def COM_FIr : FPI<0xDB, MRM6r, (outs), (ins RST:$reg), "fcomi\t$reg">;
--def COM_FIPr : FPI<0xDF, MRM6r, (outs), (ins RST:$reg), "fcompi\t$reg">;
-+def COM_FIr : FPI<0xDB, MRM6r, (outs), (ins RSTi:$reg),
-+                  "fcomi\t{$reg, %st|st, $reg}">;
-+def COM_FIPr : FPI<0xDF, MRM6r, (outs), (ins RSTi:$reg),
-+                   "fcompi\t{$reg, %st|st, $reg}">;
- }
- } // SchedRW
-
-@@ -628,12 +631,12 @@ let Defs = [AX], Uses = [FPSW] in
- def FNSTSW16r : I<0xDF, MRM_E0,                  // AX = fp flags
-                   (outs), (ins), "fnstsw\t{%ax|ax}",
-                   [(set AX, (X86fp_stsw FPSW))]>;
--let Defs = [FPSW] in
-+let Defs = [FPSW], Uses = [FPCW] in
- def FNSTCW16m : I<0xD9, MRM7m,                   // [mem16] = X87 control world
-                   (outs), (ins i16mem:$dst), "fnstcw\t$dst",
-                   [(X86fp_cwd_get16 addr:$dst)]>;
- } // SchedRW
--let Defs = [FPSW], mayLoad = 1 in
-+let Defs = [FPSW,FPCW], mayLoad = 1 in
- def FLDCW16m  : I<0xD9, MRM5m,                   // X87 control world = [mem16]
-                   (outs), (ins i16mem:$dst), "fldcw\t$dst", []>,
-                 Sched<[WriteLoad]>;
-@@ -642,8 +645,8 @@ def FLDCW16m  : I<0xD9, MRM5m,                   // X8
- let SchedRW = [WriteMicrocoded] in {
- let Defs = [FPSW] in {
- def FNINIT : I<0xDB, MRM_E3, (outs), (ins), "fninit", []>;
--def FFREE : FPI<0xDD, MRM0r, (outs), (ins RST:$reg), "ffree\t$reg">;
--def FFREEP : FPI<0xDF, MRM0r, (outs), (ins RST:$reg), "ffreep\t$reg">;
-+def FFREE : FPI<0xDD, MRM0r, (outs), (ins RSTi:$reg), "ffree\t$reg">;
-+def FFREEP : FPI<0xDF, MRM0r, (outs), (ins RSTi:$reg), "ffreep\t$reg">;
-
- // Clear exceptions
- def FNCLEX : I<0xDB, MRM_E2, (outs), (ins), "fnclex", []>;
Index: devel/llvm/patches/patch-lib_Target_X86_X86InstrInfo_td
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_X86InstrInfo_td
diff -N devel/llvm/patches/patch-lib_Target_X86_X86InstrInfo_td
--- devel/llvm/patches/patch-lib_Target_X86_X86InstrInfo_td 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,71 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_X86InstrInfo_td,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/X86InstrInfo.td
---- lib/Target/X86/X86InstrInfo.td.orig
-+++ lib/Target/X86/X86InstrInfo.td
-@@ -3259,39 +3259,39 @@ def : InstAlias<"fucompi",      (UCOM_FIPr   ST1), 0>;
- // instructions like "fadd %st(0), %st(0)" as "fadd %st(0)" for consistency with
- // gas.
- multiclass FpUnaryAlias<string Mnemonic, Instruction Inst, bit EmitAlias = 1> {
-- def : InstAlias<!strconcat(Mnemonic, "\t{$op, %st(0)|st(0), $op}"),
--                 (Inst RST:$op), EmitAlias>;
-- def : InstAlias<!strconcat(Mnemonic, "\t{%st(0), %st(0)|st(0), st(0)}"),
-+ def : InstAlias<!strconcat(Mnemonic, "\t$op"),
-+                 (Inst RSTi:$op), EmitAlias>;
-+ def : InstAlias<!strconcat(Mnemonic, "\t{%st, %st|st, st}"),
-                  (Inst ST0), EmitAlias>;
- }
-
--defm : FpUnaryAlias<"fadd",   ADD_FST0r>;
-+defm : FpUnaryAlias<"fadd",   ADD_FST0r, 0>;
- defm : FpUnaryAlias<"faddp",  ADD_FPrST0, 0>;
--defm : FpUnaryAlias<"fsub",   SUB_FST0r>;
--defm : FpUnaryAlias<"fsub{|r}p",  SUBR_FPrST0>;
--defm : FpUnaryAlias<"fsubr",  SUBR_FST0r>;
--defm : FpUnaryAlias<"fsub{r|}p", SUB_FPrST0>;
--defm : FpUnaryAlias<"fmul",   MUL_FST0r>;
--defm : FpUnaryAlias<"fmulp",  MUL_FPrST0>;
--defm : FpUnaryAlias<"fdiv",   DIV_FST0r>;
--defm : FpUnaryAlias<"fdiv{|r}p",  DIVR_FPrST0>;
--defm : FpUnaryAlias<"fdivr",  DIVR_FST0r>;
--defm : FpUnaryAlias<"fdiv{r|}p", DIV_FPrST0>;
-+defm : FpUnaryAlias<"fsub",   SUB_FST0r, 0>;
-+defm : FpUnaryAlias<"fsub{|r}p",  SUBR_FPrST0, 0>;
-+defm : FpUnaryAlias<"fsubr",  SUBR_FST0r, 0>;
-+defm : FpUnaryAlias<"fsub{r|}p", SUB_FPrST0, 0>;
-+defm : FpUnaryAlias<"fmul",   MUL_FST0r, 0>;
-+defm : FpUnaryAlias<"fmulp",  MUL_FPrST0, 0>;
-+defm : FpUnaryAlias<"fdiv",   DIV_FST0r, 0>;
-+defm : FpUnaryAlias<"fdiv{|r}p",  DIVR_FPrST0, 0>;
-+defm : FpUnaryAlias<"fdivr",  DIVR_FST0r, 0>;
-+defm : FpUnaryAlias<"fdiv{r|}p", DIV_FPrST0, 0>;
- defm : FpUnaryAlias<"fcomi",   COM_FIr, 0>;
- defm : FpUnaryAlias<"fucomi",  UCOM_FIr, 0>;
--defm : FpUnaryAlias<"fcompi",   COM_FIPr>;
--defm : FpUnaryAlias<"fucompi",  UCOM_FIPr>;
-+defm : FpUnaryAlias<"fcompi",   COM_FIPr, 0>;
-+defm : FpUnaryAlias<"fucompi",  UCOM_FIPr, 0>;
-
-
--// Handle "f{mulp,addp} st(0), $op" the same as "f{mulp,addp} $op", since they
-+// Handle "f{mulp,addp} $op, %st(0)" the same as "f{mulp,addp} $op", since they
- // commute.  We also allow fdiv[r]p/fsubrp even though they don't commute,
- // solely because gas supports it.
--def : InstAlias<"faddp\t{%st(0), $op|$op, st(0)}", (ADD_FPrST0 RST:$op), 0>;
--def : InstAlias<"fmulp\t{%st(0), $op|$op, st(0)}", (MUL_FPrST0 RST:$op)>;
--def : InstAlias<"fsub{|r}p\t{%st(0), $op|$op, st(0)}", (SUBR_FPrST0 RST:$op)>;
--def : InstAlias<"fsub{r|}p\t{%st(0), $op|$op, st(0)}", (SUB_FPrST0 RST:$op)>;
--def : InstAlias<"fdiv{|r}p\t{%st(0), $op|$op, st(0)}", (DIVR_FPrST0 RST:$op)>;
--def : InstAlias<"fdiv{r|}p\t{%st(0), $op|$op, st(0)}", (DIV_FPrST0 RST:$op)>;
-+def : InstAlias<"faddp\t{$op, %st|st, $op}", (ADD_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fmulp\t{$op, %st|st, $op}", (MUL_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fsub{|r}p\t{$op, %st|st, $op}", (SUBR_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fsub{r|}p\t{$op, %st|st, $op}", (SUB_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fdiv{|r}p\t{$op, %st|st, $op}", (DIVR_FPrST0 RSTi:$op), 0>;
-+def : InstAlias<"fdiv{r|}p\t{$op, %st|st, $op}", (DIV_FPrST0 RSTi:$op), 0>;
-
- def : InstAlias<"fnstsw"     , (FNSTSW16r), 0>;
-
Index: devel/llvm/patches/patch-lib_Target_X86_X86MCInstLower_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86MCInstLower_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-lib_Target_X86_X86MCInstLower_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86MCInstLower_cpp 24 Feb 2019 20:53:56 -0000 1.6
+++ devel/llvm/patches/patch-lib_Target_X86_X86MCInstLower_cpp 4 Jul 2019 15:26:11 -0000
@@ -22,7 +22,7 @@ $OpenBSD: patch-lib_Target_X86_X86MCInst
 Index: lib/Target/X86/X86MCInstLower.cpp
 --- lib/Target/X86/X86MCInstLower.cpp.orig
 +++ lib/Target/X86/X86MCInstLower.cpp
-@@ -1831,6 +1831,27 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr
+@@ -1786,6 +1786,27 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr
          MCInstBuilder(X86::MOV64rr).addReg(X86::R10).addReg(X86::RAX));
      return;
 
@@ -50,7 +50,7 @@ Index: lib/Target/X86/X86MCInstLower.cpp
    case X86::SEH_PushReg:
    case X86::SEH_SaveReg:
    case X86::SEH_SaveXMM:
-@@ -2257,4 +2278,10 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr
+@@ -2223,4 +2244,10 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr
    }
 
    EmitAndCountInstruction(TmpInst);
Index: devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_cpp
===================================================================
RCS file: devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_cpp
diff -N devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-$OpenBSD: patch-lib_Target_X86_X86RegisterInfo_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: lib/Target/X86/X86RegisterInfo.cpp
---- lib/Target/X86/X86RegisterInfo.cpp.orig
-+++ lib/Target/X86/X86RegisterInfo.cpp
-@@ -497,6 +497,9 @@ BitVector X86RegisterInfo::getReservedRegs(const Machi
-   BitVector Reserved(getNumRegs());
-   const X86FrameLowering *TFI = getFrameLowering(MF);
-
-+  // Set the floating point control register as reserved.
-+  Reserved.set(X86::FPCW);
-+
-   // Set the stack-pointer register and its aliases as reserved.
-   for (MCSubRegIterator I(X86::RSP, this, /*IncludeSelf=*/true); I.isValid();
-        ++I)
Index: devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_td,v
retrieving revision 1.5
diff -u -p -r1.5 patch-lib_Target_X86_X86RegisterInfo_td
--- devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_td 20 Feb 2019 00:24:11 -0000 1.5
+++ devel/llvm/patches/patch-lib_Target_X86_X86RegisterInfo_td 4 Jul 2019 15:26:11 -0000
@@ -19,35 +19,11 @@ $OpenBSD: patch-lib_Target_X86_X86Regist
   There are other possible changes in this direction. BX/BL are obvious next
   targets for avoidance, and MM3/XMM3 may also be useful to try to avoid if
   possible.
-- Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-  to fix a regression in floating point operations.
 
 Index: lib/Target/X86/X86RegisterInfo.td
 --- lib/Target/X86/X86RegisterInfo.td.orig
 +++ lib/Target/X86/X86RegisterInfo.td
-@@ -278,7 +278,7 @@ def K7 : X86Reg<"k7", 7>, DwarfRegNum<[125, 100, 100]>
- // pseudo registers, but we still mark them as aliasing FP registers. That
- // way both kinds can be live without exceeding the stack depth. ST registers
- // are only live around inline assembly.
--def ST0 : X86Reg<"st(0)", 0>, DwarfRegNum<[33, 12, 11]>;
-+def ST0 : X86Reg<"st", 0>, DwarfRegNum<[33, 12, 11]>;
- def ST1 : X86Reg<"st(1)", 1>, DwarfRegNum<[34, 13, 12]>;
- def ST2 : X86Reg<"st(2)", 2>, DwarfRegNum<[35, 14, 13]>;
- def ST3 : X86Reg<"st(3)", 3>, DwarfRegNum<[36, 15, 14]>;
-@@ -288,8 +288,11 @@ def ST6 : X86Reg<"st(6)", 6>, DwarfRegNum<[39, 18, 17]
- def ST7 : X86Reg<"st(7)", 7>, DwarfRegNum<[40, 19, 18]>;
-
- // Floating-point status word
--def FPSW : X86Reg<"fpsw", 0>;
-+def FPSW : X86Reg<"fpsr", 0>;
-
-+// Floating-point control word
-+def FPCW : X86Reg<"fpcr", 0>;
-+
- // Status flags register.
- //
- // Note that some flags that are commonly thought of as part of the status
-@@ -402,8 +405,8 @@ def GRH16 : RegisterClass<"X86", [i16], 16,
+@@ -405,8 +405,8 @@ def GRH16 : RegisterClass<"X86", [i16], 16,
                                 R15WH)>;
 
  def GR32 : RegisterClass<"X86", [i32], 32,
@@ -58,7 +34,7 @@ Index: lib/Target/X86/X86RegisterInfo.td
 
  // GR64 - 64-bit GPRs. This oddly includes RIP, which isn't accurate, since
  // RIP isn't really a register and it can't be used anywhere except in an
-@@ -412,7 +415,7 @@ def GR32 : RegisterClass<"X86", [i32], 32,
+@@ -415,7 +415,7 @@ def GR32 : RegisterClass<"X86", [i32], 32,
  // tests because of the inclusion of RIP in this register class.
  def GR64 : RegisterClass<"X86", [i64], 64,
                           (add RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11,
@@ -67,13 +43,3 @@ Index: lib/Target/X86/X86RegisterInfo.td
 
  // Segment registers for use by MOV instructions (and others) that have a
  //   segment register as one operand.  Always contain a 16-bit segment
-@@ -521,6 +524,9 @@ def RFP80 : RegisterClass<"X86",[f80], 32, (add RFP32)
- def RST : RegisterClass<"X86", [f80, f64, f32], 32, (sequence "ST%u", 0, 7)> {
-   let isAllocatable = 0;
- }
-+
-+// Helper to allow %st to print as %st(0) when its encoded in the instruction.
-+def RSTi : RegisterOperand<RST, "printSTiRegOperand">;
-
- // Generic vector registers: VR64 and VR128.
- // Ensure that float types are declared first - only float is legal on SSE1.
Index: devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_X86_X86Subtarget_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_cpp 4 Jul 2019 15:26:11 -0000
@@ -5,7 +5,7 @@ Turn on -mretpoline by default in clang
 Index: lib/Target/X86/X86Subtarget.cpp
 --- lib/Target/X86/X86Subtarget.cpp.orig
 +++ lib/Target/X86/X86Subtarget.cpp
-@@ -238,6 +238,14 @@ void X86Subtarget::initSubtargetFeatures(StringRef CPU
+@@ -251,6 +251,14 @@ void X86Subtarget::initSubtargetFeatures(StringRef CPU
        FullFS = "+sahf";
    }
 
Index: devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h,v
retrieving revision 1.5
diff -u -p -r1.5 patch-lib_Target_X86_X86Subtarget_h
--- devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h 11 Feb 2019 05:24:16 -0000 1.5
+++ devel/llvm/patches/patch-lib_Target_X86_X86Subtarget_h 4 Jul 2019 15:26:11 -0000
@@ -6,7 +6,7 @@ $OpenBSD: patch-lib_Target_X86_X86Subtar
 Index: lib/Target/X86/X86Subtarget.h
 --- lib/Target/X86/X86Subtarget.h.orig
 +++ lib/Target/X86/X86Subtarget.h
-@@ -400,6 +400,9 @@ class X86Subtarget final : public X86GenSubtargetInfo
+@@ -411,6 +411,9 @@ class X86Subtarget final : public X86GenSubtargetInfo
    /// entry to the function and which must be maintained by every function.
    unsigned stackAlignment = 4;
 
@@ -16,7 +16,7 @@ Index: lib/Target/X86/X86Subtarget.h
    /// 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?
-@@ -478,6 +481,8 @@ class X86Subtarget final : public X86GenSubtargetInfo
+@@ -492,6 +495,8 @@ class X86Subtarget final : public X86GenSubtargetInfo
      return &getInstrInfo()->getRegisterInfo();
    }
 
@@ -25,7 +25,7 @@ Index: lib/Target/X86/X86Subtarget.h
    /// 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.
-@@ -699,6 +704,7 @@ class X86Subtarget final : public X86GenSubtargetInfo
+@@ -722,6 +727,7 @@ class X86Subtarget final : public X86GenSubtargetInfo
 
    bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
    bool isTargetFreeBSD() const { return TargetTriple.isOSFreeBSD(); }
Index: devel/llvm/patches/patch-lib_Target_X86_X86TargetMachine_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86TargetMachine_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_X86_X86TargetMachine_cpp
--- devel/llvm/patches/patch-lib_Target_X86_X86TargetMachine_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_X86_X86TargetMachine_cpp 4 Jul 2019 15:26:11 -0000
@@ -9,10 +9,10 @@ this framework.
 Index: lib/Target/X86/X86TargetMachine.cpp
 --- lib/Target/X86/X86TargetMachine.cpp.orig
 +++ lib/Target/X86/X86TargetMachine.cpp
-@@ -508,6 +508,7 @@ void X86PassConfig::addPreEmitPass() {
-     addPass(createX86FixupLEAs());
-     addPass(createX86EvexToVexInsts());
+@@ -504,6 +504,7 @@ void X86PassConfig::addPreEmitPass() {
    }
+   addPass(createX86DiscriminateMemOpsPass());
+   addPass(createX86InsertPrefetchPass());
 +  addPass(createX86FixupGadgetsPass());
  }
 
Index: devel/llvm/patches/patch-lib_Target_X86_X86_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86_h,v
retrieving revision 1.2
diff -u -p -r1.2 patch-lib_Target_X86_X86_h
--- devel/llvm/patches/patch-lib_Target_X86_X86_h 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-lib_Target_X86_X86_h 4 Jul 2019 15:26:11 -0000
@@ -9,9 +9,9 @@ this framework.
 Index: lib/Target/X86/X86.h
 --- lib/Target/X86/X86.h.orig
 +++ lib/Target/X86/X86.h
-@@ -114,6 +114,10 @@ FunctionPass *createX86DomainReassignmentPass();
-
- void initializeFixupBWInstPassPass(PassRegistry &);
+@@ -115,6 +115,10 @@ FunctionPass *createX86FixupBWInsts();
+ /// to another, when profitable.
+ FunctionPass *createX86DomainReassignmentPass();
 
 +/// Return a Machine Function pass that attempts to replace
 +/// ROP friendly instructions with alternatives.
Index: devel/llvm/patches/patch-lib_Target_X86_X86_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Target_X86_X86_td,v
retrieving revision 1.3
diff -u -p -r1.3 patch-lib_Target_X86_X86_td
--- devel/llvm/patches/patch-lib_Target_X86_X86_td 11 Feb 2019 05:24:16 -0000 1.3
+++ devel/llvm/patches/patch-lib_Target_X86_X86_td 4 Jul 2019 15:26:11 -0000
@@ -5,7 +5,7 @@ implement -msave-args in clang/llvm, lik
 Index: lib/Target/X86/X86.td
 --- lib/Target/X86/X86.td.orig
 +++ lib/Target/X86/X86.td
-@@ -284,6 +284,9 @@ def FeatureLZCNTFalseDeps : SubtargetFeature<"false-de
+@@ -283,6 +283,9 @@ def FeatureLZCNTFalseDeps : SubtargetFeature<"false-de
                                       "LZCNT/TZCNT have a false dependency on dest register">;
  def FeaturePCONFIG : SubtargetFeature<"pconfig", "HasPCONFIG", "true",
                                        "platform configuration instruction">;
Index: devel/llvm/patches/patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp,v
retrieving revision 1.4
diff -u -p -r1.4 patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp
--- devel/llvm/patches/patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp 28 Jan 2019 06:27:28 -0000 1.4
+++ devel/llvm/patches/patch-lib_Transforms_Scalar_LoopIdiomRecognize_cpp 4 Jul 2019 15:26:11 -0000
@@ -8,7 +8,7 @@ recursion.
 Index: lib/Transforms/Scalar/LoopIdiomRecognize.cpp
 --- lib/Transforms/Scalar/LoopIdiomRecognize.cpp.orig
 +++ lib/Transforms/Scalar/LoopIdiomRecognize.cpp
-@@ -280,6 +280,8 @@ bool LoopIdiomRecognize::runOnLoop(Loop *L) {
+@@ -282,6 +282,8 @@ bool LoopIdiomRecognize::runOnLoop(Loop *L) {
    StringRef Name = L->getHeader()->getParent()->getName();
    if (Name == "memset" || Name == "memcpy")
      return false;
Index: devel/llvm/patches/patch-test_Assembler_debug-info_ll
===================================================================
RCS file: devel/llvm/patches/patch-test_Assembler_debug-info_ll
diff -N devel/llvm/patches/patch-test_Assembler_debug-info_ll
--- devel/llvm/patches/patch-test_Assembler_debug-info_ll 30 Jan 2019 07:36:06 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-test_Assembler_debug-info_ll,v 1.1 2019/01/30 07:36:06 semarie Exp $
-https://github.com/llvm-mirror/llvm/commit/da1fb72bb305d6bc1f3899d541414146934bf80f
-Index: test/Assembler/debug-info.ll
---- test/Assembler/debug-info.ll.orig
-+++ test/Assembler/debug-info.ll
-@@ -83,7 +83,7 @@
- ; CHECK-NEXT: !32 = !DIFile(filename: "file", directory: "dir", checksumkind: CSK_MD5, checksum: "000102030405060708090a0b0c0d0e0f")
- !35 = !DIFile(filename: "file", directory: "dir", checksumkind: CSK_MD5, checksum: "000102030405060708090a0b0c0d0e0f")
-
--; CHECK-NEXT: !33 = !DICompositeType(tag: DW_TAG_variant_part, name: "A", scope: !14, size: 64)
-+; CHECK-NEXT: !33 = !DICompositeType(tag: DW_TAG_variant_part, name: "A", scope: !14, size: 64, discriminator: !34)
- ; CHECK-NEXT: !34 = !DIDerivedType(tag: DW_TAG_member, scope: !33, baseType: !35, size: 64, align: 64, flags: DIFlagArtificial)
- ; CHECK-NEXT: !35 = !DIBasicType(name: "u64", size: 64, encoding: DW_ATE_unsigned)
- !36 = !DICompositeType(tag: DW_TAG_variant_part, name: "A", scope: !16, size: 64, discriminator: !37)
Index: devel/llvm/patches/patch-test_Assembler_debug-variant-discriminator_ll
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-test_Assembler_debug-variant-discriminator_ll,v
retrieving revision 1.1
diff -u -p -r1.1 patch-test_Assembler_debug-variant-discriminator_ll
--- devel/llvm/patches/patch-test_Assembler_debug-variant-discriminator_ll 30 Jan 2019 07:36:06 -0000 1.1
+++ devel/llvm/patches/patch-test_Assembler_debug-variant-discriminator_ll 4 Jul 2019 15:26:11 -0000
@@ -3,7 +3,10 @@ https://github.com/llvm-mirror/llvm/comm
 Index: test/Assembler/debug-variant-discriminator.ll
 --- test/Assembler/debug-variant-discriminator.ll.orig
 +++ test/Assembler/debug-variant-discriminator.ll
-@@ -0,0 +1,14 @@
+@@ -12,3 +12,17 @@
+ !1 = !DICompositeType(tag: DW_TAG_variant_part, scope: !0, size: 64, discriminator: !2)
+ !2 = !DIDerivedType(tag: DW_TAG_member, scope: !1, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial)
+ !3 = !DIBasicType(name: "u64", size: 64, encoding: DW_ATE_unsigned)
 +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
 +; RUN: verify-uselistorder %s
 +
Index: devel/llvm/patches/patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h
diff -N devel/llvm/patches/patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h
--- devel/llvm/patches/patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h 14 Jan 2019 16:08:45 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-$OpenBSD: patch-tools_clang_include_clang_Analysis_Analyses_FormatString_h,v 1.1 2019/01/14 16:08:45 jca Exp $
-
-The %b printf extension in the kernel is not fixed to a int type. On sparc64
-there are various %llb formats. Adjust the code to handle the length specifiers
-and type check like it is used by the regular case.
-
-Index: tools/clang/include/clang/Analysis/Analyses/FormatString.h
---- tools/clang/include/clang/Analysis/Analyses/FormatString.h.orig
-+++ tools/clang/include/clang/Analysis/Analyses/FormatString.h
-@@ -227,8 +227,10 @@ class ConversionSpecifier { (public)
-
-   bool isIntArg() const { return (kind >= IntArgBeg && kind <= IntArgEnd) ||
-     kind == FreeBSDrArg || kind == FreeBSDyArg; }
--  bool isUIntArg() const { return kind >= UIntArgBeg && kind <= UIntArgEnd; }
--  bool isAnyIntArg() const { return kind >= IntArgBeg && kind <= UIntArgEnd; }
-+  bool isUIntArg() const { return (kind >= UIntArgBeg && kind <= UIntArgEnd) ||
-+    kind == FreeBSDbArg; }
-+  bool isAnyIntArg() const { return (kind >= IntArgBeg && kind <= UIntArgEnd) ||
-+    kind == FreeBSDbArg; }
-   bool isDoubleArg() const {
-     return kind >= DoubleArgBeg && kind <= DoubleArgEnd;
-   }
Index: devel/llvm/patches/patch-tools_clang_include_clang_Basic_CodeGenOptions_def
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_include_clang_Basic_CodeGenOptions_def
diff -N devel/llvm/patches/patch-tools_clang_include_clang_Basic_CodeGenOptions_def
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ devel/llvm/patches/patch-tools_clang_include_clang_Basic_CodeGenOptions_def 4 Jul 2019 15:26:11 -0000
@@ -0,0 +1,33 @@
+$OpenBSD$
+
+Add RETGUARD to clang for amd64. This security mechanism uses per-function
+random cookies to protect access to function return instructions, with the
+effect that the integrity of the return address is protected, and function
+return instructions are harder to use in ROP gadgets.
+
+On function entry the return address is combined with a per-function random
+cookie and stored in the stack frame. The integrity of this value is verified
+before function return, and if this check fails, the program aborts. In this way
+RETGUARD is an improved stack protector, since the cookies are per-function. The
+verification routine is constructed such that the binary space immediately
+before each ret instruction is padded with int03 instructions, which makes these
+return instructions difficult to use in ROP gadgets. In the kernel, this has the
+effect of removing approximately 50% of total ROP gadgets, and 15% of unique
+ROP gadgets compared to the 6.3 release kernel. Function epilogues are
+essentially gadget free, leaving only the polymorphic gadgets that result from
+jumping into the instruction stream partway through other instructions. Work to
+remove these gadgets will continue through other mechanisms.
+
+Index: tools/clang/include/clang/Basic/CodeGenOptions.def
+--- tools/clang/include/clang/Basic/CodeGenOptions.def.orig
++++ tools/clang/include/clang/Basic/CodeGenOptions.def
+@@ -286,6 +286,9 @@ VALUE_CODEGENOPT(NumRegisterParameters, 32, 0)
+ /// The lower bound for a buffer to be considered for stack protection.
+ VALUE_CODEGENOPT(SSPBufferSize, 32, 0)
+
++/// Whether to use return protectors
++CODEGENOPT(ReturnProtector, 1, 0)
++
+ /// The kind of generated debug info.
+ ENUM_CODEGENOPT(DebugInfo, codegenoptions::DebugInfoKind, 3, codegenoptions::NoDebugInfo)
+
Index: devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td,v
retrieving revision 1.6
diff -u -p -r1.6 patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td
--- devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td 28 Jan 2019 06:27:28 -0000 1.6
+++ devel/llvm/patches/patch-tools_clang_include_clang_Basic_DiagnosticSemaKinds_td 4 Jul 2019 15:26:11 -0000
@@ -2,7 +2,7 @@ $OpenBSD: patch-tools_clang_include_clan
 
 - Disable -Waddress-of-packed-member by default.
 
-While these warnings have the potential to be useful, there are too manu
+While these warnings have the potential to be useful, there are too many
 false positives right now.
 
 - Disable -Wpointer-sign warnings per default
@@ -12,7 +12,7 @@ base gcc does the same.
 Index: tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
 --- tools/clang/include/clang/Basic/DiagnosticSemaKinds.td.orig
 +++ tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
-@@ -5827,7 +5827,7 @@ def warn_pointer_indirection_from_incompatible_type :
+@@ -5857,7 +5857,7 @@ def warn_pointer_indirection_from_incompatible_type :
    InGroup<UndefinedReinterpretCast>, DefaultIgnore;
  def warn_taking_address_of_packed_member : Warning<
    "taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
@@ -21,7 +21,7 @@ Index: tools/clang/include/clang/Basic/D
 
  def err_objc_object_assignment : Error<
    "cannot assign to class object (%0 invalid)">;
-@@ -6804,7 +6804,7 @@ def ext_typecheck_convert_incompatible_pointer_sign :
+@@ -6841,7 +6841,7 @@ def ext_typecheck_convert_incompatible_pointer_sign :
    "sending to parameter of different type}0,1"
    "|%diff{casting $ to type $|casting between types}0,1}2"
    " converts between pointers to integer types with different sign">,
Index: devel/llvm/patches/patch-tools_clang_include_clang_Driver_CC1Options_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_include_clang_Driver_CC1Options_td,v
retrieving revision 1.2
diff -u -p -r1.2 patch-tools_clang_include_clang_Driver_CC1Options_td
--- devel/llvm/patches/patch-tools_clang_include_clang_Driver_CC1Options_td 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-tools_clang_include_clang_Driver_CC1Options_td 4 Jul 2019 15:26:11 -0000
@@ -21,7 +21,7 @@ remove these gadgets will continue throu
 Index: tools/clang/include/clang/Driver/CC1Options.td
 --- tools/clang/include/clang/Driver/CC1Options.td.orig
 +++ tools/clang/include/clang/Driver/CC1Options.td
-@@ -676,6 +676,8 @@ def stack_protector : Separate<["-"], "stack-protector
+@@ -699,6 +699,8 @@ def stack_protector : Separate<["-"], "stack-protector
    HelpText<"Enable stack protectors">;
  def stack_protector_buffer_size : Separate<["-"], "stack-protector-buffer-size">,
    HelpText<"Lower bound for a buffer to be considered for stack protection">;
Index: devel/llvm/patches/patch-tools_clang_include_clang_Driver_Options_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_include_clang_Driver_Options_td,v
retrieving revision 1.18
diff -u -p -r1.18 patch-tools_clang_include_clang_Driver_Options_td
--- devel/llvm/patches/patch-tools_clang_include_clang_Driver_Options_td 24 Feb 2019 20:53:56 -0000 1.18
+++ devel/llvm/patches/patch-tools_clang_include_clang_Driver_Options_td 4 Jul 2019 15:26:11 -0000
@@ -8,10 +8,10 @@ $OpenBSD: patch-tools_clang_include_clan
 Index: tools/clang/include/clang/Driver/Options.td
 --- tools/clang/include/clang/Driver/Options.td.orig
 +++ tools/clang/include/clang/Driver/Options.td
-@@ -1595,6 +1595,14 @@ def fstack_protector_strong : Flag<["-"], "fstack-prot
-   HelpText<"Use a strong heuristic to apply stack protectors to functions">;
- def fstack_protector : Flag<["-"], "fstack-protector">, Group<f_Group>,
-   HelpText<"Enable stack protectors for functions potentially vulnerable to stack smashing">;
+@@ -1665,6 +1665,14 @@ def ftrivial_auto_var_init : Joined<["-"], "ftrivial-a
+ def enable_trivial_var_init_zero : Joined<["-"], "enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang">,
+   Flags<[CC1Option]>,
+   HelpText<"Trivial automatic variable initialization to zero is only here for benchmarks, it'll eventually be removed, and I'm OK with that because I'm only using it to benchmark">;
 +def fno_ret_protector : Flag<["-"], "fno-ret-protector">, Group<f_Group>,
 +  HelpText<"Disable return protector">;
 +def fret_protector : Flag<["-"], "fret-protector">, Group<f_Group>,
@@ -23,7 +23,7 @@ Index: tools/clang/include/clang/Driver/
  def fstandalone_debug : Flag<["-"], "fstandalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
    HelpText<"Emit full debug info for all types used by the program">;
  def fno_standalone_debug : Flag<["-"], "fno-standalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
-@@ -2359,7 +2367,7 @@ def pthreads : Flag<["-"], "pthreads">;
+@@ -2500,7 +2508,7 @@ def pthreads : Flag<["-"], "pthreads">;
  def pthread : Flag<["-"], "pthread">, Flags<[CC1Option]>,
    HelpText<"Support POSIX threads in generated code">;
  def no_pthread : Flag<["-"], "no-pthread">, Flags<[CC1Option]>;
@@ -32,8 +32,8 @@ Index: tools/clang/include/clang/Driver/
  def pie : Flag<["-"], "pie">;
  def read__only__relocs : Separate<["-"], "read_only_relocs">;
  def remap : Flag<["-"], "remap">;
-@@ -2810,6 +2818,8 @@ def mretpoline : Flag<["-"], "mretpoline">, Group<m_x8
- def mno_retpoline : Flag<["-"], "mno-retpoline">, Group<m_x86_Features_Group>;
+@@ -2949,6 +2957,8 @@ def mshstk : Flag<["-"], "mshstk">, Group<m_x86_Featur
+ def mno_shstk : Flag<["-"], "mno-shstk">, Group<m_x86_Features_Group>;
  def mretpoline_external_thunk : Flag<["-"], "mretpoline-external-thunk">, Group<m_x86_Features_Group>;
  def mno_retpoline_external_thunk : Flag<["-"], "mno-retpoline-external-thunk">, Group<m_x86_Features_Group>;
 +def msave_args : Flag<["-"], "msave-args">, Group<m_x86_Features_Group>;
Index: devel/llvm/patches/patch-tools_clang_include_clang_Frontend_CodeGenOptions_def
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_include_clang_Frontend_CodeGenOptions_def
diff -N devel/llvm/patches/patch-tools_clang_include_clang_Frontend_CodeGenOptions_def
--- devel/llvm/patches/patch-tools_clang_include_clang_Frontend_CodeGenOptions_def 28 Jan 2019 06:27:28 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-$OpenBSD: patch-tools_clang_include_clang_Frontend_CodeGenOptions_def,v 1.2 2019/01/28 06:27:28 jca Exp $
-
-Add RETGUARD to clang for amd64. This security mechanism uses per-function
-random cookies to protect access to function return instructions, with the
-effect that the integrity of the return address is protected, and function
-return instructions are harder to use in ROP gadgets.
-
-On function entry the return address is combined with a per-function random
-cookie and stored in the stack frame. The integrity of this value is verified
-before function return, and if this check fails, the program aborts. In this way
-RETGUARD is an improved stack protector, since the cookies are per-function. The
-verification routine is constructed such that the binary space immediately
-before each ret instruction is padded with int03 instructions, which makes these
-return instructions difficult to use in ROP gadgets. In the kernel, this has the
-effect of removing approximately 50% of total ROP gadgets, and 15% of unique
-ROP gadgets compared to the 6.3 release kernel. Function epilogues are
-essentially gadget free, leaving only the polymorphic gadgets that result from
-jumping into the instruction stream partway through other instructions. Work to
-remove these gadgets will continue through other mechanisms.
-
-Index: tools/clang/include/clang/Frontend/CodeGenOptions.def
---- tools/clang/include/clang/Frontend/CodeGenOptions.def.orig
-+++ tools/clang/include/clang/Frontend/CodeGenOptions.def
-@@ -274,6 +274,9 @@ VALUE_CODEGENOPT(NumRegisterParameters, 32, 0)
- /// The lower bound for a buffer to be considered for stack protection.
- VALUE_CODEGENOPT(SSPBufferSize, 32, 0)
-
-+/// Whether to use return protectors
-+CODEGENOPT(ReturnProtector, 1, 0)
-+
- /// The kind of generated debug info.
- ENUM_CODEGENOPT(DebugInfo, codegenoptions::DebugInfoKind, 3, codegenoptions::NoDebugInfo)
-
Index: devel/llvm/patches/patch-tools_clang_include_clang_Sema_Sema_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_include_clang_Sema_Sema_h,v
retrieving revision 1.4
diff -u -p -r1.4 patch-tools_clang_include_clang_Sema_Sema_h
--- devel/llvm/patches/patch-tools_clang_include_clang_Sema_Sema_h 28 Jan 2019 06:27:28 -0000 1.4
+++ devel/llvm/patches/patch-tools_clang_include_clang_Sema_Sema_h 4 Jul 2019 15:26:11 -0000
@@ -5,7 +5,7 @@ Teach Clang about syslog format attribut
 Index: tools/clang/include/clang/Sema/Sema.h
 --- tools/clang/include/clang/Sema/Sema.h.orig
 +++ tools/clang/include/clang/Sema/Sema.h
-@@ -10454,6 +10454,7 @@ class Sema { (public)
+@@ -10561,6 +10561,7 @@ class Sema { (public)
      FST_FreeBSDKPrintf,
      FST_OSTrace,
      FST_OSLog,
Index: devel/llvm/patches/patch-tools_clang_lib_Analysis_FormatString_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Analysis_FormatString_cpp
diff -N devel/llvm/patches/patch-tools_clang_lib_Analysis_FormatString_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Analysis_FormatString_cpp 14 Jan 2019 16:08:45 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,39 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Analysis_FormatString_cpp,v 1.1 2019/01/14 16:08:45 jca Exp $
-
-The %b printf extension in the kernel is not fixed to a int type. On sparc64
-there are various %llb formats. Adjust the code to handle the length specifiers
-and type check like it is used by the regular case.
-
-Index: tools/clang/lib/Analysis/FormatString.cpp
---- tools/clang/lib/Analysis/FormatString.cpp.orig
-+++ tools/clang/lib/Analysis/FormatString.cpp
-@@ -706,6 +706,10 @@ bool FormatSpecifier::hasValidLengthModifier(const Tar
-         case ConversionSpecifier::XArg:
-         case ConversionSpecifier::nArg:
-           return true;
-+        case ConversionSpecifier::FreeBSDbArg:
-+          return Target.getTriple().isOSFreeBSD() ||
-+                 Target.getTriple().isPS4() ||
-+                 Target.getTriple().isOSOpenBSD();
-         case ConversionSpecifier::FreeBSDrArg:
-         case ConversionSpecifier::FreeBSDyArg:
-           return Target.getTriple().isOSFreeBSD() || Target.getTriple().isPS4();
-@@ -739,6 +743,10 @@ bool FormatSpecifier::hasValidLengthModifier(const Tar
-         case ConversionSpecifier::ScanListArg:
-         case ConversionSpecifier::ZArg:
-           return true;
-+        case ConversionSpecifier::FreeBSDbArg:
-+          return Target.getTriple().isOSFreeBSD() ||
-+                 Target.getTriple().isPS4() ||
-+                 Target.getTriple().isOSOpenBSD();
-         case ConversionSpecifier::FreeBSDrArg:
-         case ConversionSpecifier::FreeBSDyArg:
-           return Target.getTriple().isOSFreeBSD() || Target.getTriple().isPS4();
-@@ -897,6 +905,7 @@ bool FormatSpecifier::hasStandardLengthConversionCombi
-         case ConversionSpecifier::uArg:
-         case ConversionSpecifier::xArg:
-         case ConversionSpecifier::XArg:
-+        case ConversionSpecifier::FreeBSDbArg:
-           return false;
-         default:
-           return true;
Index: devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_PPC_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_PPC_h
diff -N devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_PPC_h
--- devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_PPC_h 11 Feb 2019 05:33:57 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Basic_Targets_PPC_h,v 1.1 2019/02/11 05:33:57 jca Exp $
-
-long double is double on OpenBSD/NetBSD/PPC.
-
-Index: tools/clang/lib/Basic/Targets/PPC.h
---- tools/clang/lib/Basic/Targets/PPC.h.orig
-+++ tools/clang/lib/Basic/Targets/PPC.h
-@@ -328,9 +328,15 @@ class LLVM_LIBRARY_VISIBILITY PPC32TargetInfo : public
-       break;
-     }
-
--    if (getTriple().getOS() == llvm::Triple::FreeBSD) {
-+    switch (getTriple().getOS()) {
-+    case llvm::Triple::FreeBSD:
-+    case llvm::Triple::NetBSD:
-+    case llvm::Triple::OpenBSD:
-       LongDoubleWidth = LongDoubleAlign = 64;
-       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
-+      break;
-+    default:
-+      break;
-     }
-
-     // PPC32 supports atomics up to 4 bytes.
Index: devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_clang_lib_Basic_Targets_X86_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_cpp 11 Feb 2019 05:24:16 -0000 1.3
+++ devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_cpp 4 Jul 2019 15:26:11 -0000
@@ -5,7 +5,7 @@ implement -msave-args in clang/llvm, lik
 Index: tools/clang/lib/Basic/Targets/X86.cpp
 --- tools/clang/lib/Basic/Targets/X86.cpp.orig
 +++ tools/clang/lib/Basic/Targets/X86.cpp
-@@ -814,6 +814,8 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<s
+@@ -817,6 +817,8 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<s
        HasPTWRITE = true;
      } else if (Feature == "+invpcid") {
        HasINVPCID = true;
@@ -14,7 +14,7 @@ Index: tools/clang/lib/Basic/Targets/X86
      }
 
      X86SSEEnum Level = llvm::StringSwitch<X86SSEEnum>(Feature)
-@@ -1386,6 +1388,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) cons
+@@ -1398,6 +1400,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) cons
        .Case("movdiri", HasMOVDIRI)
        .Case("movdir64b", HasMOVDIR64B)
        .Case("mpx", HasMPX)
Index: devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_h,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_clang_lib_Basic_Targets_X86_h
--- devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_h 11 Feb 2019 05:24:16 -0000 1.3
+++ devel/llvm/patches/patch-tools_clang_lib_Basic_Targets_X86_h 4 Jul 2019 15:26:11 -0000
@@ -5,7 +5,7 @@ implement -msave-args in clang/llvm, lik
 Index: tools/clang/lib/Basic/Targets/X86.h
 --- tools/clang/lib/Basic/Targets/X86.h.orig
 +++ tools/clang/lib/Basic/Targets/X86.h
-@@ -107,6 +107,7 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public T
+@@ -106,6 +106,7 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public T
    bool HasMOVDIR64B = false;
    bool HasPTWRITE = false;
    bool HasINVPCID = false;
Index: devel/llvm/patches/patch-tools_clang_lib_CodeGen_CGCall_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_CodeGen_CGCall_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-tools_clang_lib_CodeGen_CGCall_cpp
--- devel/llvm/patches/patch-tools_clang_lib_CodeGen_CGCall_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-tools_clang_lib_CodeGen_CGCall_cpp 4 Jul 2019 15:26:11 -0000
@@ -21,14 +21,13 @@ remove these gadgets will continue throu
 Index: tools/clang/lib/CodeGen/CGCall.cpp
 --- tools/clang/lib/CodeGen/CGCall.cpp.orig
 +++ tools/clang/lib/CodeGen/CGCall.cpp
-@@ -1936,6 +1936,10 @@ void CodeGenModule::ConstructAttributeList(
-
+@@ -1958,6 +1958,9 @@ void CodeGenModule::ConstructAttributeList(
      FuncAttrs.addAttribute("disable-tail-calls",
                             llvm::toStringRef(DisableTailCalls));
+     GetCPUAndFeaturesAttributes(CalleeInfo.getCalleeDecl(), FuncAttrs);
 +
 +    if (CodeGenOpts.ReturnProtector)
 +      FuncAttrs.addAttribute("ret-protector");
-+
-     GetCPUAndFeaturesAttributes(TargetDecl, FuncAttrs);
    }
 
+   ClangToLLVMArgMapping IRFunctionArgs(getContext(), FI);
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_cpp 4 Jul 2019 15:26:11 -0000
@@ -5,17 +5,7 @@ Make LLVM create strict aligned code for
 Index: tools/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
 --- tools/clang/lib/Driver/ToolChains/Arch/AArch64.cpp.orig
 +++ tools/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
-@@ -152,7 +152,8 @@ getAArch64MicroArchFeaturesFromMcpu(const Driver &D, S
-   return getAArch64MicroArchFeaturesFromMtune(D, CPU, Args, Features);
- }
-
--void aarch64::getAArch64TargetFeatures(const Driver &D, const ArgList &Args,
-+void aarch64::getAArch64TargetFeatures(const Driver &D, const llvm::Triple &Triple,
-+                                       const ArgList &Args,
-                                        std::vector<StringRef> &Features) {
-   Arg *A;
-   bool success = true;
-@@ -194,9 +195,11 @@ void aarch64::getAArch64TargetFeatures(const Driver &D
+@@ -311,9 +311,11 @@ fp16_fml_fallthrough:
    }
 
    if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access,
@@ -26,5 +16,5 @@ Index: tools/clang/lib/Driver/ToolChains
 +  } else if (Triple.isOSOpenBSD())
 +    Features.push_back("+strict-align");
 
-   if (Args.hasArg(options::OPT_ffixed_x18))
-     Features.push_back("+reserve-x18");
+   if (Args.hasArg(options::OPT_ffixed_x1))
+     Features.push_back("+reserve-x1");
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h
diff -N devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h 1 Sep 2017 06:40:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Driver_ToolChains_Arch_AArch64_h,v 1.1 2017/09/01 06:40:28 ajacoutot Exp $
-
-Make LLVM create strict aligned code for OpenBSD/arm64.
-
---- tools/clang/lib/Driver/ToolChains/Arch/AArch64.h.orig Sun Apr  2 02:26:33 2017
-+++ tools/clang/lib/Driver/ToolChains/Arch/AArch64.h Sun Apr  2 02:29:49 2017
-@@ -21,7 +21,8 @@ namespace driver {
- namespace tools {
- namespace aarch64 {
-
--void getAArch64TargetFeatures(const Driver &D, const llvm::opt::ArgList &Args,
-+void getAArch64TargetFeatures(const Driver &D, const llvm::Triple &Triple,
-+                              const llvm::opt::ArgList &Args,
-                               std::vector<llvm::StringRef> &Features);
-
- std::string getAArch64TargetCPU(const llvm::opt::ArgList &Args,
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Clang_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Clang_cpp,v
retrieving revision 1.8
diff -u -p -r1.8 patch-tools_clang_lib_Driver_ToolChains_Clang_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Clang_cpp 24 Feb 2019 20:53:56 -0000 1.8
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Clang_cpp 4 Jul 2019 15:26:11 -0000
@@ -32,16 +32,7 @@ $OpenBSD: patch-tools_clang_lib_Driver_T
 Index: tools/clang/lib/Driver/ToolChains/Clang.cpp
 --- tools/clang/lib/Driver/ToolChains/Clang.cpp.orig
 +++ tools/clang/lib/Driver/ToolChains/Clang.cpp
-@@ -341,7 +341,7 @@ static void getTargetFeatures(const ToolChain &TC, con
-     break;
-   case llvm::Triple::aarch64:
-   case llvm::Triple::aarch64_be:
--    aarch64::getAArch64TargetFeatures(D, Args, Features);
-+    aarch64::getAArch64TargetFeatures(D, Triple, Args, Features);
-     break;
-   case llvm::Triple::x86:
-   case llvm::Triple::x86_64:
-@@ -3478,9 +3478,12 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+@@ -3893,9 +3893,12 @@ void Clang::ConstructJob(Compilation &C, const JobActi
        OFastEnabled ? options::OPT_Ofast : options::OPT_fstrict_aliasing;
    // We turn strict aliasing off by default if we're in CL mode, since MSVC
    // doesn't do any TBAA.
@@ -56,19 +47,22 @@ Index: tools/clang/lib/Driver/ToolChains
      CmdArgs.push_back("-relaxed-aliasing");
    if (!Args.hasFlag(options::OPT_fstruct_path_tbaa,
                      options::OPT_fno_struct_path_tbaa))
-@@ -4086,7 +4089,8 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+@@ -4521,7 +4524,8 @@ void Clang::ConstructJob(Compilation &C, const JobActi
                                        options::OPT_fno_strict_overflow)) {
      if (A->getOption().matches(options::OPT_fno_strict_overflow))
        CmdArgs.push_back("-fwrapv");
 -  }
 +  } else if (getToolChain().getTriple().isOSOpenBSD())
-+      CmdArgs.push_back("-fwrapv");
++    CmdArgs.push_back("-fwrapv");
 
    if (Arg *A = Args.getLastArg(options::OPT_freroll_loops,
                                 options::OPT_fno_reroll_loops))
-@@ -4101,6 +4105,34 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+@@ -4538,9 +4542,44 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+                    false))
+     CmdArgs.push_back(Args.MakeArgString("-mspeculative-load-hardening"));
 
-   RenderSSPOptions(getToolChain(), Args, CmdArgs, KernelOrKext);
+-  RenderSSPOptions(TC, Args, CmdArgs, KernelOrKext);
+   RenderTrivialAutoVarInitOptions(D, TC, Args, CmdArgs);
 
 +  // -ret-protector
 +  unsigned RetProtector = 1;
@@ -85,7 +79,15 @@ Index: tools/clang/lib/Driver/ToolChains
 +      !Args.hasArg(options::OPT_fno_stack_protector) &&
 +      !Args.hasArg(options::OPT_pg)) {
 +    CmdArgs.push_back(Args.MakeArgString("-D_RET_PROTECTOR"));
-+    CmdArgs.push_back(Args.MakeArgString(Twine("-ret-protector")));
++    CmdArgs.push_back(Args.MakeArgString("-ret-protector"));
++    // Consume the stack protector arguments to prevent warning
++    Args.getLastArg(options::OPT_fstack_protector_all,
++        options::OPT_fstack_protector_strong,
++        options::OPT_fstack_protector,
++        options::OPT__param); // ssp-buffer-size
++  } else {
++    // If we're not using retguard, then do the usual stack protector
++    RenderSSPOptions(getToolChain(), Args, CmdArgs, KernelOrKext);
 +  }
 +
 +  // -fixup-gadgets
@@ -101,11 +103,10 @@ Index: tools/clang/lib/Driver/ToolChains
    // Translate -mstackrealign
    if (Args.hasFlag(options::OPT_mstackrealign, options::OPT_mno_stackrealign,
                     false))
-@@ -4579,6 +4611,18 @@ void Clang::ConstructJob(Compilation &C, const JobActi
-       llvm::sys::path::replace_extension(F, "opt.yaml");
-       CmdArgs.push_back(Args.MakeArgString(F));
-     }
-+  }
+@@ -5023,6 +5062,18 @@ void Clang::ConstructJob(Compilation &C, const JobActi
+                                      options::OPT_fno_rewrite_imports, false);
+   if (RewriteImports)
+     CmdArgs.push_back("-frewrite-imports");
 +
 +  // Disable some builtins on OpenBSD because they are just not
 +  // right...
@@ -117,6 +118,7 @@ Index: tools/clang/lib/Driver/ToolChains
 +    CmdArgs.push_back("-fno-builtin-free");
 +    CmdArgs.push_back("-fno-builtin-strdup");
 +    CmdArgs.push_back("-fno-builtin-strndup");
-   }
++  }
 
-   bool RewriteImports = Args.hasFlag(options::OPT_frewrite_imports,
+   // Enable rewrite includes if the user's asked for it or if we're generating
+   // diagnostics.
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp 28 Jan 2019 06:27:28 -0000 1.6
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp 4 Jul 2019 15:26:11 -0000
@@ -1,30 +1,16 @@
 $OpenBSD: patch-tools_clang_lib_Driver_ToolChains_Gnu_cpp,v 1.6 2019/01/28 06:27:28 jca Exp $
 
-- [mips] Enable using of integrated assembler in all cases.
-- Enable IAS for OpenBSD SPARC.
+- Disable IAS for OpenBSD SPARC.
 
 Index: tools/clang/lib/Driver/ToolChains/Gnu.cpp
 --- tools/clang/lib/Driver/ToolChains/Gnu.cpp.orig
 +++ tools/clang/lib/Driver/ToolChains/Gnu.cpp
-@@ -2412,16 +2412,13 @@ bool Generic_GCC::IsIntegratedAssemblerDefault() const
-   case llvm::Triple::systemz:
-   case llvm::Triple::mips:
-   case llvm::Triple::mipsel:
--    return true;
-   case llvm::Triple::mips64:
-   case llvm::Triple::mips64el:
--    // Enabled for Debian, Android, FreeBSD and OpenBSD mips64/mipsel, as they
--    // can precisely identify the ABI in use (Debian) or only use N64 for MIPS64
--    // (Android). Other targets are unable to distinguish N32 from N64.
--    if (getTriple().getEnvironment() == llvm::Triple::GNUABI64 ||
--        getTriple().isAndroid() ||
--        getTriple().isOSFreeBSD() ||
--        getTriple().isOSOpenBSD())
-+    return true;
-+  case llvm::Triple::sparc:
-+  case llvm::Triple::sparcel:
-+  case llvm::Triple::sparcv9:
-+    if (getTriple().isOSSolaris() || getTriple().isOSOpenBSD())
+@@ -2512,7 +2512,7 @@ bool Generic_GCC::IsIntegratedAssemblerDefault() const
+   case llvm::Triple::sparc:
+   case llvm::Triple::sparcel:
+   case llvm::Triple::sparcv9:
+-    if (getTriple().isOSSolaris() || getTriple().isOSOpenBSD())
++    if (getTriple().isOSSolaris())
        return true;
      return false;
    default:
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp,v
retrieving revision 1.8
diff -u -p -r1.8 patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp 28 Jan 2019 15:34:22 -0000 1.8
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp 4 Jul 2019 15:26:11 -0000
@@ -1,6 +1,7 @@
 $OpenBSD: patch-tools_clang_lib_Driver_ToolChains_OpenBSD_cpp,v 1.8 2019/01/28 15:34:22 jca Exp $
 
-Some improvements to the OpenBSD driver.
+Add support for building against libestdc++ from ports-gcc.
+Use more *_p.a libraries from base when profiling is requested.
 
 Index: tools/clang/lib/Driver/ToolChains/OpenBSD.cpp
 --- tools/clang/lib/Driver/ToolChains/OpenBSD.cpp.orig
@@ -14,95 +15,11 @@ Index: tools/clang/lib/Driver/ToolChains
  #include "clang/Driver/Options.h"
  #include "clang/Driver/SanitizerArgs.h"
  #include "llvm/Option/ArgList.h"
-@@ -111,9 +113,9 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
-   // handled somewhere else.
-   Args.ClaimAllArgs(options::OPT_w);
-
--  if (getToolChain().getArch() == llvm::Triple::mips64)
-+  if (ToolChain.getArch() == llvm::Triple::mips64)
-     CmdArgs.push_back("-EB");
--  else if (getToolChain().getArch() == llvm::Triple::mips64el)
-+  else if (ToolChain.getArch() == llvm::Triple::mips64el)
-     CmdArgs.push_back("-EL");
-
-   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_shared)) {
-@@ -149,44 +151,50 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
-   }
-
-   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
-+    const char *crt0 = nullptr;
-+    const char *crtbegin = nullptr;
-     if (!Args.hasArg(options::OPT_shared)) {
-       if (Args.hasArg(options::OPT_pg))
--        CmdArgs.push_back(
--            Args.MakeArgString(getToolChain().GetFilePath("gcrt0.o")));
-+        crt0 = "gcrt0.o";
-       else if (Args.hasArg(options::OPT_static) &&
-                !Args.hasArg(options::OPT_nopie))
--        CmdArgs.push_back(
--            Args.MakeArgString(getToolChain().GetFilePath("rcrt0.o")));
-+        crt0 = "rcrt0.o";
-       else
--        CmdArgs.push_back(
--            Args.MakeArgString(getToolChain().GetFilePath("crt0.o")));
--      CmdArgs.push_back(
--          Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
-+        crt0 = "crt0.o";
-+      crtbegin = "crtbegin.o";
-     } else {
--      CmdArgs.push_back(
--          Args.MakeArgString(getToolChain().GetFilePath("crtbeginS.o")));
-+      crtbegin = "crtbeginS.o";
-     }
-+
-+    if (crt0)
-+      CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt0)));
-+    CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
-   }
-
--  std::string Triple = getToolChain().getTripleString();
--  if (Triple.substr(0, 6) == "x86_64")
--    Triple.replace(0, 6, "amd64");
--  CmdArgs.push_back(
--      Args.MakeArgString("-L/usr/lib/gcc-lib/" + Triple + "/4.2.1"));
--  CmdArgs.push_back(Args.MakeArgString("-L/usr/lib"));
-+  if (ToolChain.GetCXXStdlibType(Args) == ToolChain::CST_Libstdcxx) {
-+    std::string Triple = ToolChain.getTripleString();
-+    if (Triple.substr(0, 6) == "x86_64")
-+      Triple.replace(0, 6, "amd64");
-+    CmdArgs.push_back(
-+        Args.MakeArgString("-L${LOCALBASE}/lib/gcc/" + Triple + "/${GCC_VER}"));
-+    CmdArgs.push_back(
-+        Args.MakeArgString("-L${LOCALBASE}/lib"));
-+  }
-
--  Args.AddAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group,
--                            options::OPT_e, options::OPT_s, options::OPT_t,
-+  Args.AddAllArgs(CmdArgs, options::OPT_L);
-+  ToolChain.AddFilePathLibArgs(Args, CmdArgs);
-+  Args.AddAllArgs(CmdArgs, {options::OPT_T_Group, options::OPT_e,
-+                            options::OPT_s, options::OPT_t,
-                             options::OPT_Z_Flag, options::OPT_r});
-
-   bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
-   bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
--  AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
-+  AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
-
-   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
-     if (D.CCCIsCXX()) {
--      if (getToolChain().ShouldLinkCXXStdlib(Args))
--        getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
-+      if (ToolChain.ShouldLinkCXXStdlib(Args))
-+        ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
-       if (Args.hasArg(options::OPT_pg))
-         CmdArgs.push_back("-lm_p");
-       else
-@@ -202,7 +210,10 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
+@@ -198,7 +200,10 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
      }
      // FIXME: For some reason GCC passes -lgcc before adding
      // the default system libraries. Just mimic this for now.
--    CmdArgs.push_back("-lgcc");
+-    CmdArgs.push_back("-lcompiler_rt");
 +    if (ToolChain.GetCXXStdlibType(Args) == ToolChain::CST_Libcxx)
 +      CmdArgs.push_back("-lcompiler_rt");
 +    else
@@ -110,11 +27,11 @@ Index: tools/clang/lib/Driver/ToolChains
 
      if (Args.hasArg(options::OPT_pthread)) {
        if (!Args.hasArg(options::OPT_shared) && Args.hasArg(options::OPT_pg))
-@@ -218,21 +229,25 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
+@@ -214,7 +219,10 @@ void openbsd::Linker::ConstructJob(Compilation &C, con
          CmdArgs.push_back("-lc");
      }
 
--    CmdArgs.push_back("-lgcc");
+-    CmdArgs.push_back("-lcompiler_rt");
 +    if (ToolChain.GetCXXStdlibType(Args) == ToolChain::CST_Libcxx)
 +      CmdArgs.push_back("-lcompiler_rt");
 +    else
@@ -122,53 +39,27 @@ Index: tools/clang/lib/Driver/ToolChains
    }
 
    if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
-+    const char *crtend = nullptr;
-     if (!Args.hasArg(options::OPT_shared))
--      CmdArgs.push_back(
--          Args.MakeArgString(getToolChain().GetFilePath("crtend.o")));
-+      crtend = "crtend.o";
-     else
--      CmdArgs.push_back(
--          Args.MakeArgString(getToolChain().GetFilePath("crtendS.o")));
-+      crtend = "crtendS.o";
-+
-+    CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));
-   }
-
-   const char *Exec = Args.MakeArgString(
--      !NeedsSanitizerDeps ? getToolChain().GetLinkerPath()
--                          : getToolChain().GetProgramPath("ld.lld"));
-+      !NeedsSanitizerDeps ? ToolChain.GetLinkerPath()
-+                          : ToolChain.GetProgramPath("ld.lld"));
-   C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
- }
-
-@@ -257,16 +272,60 @@ SanitizerMask OpenBSD::getSupportedSanitizers() const
+@@ -252,19 +260,82 @@ SanitizerMask OpenBSD::getSupportedSanitizers() const
  OpenBSD::OpenBSD(const Driver &D, const llvm::Triple &Triple,
                   const ArgList &Args)
      : Generic_ELF(D, Triple, Args) {
--  getFilePaths().push_back(getDriver().Dir + "/../lib");
--  getFilePaths().push_back("/usr/lib");
-+  getFilePaths().push_back(getDriver().SysRoot + "/usr/lib");
++  getFilePaths().push_back(getDriver().Dir + "/../lib");
+   getFilePaths().push_back(getDriver().SysRoot + "/usr/lib");
  }
 
- void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
-                                   ArgStringList &CmdArgs) const {
-   bool Profiling = Args.hasArg(options::OPT_pg);
-
+-void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
+-                                  ArgStringList &CmdArgs) const {
+-  bool Profiling = Args.hasArg(options::OPT_pg);
+-
 -  CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
 -  CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi");
-+  switch (GetCXXStdlibType(Args)) {
-+  case ToolChain::CST_Libcxx:
-+    CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
-+    CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi");
-+    CmdArgs.push_back(Profiling ? "-lpthread_p" : "-lpthread");
-+    break;
-+  case ToolChain::CST_Libstdcxx:
-+    CmdArgs.push_back("-lestdc++");
-+    break;
-+  }
-+}
+-}
+-
+ Tool *OpenBSD::buildAssembler() const {
+   return new tools::openbsd::Assembler(*this);
+ }
+
+ Tool *OpenBSD::buildLinker() const { return new tools::openbsd::Linker(*this); }
 +
 +ToolChain::CXXStdlibType OpenBSD::GetCXXStdlibType(const ArgList &Args) const {
 +  if (Arg *A = Args.getLastArg(options::OPT_stdlib_EQ)) {
@@ -178,10 +69,10 @@ Index: tools/clang/lib/Driver/ToolChains
 +    if (Value == "libc++")
 +      return ToolChain::CST_Libcxx;
 +
-+    getDriver().Diag(diag::err_drv_invalid_stdlib_name) << A->getAsString(Args);
++    getDriver().Diag(clang::diag::err_drv_invalid_stdlib_name)
++        << A->getAsString(Args);
 +  }
-+
-+  switch (getArch()) {
++  switch (getTriple().getArch()) {
 +  case llvm::Triple::arm:
 +  case llvm::Triple::aarch64:
 +  case llvm::Triple::x86:
@@ -194,17 +85,48 @@ Index: tools/clang/lib/Driver/ToolChains
 +  }
 +}
 +
-+void OpenBSD::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
-+                                       llvm::opt::ArgStringList &CC1Args) const {
-+  addLibStdCXXIncludePaths(getDriver().SysRoot,
-+      "${LOCALBASE}/include/c++/${GCC_VER}",
-+      "", "", "", "", DriverArgs, CC1Args);
-+  addLibStdCXXIncludePaths(getDriver().SysRoot,
-+      "${LOCALBASE}/include/c++/${GCC_VER}/${GCC_CONFIG}",
-+      "", "", "", "", DriverArgs, CC1Args);
-+  addLibStdCXXIncludePaths(getDriver().SysRoot,
-+      "${LOCALBASE}/include/c++/${GCC_VER}/backward",
-+      "", "", "", "", DriverArgs, CC1Args);
- }
-
- Tool *OpenBSD::buildAssembler() const {
++void OpenBSD::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
++                                          ArgStringList &CC1Args) const {
++  if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||
++      DriverArgs.hasArg(options::OPT_nostdincxx))
++    return;
++
++  switch (GetCXXStdlibType(DriverArgs)) {
++  case ToolChain::CST_Libcxx:
++    addSystemInclude(DriverArgs, CC1Args,
++                     getDriver().SysRoot + "/usr/include/c++/v1");
++    break;
++  case ToolChain::CST_Libstdcxx:
++    std::string Triple = getTriple().str();
++    if (Triple.substr(0, 6) == "x86_64")
++      Triple.replace(0, 6, "amd64");
++    addSystemInclude(DriverArgs, CC1Args,
++                     getDriver().SysRoot + "${LOCALBASE}/include/c++/${GCC_VER}");
++    addSystemInclude(DriverArgs, CC1Args,
++                     getDriver().SysRoot + "${LOCALBASE}/include/c++/${GCC_VER}/" + Triple);
++    addSystemInclude(DriverArgs, CC1Args,
++                     getDriver().SysRoot + "${LOCALBASE}/include/c++/${GCC_VER}/backward");
++    break;
++  }
++}
++
++void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
++                                 ArgStringList &CmdArgs) const {
++  bool Profiling = Args.hasArg(options::OPT_pg);
++
++  switch (GetCXXStdlibType(Args)) {
++  case ToolChain::CST_Libcxx:
++    CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
++    CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi");
++    CmdArgs.push_back(Profiling ? "-lpthread_p" : "-lpthread");
++    break;
++  case ToolChain::CST_Libstdcxx:
++    std::string Triple = getTriple().str();
++    if (Triple.substr(0, 6) == "x86_64")
++      Triple.replace(0, 6, "amd64");
++    CmdArgs.push_back(Args.MakeArgString("-L${LOCALBASE}/lib/gcc/" + Triple + "/${GCC_VER}"));
++    CmdArgs.push_back(Args.MakeArgString("-L${LOCALBASE}/lib"));
++    CmdArgs.push_back("-lestdc++");
++    break;
++  }
++}
Index: devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h
--- devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h 28 Jan 2019 06:27:28 -0000 1.3
+++ devel/llvm/patches/patch-tools_clang_lib_Driver_ToolChains_OpenBSD_h 4 Jul 2019 15:26:11 -0000
@@ -2,17 +2,15 @@ $OpenBSD: patch-tools_clang_lib_Driver_T
 Index: tools/clang/lib/Driver/ToolChains/OpenBSD.h
 --- tools/clang/lib/Driver/ToolChains/OpenBSD.h.orig
 +++ tools/clang/lib/Driver/ToolChains/OpenBSD.h
-@@ -58,8 +58,13 @@ class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic
-   bool IsMathErrnoDefault() const override { return false; }
-   bool IsObjCNonFragileABIDefault() const override { return true; }
-   bool isPIEDefault() const override { return true; }
-+
+@@ -69,6 +69,11 @@ class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic
    void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
                             llvm::opt::ArgStringList &CmdArgs) const override;
+
 +  CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
-+  void addLibStdCxxIncludePaths(
++  void AddClangCXXStdlibIncludeArgs(
 +      const llvm::opt::ArgList &DriverArgs,
 +      llvm::opt::ArgStringList &CC1Args) const override;
-
++
    unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
      return 2;
+   }
Index: devel/llvm/patches/patch-tools_clang_lib_Frontend_CompilerInvocation_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Frontend_CompilerInvocation_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-tools_clang_lib_Frontend_CompilerInvocation_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Frontend_CompilerInvocation_cpp 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/patches/patch-tools_clang_lib_Frontend_CompilerInvocation_cpp 4 Jul 2019 15:26:11 -0000
@@ -21,7 +21,7 @@ remove these gadgets will continue throu
 Index: tools/clang/lib/Frontend/CompilerInvocation.cpp
 --- tools/clang/lib/Frontend/CompilerInvocation.cpp.orig
 +++ tools/clang/lib/Frontend/CompilerInvocation.cpp
-@@ -978,6 +978,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, Arg
+@@ -1133,6 +1133,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, Arg
      Opts.StackAlignment = StackAlignment;
    }
 
Index: devel/llvm/patches/patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp
diff -N devel/llvm/patches/patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp 28 Jan 2019 15:34:22 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Frontend_InitHeaderSearch_cpp,v 1.6 2019/01/28 15:34:22 jca Exp $
-
-Index: tools/clang/lib/Frontend/InitHeaderSearch.cpp
---- tools/clang/lib/Frontend/InitHeaderSearch.cpp.orig
-+++ tools/clang/lib/Frontend/InitHeaderSearch.cpp
-@@ -431,14 +431,6 @@ void InitHeaderSearch::AddDefaultCPlusPlusIncludePaths
-   case llvm::Triple::DragonFly:
-     AddPath("/usr/include/c++/5.0", CXXSystem, false);
-     break;
--  case llvm::Triple::OpenBSD: {
--    std::string t = triple.getTriple();
--    if (t.substr(0, 6) == "x86_64")
--      t.replace(0, 6, "amd64");
--    AddGnuCPlusPlusIncludePaths("/usr/include/g++",
--                                t, "", "", triple);
--    break;
--  }
-   case llvm::Triple::Minix:
-     AddGnuCPlusPlusIncludePaths("/usr/gnu/include/c++/4.4.3",
-                                 "", "", "", triple);
Index: devel/llvm/patches/patch-tools_clang_lib_Parse_ParseStmtAsm_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_clang_lib_Parse_ParseStmtAsm_cpp
diff -N devel/llvm/patches/patch-tools_clang_lib_Parse_ParseStmtAsm_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Parse_ParseStmtAsm_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,17 +0,0 @@
-$OpenBSD: patch-tools_clang_lib_Parse_ParseStmtAsm_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: tools/clang/lib/Parse/ParseStmtAsm.cpp
---- tools/clang/lib/Parse/ParseStmtAsm.cpp.orig
-+++ tools/clang/lib/Parse/ParseStmtAsm.cpp
-@@ -637,7 +637,7 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLo
-   // Filter out "fpsw" and "mxcsr". They aren't valid GCC asm clobber
-   // constraints. Clang always adds fpsr to the clobber list anyway.
-   llvm::erase_if(Clobbers, [](const std::string &C) {
--    return C == "fpsw" || C == "mxcsr";
-+    return C == "fpsr" || C == "mxcsr";
-   });
-
-   // Build the vector of clobber StringRefs.
Index: devel/llvm/patches/patch-tools_clang_lib_Sema_SemaChecking_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Sema_SemaChecking_cpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-tools_clang_lib_Sema_SemaChecking_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Sema_SemaChecking_cpp 28 Jan 2019 06:27:28 -0000 1.6
+++ devel/llvm/patches/patch-tools_clang_lib_Sema_SemaChecking_cpp 4 Jul 2019 15:26:11 -0000
@@ -9,7 +9,7 @@ $OpenBSD: patch-tools_clang_lib_Sema_Sem
 Index: tools/clang/lib/Sema/SemaChecking.cpp
 --- tools/clang/lib/Sema/SemaChecking.cpp.orig
 +++ tools/clang/lib/Sema/SemaChecking.cpp
-@@ -6431,7 +6431,7 @@ checkFormatStringExpr(Sema &S, const Expr *E, ArrayRef
+@@ -6608,7 +6608,7 @@ checkFormatStringExpr(Sema &S, const Expr *E, ArrayRef
  Sema::FormatStringType Sema::GetFormatStringType(const FormatAttr *Format) {
    return llvm::StringSwitch<FormatStringType>(Format->getType()->getName())
        .Case("scanf", FST_Scanf)
@@ -18,7 +18,7 @@ Index: tools/clang/lib/Sema/SemaChecking
        .Cases("NSString", "CFString", FST_NSString)
        .Case("strftime", FST_Strftime)
        .Case("strfmon", FST_Strfmon)
-@@ -6528,6 +6528,7 @@ bool Sema::CheckFormatArguments(ArrayRef<const Expr *>
+@@ -6705,6 +6705,7 @@ bool Sema::CheckFormatArguments(ArrayRef<const Expr *>
      case FST_Kprintf:
      case FST_FreeBSDKPrintf:
      case FST_Printf:
@@ -26,7 +26,7 @@ Index: tools/clang/lib/Sema/SemaChecking
        Diag(FormatLoc, diag::note_format_security_fixit)
          << FixItHint::CreateInsertion(FormatLoc, "\"%s\", ");
        break;
-@@ -7348,19 +7349,33 @@ CheckPrintfHandler::HandlePrintfSpecifier(const analyz
+@@ -7530,19 +7531,33 @@ CheckPrintfHandler::HandlePrintfSpecifier(const analyz
      // Claim the second argument.
      CoveredArgs.set(argIndex + 1);
 
@@ -37,21 +37,19 @@ Index: tools/clang/lib/Sema/SemaChecking
 -        ArgType(S.Context.IntTy) : ArgType::CPointerTy;
 -    if (AT.isValid() && !AT.matchesType(S.Context, Ex->getType()))
 -      EmitFormatDiagnostic(
--        S.PDiag(diag::warn_format_conversion_argument_type_mismatch)
--        << AT.getRepresentativeTypeName(S.Context) << Ex->getType()
--        << false << Ex->getSourceRange(),
--        Ex->getLocStart(), /*IsStringLocation*/false,
--        getSpecifierRange(startSpecifier, specifierLen));
 +    if (CS.getKind() == ConversionSpecifier::FreeBSDDArg) {
 +      // Type check the first argument (pointer for %D)
 +      const analyze_printf::ArgType &AT = ArgType::CPointerTy;
 +      if (AT.isValid() && !AT.matchesType(S.Context, Ex->getType()))
 +        EmitFormatDiagnostic(
-+          S.PDiag(diag::warn_format_conversion_argument_type_mismatch)
+           S.PDiag(diag::warn_format_conversion_argument_type_mismatch)
+-              << AT.getRepresentativeTypeName(S.Context) << Ex->getType()
+-              << false << Ex->getSourceRange(),
+-          Ex->getBeginLoc(), /*IsStringLocation*/ false,
 +          << AT.getRepresentativeTypeName(S.Context) << Ex->getType()
 +          << false << Ex->getSourceRange(),
-+          Ex->getLocStart(), /*IsStringLocation*/false,
-+          getSpecifierRange(startSpecifier, specifierLen));
++          Ex->getBeginLoc(), /*IsStringLocation*/false,
+           getSpecifierRange(startSpecifier, specifierLen));
 +    } else {
 +      // Check the length modifier for %b
 +      if (!FS.hasValidLengthModifier(S.getASTContext().getTargetInfo()))
@@ -71,7 +69,7 @@ Index: tools/clang/lib/Sema/SemaChecking
      // Type check the second argument (char * for both %b and %D)
      Ex = getDataArg(argIndex + 1);
      const analyze_printf::ArgType &AT2 = ArgType::CStrTy;
-@@ -8079,8 +8094,9 @@ static void CheckFormatString(Sema &S, const FormatStr
+@@ -8277,8 +8292,9 @@ static void CheckFormatString(Sema &S, const FormatStr
    }
 
    if (Type == Sema::FST_Printf || Type == Sema::FST_NSString ||
@@ -83,7 +81,7 @@ Index: tools/clang/lib/Sema/SemaChecking
      CheckPrintfHandler H(
          S, FExpr, OrigFormatExpr, Type, firstDataArg, numDataArgs,
          (Type == Sema::FST_NSString || Type == Sema::FST_OSTrace), Str,
-@@ -8090,7 +8106,7 @@ static void CheckFormatString(Sema &S, const FormatStr
+@@ -8288,7 +8304,7 @@ static void CheckFormatString(Sema &S, const FormatStr
      if (!analyze_format_string::ParsePrintfString(H, Str, Str + StrLen,
                                                    S.getLangOpts(),
                                                    S.Context.getTargetInfo(),
Index: devel/llvm/patches/patch-tools_clang_lib_Sema_SemaDeclAttr_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_clang_lib_Sema_SemaDeclAttr_cpp,v
retrieving revision 1.9
diff -u -p -r1.9 patch-tools_clang_lib_Sema_SemaDeclAttr_cpp
--- devel/llvm/patches/patch-tools_clang_lib_Sema_SemaDeclAttr_cpp 28 Jan 2019 06:27:28 -0000 1.9
+++ devel/llvm/patches/patch-tools_clang_lib_Sema_SemaDeclAttr_cpp 4 Jul 2019 15:26:11 -0000
@@ -5,7 +5,7 @@ Teach Clang about syslog format attribut
 Index: tools/clang/lib/Sema/SemaDeclAttr.cpp
 --- tools/clang/lib/Sema/SemaDeclAttr.cpp.orig
 +++ tools/clang/lib/Sema/SemaDeclAttr.cpp
-@@ -3179,6 +3179,7 @@ static FormatAttrKind getFormatAttrKind(StringRef Form
+@@ -3290,6 +3290,7 @@ static FormatAttrKind getFormatAttrKind(StringRef Form
        .Case("freebsd_kprintf", SupportedFormat) // FreeBSD.
        .Case("os_trace", SupportedFormat)
        .Case("os_log", SupportedFormat)
Index: devel/llvm/patches/patch-tools_lld_ELF_Config_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_lld_ELF_Config_h
diff -N devel/llvm/patches/patch-tools_lld_ELF_Config_h
--- devel/llvm/patches/patch-tools_lld_ELF_Config_h 28 Jan 2019 15:34:22 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-tools_lld_ELF_Config_h,v 1.6 2019/01/28 15:34:22 jca Exp $
-
-lld: add -z interpose support
-
-Index: tools/lld/ELF/Config.h
---- tools/lld/ELF/Config.h.orig
-+++ tools/lld/ELF/Config.h
-@@ -182,6 +182,7 @@ struct Configuration {
-   bool ZExecstack;
-   bool ZHazardplt;
-   bool ZInitfirst;
-+  bool ZInterpose;
-   bool ZKeepTextSectionPrefix;
-   bool ZNodelete;
-   bool ZNodlopen;
Index: devel/llvm/patches/patch-tools_lld_ELF_DriverUtils_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_DriverUtils_cpp,v
retrieving revision 1.8
diff -u -p -r1.8 patch-tools_lld_ELF_DriverUtils_cpp
--- devel/llvm/patches/patch-tools_lld_ELF_DriverUtils_cpp 28 Jan 2019 06:27:28 -0000 1.8
+++ devel/llvm/patches/patch-tools_lld_ELF_DriverUtils_cpp 4 Jul 2019 15:26:11 -0000
@@ -5,7 +5,7 @@ Handle the OpenBSD-style major/minor sha
 Index: tools/lld/ELF/DriverUtils.cpp
 --- tools/lld/ELF/DriverUtils.cpp.orig
 +++ tools/lld/ELF/DriverUtils.cpp
-@@ -218,9 +218,35 @@ Optional<std::string> elf::searchLibrary(StringRef Nam
+@@ -219,9 +219,35 @@ Optional<std::string> elf::searchLibrary(StringRef Nam
      return findFromSearchPaths(Name.substr(1));
 
    for (StringRef Dir : Config->SearchPaths) {
Index: devel/llvm/patches/patch-tools_lld_ELF_Driver_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_Driver_cpp,v
retrieving revision 1.12
diff -u -p -r1.12 patch-tools_lld_ELF_Driver_cpp
--- devel/llvm/patches/patch-tools_lld_ELF_Driver_cpp 28 Jan 2019 15:34:22 -0000 1.12
+++ devel/llvm/patches/patch-tools_lld_ELF_Driver_cpp 4 Jul 2019 15:26:11 -0000
@@ -1,38 +1,62 @@
 $OpenBSD: patch-tools_lld_ELF_Driver_cpp,v 1.12 2019/01/28 15:34:22 jca Exp $
 
 - Enable PIE by default.
-- lld: add -z interpose support
+- XXX retpoline, EM_SPARCV9, ???
 
 Index: tools/lld/ELF/Driver.cpp
 --- tools/lld/ELF/Driver.cpp.orig
 +++ tools/lld/ELF/Driver.cpp
-@@ -339,8 +339,9 @@ static bool getZFlag(opt::InputArgList &Args, StringRe
- static bool isKnown(StringRef S) {
-   return S == "combreloc" || S == "copyreloc" || S == "defs" ||
-          S == "execstack" || S == "hazardplt" || S == "initfirst" ||
--         S == "keep-text-section-prefix" || S == "lazy" || S == "muldefs" ||
--         S == "nocombreloc" || S == "nocopyreloc" || S == "nodelete" ||
-+         S == "interpose" || S == "keep-text-section-prefix" ||
-+         S == "lazy" || S == "muldefs" || S == "nocombreloc" ||
-+         S == "nocopyreloc" || S == "nodelete" ||
-          S == "nodlopen" || S == "noexecstack" ||
-          S == "nokeep-text-section-prefix" || S == "norelro" || S == "notext" ||
+@@ -131,6 +131,7 @@ static std::tuple<ELFKind, uint16_t, uint8_t> parseEmu
+           .Cases("elf32ltsmip", "elf32ltsmipn32", {ELF32LEKind, EM_MIPS})
+           .Case("elf32lriscv", {ELF32LEKind, EM_RISCV})
+           .Cases("elf32ppc", "elf32ppclinux", {ELF32BEKind, EM_PPC})
++          .Case("elf64_sparc", {ELF64BEKind, EM_SPARCV9})
+           .Case("elf64btsmip", {ELF64BEKind, EM_MIPS})
+           .Case("elf64ltsmip", {ELF64LEKind, EM_MIPS})
+           .Case("elf64lriscv", {ELF64LEKind, EM_RISCV})
+@@ -352,7 +353,8 @@ static bool isKnownZFlag(StringRef S) {
+          S == "keep-text-section-prefix" || S == "lazy" || S == "muldefs" ||
+          S == "nocombreloc" || S == "nocopyreloc" || S == "nodefaultlib" ||
+          S == "nodelete" || S == "nodlopen" || S == "noexecstack" ||
+-         S == "nokeep-text-section-prefix" || S == "norelro" || S == "notext" ||
++         S == "nokeep-text-section-prefix" || S == "norelro" ||
++         S == "noretpolineplt" || S == "notext" ||
           S == "now" || S == "origin" || S == "relro" || S == "retpolineplt" ||
-@@ -794,7 +795,8 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
+          S == "rodynamic" || S == "text" || S == "wxneeded" ||
+          S.startswith("max-page-size=") || S.startswith("stack-size=");
+@@ -795,7 +797,8 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
+   Config->IgnoreDataAddressEquality =
+       Args.hasArg(OPT_ignore_data_address_equality);
+   Config->IgnoreFunctionAddressEquality =
+-      Args.hasArg(OPT_ignore_function_address_equality);
++      Args.hasFlag(OPT_ignore_function_address_equality,
++      OPT_no_ignore_function_address_equality, true);
+   Config->Init = Args.getLastArgValue(OPT_init, "_init");
+   Config->LTOAAPipeline = Args.getLastArgValue(OPT_lto_aa_pipeline);
+   Config->LTODebugPassManager = Args.hasArg(OPT_lto_debug_pass_manager);
+@@ -818,7 +821,12 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
    Config->Optimize = args::getInteger(Args, OPT_O, 1);
    Config->OrphanHandling = getOrphanHandling(Args);
    Config->OutputFile = Args.getLastArgValue(OPT_o);
--  Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie, false);
++#ifdef __OpenBSD__
 +  Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie,
 +      !Args.hasArg(OPT_shared) && !Args.hasArg(OPT_relocatable));
++#else
+   Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie, false);
++#endif
    Config->PrintIcfSections =
        Args.hasFlag(OPT_print_icf_sections, OPT_no_print_icf_sections, false);
    Config->PrintGcSections =
-@@ -844,6 +846,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
-   Config->ZExecstack = getZFlag(Args, "execstack", "noexecstack", false);
-   Config->ZHazardplt = hasZOption(Args, "hazardplt");
-   Config->ZInitfirst = hasZOption(Args, "initfirst");
-+  Config->ZInterpose = hasZOption(Args, "interpose");
-   Config->ZKeepTextSectionPrefix = getZFlag(
-       Args, "keep-text-section-prefix", "nokeep-text-section-prefix", false);
-   Config->ZNodelete = hasZOption(Args, "nodelete");
+@@ -881,7 +889,11 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
+   Config->ZNow = getZFlag(Args, "now", "lazy", false);
+   Config->ZOrigin = hasZOption(Args, "origin");
+   Config->ZRelro = getZFlag(Args, "relro", "norelro", true);
+-  Config->ZRetpolineplt = hasZOption(Args, "retpolineplt");
++#ifndef __OpenBSD__
++  Config->ZRetpolineplt = getZFlag(Args, "retpolineplt", "noretpolineplt", false);
++#else
++  Config->ZRetpolineplt = getZFlag(Args, "retpolineplt", "noretpolineplt", true);
++#endif
+   Config->ZRodynamic = hasZOption(Args, "rodynamic");
+   Config->ZStackSize = args::getZOptionValue(Args, OPT_z, "stack-size", 0);
+   Config->ZText = getZFlag(Args, "text", "notext", true);
Index: devel/llvm/patches/patch-tools_lld_ELF_Options_td
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_Options_td,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_lld_ELF_Options_td
--- devel/llvm/patches/patch-tools_lld_ELF_Options_td 28 Jan 2019 15:34:22 -0000 1.3
+++ devel/llvm/patches/patch-tools_lld_ELF_Options_td 4 Jul 2019 15:26:11 -0000
@@ -5,7 +5,7 @@ $OpenBSD: patch-tools_lld_ELF_Options_td
 Index: tools/lld/ELF/Options.td
 --- tools/lld/ELF/Options.td.orig
 +++ tools/lld/ELF/Options.td
-@@ -178,8 +178,9 @@ def icf_safe: F<"icf=safe">, HelpText<"Enable safe ide
+@@ -188,8 +188,9 @@ def icf_safe: F<"icf=safe">, HelpText<"Enable safe ide
 
  def icf_none: F<"icf=none">, HelpText<"Disable identical code folding (default)">;
 
@@ -17,7 +17,7 @@ Index: tools/lld/ELF/Options.td
 
  def ignore_data_address_equality: F<"ignore-data-address-equality">,
    HelpText<"lld can break the address equality of data">;
-@@ -386,6 +387,7 @@ def: Separate<["-"], "b">, Alias<format>, HelpText<"Al
+@@ -407,6 +408,7 @@ def: Separate<["-"], "b">, Alias<format>, HelpText<"Al
  def: JoinedOrSeparate<["-"], "l">, Alias<library>, HelpText<"Alias for --library">;
  def: JoinedOrSeparate<["-"], "L">, Alias<library_path>, HelpText<"Alias for --library-path">;
  def: F<"no-pic-executable">, Alias<no_pie>, HelpText<"Alias for --no-pie">;
Index: devel/llvm/patches/patch-tools_lld_ELF_Symbols_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_Symbols_h,v
retrieving revision 1.3
diff -u -p -r1.3 patch-tools_lld_ELF_Symbols_h
--- devel/llvm/patches/patch-tools_lld_ELF_Symbols_h 28 Jan 2019 15:34:22 -0000 1.3
+++ devel/llvm/patches/patch-tools_lld_ELF_Symbols_h 4 Jul 2019 15:26:11 -0000
@@ -6,7 +6,7 @@ is referenced from code being linked.
 Index: tools/lld/ELF/Symbols.h
 --- tools/lld/ELF/Symbols.h.orig
 +++ tools/lld/ELF/Symbols.h
-@@ -308,6 +308,9 @@ struct ElfSym {
+@@ -330,6 +330,9 @@ struct ElfSym {
    // __bss_start
    static Defined *Bss;
 
Index: devel/llvm/patches/patch-tools_lld_ELF_SyntheticSections_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_lld_ELF_SyntheticSections_cpp
diff -N devel/llvm/patches/patch-tools_lld_ELF_SyntheticSections_cpp
--- devel/llvm/patches/patch-tools_lld_ELF_SyntheticSections_cpp 28 Jan 2019 15:34:22 -0000 1.10
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,33 +0,0 @@
-$OpenBSD: patch-tools_lld_ELF_SyntheticSections_cpp,v 1.10 2019/01/28 15:34:22 jca Exp $
-
-- lld: add -z interpose support
-- When merging sections into the output, lld tries to adjust the alignment of
-  the section to be at least as large as the entry size of the section.
-  This causes a later check that validates the alignment to fail if the
-  entry size isn't a power of two.  This happens when building some of the
-  java support code in ports gcc.  Fix this by sticking to the original
-  alignment if the entry size isn't a power of two.
-
-Index: tools/lld/ELF/SyntheticSections.cpp
---- tools/lld/ELF/SyntheticSections.cpp.orig
-+++ tools/lld/ELF/SyntheticSections.cpp
-@@ -1266,6 +1266,8 @@ template <class ELFT> void DynamicSection<ELFT>::final
-     DtFlags |= DF_SYMBOLIC;
-   if (Config->ZInitfirst)
-     DtFlags1 |= DF_1_INITFIRST;
-+  if (Config->ZInterpose)
-+    DtFlags1 |= DF_1_INTERPOSE;
-   if (Config->ZNodelete)
-     DtFlags1 |= DF_1_NODELETE;
-   if (Config->ZNodlopen)
-@@ -2935,7 +2937,9 @@ void elf::mergeSections() {
-     }
-
-     StringRef OutsecName = getOutputSectionName(MS);
--    uint32_t Alignment = std::max<uint32_t>(MS->Alignment, MS->Entsize);
-+    uint32_t Alignment = MS->Alignment;
-+    if (isPowerOf2_32(MS->Entsize))
-+        Alignment = std::max<uint32_t>(Alignment, MS->Entsize);
-
-     auto I = llvm::find_if(MergeSections, [=](MergeSyntheticSection *Sec) {
-       // While we could create a single synthetic section for two different
Index: devel/llvm/patches/patch-tools_lld_ELF_Writer_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lld_ELF_Writer_cpp,v
retrieving revision 1.10
diff -u -p -r1.10 patch-tools_lld_ELF_Writer_cpp
--- devel/llvm/patches/patch-tools_lld_ELF_Writer_cpp 28 Jan 2019 15:34:22 -0000 1.10
+++ devel/llvm/patches/patch-tools_lld_ELF_Writer_cpp 4 Jul 2019 15:26:11 -0000
@@ -14,13 +14,13 @@ Index: tools/lld/ELF/Writer.cpp
    for (StringRef V :
         {".text.", ".rodata.", ".data.rel.ro.", ".data.", ".bss.rel.ro.",
          ".bss.", ".init_array.", ".fini_array.", ".ctors.", ".dtors.", ".tbss.",
--        ".gcc_except_table.", ".tdata.", ".ARM.exidx.", ".ARM.extab."}) {
+-        ".gcc_except_table.", ".tdata.", ".ARM.exidx.", ".ARM.extab."})
 +        ".gcc_except_table.", ".tdata.", ".ARM.exidx.", ".ARM.extab.",
-+        ".openbsd.randomdata."}) {
++        ".openbsd.randomdata."})
      if (isSectionPrefix(V, S->Name))
        return V.drop_back();
-   }
-@@ -239,6 +240,7 @@ void elf::addReservedSymbols() {
+
+@@ -251,6 +252,7 @@ void elf::addReservedSymbols() {
    };
 
    ElfSym::Bss = Add("__bss_start", 0);
@@ -28,10 +28,10 @@ Index: tools/lld/ELF/Writer.cpp
    ElfSym::End1 = Add("end", -1);
    ElfSym::End2 = Add("_end", -1);
    ElfSym::Etext1 = Add("etext", -1);
-@@ -673,7 +675,11 @@ static bool isRelroSection(const OutputSection *Sec) {
+@@ -703,7 +705,11 @@ static bool isRelroSection(const OutputSection *Sec) {
    // However, if "-z now" is given, the lazy symbol resolution is
    // disabled, which enables us to put it into RELRO.
-   if (Sec == InX::GotPlt->getParent())
+   if (Sec == In.GotPlt->getParent())
 +#ifndef __OpenBSD__
      return Config->ZNow;
 +#else
@@ -40,7 +40,7 @@ Index: tools/lld/ELF/Writer.cpp
 
    // .dynamic section contains data for the dynamic linker, and
    // there's no need to write to it at runtime, so it's better to put
-@@ -962,6 +968,9 @@ template <class ELFT> void Writer<ELFT>::setReservedSy
+@@ -1006,6 +1012,9 @@ template <class ELFT> void Writer<ELFT>::setReservedSy
    if (ElfSym::Bss)
      ElfSym::Bss->Section = findSection(".bss");
 
@@ -50,7 +50,7 @@ Index: tools/lld/ELF/Writer.cpp
    // Setup MIPS _gp_disp/__gnu_local_gp symbols which should
    // be equal to the _gp symbol's value.
    if (ElfSym::MipsGp) {
-@@ -1937,6 +1946,23 @@ template <class ELFT> void Writer<ELFT>::fixSectionAli
+@@ -2042,6 +2051,23 @@ template <class ELFT> void Writer<ELFT>::fixSectionAli
          return alignTo(Script->getDot(), Config->MaxPageSize);
        };
    };
Index: devel/llvm/patches/patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h
===================================================================
RCS file: devel/llvm/patches/patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h
diff -N devel/llvm/patches/patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h
--- devel/llvm/patches/patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h 28 Jan 2019 06:27:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-$OpenBSD: patch-tools_lldb_include_lldb_Host_openbsd_HostInfoOpenBSD_h,v 1.1 2019/01/28 06:27:28 jca Exp $
-
-Use llvm::VersionTuple instead of manual version marshalling
-
-Index: tools/lldb/include/lldb/Host/openbsd/HostInfoOpenBSD.h
---- tools/lldb/include/lldb/Host/openbsd/HostInfoOpenBSD.h.orig
-+++ tools/lldb/include/lldb/Host/openbsd/HostInfoOpenBSD.h
-@@ -12,12 +12,13 @@
-
- #include "lldb/Host/posix/HostInfoPosix.h"
- #include "lldb/Utility/FileSpec.h"
-+#include "llvm/Support/VersionTuple.h"
-
- namespace lldb_private {
-
- class HostInfoOpenBSD : public HostInfoPosix {
- public:
--  static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
-+  static llvm::VersionTuple GetOSVersion();
-   static bool GetOSBuildString(std::string &s);
-   static bool GetOSKernelDescription(std::string &s);
-   static FileSpec GetProgramFileSpec();
Index: devel/llvm/patches/patch-tools_lldb_scripts_utilsOsType_py
===================================================================
RCS file: devel/llvm/patches/patch-tools_lldb_scripts_utilsOsType_py
diff -N devel/llvm/patches/patch-tools_lldb_scripts_utilsOsType_py
--- devel/llvm/patches/patch-tools_lldb_scripts_utilsOsType_py 28 Jan 2019 06:27:28 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-$OpenBSD: patch-tools_lldb_scripts_utilsOsType_py,v 1.2 2019/01/28 06:27:28 jca Exp $
-
-Recognize OpenBSD.
-
-Index: tools/lldb/scripts/utilsOsType.py
---- tools/lldb/scripts/utilsOsType.py.orig
-+++ tools/lldb/scripts/utilsOsType.py
-@@ -35,8 +35,9 @@ if sys.version_info.major >= 3:
-         FreeBSD = 2
-         Linux = 3
-         NetBSD = 4
--        Windows = 5
--        kFreeBSD = 6
-+        OpenBSD = 5
-+        Windows = 6
-+        kFreeBSD = 7
- else:
-     class EnumOsType(object):
-         values = ["Unknown",
Index: devel/llvm/patches/patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp
===================================================================
RCS file: devel/llvm/patches/patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp
diff -N devel/llvm/patches/patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp
--- devel/llvm/patches/patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp 28 Jan 2019 06:27:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-$OpenBSD: patch-tools_lldb_source_Host_openbsd_HostInfoOpenBSD_cpp,v 1.1 2019/01/28 06:27:28 jca Exp $
-
-Use llvm::VersionTuple instead of manual version marshalling
-
-Index: tools/lldb/source/Host/openbsd/HostInfoOpenBSD.cpp
---- tools/lldb/source/Host/openbsd/HostInfoOpenBSD.cpp.orig
-+++ tools/lldb/source/Host/openbsd/HostInfoOpenBSD.cpp
-@@ -17,16 +17,17 @@
-
- using namespace lldb_private;
-
--bool HostInfoOpenBSD::GetOSVersion(uint32_t &major, uint32_t &minor,
--                                   uint32_t &update) {
-+llvm::VersionTuple HostInfoOpenBSD::GetOSVersion() {
-   struct utsname un;
-
-   ::memset(&un, 0, sizeof(utsname));
-   if (uname(&un) < 0)
--    return false;
-+    return llvm::VersionTuple();
-
--  int status = sscanf(un.release, "%u.%u", &major, &minor);
--  return status == 2;
-+  unsigned major, minor;
-+  if (2 == sscanf(un.release, "%u.%u", &major, &minor))
-+    return llvm::VersionTuple(major, minor);
-+  return llvm::VersionTuple();
- }
-
- bool HostInfoOpenBSD::GetOSBuildString(std::string &s) {
Index: devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp,v
retrieving revision 1.1
diff -u -p -r1.1 patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp
--- devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_cpp 4 Jul 2019 15:26:11 -0000
@@ -5,8 +5,8 @@ Skip retguard instructions in prologue d
 Index: tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
 --- tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp.orig
 +++ tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
-@@ -593,6 +593,18 @@ bool x86AssemblyInspectionEngine::ret_pattern_p() {
-   return false;
+@@ -672,6 +672,18 @@ bool x86AssemblyInspectionEngine::ret_pattern_p() {
+   return *p == 0xc9 || *p == 0xc2 || *p == 0xca || *p == 0xc3;
  }
 
 +// movq $0x????????(%rip), $reg [(0x4c || 0x48) 0x8b ?? ?? ?? ?? ??]
@@ -24,7 +24,7 @@ Index: tools/lldb/source/Plugins/UnwindA
  uint32_t x86AssemblyInspectionEngine::extract_4(uint8_t *b) {
    uint32_t v = 0;
    for (int i = 3; i >= 0; i--)
-@@ -1214,6 +1226,7 @@ bool x86AssemblyInspectionEngine::FindFirstNonPrologue
+@@ -1374,6 +1386,7 @@ bool x86AssemblyInspectionEngine::FindFirstNonPrologue
      if (push_rbp_pattern_p() || mov_rsp_rbp_pattern_p() ||
          sub_rsp_pattern_p(scratch) || push_reg_p(regno) ||
          mov_reg_to_local_stack_frame_p(regno, scratch) ||
Index: devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h
===================================================================
RCS file: /cvs/ports/devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h,v
retrieving revision 1.1
diff -u -p -r1.1 patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h
--- devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h 20 Feb 2019 00:24:11 -0000 1.1
+++ devel/llvm/patches/patch-tools_lldb_source_Plugins_UnwindAssembly_x86_x86AssemblyInspectionEngine_h 4 Jul 2019 15:26:11 -0000
@@ -5,7 +5,7 @@ Skip retguard instructions in prologue d
 Index: tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h
 --- tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h.orig
 +++ tools/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h
-@@ -110,6 +110,7 @@ class x86AssemblyInspectionEngine { (private)
+@@ -115,6 +115,7 @@ class x86AssemblyInspectionEngine { (private)
    bool call_next_insn_pattern_p();
    bool mov_reg_to_local_stack_frame_p(int &regno, int &rbp_offset);
    bool ret_pattern_p();
Index: devel/llvm/patches/patch-unittests_ADT_OptionalTest_cpp
===================================================================
RCS file: devel/llvm/patches/patch-unittests_ADT_OptionalTest_cpp
diff -N devel/llvm/patches/patch-unittests_ADT_OptionalTest_cpp
--- devel/llvm/patches/patch-unittests_ADT_OptionalTest_cpp 22 Apr 2019 17:24:26 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-$OpenBSD: patch-unittests_ADT_OptionalTest_cpp,v 1.1 2019/04/22 17:24:26 jca Exp $
-
-XXX disable failing static_assert to let other tests run.
-
-Index: unittests/ADT/OptionalTest.cpp
---- unittests/ADT/OptionalTest.cpp.orig
-+++ unittests/ADT/OptionalTest.cpp
-@@ -519,8 +519,8 @@ TEST_F(OptionalTest, OperatorGreaterEqual) {
- }
-
- #if __has_feature(is_trivially_copyable) && defined(_LIBCPP_VERSION)
--static_assert(std::is_trivially_copyable<Optional<int>>::value,
--              "Should be trivially copyable");
-+//static_assert(std::is_trivially_copyable<Optional<int>>::value,
-+//              "Should be trivially copyable");
- static_assert(
-     !std::is_trivially_copyable<Optional<NonDefaultConstructible>>::value,
-     "Shouldn't be trivially copyable");
Index: devel/llvm/patches/patch-utils_TableGen_X86RecognizableInstr_cpp
===================================================================
RCS file: devel/llvm/patches/patch-utils_TableGen_X86RecognizableInstr_cpp
diff -N devel/llvm/patches/patch-utils_TableGen_X86RecognizableInstr_cpp
--- devel/llvm/patches/patch-utils_TableGen_X86RecognizableInstr_cpp 20 Feb 2019 00:24:11 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-$OpenBSD: patch-utils_TableGen_X86RecognizableInstr_cpp,v 1.1 2019/02/20 00:24:11 jca Exp $
-
-Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branch
-to fix a regression in floating point operations.
-
-Index: utils/TableGen/X86RecognizableInstr.cpp
---- utils/TableGen/X86RecognizableInstr.cpp.orig
-+++ utils/TableGen/X86RecognizableInstr.cpp
-@@ -842,6 +842,7 @@ OperandType RecognizableInstr::typeFromString(const st
-   TYPE("f32mem",              TYPE_M)
-   TYPE("ssmem",               TYPE_M)
-   TYPE("RST",                 TYPE_ST)
-+  TYPE("RSTi",                TYPE_ST)
-   TYPE("i128mem",             TYPE_M)
-   TYPE("i256mem",             TYPE_M)
-   TYPE("i512mem",             TYPE_M)
-@@ -964,6 +965,7 @@ OperandEncoding
- RecognizableInstr::rmRegisterEncodingFromString(const std::string &s,
-                                                 uint8_t OpSize) {
-   ENCODING("RST",             ENCODING_FP)
-+  ENCODING("RSTi",            ENCODING_FP)
-   ENCODING("GR16",            ENCODING_RM)
-   ENCODING("GR32",            ENCODING_RM)
-   ENCODING("GR32orGR64",      ENCODING_RM)
Index: devel/llvm/pkg/PFRAG.no-powerpc-main
===================================================================
RCS file: /cvs/ports/devel/llvm/pkg/PFRAG.no-powerpc-main,v
retrieving revision 1.2
diff -u -p -r1.2 PFRAG.no-powerpc-main
--- devel/llvm/pkg/PFRAG.no-powerpc-main 21 Nov 2018 12:46:00 -0000 1.2
+++ devel/llvm/pkg/PFRAG.no-powerpc-main 4 Jul 2019 15:26:11 -0000
@@ -37,9 +37,11 @@ lib/libLLVMLanaiCodeGen.a
 lib/libLLVMLanaiDesc.a
 lib/libLLVMLanaiDisassembler.a
 lib/libLLVMLanaiInfo.a
+lib/libLLVMMSP430AsmParser.a
 lib/libLLVMMSP430AsmPrinter.a
 lib/libLLVMMSP430CodeGen.a
 lib/libLLVMMSP430Desc.a
+lib/libLLVMMSP430Disassembler.a
 lib/libLLVMMSP430Info.a
 lib/libLLVMMipsAsmParser.a
 lib/libLLVMMipsAsmPrinter.a
@@ -75,3 +77,9 @@ lib/libLLVMXCoreCodeGen.a
 lib/libLLVMXCoreDesc.a
 lib/libLLVMXCoreDisassembler.a
 lib/libLLVMXCoreInfo.a
+lib/libLLVMWebAssemblyAsmParser.a
+lib/libLLVMWebAssemblyAsmPrinter.a
+lib/libLLVMWebAssemblyCodeGen.a
+lib/libLLVMWebAssemblyDesc.a
+lib/libLLVMWebAssemblyDisassembler.a
+lib/libLLVMWebAssemblyInfo.a
Index: devel/llvm/pkg/PLIST-lldb
===================================================================
RCS file: /cvs/ports/devel/llvm/pkg/PLIST-lldb,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST-lldb
--- devel/llvm/pkg/PLIST-lldb 28 Jan 2019 06:27:28 -0000 1.2
+++ devel/llvm/pkg/PLIST-lldb 4 Jul 2019 15:26:11 -0000
@@ -5,6 +5,7 @@
 @bin bin/lldb-argdumper
 @bin bin/lldb-mi
 @bin bin/lldb-test
+@bin bin/lldb-vscode
 include/lldb/
 include/lldb/API/
 include/lldb/API/LLDB.h
@@ -32,6 +33,7 @@ include/lldb/API/SBFileSpecList.h
 include/lldb/API/SBFrame.h
 include/lldb/API/SBFunction.h
 include/lldb/API/SBHostOS.h
+include/lldb/API/SBInitializerOptions.h
 include/lldb/API/SBInstruction.h
 include/lldb/API/SBInstructionList.h
 include/lldb/API/SBLanguageRuntime.h
@@ -89,6 +91,7 @@ include/lldb/Breakpoint/BreakpointResolv
 include/lldb/Breakpoint/BreakpointResolverFileLine.h
 include/lldb/Breakpoint/BreakpointResolverFileRegex.h
 include/lldb/Breakpoint/BreakpointResolverName.h
+include/lldb/Breakpoint/BreakpointResolverScripted.h
 include/lldb/Breakpoint/BreakpointSite.h
 include/lldb/Breakpoint/BreakpointSiteList.h
 include/lldb/Breakpoint/Stoppoint.h
@@ -104,7 +107,6 @@ include/lldb/Core/AddressResolver.h
 include/lldb/Core/AddressResolverFileLine.h
 include/lldb/Core/AddressResolverName.h
 include/lldb/Core/Architecture.h
-include/lldb/Core/Broadcaster.h
 include/lldb/Core/ClangForward.h
 include/lldb/Core/Communication.h
 include/lldb/Core/Debugger.h
@@ -112,13 +114,12 @@ include/lldb/Core/Disassembler.h
 include/lldb/Core/DumpDataExtractor.h
 include/lldb/Core/DumpRegisterValue.h
 include/lldb/Core/EmulateInstruction.h
-include/lldb/Core/Event.h
 include/lldb/Core/FileLineResolver.h
 include/lldb/Core/FileSpecList.h
 include/lldb/Core/FormatEntity.h
+include/lldb/Core/Highlighter.h
 include/lldb/Core/IOHandler.h
 include/lldb/Core/IOStreamMacros.h
-include/lldb/Core/Listener.h
 include/lldb/Core/LoadedModuleInfoList.h
 include/lldb/Core/Mangled.h
 include/lldb/Core/MappedHash.h
@@ -130,13 +131,11 @@ include/lldb/Core/Opcode.h
 include/lldb/Core/PluginInterface.h
 include/lldb/Core/PluginManager.h
 include/lldb/Core/RangeMap.h
-include/lldb/Core/RegisterValue.h
+include/lldb/Core/RichManglingContext.h
 include/lldb/Core/STLUtils.h
-include/lldb/Core/Scalar.h
 include/lldb/Core/SearchFilter.h
 include/lldb/Core/Section.h
 include/lldb/Core/SourceManager.h
-include/lldb/Core/State.h
 include/lldb/Core/StreamAsynchronousIO.h
 include/lldb/Core/StreamBuffer.h
 include/lldb/Core/StreamFile.h
@@ -229,10 +228,10 @@ include/lldb/Host/OptionParser.h
 include/lldb/Host/Pipe.h
 include/lldb/Host/PipeBase.h
 include/lldb/Host/PosixApi.h
-include/lldb/Host/Predicate.h
 include/lldb/Host/ProcessLauncher.h
 include/lldb/Host/ProcessRunLock.h
 include/lldb/Host/PseudoTerminal.h
+include/lldb/Host/SafeMachO.h
 include/lldb/Host/Socket.h
 include/lldb/Host/SocketAddress.h
 include/lldb/Host/StringConvert.h
@@ -246,13 +245,11 @@ include/lldb/Host/android/
 include/lldb/Host/android/HostInfoAndroid.h
 include/lldb/Host/common/
 include/lldb/Host/common/GetOptInc.h
-include/lldb/Host/common/NativeBreakpoint.h
 include/lldb/Host/common/NativeBreakpointList.h
 include/lldb/Host/common/NativeProcessProtocol.h
 include/lldb/Host/common/NativeRegisterContext.h
 include/lldb/Host/common/NativeThreadProtocol.h
 include/lldb/Host/common/NativeWatchpointList.h
-include/lldb/Host/common/SoftwareBreakpoint.h
 include/lldb/Host/common/TCPSocket.h
 include/lldb/Host/common/UDPSocket.h
 include/lldb/Host/freebsd/
@@ -362,11 +359,8 @@ include/lldb/Symbol/DeclVendor.h
 include/lldb/Symbol/Declaration.h
 include/lldb/Symbol/FuncUnwinders.h
 include/lldb/Symbol/Function.h
-include/lldb/Symbol/GoASTContext.h
-include/lldb/Symbol/JavaASTContext.h
 include/lldb/Symbol/LineEntry.h
 include/lldb/Symbol/LineTable.h
-include/lldb/Symbol/OCamlASTContext.h
 include/lldb/Symbol/ObjectContainer.h
 include/lldb/Symbol/ObjectFile.h
 include/lldb/Symbol/Symbol.h
@@ -420,6 +414,7 @@ include/lldb/Target/SectionLoadHistory.h
 include/lldb/Target/SectionLoadList.h
 include/lldb/Target/StackFrame.h
 include/lldb/Target/StackFrameList.h
+include/lldb/Target/StackFrameRecognizer.h
 include/lldb/Target/StackID.h
 include/lldb/Target/StopInfo.h
 include/lldb/Target/StructuredDataPlugin.h
@@ -456,6 +451,7 @@ include/lldb/Utility/AnsiTerminal.h
 include/lldb/Utility/ArchSpec.h
 include/lldb/Utility/Args.h
 include/lldb/Utility/Baton.h
+include/lldb/Utility/Broadcaster.h
 include/lldb/Utility/CleanUp.h
 include/lldb/Utility/CompletionRequest.h
 include/lldb/Utility/Connection.h
@@ -465,25 +461,28 @@ include/lldb/Utility/DataBufferHeap.h
 include/lldb/Utility/DataBufferLLVM.h
 include/lldb/Utility/DataEncoder.h
 include/lldb/Utility/DataExtractor.h
-include/lldb/Utility/Either.h
 include/lldb/Utility/Endian.h
 include/lldb/Utility/Environment.h
-include/lldb/Utility/FastDemangle.h
+include/lldb/Utility/Event.h
 include/lldb/Utility/FileSpec.h
 include/lldb/Utility/Flags.h
 include/lldb/Utility/IOObject.h
 include/lldb/Utility/Iterable.h
 include/lldb/Utility/JSON.h
 include/lldb/Utility/LLDBAssert.h
+include/lldb/Utility/Listener.h
 include/lldb/Utility/Log.h
 include/lldb/Utility/Logging.h
 include/lldb/Utility/NameMatches.h
-include/lldb/Utility/Range.h
+include/lldb/Utility/Predicate.h
+include/lldb/Utility/RegisterValue.h
 include/lldb/Utility/RegularExpression.h
-include/lldb/Utility/SafeMachO.h
+include/lldb/Utility/Reproducer.h
+include/lldb/Utility/Scalar.h
 include/lldb/Utility/SelectHelper.h
 include/lldb/Utility/SharedCluster.h
 include/lldb/Utility/SharingPtr.h
+include/lldb/Utility/State.h
 include/lldb/Utility/Status.h
 include/lldb/Utility/Stream.h
 include/lldb/Utility/StreamCallback.h
@@ -542,9 +541,11 @@ lib/liblldbPluginABISysV_s390x.a
 lib/liblldbPluginABISysV_x86_64.a
 lib/liblldbPluginAppleObjCRuntime.a
 lib/liblldbPluginArchitectureArm.a
+lib/liblldbPluginArchitectureMips.a
 lib/liblldbPluginArchitecturePPC64.a
 lib/liblldbPluginCPlusPlusLanguage.a
 lib/liblldbPluginCXXItaniumABI.a
+lib/liblldbPluginClangCommon.a
 lib/liblldbPluginDisassemblerLLVM.a
 lib/liblldbPluginDynamicLoaderDarwinKernel.a
 lib/liblldbPluginDynamicLoaderHexagonDYLD.a
@@ -553,8 +554,6 @@ lib/liblldbPluginDynamicLoaderPosixDYLD.
 lib/liblldbPluginDynamicLoaderStatic.a
 lib/liblldbPluginDynamicLoaderWindowsDYLD.a
 lib/liblldbPluginExpressionParserClang.a
-lib/liblldbPluginExpressionParserGo.a
-lib/liblldbPluginGoLanguage.a
 lib/liblldbPluginInstructionARM.a
 lib/liblldbPluginInstructionARM64.a
 lib/liblldbPluginInstructionMIPS.a
@@ -565,17 +564,13 @@ lib/liblldbPluginInstrumentationRuntimeM
 lib/liblldbPluginInstrumentationRuntimeTSan.a
 lib/liblldbPluginInstrumentationRuntimeUBSan.a
 lib/liblldbPluginJITLoaderGDB.a
-lib/liblldbPluginJavaLanguage.a
-lib/liblldbPluginLanguageRuntimeGo.a
-lib/liblldbPluginLanguageRuntimeJava.a
 lib/liblldbPluginMemoryHistoryASan.a
-lib/liblldbPluginOCamlLanguage.a
-lib/liblldbPluginOSGo.a
 lib/liblldbPluginOSPython.a
 lib/liblldbPluginObjCLanguage.a
 lib/liblldbPluginObjCPlusPlusLanguage.a
 lib/liblldbPluginObjectContainerBSDArchive.a
 lib/liblldbPluginObjectContainerMachOArchive.a
+lib/liblldbPluginObjectFileBreakpad.a
 lib/liblldbPluginObjectFileELF.a
 lib/liblldbPluginObjectFileJIT.a
 lib/liblldbPluginObjectFileMachO.a
@@ -599,7 +594,9 @@ lib/liblldbPluginRenderScriptRuntime.a
 lib/liblldbPluginScriptInterpreterNone.a
 lib/liblldbPluginScriptInterpreterPython.a
 lib/liblldbPluginStructuredDataDarwinLog.a
+lib/liblldbPluginSymbolFileBreakpad.a
 lib/liblldbPluginSymbolFileDWARF.a
+lib/liblldbPluginSymbolFileNativePDB.a
 lib/liblldbPluginSymbolFilePDB.a
 lib/liblldbPluginSymbolFileSymtab.a
 lib/liblldbPluginSymbolVendorELF.a
Index: devel/llvm/pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/devel/llvm/pkg/PLIST-main,v
retrieving revision 1.12
diff -u -p -r1.12 PLIST-main
--- devel/llvm/pkg/PLIST-main 9 Mar 2019 06:18:11 -0000 1.12
+++ devel/llvm/pkg/PLIST-main 4 Jul 2019 15:26:12 -0000
@@ -4,12 +4,12 @@
 @bin bin/c-index-test
 bin/clang
 bin/clang++
-@bin bin/clang-7
+@bin bin/clang-8
 @bin bin/clang-check
 bin/clang-cl
 bin/clang-cpp
+@bin bin/clang-extdef-mapping
 @bin bin/clang-format
-@bin bin/clang-func-mapping
 @bin bin/clang-import-test
 @bin bin/clang-offload-bundler
 @bin bin/clang-refactor
@@ -35,11 +35,13 @@ bin/lld-link
 @bin bin/llvm-cvtres
 @bin bin/llvm-cxxdump
 @bin bin/llvm-cxxfilt
+@bin bin/llvm-cxxmap
 @bin bin/llvm-diff
 @bin bin/llvm-dis
 bin/llvm-dlltool
 @bin bin/llvm-dwarfdump
 @bin bin/llvm-dwp
+@bin bin/llvm-elfabi
 @bin bin/llvm-exegesis
 @bin bin/llvm-extract
 bin/llvm-lib
@@ -97,9 +99,12 @@ include/clang/AST/APValue.h
 include/clang/AST/AST.h
 include/clang/AST/ASTConsumer.h
 include/clang/AST/ASTContext.h
+include/clang/AST/ASTContextAllocate.h
 include/clang/AST/ASTDiagnostic.h
+include/clang/AST/ASTDumperUtils.h
 include/clang/AST/ASTFwd.h
 include/clang/AST/ASTImporter.h
+include/clang/AST/ASTImporterLookupTable.h
 include/clang/AST/ASTLambda.h
 include/clang/AST/ASTMutationListener.h
 include/clang/AST/ASTStructuralEquivalence.h
@@ -107,9 +112,11 @@ include/clang/AST/ASTTypeTraits.h
 include/clang/AST/ASTUnresolvedSet.h
 include/clang/AST/ASTVector.h
 include/clang/AST/Attr.h
-include/clang/AST/AttrDump.inc
 include/clang/AST/AttrImpl.inc
 include/clang/AST/AttrIterator.h
+include/clang/AST/AttrNodeTraverse.inc
+include/clang/AST/AttrTextNodeDump.inc
+include/clang/AST/AttrVisitor.h
 include/clang/AST/AttrVisitor.inc
 include/clang/AST/Attrs.inc
 include/clang/AST/Availability.h
@@ -156,6 +163,7 @@ include/clang/AST/ExprObjC.h
 include/clang/AST/ExprOpenMP.h
 include/clang/AST/ExternalASTMerger.h
 include/clang/AST/ExternalASTSource.h
+include/clang/AST/FormatString.h
 include/clang/AST/GlobalDecl.h
 include/clang/AST/LambdaCapture.h
 include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h
@@ -166,6 +174,7 @@ include/clang/AST/NSAPI.h
 include/clang/AST/NestedNameSpecifier.h
 include/clang/AST/NonTrivialTypeVisitor.h
 include/clang/AST/ODRHash.h
+include/clang/AST/OSLog.h
 include/clang/AST/OpenMPClause.h
 include/clang/AST/OperationKinds.def
 include/clang/AST/OperationKinds.h
@@ -187,8 +196,10 @@ include/clang/AST/StmtNodes.inc
 include/clang/AST/StmtObjC.h
 include/clang/AST/StmtOpenMP.h
 include/clang/AST/StmtVisitor.h
+include/clang/AST/TemplateArgumentVisitor.h
 include/clang/AST/TemplateBase.h
 include/clang/AST/TemplateName.h
+include/clang/AST/TextNodeDumper.h
 include/clang/AST/Type.h
 include/clang/AST/TypeLoc.h
 include/clang/AST/TypeLocNodes.def
@@ -214,11 +225,9 @@ include/clang/Analysis/Analyses/
 include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h
 include/clang/Analysis/Analyses/Consumed.h
 include/clang/Analysis/Analyses/Dominators.h
-include/clang/Analysis/Analyses/FormatString.h
+include/clang/Analysis/Analyses/ExprMutationAnalyzer.h
 include/clang/Analysis/Analyses/LiveVariables.h
-include/clang/Analysis/Analyses/OSLog.h
 include/clang/Analysis/Analyses/PostOrderCFGView.h
-include/clang/Analysis/Analyses/PseudoConstantAnalysis.h
 include/clang/Analysis/Analyses/ReachableCode.h
 include/clang/Analysis/Analyses/ThreadSafety.h
 include/clang/Analysis/Analyses/ThreadSafetyCommon.h
@@ -243,6 +252,7 @@ include/clang/Analysis/DomainSpecific/Ob
 include/clang/Analysis/FlowSensitive/
 include/clang/Analysis/FlowSensitive/DataflowValues.h
 include/clang/Analysis/ProgramPoint.h
+include/clang/Analysis/SelectorExtras.h
 include/clang/Analysis/Support/
 include/clang/Analysis/Support/BumpVector.h
 include/clang/Basic/
@@ -267,7 +277,6 @@ include/clang/Basic/BuiltinsLe64.def
 include/clang/Basic/BuiltinsMips.def
 include/clang/Basic/BuiltinsNEON.def
 include/clang/Basic/BuiltinsNVPTX.def
-include/clang/Basic/BuiltinsNios2.def
 include/clang/Basic/BuiltinsPPC.def
 include/clang/Basic/BuiltinsSystemZ.def
 include/clang/Basic/BuiltinsWebAssembly.def
@@ -276,28 +285,41 @@ include/clang/Basic/BuiltinsX86_64.def
 include/clang/Basic/BuiltinsXCore.def
 include/clang/Basic/CapturedStmt.h
 include/clang/Basic/CharInfo.h
+include/clang/Basic/CodeGenOptions.def
+include/clang/Basic/CodeGenOptions.h
 include/clang/Basic/CommentOptions.h
 include/clang/Basic/Cuda.h
 include/clang/Basic/DebugInfoOptions.h
 include/clang/Basic/Diagnostic.h
+include/clang/Basic/DiagnosticAST.h
 include/clang/Basic/DiagnosticASTKinds.inc
+include/clang/Basic/DiagnosticAnalysis.h
 include/clang/Basic/DiagnosticAnalysisKinds.inc
 include/clang/Basic/DiagnosticCategories.h
+include/clang/Basic/DiagnosticComment.h
 include/clang/Basic/DiagnosticCommentKinds.inc
 include/clang/Basic/DiagnosticCommonKinds.inc
+include/clang/Basic/DiagnosticCrossTU.h
 include/clang/Basic/DiagnosticCrossTUKinds.inc
+include/clang/Basic/DiagnosticDriver.h
 include/clang/Basic/DiagnosticDriverKinds.inc
 include/clang/Basic/DiagnosticError.h
+include/clang/Basic/DiagnosticFrontend.h
 include/clang/Basic/DiagnosticFrontendKinds.inc
 include/clang/Basic/DiagnosticGroups.inc
 include/clang/Basic/DiagnosticIDs.h
 include/clang/Basic/DiagnosticIndexName.inc
+include/clang/Basic/DiagnosticLex.h
 include/clang/Basic/DiagnosticLexKinds.inc
 include/clang/Basic/DiagnosticOptions.def
 include/clang/Basic/DiagnosticOptions.h
+include/clang/Basic/DiagnosticParse.h
 include/clang/Basic/DiagnosticParseKinds.inc
+include/clang/Basic/DiagnosticRefactoring.h
 include/clang/Basic/DiagnosticRefactoringKinds.inc
+include/clang/Basic/DiagnosticSema.h
 include/clang/Basic/DiagnosticSemaKinds.inc
+include/clang/Basic/DiagnosticSerialization.h
 include/clang/Basic/DiagnosticSerializationKinds.inc
 include/clang/Basic/ExceptionSpecificationType.h
 include/clang/Basic/ExpressionTraits.h
@@ -305,16 +327,19 @@ include/clang/Basic/Features.def
 include/clang/Basic/FileManager.h
 include/clang/Basic/FileSystemOptions.h
 include/clang/Basic/FileSystemStatCache.h
+include/clang/Basic/FixedPoint.h
 include/clang/Basic/IdentifierTable.h
 include/clang/Basic/LLVM.h
 include/clang/Basic/Lambda.h
 include/clang/Basic/LangOptions.def
 include/clang/Basic/LangOptions.h
 include/clang/Basic/Linkage.h
+include/clang/Basic/MSP430Target.def
 include/clang/Basic/MacroBuilder.h
 include/clang/Basic/MemoryBufferCache.h
 include/clang/Basic/Module.h
 include/clang/Basic/ObjCRuntime.h
+include/clang/Basic/OpenCLExtensionTypes.def
 include/clang/Basic/OpenCLExtensions.def
 include/clang/Basic/OpenCLImageTypes.def
 include/clang/Basic/OpenCLOptions.h
@@ -347,7 +372,6 @@ include/clang/Basic/TokenKinds.h
 include/clang/Basic/TypeTraits.h
 include/clang/Basic/Version.h
 include/clang/Basic/Version.inc
-include/clang/Basic/VirtualFileSystem.h
 include/clang/Basic/Visibility.h
 include/clang/Basic/X86Target.def
 include/clang/Basic/XRayInstr.h
@@ -372,6 +396,7 @@ include/clang/CrossTU/CrossTranslationUn
 include/clang/Driver/
 include/clang/Driver/Action.h
 include/clang/Driver/Compilation.h
+include/clang/Driver/DarwinSDKInfo.h
 include/clang/Driver/Distro.h
 include/clang/Driver/Driver.h
 include/clang/Driver/DriverDiagnostic.h
@@ -399,8 +424,6 @@ include/clang/Frontend/
 include/clang/Frontend/ASTConsumers.h
 include/clang/Frontend/ASTUnit.h
 include/clang/Frontend/ChainedDiagnosticConsumer.h
-include/clang/Frontend/CodeGenOptions.def
-include/clang/Frontend/CodeGenOptions.h
 include/clang/Frontend/CommandLineSourceLoc.h
 include/clang/Frontend/CompilerInstance.h
 include/clang/Frontend/CompilerInvocation.h
@@ -455,8 +478,6 @@ include/clang/Lex/ModuleMap.h
 include/clang/Lex/MultipleIncludeOpt.h
 include/clang/Lex/PPCallbacks.h
 include/clang/Lex/PPConditionalDirectiveRecord.h
-include/clang/Lex/PTHLexer.h
-include/clang/Lex/PTHManager.h
 include/clang/Lex/Pragma.h
 include/clang/Lex/PreprocessingRecord.h
 include/clang/Lex/Preprocessor.h
@@ -470,6 +491,7 @@ include/clang/Lex/VariadicMacroSupport.h
 include/clang/Parse/
 include/clang/Parse/AttrParserStringSwitches.inc
 include/clang/Parse/AttrSubMatchRulesParserStringSwitches.inc
+include/clang/Parse/LoopHint.h
 include/clang/Parse/ParseAST.h
 include/clang/Parse/ParseDiagnostic.h
 include/clang/Parse/Parser.h
@@ -505,7 +527,6 @@ include/clang/Sema/ExternalSemaSource.h
 include/clang/Sema/IdentifierResolver.h
 include/clang/Sema/Initialization.h
 include/clang/Sema/Lookup.h
-include/clang/Sema/LoopHint.h
 include/clang/Sema/MultiplexExternalSemaSource.h
 include/clang/Sema/ObjCMethodList.h
 include/clang/Sema/Overload.h
@@ -537,17 +558,18 @@ include/clang/Serialization/GlobalModule
 include/clang/Serialization/Module.h
 include/clang/Serialization/ModuleFileExtension.h
 include/clang/Serialization/ModuleManager.h
+include/clang/Serialization/PCHContainerOperations.h
 include/clang/Serialization/SerializationDiagnostic.h
 include/clang/StaticAnalyzer/
 include/clang/StaticAnalyzer/Checkers/
+include/clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h
 include/clang/StaticAnalyzer/Checkers/Checkers.inc
-include/clang/StaticAnalyzer/Checkers/ClangCheckers.h
 include/clang/StaticAnalyzer/Checkers/LocalCheckers.h
 include/clang/StaticAnalyzer/Checkers/MPIFunctionClassifier.h
-include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h
 include/clang/StaticAnalyzer/Checkers/SValExplainer.h
 include/clang/StaticAnalyzer/Core/
 include/clang/StaticAnalyzer/Core/Analyses.def
+include/clang/StaticAnalyzer/Core/AnalyzerOptions.def
 include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
 include/clang/StaticAnalyzer/Core/BugReporter/
 include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
@@ -557,8 +579,6 @@ include/clang/StaticAnalyzer/Core/BugRep
 include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
 include/clang/StaticAnalyzer/Core/Checker.h
 include/clang/StaticAnalyzer/Core/CheckerManager.h
-include/clang/StaticAnalyzer/Core/CheckerOptInfo.h
-include/clang/StaticAnalyzer/Core/CheckerRegistry.h
 include/clang/StaticAnalyzer/Core/IssueHash.h
 include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h
 include/clang/StaticAnalyzer/Core/PathSensitive/
@@ -586,7 +606,7 @@ include/clang/StaticAnalyzer/Core/PathSe
 include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h
 include/clang/StaticAnalyzer/Core/PathSensitive/Regions.def
 include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h
-include/clang/StaticAnalyzer/Core/PathSensitive/SMTContext.h
+include/clang/StaticAnalyzer/Core/PathSensitive/SMTConv.h
 include/clang/StaticAnalyzer/Core/PathSensitive/SMTExpr.h
 include/clang/StaticAnalyzer/Core/PathSensitive/SMTSolver.h
 include/clang/StaticAnalyzer/Core/PathSensitive/SMTSort.h
@@ -605,9 +625,11 @@ include/clang/StaticAnalyzer/Core/PathSe
 include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h
 include/clang/StaticAnalyzer/Core/PathSensitive/TaintTag.h
 include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h
+include/clang/StaticAnalyzer/Core/RetainSummaryManager.h
 include/clang/StaticAnalyzer/Frontend/
 include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h
 include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h
+include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
 include/clang/StaticAnalyzer/Frontend/FrontendActions.h
 include/clang/StaticAnalyzer/Frontend/ModelConsumer.h
 include/clang/Tooling/
@@ -709,6 +731,7 @@ include/llvm-c/DataTypes.h
 include/llvm-c/DebugInfo.h
 include/llvm-c/Disassembler.h
 include/llvm-c/DisassemblerTypes.h
+include/llvm-c/Error.h
 include/llvm-c/ErrorHandling.h
 include/llvm-c/ExecutionEngine.h
 include/llvm-c/IRReader.h
@@ -716,11 +739,14 @@ include/llvm-c/Initialization.h
 include/llvm-c/LinkTimeOptimizer.h
 include/llvm-c/Linker.h
 include/llvm-c/Object.h
+include/llvm-c/OptRemarks.h
 include/llvm-c/OrcBindings.h
 include/llvm-c/Support.h
 include/llvm-c/Target.h
 include/llvm-c/TargetMachine.h
 include/llvm-c/Transforms/
+include/llvm-c/Transforms/AggressiveInstCombine.h
+include/llvm-c/Transforms/Coroutines.h
 include/llvm-c/Transforms/IPO.h
 include/llvm-c/Transforms/InstCombine.h
 include/llvm-c/Transforms/PassManagerBuilder.h
@@ -796,6 +822,7 @@ include/llvm/ADT/Triple.h
 include/llvm/ADT/Twine.h
 include/llvm/ADT/UniqueVector.h
 include/llvm/ADT/VariadicFunction.h
+include/llvm/ADT/bit.h
 include/llvm/ADT/edit_distance.h
 include/llvm/ADT/ilist.h
 include/llvm/ADT/ilist_base.h
@@ -837,10 +864,13 @@ include/llvm/Analysis/DominanceFrontier.
 include/llvm/Analysis/DominanceFrontierImpl.h
 include/llvm/Analysis/EHPersonalities.h
 include/llvm/Analysis/GlobalsModRef.h
+include/llvm/Analysis/GuardUtils.h
+include/llvm/Analysis/IVDescriptors.h
 include/llvm/Analysis/IVUsers.h
 include/llvm/Analysis/IndirectCallPromotionAnalysis.h
-include/llvm/Analysis/IndirectCallSiteVisitor.h
+include/llvm/Analysis/IndirectCallVisitor.h
 include/llvm/Analysis/InlineCost.h
+include/llvm/Analysis/InstructionPrecedenceTracking.h
 include/llvm/Analysis/InstructionSimplify.h
 include/llvm/Analysis/Interval.h
 include/llvm/Analysis/IntervalIterator.h
@@ -850,6 +880,7 @@ include/llvm/Analysis/LazyBlockFrequency
 include/llvm/Analysis/LazyBranchProbabilityInfo.h
 include/llvm/Analysis/LazyCallGraph.h
 include/llvm/Analysis/LazyValueInfo.h
+include/llvm/Analysis/LegacyDivergenceAnalysis.h
 include/llvm/Analysis/Lint.h
 include/llvm/Analysis/Loads.h
 include/llvm/Analysis/LoopAccessAnalysis.h
@@ -871,6 +902,7 @@ include/llvm/Analysis/ObjCARCAnalysisUti
 include/llvm/Analysis/ObjCARCInstKind.h
 include/llvm/Analysis/OptimizationRemarkEmitter.h
 include/llvm/Analysis/OrderedBasicBlock.h
+include/llvm/Analysis/OrderedInstructions.h
 include/llvm/Analysis/PHITransAddr.h
 include/llvm/Analysis/Passes.h
 include/llvm/Analysis/PhiValues.h
@@ -889,6 +921,8 @@ include/llvm/Analysis/ScalarEvolutionExp
 include/llvm/Analysis/ScalarEvolutionNormalization.h
 include/llvm/Analysis/ScopedNoAliasAA.h
 include/llvm/Analysis/SparsePropagation.h
+include/llvm/Analysis/StackSafetyAnalysis.h
+include/llvm/Analysis/SyncDependenceAnalysis.h
 include/llvm/Analysis/SyntheticCountsUtils.h
 include/llvm/Analysis/TargetFolder.h
 include/llvm/Analysis/TargetLibraryInfo.def
@@ -908,6 +942,7 @@ include/llvm/AsmParser/
 include/llvm/AsmParser/Parser.h
 include/llvm/AsmParser/SlotMapping.h
 include/llvm/BinaryFormat/
+include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
 include/llvm/BinaryFormat/COFF.h
 include/llvm/BinaryFormat/Dwarf.def
 include/llvm/BinaryFormat/Dwarf.h
@@ -922,6 +957,7 @@ include/llvm/BinaryFormat/ELFRelocs/AVR.
 include/llvm/BinaryFormat/ELFRelocs/BPF.def
 include/llvm/BinaryFormat/ELFRelocs/Hexagon.def
 include/llvm/BinaryFormat/ELFRelocs/Lanai.def
+include/llvm/BinaryFormat/ELFRelocs/MSP430.def
 include/llvm/BinaryFormat/ELFRelocs/Mips.def
 include/llvm/BinaryFormat/ELFRelocs/PowerPC.def
 include/llvm/BinaryFormat/ELFRelocs/PowerPC64.def
@@ -933,6 +969,11 @@ include/llvm/BinaryFormat/ELFRelocs/x86_
 include/llvm/BinaryFormat/MachO.def
 include/llvm/BinaryFormat/MachO.h
 include/llvm/BinaryFormat/Magic.h
+include/llvm/BinaryFormat/MsgPack.def
+include/llvm/BinaryFormat/MsgPack.h
+include/llvm/BinaryFormat/MsgPackReader.h
+include/llvm/BinaryFormat/MsgPackTypes.h
+include/llvm/BinaryFormat/MsgPackWriter.h
 include/llvm/BinaryFormat/Wasm.h
 include/llvm/BinaryFormat/WasmRelocs/
 include/llvm/BinaryFormat/WasmRelocs.def
@@ -948,8 +989,10 @@ include/llvm/CodeGen/
 include/llvm/CodeGen/AccelTable.h
 include/llvm/CodeGen/Analysis.h
 include/llvm/CodeGen/AsmPrinter.h
+include/llvm/CodeGen/AsmPrinterHandler.h
 include/llvm/CodeGen/AtomicExpandUtils.h
 include/llvm/CodeGen/BasicTTIImpl.h
+include/llvm/CodeGen/BuiltinGCs.h
 include/llvm/CodeGen/CalcSpillWeights.h
 include/llvm/CodeGen/CallingConvLower.h
 include/llvm/CodeGen/CommandFlags.inc
@@ -958,6 +1001,8 @@ include/llvm/CodeGen/DAGCombine.h
 include/llvm/CodeGen/DFAPacketizer.h
 include/llvm/CodeGen/DIE.h
 include/llvm/CodeGen/DIEValue.def
+include/llvm/CodeGen/DbgEntityHistoryCalculator.h
+include/llvm/CodeGen/DebugHandlerBase.h
 include/llvm/CodeGen/DwarfStringPoolEntry.h
 include/llvm/CodeGen/EdgeBundles.h
 include/llvm/CodeGen/ExecutionDomainFix.h
@@ -968,13 +1013,15 @@ include/llvm/CodeGen/FunctionLoweringInf
 include/llvm/CodeGen/GCMetadata.h
 include/llvm/CodeGen/GCMetadataPrinter.h
 include/llvm/CodeGen/GCStrategy.h
-include/llvm/CodeGen/GCs.h
 include/llvm/CodeGen/GlobalISel/
+include/llvm/CodeGen/GlobalISel/CSEInfo.h
+include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h
 include/llvm/CodeGen/GlobalISel/CallLowering.h
 include/llvm/CodeGen/GlobalISel/Combiner.h
 include/llvm/CodeGen/GlobalISel/CombinerHelper.h
 include/llvm/CodeGen/GlobalISel/CombinerInfo.h
 include/llvm/CodeGen/GlobalISel/ConstantFoldingMIRBuilder.h
+include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h
 include/llvm/CodeGen/GlobalISel/GISelWorkList.h
 include/llvm/CodeGen/GlobalISel/IRTranslator.h
 include/llvm/CodeGen/GlobalISel/InstructionSelect.h
@@ -1038,6 +1085,7 @@ include/llvm/CodeGen/MachineOperand.h
 include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h
 include/llvm/CodeGen/MachineOutliner.h
 include/llvm/CodeGen/MachinePassRegistry.h
+include/llvm/CodeGen/MachinePipeliner.h
 include/llvm/CodeGen/MachinePostDominators.h
 include/llvm/CodeGen/MachineRegionInfo.h
 include/llvm/CodeGen/MachineRegisterInfo.h
@@ -1148,6 +1196,7 @@ include/llvm/DebugInfo/CodeView/SymbolDe
 include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h
 include/llvm/DebugInfo/CodeView/SymbolDumper.h
 include/llvm/DebugInfo/CodeView/SymbolRecord.h
+include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h
 include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
 include/llvm/DebugInfo/CodeView/SymbolSerializer.h
 include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h
@@ -1160,6 +1209,7 @@ include/llvm/DebugInfo/CodeView/TypeHash
 include/llvm/DebugInfo/CodeView/TypeIndex.h
 include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h
 include/llvm/DebugInfo/CodeView/TypeRecord.h
+include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h
 include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
 include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
 include/llvm/DebugInfo/CodeView/TypeSymbolEmitter.h
@@ -1210,6 +1260,7 @@ include/llvm/DebugInfo/PDB/ConcreteSymbo
 include/llvm/DebugInfo/PDB/DIA/
 include/llvm/DebugInfo/PDB/DIA/DIADataStream.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h
+include/llvm/DebugInfo/PDB/DIA/DIAEnumFrameData.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h
@@ -1217,6 +1268,7 @@ include/llvm/DebugInfo/PDB/DIA/DIAEnumSo
 include/llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h
 include/llvm/DebugInfo/PDB/DIA/DIAEnumTables.h
 include/llvm/DebugInfo/PDB/DIA/DIAError.h
+include/llvm/DebugInfo/PDB/DIA/DIAFrameData.h
 include/llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h
 include/llvm/DebugInfo/PDB/DIA/DIALineNumber.h
 include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h
@@ -1229,6 +1281,7 @@ include/llvm/DebugInfo/PDB/DIA/DIAUtils.
 include/llvm/DebugInfo/PDB/GenericError.h
 include/llvm/DebugInfo/PDB/IPDBDataStream.h
 include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
+include/llvm/DebugInfo/PDB/IPDBFrameData.h
 include/llvm/DebugInfo/PDB/IPDBInjectedSource.h
 include/llvm/DebugInfo/PDB/IPDBLineNumber.h
 include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
@@ -1253,14 +1306,22 @@ include/llvm/DebugInfo/PDB/Native/InfoSt
 include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
 include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
 include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
-include/llvm/DebugInfo/PDB/Native/NativeBuiltinSymbol.h
 include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
+include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
 include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
-include/llvm/DebugInfo/PDB/Native/NativeEnumSymbol.h
 include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
 include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
 include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
 include/llvm/DebugInfo/PDB/Native/NativeSession.h
+include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
+include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
+include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
 include/llvm/DebugInfo/PDB/Native/PDBFile.h
 include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
 include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
@@ -1269,6 +1330,7 @@ include/llvm/DebugInfo/PDB/Native/Public
 include/llvm/DebugInfo/PDB/Native/RawConstants.h
 include/llvm/DebugInfo/PDB/Native/RawError.h
 include/llvm/DebugInfo/PDB/Native/RawTypes.h
+include/llvm/DebugInfo/PDB/Native/SymbolCache.h
 include/llvm/DebugInfo/PDB/Native/SymbolStream.h
 include/llvm/DebugInfo/PDB/Native/TpiHashing.h
 include/llvm/DebugInfo/PDB/Native/TpiStream.h
@@ -1316,7 +1378,13 @@ include/llvm/DebugInfo/Symbolize/DIPrint
 include/llvm/DebugInfo/Symbolize/SymbolizableModule.h
 include/llvm/DebugInfo/Symbolize/Symbolize.h
 include/llvm/Demangle/
+include/llvm/Demangle/Compiler.h
 include/llvm/Demangle/Demangle.h
+include/llvm/Demangle/ItaniumDemangle.h
+include/llvm/Demangle/MicrosoftDemangle.h
+include/llvm/Demangle/MicrosoftDemangleNodes.h
+include/llvm/Demangle/StringView.h
+include/llvm/Demangle/Utility.h
 include/llvm/ExecutionEngine/
 include/llvm/ExecutionEngine/ExecutionEngine.h
 include/llvm/ExecutionEngine/GenericValue.h
@@ -1335,10 +1403,12 @@ include/llvm/ExecutionEngine/Orc/GlobalM
 include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
 include/llvm/ExecutionEngine/Orc/IRTransformLayer.h
 include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
+include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
 include/llvm/ExecutionEngine/Orc/LLJIT.h
 include/llvm/ExecutionEngine/Orc/LambdaResolver.h
 include/llvm/ExecutionEngine/Orc/Layer.h
 include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
+include/llvm/ExecutionEngine/Orc/LazyReexports.h
 include/llvm/ExecutionEngine/Orc/Legacy.h
 include/llvm/ExecutionEngine/Orc/NullResolver.h
 include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h
@@ -1353,6 +1423,7 @@ include/llvm/ExecutionEngine/Orc/RTDyldO
 include/llvm/ExecutionEngine/Orc/RawByteChannel.h
 include/llvm/ExecutionEngine/Orc/RemoteObjectLayer.h
 include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
+include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h
 include/llvm/ExecutionEngine/OrcMCJITReplacement.h
 include/llvm/ExecutionEngine/RTDyldMemoryManager.h
 include/llvm/ExecutionEngine/RuntimeDyld.h
@@ -1374,6 +1445,7 @@ include/llvm/IR/Attributes.td
 include/llvm/IR/AutoUpgrade.h
 include/llvm/IR/BasicBlock.h
 include/llvm/IR/CFG.h
+include/llvm/IR/CFGDiff.h
 include/llvm/IR/CallSite.h
 include/llvm/IR/CallingConv.h
 include/llvm/IR/Comdat.h
@@ -1425,6 +1497,7 @@ include/llvm/IR/IntrinsicsHexagon.td
 include/llvm/IR/IntrinsicsMips.td
 include/llvm/IR/IntrinsicsNVVM.td
 include/llvm/IR/IntrinsicsPowerPC.td
+include/llvm/IR/IntrinsicsRISCV.td
 include/llvm/IR/IntrinsicsSystemZ.td
 include/llvm/IR/IntrinsicsWebAssembly.td
 include/llvm/IR/IntrinsicsX86.td
@@ -1445,8 +1518,10 @@ include/llvm/IR/NoFolder.h
 include/llvm/IR/OperandTraits.h
 include/llvm/IR/Operator.h
 include/llvm/IR/OptBisect.h
+include/llvm/IR/PassInstrumentation.h
 include/llvm/IR/PassManager.h
 include/llvm/IR/PassManagerInternal.h
+include/llvm/IR/PassTimingInfo.h
 include/llvm/IR/PatternMatch.h
 include/llvm/IR/PredIteratorCache.h
 include/llvm/IR/ProfileSummary.h
@@ -1456,7 +1531,6 @@ include/llvm/IR/Statepoint.h
 include/llvm/IR/SymbolTableListTraits.h
 include/llvm/IR/TrackingMDRef.h
 include/llvm/IR/Type.h
-include/llvm/IR/TypeBuilder.h
 include/llvm/IR/TypeFinder.h
 include/llvm/IR/Use.h
 include/llvm/IR/UseListOrder.h
@@ -1475,6 +1549,7 @@ include/llvm/LTO/Caching.h
 include/llvm/LTO/Config.h
 include/llvm/LTO/LTO.h
 include/llvm/LTO/LTOBackend.h
+include/llvm/LTO/SummaryBasedOptimizations.h
 include/llvm/LTO/legacy/
 include/llvm/LTO/legacy/LTOCodeGenerator.h
 include/llvm/LTO/legacy/LTOModule.h
@@ -1567,6 +1642,28 @@ include/llvm/MC/MachineLocation.h
 include/llvm/MC/SectionKind.h
 include/llvm/MC/StringTableBuilder.h
 include/llvm/MC/SubtargetFeature.h
+include/llvm/MCA/
+include/llvm/MCA/Context.h
+include/llvm/MCA/HWEventListener.h
+include/llvm/MCA/HardwareUnits/
+include/llvm/MCA/HardwareUnits/HardwareUnit.h
+include/llvm/MCA/HardwareUnits/LSUnit.h
+include/llvm/MCA/HardwareUnits/RegisterFile.h
+include/llvm/MCA/HardwareUnits/ResourceManager.h
+include/llvm/MCA/HardwareUnits/RetireControlUnit.h
+include/llvm/MCA/HardwareUnits/Scheduler.h
+include/llvm/MCA/InstrBuilder.h
+include/llvm/MCA/Instruction.h
+include/llvm/MCA/Pipeline.h
+include/llvm/MCA/SourceMgr.h
+include/llvm/MCA/Stages/
+include/llvm/MCA/Stages/DispatchStage.h
+include/llvm/MCA/Stages/EntryStage.h
+include/llvm/MCA/Stages/ExecuteStage.h
+include/llvm/MCA/Stages/InstructionTables.h
+include/llvm/MCA/Stages/RetireStage.h
+include/llvm/MCA/Stages/Stage.h
+include/llvm/MCA/Support.h
 include/llvm/Object/
 include/llvm/Object/Archive.h
 include/llvm/Object/ArchiveWriter.h
@@ -1621,6 +1718,7 @@ include/llvm/PassSupport.h
 include/llvm/Passes/
 include/llvm/Passes/PassBuilder.h
 include/llvm/Passes/PassPlugin.h
+include/llvm/Passes/StandardInstrumentations.h
 include/llvm/ProfileData/
 include/llvm/ProfileData/Coverage/
 include/llvm/ProfileData/Coverage/CoverageMapping.h
@@ -1637,12 +1735,14 @@ include/llvm/ProfileData/SampleProfReade
 include/llvm/ProfileData/SampleProfWriter.h
 include/llvm/Support/
 include/llvm/Support/AArch64TargetParser.def
+include/llvm/Support/AArch64TargetParser.h
 include/llvm/Support/AMDGPUMetadata.h
 include/llvm/Support/AMDHSAKernelDescriptor.h
 include/llvm/Support/ARMAttributeParser.h
 include/llvm/Support/ARMBuildAttributes.h
 include/llvm/Support/ARMEHABI.h
 include/llvm/Support/ARMTargetParser.def
+include/llvm/Support/ARMTargetParser.h
 include/llvm/Support/ARMWinEH.h
 include/llvm/Support/AlignOf.h
 include/llvm/Support/Allocator.h
@@ -1659,7 +1759,9 @@ include/llvm/Support/BinaryStreamRef.h
 include/llvm/Support/BinaryStreamWriter.h
 include/llvm/Support/BlockFrequency.h
 include/llvm/Support/BranchProbability.h
+include/llvm/Support/BuryPointer.h
 include/llvm/Support/CBindingWrapping.h
+include/llvm/Support/CFGUpdate.h
 include/llvm/Support/COM.h
 include/llvm/Support/CachePruning.h
 include/llvm/Support/Capacity.h
@@ -1687,6 +1789,7 @@ include/llvm/Support/Errno.h
 include/llvm/Support/Error.h
 include/llvm/Support/ErrorHandling.h
 include/llvm/Support/ErrorOr.h
+include/llvm/Support/FileCheck.h
 include/llvm/Support/FileOutputBuffer.h
 include/llvm/Support/FileSystem.h
 include/llvm/Support/FileUtilities.h
@@ -1703,6 +1806,7 @@ include/llvm/Support/GlobPattern.h
 include/llvm/Support/GraphWriter.h
 include/llvm/Support/Host.h
 include/llvm/Support/InitLLVM.h
+include/llvm/Support/ItaniumManglingCanonicalizer.h
 include/llvm/Support/JSON.h
 include/llvm/Support/JamCRC.h
 include/llvm/Support/KnownBits.h
@@ -1713,6 +1817,7 @@ include/llvm/Support/Locale.h
 include/llvm/Support/LockFileManager.h
 include/llvm/Support/LowLevelTypeImpl.h
 include/llvm/Support/MD5.h
+include/llvm/Support/MSVCErrorWorkarounds.h
 include/llvm/Support/MachineValueType.h
 include/llvm/Support/ManagedStatic.h
 include/llvm/Support/MathExtras.h
@@ -1755,6 +1860,7 @@ include/llvm/Support/SpecialCaseList.h
 include/llvm/Support/StringPool.h
 include/llvm/Support/StringSaver.h
 include/llvm/Support/SwapByteOrder.h
+include/llvm/Support/SymbolRemappingReader.h
 include/llvm/Support/SystemUtils.h
 include/llvm/Support/TarWriter.h
 include/llvm/Support/TargetOpcodes.def
@@ -1776,6 +1882,7 @@ include/llvm/Support/UniqueLock.h
 include/llvm/Support/VCSRevision.h
 include/llvm/Support/Valgrind.h
 include/llvm/Support/VersionTuple.h
+include/llvm/Support/VirtualFileSystem.h
 include/llvm/Support/Watchdog.h
 include/llvm/Support/Win64EH.h
 include/llvm/Support/WindowsError.h
@@ -1815,12 +1922,18 @@ include/llvm/Target/TargetItinerary.td
 include/llvm/Target/TargetLoweringObjectFile.h
 include/llvm/Target/TargetMachine.h
 include/llvm/Target/TargetOptions.h
+include/llvm/Target/TargetPfmCounters.td
 include/llvm/Target/TargetSchedule.td
 include/llvm/Target/TargetSelectionDAG.td
 include/llvm/Testing/
 include/llvm/Testing/Support/
 include/llvm/Testing/Support/Error.h
 include/llvm/Testing/Support/SupportHelpers.h
+include/llvm/TextAPI/
+include/llvm/TextAPI/ELF/
+include/llvm/TextAPI/ELF/ELFStub.h
+include/llvm/TextAPI/ELF/TBEHandler.h
+include/llvm/TextAPI/MachO/
 include/llvm/ToolDrivers/
 include/llvm/ToolDrivers/llvm-dlltool/
 include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h
@@ -1845,6 +1958,7 @@ include/llvm/Transforms/IPO/FunctionImpo
 include/llvm/Transforms/IPO/GlobalDCE.h
 include/llvm/Transforms/IPO/GlobalOpt.h
 include/llvm/Transforms/IPO/GlobalSplit.h
+include/llvm/Transforms/IPO/HotColdSplitting.h
 include/llvm/Transforms/IPO/InferFunctionAttrs.h
 include/llvm/Transforms/IPO/Inliner.h
 include/llvm/Transforms/IPO/Internalize.h
@@ -1864,9 +1978,12 @@ include/llvm/Transforms/Instrumentation/
 include/llvm/Transforms/Instrumentation.h
 include/llvm/Transforms/Instrumentation/BoundsChecking.h
 include/llvm/Transforms/Instrumentation/CGProfile.h
+include/llvm/Transforms/Instrumentation/ControlHeightReduction.h
 include/llvm/Transforms/Instrumentation/GCOVProfiler.h
 include/llvm/Transforms/Instrumentation/InstrProfiling.h
+include/llvm/Transforms/Instrumentation/MemorySanitizer.h
 include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
+include/llvm/Transforms/Instrumentation/ThreadSanitizer.h
 include/llvm/Transforms/ObjCARC.h
 include/llvm/Transforms/Scalar/
 include/llvm/Transforms/Scalar.h
@@ -1908,6 +2025,7 @@ include/llvm/Transforms/Scalar/LoopUnrol
 include/llvm/Transforms/Scalar/LowerAtomic.h
 include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h
 include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h
+include/llvm/Transforms/Scalar/MakeGuardsExplicit.h
 include/llvm/Transforms/Scalar/MemCpyOptimizer.h
 include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h
 include/llvm/Transforms/Scalar/NaryReassociate.h
@@ -1917,12 +2035,14 @@ include/llvm/Transforms/Scalar/Reassocia
 include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h
 include/llvm/Transforms/Scalar/SCCP.h
 include/llvm/Transforms/Scalar/SROA.h
+include/llvm/Transforms/Scalar/Scalarizer.h
 include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h
 include/llvm/Transforms/Scalar/SimplifyCFG.h
 include/llvm/Transforms/Scalar/Sink.h
 include/llvm/Transforms/Scalar/SpeculateAroundPHIs.h
 include/llvm/Transforms/Scalar/SpeculativeExecution.h
 include/llvm/Transforms/Scalar/TailRecursionElimination.h
+include/llvm/Transforms/Scalar/WarnMissedTransforms.h
 include/llvm/Transforms/Utils/
 include/llvm/Transforms/Utils.h
 include/llvm/Transforms/Utils/ASanStackFrameLayout.h
@@ -1932,6 +2052,7 @@ include/llvm/Transforms/Utils/BreakCriti
 include/llvm/Transforms/Utils/BuildLibCalls.h
 include/llvm/Transforms/Utils/BypassSlowDivision.h
 include/llvm/Transforms/Utils/CallPromotionUtils.h
+include/llvm/Transforms/Utils/CanonicalizeAliases.h
 include/llvm/Transforms/Utils/Cloning.h
 include/llvm/Transforms/Utils/CodeExtractor.h
 include/llvm/Transforms/Utils/CtorUtils.h
@@ -1941,6 +2062,7 @@ include/llvm/Transforms/Utils/Evaluator.
 include/llvm/Transforms/Utils/FunctionComparator.h
 include/llvm/Transforms/Utils/FunctionImportUtils.h
 include/llvm/Transforms/Utils/GlobalStatus.h
+include/llvm/Transforms/Utils/GuardUtils.h
 include/llvm/Transforms/Utils/ImportedFunctionsInliningStatistics.h
 include/llvm/Transforms/Utils/IntegerDivision.h
 include/llvm/Transforms/Utils/LCSSA.h
@@ -1955,7 +2077,6 @@ include/llvm/Transforms/Utils/LowerMemIn
 include/llvm/Transforms/Utils/Mem2Reg.h
 include/llvm/Transforms/Utils/ModuleUtils.h
 include/llvm/Transforms/Utils/NameAnonGlobals.h
-include/llvm/Transforms/Utils/OrderedInstructions.h
 include/llvm/Transforms/Utils/PredicateInfo.h
 include/llvm/Transforms/Utils/PromoteMemToReg.h
 include/llvm/Transforms/Utils/SSAUpdater.h
@@ -1972,6 +2093,7 @@ include/llvm/Transforms/Utils/VNCoercion
 include/llvm/Transforms/Utils/ValueMapper.h
 include/llvm/Transforms/Vectorize/
 include/llvm/Transforms/Vectorize.h
+include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h
 include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
 include/llvm/Transforms/Vectorize/LoopVectorize.h
 include/llvm/Transforms/Vectorize/SLPVectorizer.h
@@ -1982,14 +2104,23 @@ include/llvm/WindowsResource/ResourcePro
 include/llvm/WindowsResource/ResourceScriptToken.h
 include/llvm/WindowsResource/ResourceScriptTokenList.h
 include/llvm/XRay/
+include/llvm/XRay/BlockIndexer.h
+include/llvm/XRay/BlockPrinter.h
+include/llvm/XRay/BlockVerifier.h
+include/llvm/XRay/FDRLogBuilder.h
+include/llvm/XRay/FDRRecordConsumer.h
+include/llvm/XRay/FDRRecordProducer.h
+include/llvm/XRay/FDRRecords.h
+include/llvm/XRay/FDRTraceExpander.h
+include/llvm/XRay/FDRTraceWriter.h
+include/llvm/XRay/FileHeaderReader.h
 include/llvm/XRay/Graph.h
 include/llvm/XRay/InstrumentationMap.h
+include/llvm/XRay/Profile.h
+include/llvm/XRay/RecordPrinter.h
 include/llvm/XRay/Trace.h
 include/llvm/XRay/XRayRecord.h
 include/llvm/XRay/YAMLXRayRecord.h
-lib/BugpointPasses.so
-lib/LLVMHello.so
-lib/TestPlugin.so
 lib/clang/
 lib/clang/${LLVM_V}/
 ${CLANG_INCLUDE_PATH}/
@@ -2148,7 +2279,7 @@ lib/cmake/llvm/LLVMProcessSources.cmake
 lib/cmake/llvm/TableGen.cmake
 lib/cmake/llvm/VersionFromVCS.cmake
 lib/libLLVM-${LLVM_V}.so
-lib/libLLVM-7.so
+lib/libLLVM-8.so
 lib/libLLVM.so
 lib/libLLVMAggressiveInstCombine.a
 lib/libLLVMAnalysis.a
@@ -2179,6 +2310,7 @@ lib/libLLVMLibDriver.a
 lib/libLLVMLineEditor.a
 lib/libLLVMLinker.a
 lib/libLLVMMC.a
+lib/libLLVMMCA.a
 lib/libLLVMMCDisassembler.a
 lib/libLLVMMCJIT.a
 lib/libLLVMMCParser.a
@@ -2186,6 +2318,7 @@ lib/libLLVMMIRParser.a
 lib/libLLVMObjCARCOpts.a
 lib/libLLVMObject.a
 lib/libLLVMObjectYAML.a
+lib/libLLVMOptRemarks.a
 lib/libLLVMOption.a
 lib/libLLVMOrcJIT.a
 lib/libLLVMPasses.a
@@ -2203,12 +2336,14 @@ lib/libLLVMSupport.a
 lib/libLLVMSymbolize.a
 lib/libLLVMTableGen.a
 lib/libLLVMTarget.a
+lib/libLLVMTextAPI.a
 lib/libLLVMTransformUtils.a
 lib/libLLVMVectorize.a
 lib/libLLVMWindowsManifest.a
 lib/libLLVMXRay.a
 lib/libLLVMipo.a
 @lib lib/libLTO.so.${LIBLTO_VERSION}
+lib/libOptRemarks.so.8
 @lib lib/libclang.so.${LIBclang_VERSION}
 lib/libclangARCMigrate.a
 lib/libclangAST.a
@@ -2265,6 +2400,7 @@ libexec/ccc-analyzer
 @man man/man1/llvm-build.1
 @man man/man1/llvm-config.1
 @man man/man1/llvm-cov.1
+@man man/man1/llvm-cxxmap.1
 @man man/man1/llvm-diff.1
 @man man/man1/llvm-dis.1
 @man man/man1/llvm-dwarfdump.1
@@ -2274,6 +2410,7 @@ libexec/ccc-analyzer
 @man man/man1/llvm-link.1
 @man man/man1/llvm-mca.1
 @man man/man1/llvm-nm.1
+@man man/man1/llvm-objdump.1
 @man man/man1/llvm-pdbutil.1
 @man man/man1/llvm-profdata.1
 @man man/man1/llvm-readobj.1
Index: lang/clang/clang.port.mk
===================================================================
RCS file: /cvs/ports/lang/clang/clang.port.mk,v
retrieving revision 1.32
diff -u -p -r1.32 clang.port.mk
--- lang/clang/clang.port.mk 28 Jan 2019 06:27:28 -0000 1.32
+++ lang/clang/clang.port.mk 4 Jul 2019 15:26:12 -0000
@@ -1,6 +1,6 @@
 # $OpenBSD: clang.port.mk,v 1.32 2019/01/28 06:27:28 jca Exp $
 
-MODCLANG_VERSION= 7.0.1
+MODCLANG_VERSION= 8.0.0
 
 MODCLANG_ARCHS ?= ${LLVM_ARCHS}
 MODCLANG_LANGS ?=



--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: [wip] devel/llvm 8.0.0

Jeremie Courreges-Anglas-2
On Thu, Jul 04 2019, Jeremie Courreges-Anglas <[hidden email]> wrote:

> On Tue, Jul 02 2019, Charlene Wendling <[hidden email]> wrote:
>> Hi!
>>
>>> On Sun, Jun 30 2019, Sebastien Marie <[hidden email]> wrote:
>>> > On Sun, Jun 30, 2019 at 12:55:44AM +0200, Jeremie Courreges-Anglas
>>> > wrote:
>>> >>
>>> >> Here's the diff I'm testing right now.  I have merged the llvm
>>> >> patches this morning and I did not double check them so far, but
>>> >> this lets llvm, include-what-you-use, rust and ripgrep build on
>>> >> amd64.  mozillas are building on amd64, llvm still compiling on
>>> >> sparc64.
>>> >>
>>> >> Sebastien, I guess we'll need to coordinate regarding rust-1.35 /
>>> >> rust-1.36 and llvm-7 / llvm-8.
>>> >
>>> > I think you have more work than me to push a tested llvm-8. so you
>>> > should go first, and I will redo a part of my work for upgrading rust
>>> > to 1.36, using llvm-8.
>>>
>>> I guess it's going to be easier for me this way, I'm not completely
>>> sure.  After all, rust doesn't build on the slower archs that need to be
>>> tested with llvm-8.  Anyway, the current rust version seems to cope fine
>>> with llvm-8 so upgrading llvm first sound appealing.
>>>
>>> > I will use the diff to prepare llvm-8 packages on my buildhosts and
>>> > test rust-1.36 with that.
>>>
>>> Please use this updated diff which adds py-recommonmark[0] as a build
>>> dep.  Sorry for the obvious oversight!
>>>
>>> [0] https://marc.info/?l=openbsd-ports&m=156189089024457&w=2
>>
>> On macppc it fails while packaging [1] because some .a aren't built,
>> as such i've modified a bit the PLISTs.
>
> Thanks (again) for this.
>
>> I guess it's because on macppc only the powerpc target is built.
>
> Yep.
>
>> devel/include-what-you-use still doesn't build with the same error
>> llvm-7 has [2], probably for the same reason.
>
> I had missed that one.  iwyu.cc:
>
> --8<--
> int main(int argc, char **argv) {
>   // Must initialize X86 target to be able to parse Microsoft inline
>   // assembly. We do this unconditionally, because it allows an IWYU
>   // built for non-X86 targets to parse MS inline asm without choking.
>   LLVMInitializeX86TargetInfo();
>   LLVMInitializeX86TargetMC();
>   LLVMInitializeX86AsmParser();
> -->8--
>
> For the ports tree I guess an #ifndef __powerpc__ would be enough.

Jonathan, Charlene, please see the diff below.

>> I'm sending the diff with only the PLIST changes done. sysutils/free
>> builds and runs fine with forced COMPILER. I'll report any arising issues.
>
> As discussed privately PLIST/PFRAG were still not right but that was easy
> to fix.  On top of this I had missed some bits when doing the merge of
> OpenBSD.cpp, which resulted in -lcompiler_rt being incorrectly used
> instead of libgcc on sparc64 (rather, where libestdc++ is used).
> I spotted this thanks to a failure in devel/cbmc.
>
> Here's the latest diff.  It still doesn't merge all the changes from
> base but the differences don't seem to matter for the correctness of the
> compiled code, so I might address this later.  Hopefully this version
> can go in soonish so that semarie@ can proceed to updating lang/rust.
>
> Feedback, reviews, tests, oks etc welcome, as usual.

The latest diff needed yet another PLIST fix.  This update has been
committed, including the include-what-you-use version bump.  I will now
work on syncing the remaining differences between base-clang and
ports-clang.  Thank you all.


Tentative fix for include-what-you-use on powerpc.

Index: patches/patch-iwyu_cc
===================================================================
RCS file: patches/patch-iwyu_cc
diff -N patches/patch-iwyu_cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-iwyu_cc 6 Jul 2019 15:15:53 -0000
@@ -0,0 +1,19 @@
+$OpenBSD$
+
+devel/llvm is built without X86 target support on powerpc.
+
+Index: iwyu.cc
+--- iwyu.cc.orig
++++ iwyu.cc
+@@ -4066,9 +4066,11 @@ int main(int argc, char **argv) {
+   // Must initialize X86 target to be able to parse Microsoft inline
+   // assembly. We do this unconditionally, because it allows an IWYU
+   // built for non-X86 targets to parse MS inline asm without choking.
++#ifndef __powerpc__
+   LLVMInitializeX86TargetInfo();
+   LLVMInitializeX86TargetMC();
+   LLVMInitializeX86AsmParser();
++#endif
+
+   // The command line should look like
+   //   path/to/iwyu -Xiwyu --verbose=4 [-Xiwyu --other_iwyu_flag]... CLANG_FLAGS... foo.cc


--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: [wip] devel/llvm 8.0.0

Jonathan Gray-11
On Sat, Jul 06, 2019 at 05:19:57PM +0200, Jeremie Courreges-Anglas wrote:

> On Thu, Jul 04 2019, Jeremie Courreges-Anglas <[hidden email]> wrote:
> > On Tue, Jul 02 2019, Charlene Wendling <[hidden email]> wrote:
> >> Hi!
> >>
> >>> On Sun, Jun 30 2019, Sebastien Marie <[hidden email]> wrote:
> >>> > On Sun, Jun 30, 2019 at 12:55:44AM +0200, Jeremie Courreges-Anglas
> >>> > wrote:
> >>> >>
> >>> >> Here's the diff I'm testing right now.  I have merged the llvm
> >>> >> patches this morning and I did not double check them so far, but
> >>> >> this lets llvm, include-what-you-use, rust and ripgrep build on
> >>> >> amd64.  mozillas are building on amd64, llvm still compiling on
> >>> >> sparc64.
> >>> >>
> >>> >> Sebastien, I guess we'll need to coordinate regarding rust-1.35 /
> >>> >> rust-1.36 and llvm-7 / llvm-8.
> >>> >
> >>> > I think you have more work than me to push a tested llvm-8. so you
> >>> > should go first, and I will redo a part of my work for upgrading rust
> >>> > to 1.36, using llvm-8.
> >>>
> >>> I guess it's going to be easier for me this way, I'm not completely
> >>> sure.  After all, rust doesn't build on the slower archs that need to be
> >>> tested with llvm-8.  Anyway, the current rust version seems to cope fine
> >>> with llvm-8 so upgrading llvm first sound appealing.
> >>>
> >>> > I will use the diff to prepare llvm-8 packages on my buildhosts and
> >>> > test rust-1.36 with that.
> >>>
> >>> Please use this updated diff which adds py-recommonmark[0] as a build
> >>> dep.  Sorry for the obvious oversight!
> >>>
> >>> [0] https://marc.info/?l=openbsd-ports&m=156189089024457&w=2
> >>
> >> On macppc it fails while packaging [1] because some .a aren't built,
> >> as such i've modified a bit the PLISTs.
> >
> > Thanks (again) for this.
> >
> >> I guess it's because on macppc only the powerpc target is built.
> >
> > Yep.
> >
> >> devel/include-what-you-use still doesn't build with the same error
> >> llvm-7 has [2], probably for the same reason.
> >
> > I had missed that one.  iwyu.cc:
> >
> > --8<--
> > int main(int argc, char **argv) {
> >   // Must initialize X86 target to be able to parse Microsoft inline
> >   // assembly. We do this unconditionally, because it allows an IWYU
> >   // built for non-X86 targets to parse MS inline asm without choking.
> >   LLVMInitializeX86TargetInfo();
> >   LLVMInitializeX86TargetMC();
> >   LLVMInitializeX86AsmParser();
> > -->8--
> >
> > For the ports tree I guess an #ifndef __powerpc__ would be enough.
>
> Jonathan, Charlene, please see the diff below.
>
> >> I'm sending the diff with only the PLIST changes done. sysutils/free
> >> builds and runs fine with forced COMPILER. I'll report any arising issues.
> >
> > As discussed privately PLIST/PFRAG were still not right but that was easy
> > to fix.  On top of this I had missed some bits when doing the merge of
> > OpenBSD.cpp, which resulted in -lcompiler_rt being incorrectly used
> > instead of libgcc on sparc64 (rather, where libestdc++ is used).
> > I spotted this thanks to a failure in devel/cbmc.
> >
> > Here's the latest diff.  It still doesn't merge all the changes from
> > base but the differences don't seem to matter for the correctness of the
> > compiled code, so I might address this later.  Hopefully this version
> > can go in soonish so that semarie@ can proceed to updating lang/rust.
> >
> > Feedback, reviews, tests, oks etc welcome, as usual.
>
> The latest diff needed yet another PLIST fix.  This update has been
> committed, including the include-what-you-use version bump.  I will now
> work on syncing the remaining differences between base-clang and
> ports-clang.  Thank you all.
>
>
> Tentative fix for include-what-you-use on powerpc.

I'm ok with this though the targets being different on powerpc is
annoying.  Does building the X86 and PowerPC targets without the rest
still fit while dropping the rest?

>
> Index: patches/patch-iwyu_cc
> ===================================================================
> RCS file: patches/patch-iwyu_cc
> diff -N patches/patch-iwyu_cc
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-iwyu_cc 6 Jul 2019 15:15:53 -0000
> @@ -0,0 +1,19 @@
> +$OpenBSD$
> +
> +devel/llvm is built without X86 target support on powerpc.
> +
> +Index: iwyu.cc
> +--- iwyu.cc.orig
> ++++ iwyu.cc
> +@@ -4066,9 +4066,11 @@ int main(int argc, char **argv) {
> +   // Must initialize X86 target to be able to parse Microsoft inline
> +   // assembly. We do this unconditionally, because it allows an IWYU
> +   // built for non-X86 targets to parse MS inline asm without choking.
> ++#ifndef __powerpc__
> +   LLVMInitializeX86TargetInfo();
> +   LLVMInitializeX86TargetMC();
> +   LLVMInitializeX86AsmParser();
> ++#endif
> +
> +   // The command line should look like
> +   //   path/to/iwyu -Xiwyu --verbose=4 [-Xiwyu --other_iwyu_flag]... CLANG_FLAGS... foo.cc
>
>
> --
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: [wip] devel/llvm 8.0.0

Jeremie Courreges-Anglas-2
On Sun, Jul 07 2019, Jonathan Gray <[hidden email]> wrote:
> On Sat, Jul 06, 2019 at 05:19:57PM +0200, Jeremie Courreges-Anglas wrote:

[...]

>> Tentative fix for include-what-you-use on powerpc.
>
> I'm ok with this though the targets being different on powerpc is
> annoying.  Does building the X86 and PowerPC targets without the rest
> still fit while dropping the rest?

Well, llvm on powerpc will still be different even if we enable the X86
backend.  I guess adding such support would be doable, but it's also
going to make things a tad uglier.

I wonder whether the build system of include-what-you-use could detect
whether this X86 backend is available.  Also I wonder why the affected
function calls are x86-specific.  Why wouldn't other backends have
a need to be initialized?

Anyway, I have committed this workaround for now, thanks cwen@ for the
tests.

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE