Re: llvm: patch-update to release 5.0.1

2018-09-05 Thread Leonid Bobrov
I always wonder: where the fuck is lldb? I don't see it in base or ports



Re: llvm: patch-update to release 5.0.1

2017-12-24 Thread Alexander Bluhm
On Fri, Dec 22, 2017 at 01:35:28PM +0100, Patrick Wildt wrote:
> Feedback appreciated!

On i386 I used clang version 5.0.1 to build a kernel and /usr/src.
The regression tests passed on that system.

bluhm



llvm: patch-update to release 5.0.1

2017-12-22 Thread Patrick Wildt
Hi,

I would like to update LLVM, including clang, lld and lldb, to the
patch release version 5.0.1.  They typically only do bugfixing, which
means that the diff to 5.0.0 is "only" about 3500 lines.

I don't expect any big fallout, but I would appreciate if someone
could do a ports run with this change.  I will take care of src/x11
on amd64.

Update procedure is simply running
  $ cd /usr/src/gnu/usr.bin/clang
  $ make obj
  $ make clean
  $ make -j8
  $ make install

Feedback appreciated!

Patrick

diff --git a/gnu/llvm/CMakeLists.txt b/gnu/llvm/CMakeLists.txt
index 8c0f5114513..960febf6007 100644
--- a/gnu/llvm/CMakeLists.txt
+++ b/gnu/llvm/CMakeLists.txt
@@ -26,7 +26,7 @@ if(NOT DEFINED LLVM_VERSION_MINOR)
   set(LLVM_VERSION_MINOR 0)
 endif()
 if(NOT DEFINED LLVM_VERSION_PATCH)
-  set(LLVM_VERSION_PATCH 0)
+  set(LLVM_VERSION_PATCH 1)
 endif()
 if(NOT DEFINED LLVM_VERSION_SUFFIX)
   set(LLVM_VERSION_SUFFIX "")
@@ -208,10 +208,6 @@ include(VersionFromVCS)
 option(LLVM_APPEND_VC_REV
   "Embed the version control system revision id in LLVM" ON)
 
-if( LLVM_APPEND_VC_REV )
-  add_version_info_from_vcs(PACKAGE_VERSION)
-endif()
-
 set(PACKAGE_NAME LLVM)
 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
 set(PACKAGE_BUGREPORT "http://llvm.org/bugs/;)
diff --git a/gnu/llvm/docs/CMake.rst b/gnu/llvm/docs/CMake.rst
index bf97e917315..b6ebf37adc9 100644
--- a/gnu/llvm/docs/CMake.rst
+++ b/gnu/llvm/docs/CMake.rst
@@ -248,9 +248,10 @@ LLVM-specific variables
 
 **LLVM_APPEND_VC_REV**:BOOL
   Embed version control revision info (svn revision number or Git revision id).
-  This is used among other things in the LLVM version string (stored in the
-  PACKAGE_VERSION macro). For this to work cmake must be invoked before the
-  build. Defaults to ON.
+  The version info is provided by the ``LLVM_REVISION`` macro in
+  ``llvm/include/llvm/Support/VCSRevision.h``. Developers using git who don't
+  need revision info can disable this option to avoid re-linking most binaries
+  after a branch switch. Defaults to ON.
 
 **LLVM_ENABLE_THREADS**:BOOL
   Build with threads support, if available. Defaults to ON.
diff --git a/gnu/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h 
b/gnu/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
index 0b07fe9aa23..9bbda718aca 100644
--- a/gnu/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+++ b/gnu/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
@@ -652,6 +652,12 @@ public:
 
 auto GTI = gep_type_begin(PointeeType, Operands);
 Type *TargetType;
+
+// Handle the case where the GEP instruction has a single operand,
+// the basis, therefore TargetType is a nullptr.
+if (Operands.empty())
+  return !BaseGV ? TTI::TCC_Free : TTI::TCC_Basic;
+
 for (auto I = Operands.begin(); I != Operands.end(); ++I, ++GTI) {
   TargetType = GTI.getIndexedType();
   // We assume that the cost of Scalar GEP with constant index and the
diff --git a/gnu/llvm/include/llvm/CodeGen/MachineRegisterInfo.h 
b/gnu/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
index 8347f00cbc7..5ef0ac90e3c 100644
--- a/gnu/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
+++ b/gnu/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
@@ -807,6 +807,14 @@ public:
 return getReservedRegs().test(PhysReg);
   }
 
+  /// Returns true when the given register unit is considered reserved.
+  ///
+  /// Register units are considered reserved when for at least one of their
+  /// root registers, the root register and all super registers are reserved.
+  /// This currently iterates the register hierarchy and may be slower than
+  /// expected.
+  bool isReservedRegUnit(unsigned Unit) const;
+
   /// isAllocatable - Returns true when PhysReg belongs to an allocatable
   /// register class and it hasn't been reserved.
   ///
diff --git a/gnu/llvm/include/llvm/IR/AutoUpgrade.h 
b/gnu/llvm/include/llvm/IR/AutoUpgrade.h
index b42a3d3ad95..3f406f0cf19 100644
--- a/gnu/llvm/include/llvm/IR/AutoUpgrade.h
+++ b/gnu/llvm/include/llvm/IR/AutoUpgrade.h
@@ -51,6 +51,8 @@ namespace llvm {
   /// module is modified.
   bool UpgradeModuleFlags(Module );
 
+  void UpgradeSectionAttributes(Module );
+
   /// If the given TBAA tag uses the scalar TBAA format, create a new node
   /// corresponding to the upgrade to the struct-path aware TBAA format.
   /// Otherwise return the \p TBAANode itself.
diff --git a/gnu/llvm/include/llvm/Support/FormatVariadic.h 
b/gnu/llvm/include/llvm/Support/FormatVariadic.h
index c1153e84dfb..408c6d8b2e0 100644
--- a/gnu/llvm/include/llvm/Support/FormatVariadic.h
+++ b/gnu/llvm/include/llvm/Support/FormatVariadic.h
@@ -94,6 +94,15 @@ public:
 Adapters.reserve(ParamCount);
   }
 
+  formatv_object_base(formatv_object_base const ) = delete;
+
+  formatv_object_base(formatv_object_base &)
+  : Fmt(std::move(rhs.Fmt)),
+Adapters(), // Adapters are initialized by formatv_object
+Replacements(std::move(rhs.Replacements)) {
+