From owner-svn-src-all@freebsd.org Sun Dec 3 12:14:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF9A7DF9898; Sun, 3 Dec 2017 12:14:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38C4176B98; Sun, 3 Dec 2017 12:14:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB3CEbvB040795; Sun, 3 Dec 2017 12:14:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB3CEYdU040767; Sun, 3 Dec 2017 12:14:34 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201712031214.vB3CEYdU040767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 3 Dec 2017 12:14:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326496 - in head: . contrib/libc++/include contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm/CodeGen contrib/llvm/include/llvm/IR contrib/llvm/include/llvm/Support contrib/l... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: . contrib/libc++/include contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm/CodeGen contrib/llvm/include/llvm/IR contrib/llvm/include/llvm/Support contrib/llvm/lib/AsmParser contrib... X-SVN-Commit-Revision: 326496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Dec 2017 12:14:38 -0000 Author: dim Date: Sun Dec 3 12:14:34 2017 New Revision: 326496 URL: https://svnweb.freebsd.org/changeset/base/326496 Log: Upgrade our copies of clang, llvm, lldb and libc++ to r319231 from the upstream release_50 branch. This corresponds to 5.0.1 rc2. MFC after: 2 weeks Modified: head/ObsoleteFiles.inc head/contrib/libc++/include/algorithm head/contrib/libc++/include/deque head/contrib/libc++/include/functional head/contrib/libc++/include/list head/contrib/libc++/include/string head/contrib/libc++/include/type_traits head/contrib/libc++/include/vector head/contrib/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h head/contrib/llvm/include/llvm/IR/AutoUpgrade.h head/contrib/llvm/include/llvm/Support/FormatVariadic.h head/contrib/llvm/lib/AsmParser/LLParser.cpp head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp head/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp head/contrib/llvm/lib/CodeGen/MachineVerifier.cpp head/contrib/llvm/lib/IR/AutoUpgrade.cpp head/contrib/llvm/lib/IR/ConstantFold.cpp head/contrib/llvm/lib/Linker/IRMover.cpp head/contrib/llvm/lib/Linker/LinkModules.cpp head/contrib/llvm/lib/Support/Host.cpp head/contrib/llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td head/contrib/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp head/contrib/llvm/lib/Target/ARM/ARMCallLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp head/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td head/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp head/contrib/llvm/lib/Target/ARM/ARMSubtarget.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp head/contrib/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp head/contrib/llvm/lib/Target/AVR/AVRISelLowering.cpp head/contrib/llvm/lib/Target/AVR/AVRISelLowering.h head/contrib/llvm/lib/Target/AVR/AVRInstrInfo.cpp head/contrib/llvm/lib/Target/AVR/AVRInstrInfo.h head/contrib/llvm/lib/Target/AVR/AVRInstrInfo.td head/contrib/llvm/lib/Target/AVR/AVRRegisterInfo.cpp head/contrib/llvm/lib/Target/AVR/AVRTargetMachine.cpp head/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRTargetStreamer.cpp head/contrib/llvm/lib/Target/AVR/MCTargetDesc/AVRTargetStreamer.h head/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp head/contrib/llvm/lib/Target/Mips/MicroMipsDSPInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsDSPInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsFrameLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsMTInstrFormats.td head/contrib/llvm/lib/Target/Mips/MipsMTInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsSchedule.td head/contrib/llvm/lib/Target/Mips/MipsScheduleGeneric.td head/contrib/llvm/lib/Target/Mips/MipsTargetStreamer.h head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/tools/clang/include/clang/Basic/Attr.td head/contrib/llvm/tools/clang/include/clang/Basic/AttrDocs.td head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.h head/contrib/llvm/tools/clang/lib/CodeGen/CGStmtOpenMP.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h head/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/BareMetal.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/BareMetal.h head/contrib/llvm/tools/clang/lib/Driver/ToolChains/Clang.cpp head/contrib/llvm/tools/clang/lib/Format/Format.cpp head/contrib/llvm/tools/clang/lib/Headers/avx512fintrin.h head/contrib/llvm/tools/clang/lib/Sema/SemaOpenMP.cpp head/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp head/contrib/llvm/tools/lld/ELF/SyntheticSections.h head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp head/etc/mtree/BSD.debug.dist head/etc/mtree/BSD.usr.dist head/lib/clang/headers/Makefile head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/clang/Config/config.h head/lib/clang/include/lld/Config/Version.inc head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h head/lib/clang/include/llvm/Support/VCSRevision.h head/lib/libclang_rt/Makefile.inc head/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: head/contrib/compiler-rt/ (props changed) head/contrib/libc++/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lld/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Dec 3 04:55:38 2017 (r326495) +++ head/ObsoleteFiles.inc Sun Dec 3 12:14:34 2017 (r326496) @@ -38,6 +38,123 @@ # xargs -n1 | sort | uniq -d; # done +# 20171203: new clang import which bumps version from 5.0.0 to 5.0.1. +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/esan_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/5.0.0/include/sanitizer/tsan_interface_atomic.h +OLD_DIRS+=usr/lib/clang/5.0.0/include/sanitizer +OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/5.0.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/5.0.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/altivec.h +OLD_FILES+=usr/lib/clang/5.0.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/5.0.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/5.0.0/include/armintr.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/5.0.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/5.0.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/5.0.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/5.0.0/include/msa.h +OLD_FILES+=usr/lib/clang/5.0.0/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/opencl-c.h +OLD_FILES+=usr/lib/clang/5.0.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/5.0.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/5.0.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/5.0.0/include +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_DIRS+=usr/lib/clang/5.0.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/5.0.0/lib +OLD_DIRS+=usr/lib/clang/5.0.0 # 20171118: Remove old etc casper files OLD_FILES+=etc/casper/system.dns OLD_FILES+=etc/casper/system.grp Modified: head/contrib/libc++/include/algorithm ============================================================================== --- head/contrib/libc++/include/algorithm Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/libc++/include/algorithm Sun Dec 3 12:14:34 2017 (r326496) @@ -3013,6 +3013,7 @@ template _UIntType __independent_bits_engine<_Engine, _UIntType>::__eval(true_type) { + const size_t _WRt = numeric_limits::digits; result_type _Sp = 0; for (size_t __k = 0; __k < __n0_; ++__k) { @@ -3021,7 +3022,7 @@ __independent_bits_engine<_Engine, _UIntType>::__eval( { __u = __e_() - _Engine::min(); } while (__u >= __y0_); - if (__w0_ < _WDt) + if (__w0_ < _WRt) _Sp <<= __w0_; else _Sp = 0; @@ -3034,7 +3035,7 @@ __independent_bits_engine<_Engine, _UIntType>::__eval( { __u = __e_() - _Engine::min(); } while (__u >= __y1_); - if (__w0_ < _WDt - 1) + if (__w0_ < _WRt - 1) _Sp <<= __w0_ + 1; else _Sp = 0; Modified: head/contrib/libc++/include/deque ============================================================================== --- head/contrib/libc++/include/deque Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/libc++/include/deque Sun Dec 3 12:14:34 2017 (r326496) @@ -1356,7 +1356,6 @@ class _LIBCPP_TEMPLATE_VIS deque (public) iterator insert(const_iterator __p, initializer_list __il) {return insert(__p, __il.begin(), __il.end());} #endif // _LIBCPP_CXX03_LANG - iterator insert(const_iterator __p, const value_type& __v); iterator insert(const_iterator __p, size_type __n, const value_type& __v); template @@ -2224,7 +2223,11 @@ deque<_Tp, _Allocator>::__append(_InpIter __f, _InpIte !__is_forward_iterator<_InpIter>::value>::type*) { for (; __f != __l; ++__f) +#ifdef _LIBCPP_CXX03_LANG push_back(*__f); +#else + emplace_back(*__f); +#endif } template Modified: head/contrib/libc++/include/functional ============================================================================== --- head/contrib/libc++/include/functional Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/libc++/include/functional Sun Dec 3 12:14:34 2017 (r326496) @@ -1597,9 +1597,11 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)> return reinterpret_cast<__base*>(p); } - template ::value && - __invokable<_Fp&, _ArgTypes...>::value> - struct __callable; + template , function>::value>, + __invokable<_Fp&, _ArgTypes...> + >::value> + struct __callable; template struct __callable<_Fp, true> { @@ -1612,6 +1614,9 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)> { static const bool value = false; }; + + template + using _EnableIfCallable = typename enable_if<__callable<_Fp>::value>::type; public: typedef _Rp result_type; @@ -1622,9 +1627,7 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)> function(nullptr_t) _NOEXCEPT : __f_(0) {} function(const function&); function(function&&) _NOEXCEPT; - template::value && !is_same<_Fp, function>::value - >::type> + template> function(_Fp); #if _LIBCPP_STD_VER <= 14 @@ -1638,21 +1641,15 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)> function(allocator_arg_t, const _Alloc&, const function&); template function(allocator_arg_t, const _Alloc&, function&&); - template::value>::type> + template> function(allocator_arg_t, const _Alloc& __a, _Fp __f); #endif function& operator=(const function&); function& operator=(function&&) _NOEXCEPT; function& operator=(nullptr_t) _NOEXCEPT; - template - typename enable_if - < - __callable::type>::value && - !is_same::type, function>::value, - function& - >::type - operator=(_Fp&&); + template> + function& operator=(_Fp&&); ~function(); @@ -1854,13 +1851,8 @@ function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOE } template -template -typename enable_if -< - function<_Rp(_ArgTypes...)>::template __callable::type>::value && - !is_same::type, function<_Rp(_ArgTypes...)>>::value, - function<_Rp(_ArgTypes...)>& ->::type +template +function<_Rp(_ArgTypes...)>& function<_Rp(_ArgTypes...)>::operator=(_Fp&& __f) { function(_VSTD::forward<_Fp>(__f)).swap(*this); Modified: head/contrib/libc++/include/list ============================================================================== --- head/contrib/libc++/include/list Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/libc++/include/list Sun Dec 3 12:14:34 2017 (r326496) @@ -992,6 +992,15 @@ class _LIBCPP_TEMPLATE_VIS list (public) void push_front(const value_type& __x); void push_back(const value_type& __x); +#ifndef _LIBCPP_CXX03_LANG + template + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(_Arg&& __arg) { emplace_back(_VSTD::forward<_Arg>(__arg)); } +#else + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(value_type const& __arg) { push_back(__arg); } +#endif + iterator insert(const_iterator __p, const value_type& __x); iterator insert(const_iterator __p, size_type __n, const value_type& __x); template @@ -1189,7 +1198,7 @@ list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, __get_db()->__insert_c(this); #endif for (; __f != __l; ++__f) - push_back(*__f); + __emplace_back(*__f); } template @@ -1202,7 +1211,7 @@ list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, co __get_db()->__insert_c(this); #endif for (; __f != __l; ++__f) - push_back(*__f); + __emplace_back(*__f); } template Modified: head/contrib/libc++/include/string ============================================================================== --- head/contrib/libc++/include/string Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/libc++/include/string Sun Dec 3 12:14:34 2017 (r326496) @@ -259,7 +259,7 @@ class basic_string (public) size_type find(value_type c, size_type pos = 0) const noexcept; size_type rfind(const basic_string& str, size_type pos = npos) const noexcept; - size_type ffind(basic_string_view sv, size_type pos = 0) const noexcept; + size_type rfind(basic_string_view sv, size_type pos = npos) const noexcept; size_type rfind(const value_type* s, size_type pos, size_type n) const noexcept; size_type rfind(const value_type* s, size_type pos = npos) const noexcept; size_type rfind(value_type c, size_type pos = npos) const noexcept; @@ -271,7 +271,7 @@ class basic_string (public) size_type find_first_of(value_type c, size_type pos = 0) const noexcept; size_type find_last_of(const basic_string& str, size_type pos = npos) const noexcept; - size_type find_last_of(basic_string_view sv, size_type pos = 0) const noexcept; + size_type find_last_of(basic_string_view sv, size_type pos = npos) const noexcept; size_type find_last_of(const value_type* s, size_type pos, size_type n) const noexcept; size_type find_last_of(const value_type* s, size_type pos = npos) const noexcept; size_type find_last_of(value_type c, size_type pos = npos) const noexcept; @@ -283,7 +283,7 @@ class basic_string (public) size_type find_first_not_of(value_type c, size_type pos = 0) const noexcept; size_type find_last_not_of(const basic_string& str, size_type pos = npos) const noexcept; - size_type find_last_not_of(basic_string_view sv, size_type pos = 0) const noexcept; + size_type find_last_not_of(basic_string_view sv, size_type pos = npos) const noexcept; size_type find_last_not_of(const value_type* s, size_type pos, size_type n) const noexcept; size_type find_last_not_of(const value_type* s, size_type pos = npos) const noexcept; size_type find_last_not_of(value_type c, size_type pos = npos) const noexcept; @@ -1147,7 +1147,7 @@ class _LIBCPP_TEMPLATE_VIS basic_string (public) _LIBCPP_INLINE_VISIBILITY size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY - size_type rfind(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + size_type rfind(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY size_type rfind(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; @@ -1166,7 +1166,7 @@ class _LIBCPP_TEMPLATE_VIS basic_string (public) _LIBCPP_INLINE_VISIBILITY size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY - size_type find_last_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + size_type find_last_of(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY size_type find_last_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; @@ -1186,7 +1186,7 @@ class _LIBCPP_TEMPLATE_VIS basic_string (public) _LIBCPP_INLINE_VISIBILITY size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY - size_type find_last_not_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + size_type find_last_not_of(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY size_type find_last_not_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; Modified: head/contrib/libc++/include/type_traits ============================================================================== --- head/contrib/libc++/include/type_traits Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/libc++/include/type_traits Sun Dec 3 12:14:34 2017 (r326496) @@ -4339,8 +4339,8 @@ struct __invokable_r using _Result = decltype( _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...)); - static const bool value = - conditional< + using type = + typename conditional< !is_same<_Result, __nat>::value, typename conditional< is_void<_Ret>::value, @@ -4348,7 +4348,8 @@ struct __invokable_r is_convertible<_Result, _Ret> >::type, false_type - >::type::value; + >::type; + static const bool value = type::value; }; template Modified: head/contrib/libc++/include/vector ============================================================================== --- head/contrib/libc++/include/vector Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/libc++/include/vector Sun Dec 3 12:14:34 2017 (r326496) @@ -674,6 +674,17 @@ class _LIBCPP_TEMPLATE_VIS vector (public) const value_type* data() const _NOEXCEPT {return _VSTD::__to_raw_pointer(this->__begin_);} +#ifdef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(const value_type& __x) { push_back(__x); } +#else + template + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(_Arg&& __arg) { + emplace_back(_VSTD::forward<_Arg>(__arg)); + } +#endif + _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x); #ifndef _LIBCPP_CXX03_LANG @@ -1128,7 +1139,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first __get_db()->__insert_c(this); #endif for (; __first != __last; ++__first) - push_back(*__first); + __emplace_back(*__first); } template @@ -1145,7 +1156,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first __get_db()->__insert_c(this); #endif for (; __first != __last; ++__first) - push_back(*__first); + __emplace_back(*__first); } template @@ -1365,7 +1376,7 @@ vector<_Tp, _Allocator>::assign(_InputIterator __first { clear(); for (; __first != __last; ++__first) - push_back(*__first); + __emplace_back(*__first); } template Modified: head/contrib/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h Sun Dec 3 12:14:34 2017 (r326496) @@ -652,6 +652,12 @@ class TargetTransformInfoImplCRTPBase : public TargetT 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 Modified: head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h Sun Dec 3 12:14:34 2017 (r326496) @@ -807,6 +807,14 @@ class MachineRegisterInfo { (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. /// Modified: head/contrib/llvm/include/llvm/IR/AutoUpgrade.h ============================================================================== --- head/contrib/llvm/include/llvm/IR/AutoUpgrade.h Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/include/llvm/IR/AutoUpgrade.h Sun Dec 3 12:14:34 2017 (r326496) @@ -51,6 +51,8 @@ namespace llvm { /// module is modified. bool UpgradeModuleFlags(Module &M); + void UpgradeSectionAttributes(Module &M); + /// 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. Modified: head/contrib/llvm/include/llvm/Support/FormatVariadic.h ============================================================================== --- head/contrib/llvm/include/llvm/Support/FormatVariadic.h Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/include/llvm/Support/FormatVariadic.h Sun Dec 3 12:14:34 2017 (r326496) @@ -94,6 +94,15 @@ class formatv_object_base { (public) Adapters.reserve(ParamCount); } + formatv_object_base(formatv_object_base const &rhs) = delete; + + formatv_object_base(formatv_object_base &&rhs) + : Fmt(std::move(rhs.Fmt)), + Adapters(), // Adapters are initialized by formatv_object + Replacements(std::move(rhs.Replacements)) { + Adapters.reserve(rhs.Adapters.size()); + }; + void format(raw_ostream &S) const { for (auto &R : Replacements) { if (R.Type == ReplacementType::Empty) @@ -147,6 +156,14 @@ template class formatv_object : publi formatv_object(StringRef Fmt, Tuple &&Params) : formatv_object_base(Fmt, std::tuple_size::value), Parameters(std::move(Params)) { + Adapters = apply_tuple(create_adapters(), Parameters); + } + + formatv_object(formatv_object const &rhs) = delete; + + formatv_object(formatv_object &&rhs) + : formatv_object_base(std::move(rhs)), + Parameters(std::move(rhs.Parameters)) { Adapters = apply_tuple(create_adapters(), Parameters); } }; Modified: head/contrib/llvm/lib/AsmParser/LLParser.cpp ============================================================================== --- head/contrib/llvm/lib/AsmParser/LLParser.cpp Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/AsmParser/LLParser.cpp Sun Dec 3 12:14:34 2017 (r326496) @@ -240,6 +240,7 @@ bool LLParser::ValidateEndOfModule() { UpgradeDebugInfo(*M); UpgradeModuleFlags(*M); + UpgradeSectionAttributes(*M); if (!Slots) return false; Modified: head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp ============================================================================== --- head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp Sun Dec 3 12:14:34 2017 (r326496) @@ -264,7 +264,7 @@ Expected hasObjCCategoryInModule(BitstreamCursor if (convertToString(Record, 0, S)) return error("Invalid record"); // Check for the i386 and other (x86_64, ARM) conventions - if (S.find("__DATA, __objc_catlist") != std::string::npos || + if (S.find("__DATA,__objc_catlist") != std::string::npos || S.find("__OBJC,__category") != std::string::npos) return true; break; Modified: head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Sun Dec 3 12:14:34 2017 (r326496) @@ -621,6 +621,7 @@ void DwarfCompileUnit::constructAbstractSubprogramScop auto *SP = cast(Scope->getScopeNode()); DIE *ContextDIE; + DwarfCompileUnit *ContextCU = this; if (includeMinimalInlineScopes()) ContextDIE = &getUnitDie(); @@ -631,18 +632,23 @@ void DwarfCompileUnit::constructAbstractSubprogramScop else if (auto *SPDecl = SP->getDeclaration()) { ContextDIE = &getUnitDie(); getOrCreateSubprogramDIE(SPDecl); - } else + } else { ContextDIE = getOrCreateContextDIE(resolve(SP->getScope())); + // The scope may be shared with a subprogram that has already been + // constructed in another CU, in which case we need to construct this + // subprogram in the same CU. + ContextCU = DD->lookupCU(ContextDIE->getUnitDie()); + } // Passing null as the associated node because the abstract definition // shouldn't be found by lookup. - AbsDef = &createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, nullptr); - applySubprogramAttributesToDefinition(SP, *AbsDef); + AbsDef = &ContextCU->createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, nullptr); + ContextCU->applySubprogramAttributesToDefinition(SP, *AbsDef); - if (!includeMinimalInlineScopes()) - addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined); - if (DIE *ObjectPointer = createAndAddScopeChildren(Scope, *AbsDef)) - addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer); + if (!ContextCU->includeMinimalInlineScopes()) + ContextCU->addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined); + if (DIE *ObjectPointer = ContextCU->createAndAddScopeChildren(Scope, *AbsDef)) + ContextCU->addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer); } DIE *DwarfCompileUnit::constructImportedEntityDIE( Modified: head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h ============================================================================== --- head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h Sun Dec 3 12:14:34 2017 (r326496) @@ -283,7 +283,7 @@ class DwarfDebug : public DebugHandlerBase { // 0, referencing the comp_dir of all the type units that use it. MCDwarfDwoLineTable SplitTypeUnitFileTable; /// @} - + /// True iff there are multiple CUs in this module. bool SingleCU; bool IsDarwin; @@ -562,6 +562,9 @@ class DwarfDebug : public DebugHandlerBase { bool isLexicalScopeDIENull(LexicalScope *Scope); bool hasDwarfPubSections(bool includeMinimalInlineScopes) const; + + /// Find the matching DwarfCompileUnit for the given CU DIE. + DwarfCompileUnit *lookupCU(const DIE *Die) { return CUDieMap.lookup(Die); } }; } // End of namespace llvm Modified: head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp Sun Dec 3 12:14:34 2017 (r326496) @@ -131,13 +131,12 @@ bool DwarfExpression::addMachineReg(const TargetRegist // Intersection between the bits we already emitted and the bits // covered by this subregister. - SmallBitVector Intersection(RegSize, false); - Intersection.set(Offset, Offset + Size); - Intersection ^= Coverage; + SmallBitVector CurSubReg(RegSize, false); + CurSubReg.set(Offset, Offset + Size); // If this sub-register has a DWARF number and we haven't covered // its range, emit a DWARF piece for it. - if (Reg >= 0 && Intersection.any()) { + if (Reg >= 0 && CurSubReg.test(Coverage)) { // Emit a piece for any gap in the coverage. if (Offset > CurPos) DwarfRegs.push_back({-1, Offset - CurPos, nullptr}); Modified: head/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Sun Dec 3 12:14:34 2017 (r326496) @@ -269,8 +269,9 @@ void LiveIntervals::computeRegUnitRange(LiveRange &LR, // may share super-registers. That's OK because createDeadDefs() is // idempotent. It is very rare for a register unit to have multiple roots, so // uniquing super-registers is probably not worthwhile. - bool IsReserved = true; + bool IsReserved = false; for (MCRegUnitRootIterator Root(Unit, TRI); Root.isValid(); ++Root) { + bool IsRootReserved = true; for (MCSuperRegIterator Super(*Root, TRI, /*IncludeSelf=*/true); Super.isValid(); ++Super) { unsigned Reg = *Super; @@ -279,9 +280,12 @@ void LiveIntervals::computeRegUnitRange(LiveRange &LR, // A register unit is considered reserved if all its roots and all their // super registers are reserved. if (!MRI->isReserved(Reg)) - IsReserved = false; + IsRootReserved = false; } + IsReserved |= IsRootReserved; } + assert(IsReserved == MRI->isReservedRegUnit(Unit) && + "reserved computation mismatch"); // Now extend LR to reach all uses. // Ignore uses of reserved registers. We only track defs of those. @@ -924,7 +928,7 @@ class LiveIntervals::HMEditor { (public) // kill flags. This is wasteful. Eventually, LiveVariables will strip all kill // flags, and postRA passes will use a live register utility instead. LiveRange *getRegUnitLI(unsigned Unit) { - if (UpdateFlags) + if (UpdateFlags && !MRI.isReservedRegUnit(Unit)) return &LIS.getRegUnit(Unit); return LIS.getCachedRegUnit(Unit); } Modified: head/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp Sun Dec 3 12:14:34 2017 (r326496) @@ -601,3 +601,21 @@ void MachineRegisterInfo::setCalleeSavedRegs(ArrayRef< UpdatedCSRs.push_back(0); IsUpdatedCSRsInitialized = true; } + +bool MachineRegisterInfo::isReservedRegUnit(unsigned Unit) const { + const TargetRegisterInfo *TRI = getTargetRegisterInfo(); + for (MCRegUnitRootIterator Root(Unit, TRI); Root.isValid(); ++Root) { + bool IsRootReserved = true; + for (MCSuperRegIterator Super(*Root, TRI, /*IncludeSelf=*/true); + Super.isValid(); ++Super) { + unsigned Reg = *Super; + if (!isReserved(Reg)) { + IsRootReserved = false; + break; + } + } + if (IsRootReserved) + return true; + } + return false; +} Modified: head/contrib/llvm/lib/CodeGen/MachineVerifier.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/MachineVerifier.cpp Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/CodeGen/MachineVerifier.cpp Sun Dec 3 12:14:34 2017 (r326496) @@ -1316,6 +1316,8 @@ void MachineVerifier::checkLiveness(const MachineOpera // Check the cached regunit intervals. if (TargetRegisterInfo::isPhysicalRegister(Reg) && !isReserved(Reg)) { for (MCRegUnitIterator Units(Reg, TRI); Units.isValid(); ++Units) { + if (MRI->isReservedRegUnit(*Units)) + continue; if (const LiveRange *LR = LiveInts->getCachedRegUnit(*Units)) checkLivenessAtUse(MO, MONum, UseIdx, *LR, *Units); } Modified: head/contrib/llvm/lib/IR/AutoUpgrade.cpp ============================================================================== --- head/contrib/llvm/lib/IR/AutoUpgrade.cpp Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/IR/AutoUpgrade.cpp Sun Dec 3 12:14:34 2017 (r326496) @@ -2271,6 +2271,24 @@ bool llvm::UpgradeModuleFlags(Module &M) { } } } + // Upgrade Objective-C Image Info Section. Removed the whitespce in the + // section name so that llvm-lto will not complain about mismatching + // module flags that is functionally the same. + if (ID->getString() == "Objective-C Image Info Section") { + if (auto *Value = dyn_cast_or_null(Op->getOperand(2))) { + SmallVector ValueComp; + Value->getString().split(ValueComp, " "); + if (ValueComp.size() != 1) { + std::string NewValue; + for (auto &S : ValueComp) + NewValue += S.str(); + Metadata *Ops[3] = {Op->getOperand(0), Op->getOperand(1), + MDString::get(M.getContext(), NewValue)}; + ModFlags->setOperand(I, MDNode::get(M.getContext(), Ops)); + Changed = true; + } + } + } } // "Objective-C Class Properties" is recently added for Objective-C. We @@ -2285,6 +2303,35 @@ bool llvm::UpgradeModuleFlags(Module &M) { } return Changed; +} + +void llvm::UpgradeSectionAttributes(Module &M) { + auto TrimSpaces = [](StringRef Section) -> std::string { + SmallVector Components; + Section.split(Components, ','); + + SmallString<32> Buffer; + raw_svector_ostream OS(Buffer); + + for (auto Component : Components) + OS << ',' << Component.trim(); + + return OS.str().substr(1); + }; + + for (auto &GV : M.globals()) { + if (!GV.hasSection()) + continue; + + StringRef Section = GV.getSection(); + + if (!Section.startswith("__DATA, __objc_catlist")) + continue; + + // __DATA, __objc_catlist, regular, no_dead_strip + // __DATA,__objc_catlist,regular,no_dead_strip + GV.setSection(TrimSpaces(Section)); + } } static bool isOldLoopArgument(Metadata *MD) { Modified: head/contrib/llvm/lib/IR/ConstantFold.cpp ============================================================================== --- head/contrib/llvm/lib/IR/ConstantFold.cpp Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/IR/ConstantFold.cpp Sun Dec 3 12:14:34 2017 (r326496) @@ -2199,6 +2199,9 @@ Constant *llvm::ConstantFoldGetElementPtr(Type *Pointe Unknown = true; continue; } + if (!isa(Idxs[i - 1])) + // FIXME: add the support of cosntant vector index. + continue; if (InRangeIndex && i == *InRangeIndex + 1) { // If an index is marked inrange, we cannot apply this canonicalization to // the following index, as that will cause the inrange index to point to Modified: head/contrib/llvm/lib/Linker/IRMover.cpp ============================================================================== --- head/contrib/llvm/lib/Linker/IRMover.cpp Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/Linker/IRMover.cpp Sun Dec 3 12:14:34 2017 (r326496) @@ -640,6 +640,10 @@ GlobalValue *IRLinker::copyGlobalValueProto(const Glob } else { if (ForDefinition) NewGV = copyGlobalAliasProto(cast(SGV)); + else if (SGV->getValueType()->isFunctionTy()) + NewGV = + Function::Create(cast(TypeMap.get(SGV->getValueType())), + GlobalValue::ExternalLinkage, SGV->getName(), &DstM); else NewGV = new GlobalVariable( DstM, TypeMap.get(SGV->getValueType()), Modified: head/contrib/llvm/lib/Linker/LinkModules.cpp ============================================================================== --- head/contrib/llvm/lib/Linker/LinkModules.cpp Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/Linker/LinkModules.cpp Sun Dec 3 12:14:34 2017 (r326496) @@ -329,8 +329,18 @@ bool ModuleLinker::shouldLinkFromSource(bool &LinkFrom bool ModuleLinker::linkIfNeeded(GlobalValue &GV) { GlobalValue *DGV = getLinkedToGlobal(&GV); - if (shouldLinkOnlyNeeded() && !(DGV && DGV->isDeclaration())) - return false; + if (shouldLinkOnlyNeeded()) { + // Always import variables with appending linkage. + if (!GV.hasAppendingLinkage()) { + // Don't import globals unless they are referenced by the destination + // module. + if (!DGV) + return false; + // Don't import globals that are already defined in the destination module + if (!DGV->isDeclaration()) + return false; + } + } if (DGV && !GV.hasLocalLinkage() && !GV.hasAppendingLinkage()) { auto *DGVar = dyn_cast(DGV); Modified: head/contrib/llvm/lib/Support/Host.cpp ============================================================================== --- head/contrib/llvm/lib/Support/Host.cpp Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/Support/Host.cpp Sun Dec 3 12:14:34 2017 (r326496) @@ -208,6 +208,7 @@ StringRef sys::detail::getHostCPUNameForARM( .Case("0x06f", "krait") // APQ8064 .Case("0x201", "kryo") .Case("0x205", "kryo") + .Case("0xc00", "falkor") .Default("generic"); return "generic"; Modified: head/contrib/llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp Sun Dec 3 04:55:38 2017 (r326495) +++ head/contrib/llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp Sun Dec 3 12:14:34 2017 (r326496) @@ -220,27 +220,27 @@ static Optional getLoadInfo(const MachineIns default: return None; + case AArch64::LD1i64: + case AArch64::LD2i64: + DestRegIdx = 0; + BaseRegIdx = 3; + OffsetIdx = -1; + IsPrePost = false; + break; + case AArch64::LD1i8: case AArch64::LD1i16: case AArch64::LD1i32: - case AArch64::LD1i64: case AArch64::LD2i8: case AArch64::LD2i16: case AArch64::LD2i32: - case AArch64::LD2i64: case AArch64::LD3i8: case AArch64::LD3i16: case AArch64::LD3i32: + case AArch64::LD3i64: case AArch64::LD4i8: case AArch64::LD4i16: case AArch64::LD4i32: - DestRegIdx = 0; - BaseRegIdx = 3; - OffsetIdx = -1; - IsPrePost = false; - break; - - case AArch64::LD3i64: case AArch64::LD4i64: DestRegIdx = -1; BaseRegIdx = 3; @@ -264,23 +264,16 @@ static Optional getLoadInfo(const MachineIns case AArch64::LD1Rv4s: case AArch64::LD1Rv8h: case AArch64::LD1Rv16b: - case AArch64::LD1Twov1d: - case AArch64::LD1Twov2s: - case AArch64::LD1Twov4h: - case AArch64::LD1Twov8b: - case AArch64::LD2Twov2s: - case AArch64::LD2Twov4s: - case AArch64::LD2Twov8b: - case AArch64::LD2Rv1d: - case AArch64::LD2Rv2s: - case AArch64::LD2Rv4s: - case AArch64::LD2Rv8b: DestRegIdx = 0; BaseRegIdx = 1; OffsetIdx = -1; IsPrePost = false; break; + case AArch64::LD1Twov1d: + case AArch64::LD1Twov2s: + case AArch64::LD1Twov4h: + case AArch64::LD1Twov8b: case AArch64::LD1Twov2d: case AArch64::LD1Twov4s: case AArch64::LD1Twov8h: @@ -301,10 +294,17 @@ static Optional getLoadInfo(const MachineIns case AArch64::LD1Fourv4s: case AArch64::LD1Fourv8h: case AArch64::LD1Fourv16b: + case AArch64::LD2Twov2s: + case AArch64::LD2Twov4s: + case AArch64::LD2Twov8b: case AArch64::LD2Twov2d: case AArch64::LD2Twov4h: case AArch64::LD2Twov8h: case AArch64::LD2Twov16b: + case AArch64::LD2Rv1d: + case AArch64::LD2Rv2s: + case AArch64::LD2Rv4s: + case AArch64::LD2Rv8b: case AArch64::LD2Rv2d: case AArch64::LD2Rv4h: case AArch64::LD2Rv8h: @@ -345,32 +345,32 @@ static Optional getLoadInfo(const MachineIns IsPrePost = false; break; + case AArch64::LD1i64_POST: + case AArch64::LD2i64_POST: + DestRegIdx = 1; + BaseRegIdx = 4; + OffsetIdx = 5; + IsPrePost = true; + break; + case AArch64::LD1i8_POST: case AArch64::LD1i16_POST: case AArch64::LD1i32_POST: - case AArch64::LD1i64_POST: case AArch64::LD2i8_POST: case AArch64::LD2i16_POST: case AArch64::LD2i32_POST: - case AArch64::LD2i64_POST: case AArch64::LD3i8_POST: case AArch64::LD3i16_POST: case AArch64::LD3i32_POST: + case AArch64::LD3i64_POST: case AArch64::LD4i8_POST: case AArch64::LD4i16_POST: case AArch64::LD4i32_POST: - DestRegIdx = 1; - BaseRegIdx = 4; - OffsetIdx = 5; - IsPrePost = false; - break; - - case AArch64::LD3i64_POST: case AArch64::LD4i64_POST: DestRegIdx = -1; BaseRegIdx = 4; OffsetIdx = 5; - IsPrePost = false; + IsPrePost = true; break; case AArch64::LD1Onev1d_POST: @@ -389,23 +389,16 @@ static Optional getLoadInfo(const MachineIns case AArch64::LD1Rv4s_POST: case AArch64::LD1Rv8h_POST: case AArch64::LD1Rv16b_POST: - case AArch64::LD1Twov1d_POST: - case AArch64::LD1Twov2s_POST: - case AArch64::LD1Twov4h_POST: - case AArch64::LD1Twov8b_POST: - case AArch64::LD2Twov2s_POST: - case AArch64::LD2Twov4s_POST: - case AArch64::LD2Twov8b_POST: - case AArch64::LD2Rv1d_POST: - case AArch64::LD2Rv2s_POST: - case AArch64::LD2Rv4s_POST: - case AArch64::LD2Rv8b_POST: DestRegIdx = 1; BaseRegIdx = 2; OffsetIdx = 3; - IsPrePost = false; + IsPrePost = true; break; + case AArch64::LD1Twov1d_POST: + case AArch64::LD1Twov2s_POST: + case AArch64::LD1Twov4h_POST: + case AArch64::LD1Twov8b_POST: case AArch64::LD1Twov2d_POST: case AArch64::LD1Twov4s_POST: case AArch64::LD1Twov8h_POST: @@ -426,10 +419,17 @@ static Optional getLoadInfo(const MachineIns case AArch64::LD1Fourv4s_POST: case AArch64::LD1Fourv8h_POST: case AArch64::LD1Fourv16b_POST: + case AArch64::LD2Twov2s_POST: + case AArch64::LD2Twov4s_POST: + case AArch64::LD2Twov8b_POST: case AArch64::LD2Twov2d_POST: case AArch64::LD2Twov4h_POST: case AArch64::LD2Twov8h_POST: case AArch64::LD2Twov16b_POST: + case AArch64::LD2Rv1d_POST: + case AArch64::LD2Rv2s_POST: + case AArch64::LD2Rv4s_POST: + case AArch64::LD2Rv8b_POST: case AArch64::LD2Rv2d_POST: case AArch64::LD2Rv4h_POST: case AArch64::LD2Rv8h_POST: @@ -467,7 +467,7 @@ static Optional getLoadInfo(const MachineIns DestRegIdx = -1; BaseRegIdx = 2; OffsetIdx = 3; - IsPrePost = false; + IsPrePost = true; break; case AArch64::LDRBBroW: @@ -572,8 +572,12 @@ static Optional getLoadInfo(const MachineIns IsPrePost = true; break; - case AArch64::LDPDi: + case AArch64::LDNPDi: + case AArch64::LDNPQi: + case AArch64::LDNPSi: case AArch64::LDPQi: + case AArch64::LDPDi: + case AArch64::LDPSi: DestRegIdx = -1; BaseRegIdx = 2; OffsetIdx = 3; @@ -581,7 +585,6 @@ static Optional getLoadInfo(const MachineIns break; case AArch64::LDPSWi: - case AArch64::LDPSi: case AArch64::LDPWi: case AArch64::LDPXi: DestRegIdx = 0; @@ -592,18 +595,18 @@ static Optional getLoadInfo(const MachineIns case AArch64::LDPQpost: case AArch64::LDPQpre: + case AArch64::LDPDpost: + case AArch64::LDPDpre: + case AArch64::LDPSpost: *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***