From owner-svn-src-vendor@freebsd.org Mon May 8 17:13:02 2017 Return-Path: Delivered-To: svn-src-vendor@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 C245DD634CA; Mon, 8 May 2017 17:13:02 +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 E5CC9814; Mon, 8 May 2017 17:13:01 +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 v48HD11M042548; Mon, 8 May 2017 17:13:01 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v48HCwdf042467; Mon, 8 May 2017 17:12:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705081712.v48HCwdf042467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 8 May 2017 17:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317948 - in vendor/llvm/dist: docs examples/Kaleidoscope/BuildingAJIT/Chapter1 examples/Kaleidoscope/BuildingAJIT/Chapter2 examples/Kaleidoscope/BuildingAJIT/Chapter3 examples/Kaleidos... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2017 17:13:03 -0000 Author: dim Date: Mon May 8 17:12:57 2017 New Revision: 317948 URL: https://svnweb.freebsd.org/changeset/base/317948 Log: Vendor import of llvm trunk r302418: https://llvm.org/svn/llvm-project/llvm/trunk@302418 Added: vendor/llvm/dist/include/llvm/CodeGen/MIRPrinter.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h (contents, props changed) vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiModuleList.cpp (contents, props changed) vendor/llvm/dist/lib/Target/Hexagon/HexagonDepIICHVX.td vendor/llvm/dist/lib/Target/Hexagon/HexagonDepIICScalar.td vendor/llvm/dist/lib/Target/Hexagon/HexagonDepTimingClasses.h (contents, props changed) vendor/llvm/dist/test/Analysis/ScalarEvolution/ZeroStep.ll vendor/llvm/dist/test/CodeGen/AArch64/fadd-combines.ll vendor/llvm/dist/test/CodeGen/AMDGPU/scratch-simple.ll vendor/llvm/dist/test/CodeGen/AMDGPU/waitcnt-looptest.ll vendor/llvm/dist/test/CodeGen/ARM/acle-intrinsics-v5.ll vendor/llvm/dist/test/CodeGen/ARM/acle-intrinsics.ll vendor/llvm/dist/test/CodeGen/ARM/alloca-align.ll vendor/llvm/dist/test/CodeGen/Hexagon/branch-folder-hoist-kills.mir vendor/llvm/dist/test/CodeGen/Hexagon/rdf-cover-use.ll vendor/llvm/dist/test/CodeGen/MIR/X86/auto-successor.mir vendor/llvm/dist/test/CodeGen/MIR/X86/branch-probabilities.mir vendor/llvm/dist/test/CodeGen/PowerPC/restore-r30.ll vendor/llvm/dist/test/CodeGen/SystemZ/copy-physreg-128.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/gep.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/legalize-gep.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/legalize-mul-scalar.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/legalize-mul-v128.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/legalize-mul-v256.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/legalize-mul-v512.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/mul-scalar.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/mul-vec.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/regbankselect-AVX2.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/regbankselect-AVX512.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-gep.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-mul-scalar.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-mul-vec.mir vendor/llvm/dist/test/CodeGen/X86/avx2-schedule.ll vendor/llvm/dist/test/CodeGen/X86/build-vector-128.ll vendor/llvm/dist/test/CodeGen/X86/build-vector-256.ll vendor/llvm/dist/test/CodeGen/X86/build-vector-512.ll vendor/llvm/dist/test/CodeGen/X86/ms-inline-asm-avx512.ll vendor/llvm/dist/test/CodeGen/X86/pr32907.ll vendor/llvm/dist/test/CodeGen/X86/regcall-no-plt.ll vendor/llvm/dist/test/CodeGen/X86/xray-custom-log.ll vendor/llvm/dist/test/CodeGen/X86/xray-loop-detection.ll vendor/llvm/dist/test/DebugInfo/COFF/synthetic.ll vendor/llvm/dist/test/DebugInfo/Inputs/dwarfdump-decompression-error.elf-x86-64 (contents, props changed) vendor/llvm/dist/test/DebugInfo/dwarfdump-decompression-error.test vendor/llvm/dist/test/Linker/metadata-global.ll vendor/llvm/dist/test/MC/AArch64/crc.s (contents, props changed) vendor/llvm/dist/test/MC/ARM/ltorg-range.s (contents, props changed) vendor/llvm/dist/test/MC/AsmParser/altmacro_string.s (contents, props changed) vendor/llvm/dist/test/MC/AsmParser/negative_altmacro_string.s (contents, props changed) vendor/llvm/dist/test/ObjectYAML/wasm/name_section.yaml vendor/llvm/dist/test/Transforms/ArgumentPromotion/pr32917.ll vendor/llvm/dist/test/Transforms/LoopIdiom/unsafe.ll vendor/llvm/dist/test/tools/llvm-objdump/WebAssembly/ vendor/llvm/dist/test/tools/llvm-objdump/WebAssembly/symbol-table.test vendor/llvm/dist/test/tools/llvm-readobj/Inputs/resources/ vendor/llvm/dist/test/tools/llvm-readobj/Inputs/resources/cursor_small.bmp (contents, props changed) vendor/llvm/dist/test/tools/llvm-readobj/Inputs/resources/okay_small.bmp (contents, props changed) vendor/llvm/dist/test/tools/llvm-readobj/Inputs/resources/test_resource.obj.coff (contents, props changed) vendor/llvm/dist/test/tools/llvm-readobj/Inputs/resources/test_resource.rc vendor/llvm/dist/test/tools/llvm-readobj/Inputs/resources/test_resource.res (contents, props changed) Deleted: vendor/llvm/dist/lib/CodeGen/MIRPrinter.h vendor/llvm/dist/lib/Target/AArch64/AArch64AddressTypePromotion.cpp vendor/llvm/dist/test/CodeGen/AMDGPU/local-stack-slot-bug.ll vendor/llvm/dist/test/CodeGen/ARM/sat-arith.ll vendor/llvm/dist/test/CodeGen/MIR/Generic/branch-probabilities.ll vendor/llvm/dist/test/MC/AArch64/cyclone-crc.s vendor/llvm/dist/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll Modified: vendor/llvm/dist/docs/Lexicon.rst vendor/llvm/dist/docs/MIRLangRef.rst vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/Chapter6/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/Chapter7/toy.cpp vendor/llvm/dist/examples/Kaleidoscope/Chapter8/toy.cpp vendor/llvm/dist/include/llvm/ADT/APInt.h vendor/llvm/dist/include/llvm/ADT/BitVector.h vendor/llvm/dist/include/llvm/ADT/SmallBitVector.h vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h vendor/llvm/dist/include/llvm/Analysis/ProfileSummaryInfo.h vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h vendor/llvm/dist/include/llvm/Analysis/TargetLibraryInfo.def vendor/llvm/dist/include/llvm/CodeGen/AsmPrinter.h vendor/llvm/dist/include/llvm/CodeGen/FastISel.h vendor/llvm/dist/include/llvm/CodeGen/FunctionLoweringInfo.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/IRTranslator.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegBankSelect.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h vendor/llvm/dist/include/llvm/CodeGen/MachineFrameInfo.h vendor/llvm/dist/include/llvm/CodeGen/MachineModuleInfo.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDatabase.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFContext.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFFormValue.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/RawTypes.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/TpiStream.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RPCSerialization.h vendor/llvm/dist/include/llvm/ExecutionEngine/RuntimeDyldChecker.h vendor/llvm/dist/include/llvm/IR/Attributes.h vendor/llvm/dist/include/llvm/IR/BasicBlock.h vendor/llvm/dist/include/llvm/IR/CFG.h vendor/llvm/dist/include/llvm/IR/CallSite.h vendor/llvm/dist/include/llvm/IR/CallingConv.h vendor/llvm/dist/include/llvm/IR/ConstantRange.h vendor/llvm/dist/include/llvm/IR/DataLayout.h vendor/llvm/dist/include/llvm/IR/DebugInfo.h vendor/llvm/dist/include/llvm/IR/Dominators.h vendor/llvm/dist/include/llvm/IR/Function.h vendor/llvm/dist/include/llvm/IR/InlineAsm.h vendor/llvm/dist/include/llvm/IR/InstIterator.h vendor/llvm/dist/include/llvm/IR/InstrTypes.h vendor/llvm/dist/include/llvm/IR/Intrinsics.td vendor/llvm/dist/include/llvm/IR/IntrinsicsARM.td vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndex.h vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndexYAML.h vendor/llvm/dist/include/llvm/MC/ConstantPools.h vendor/llvm/dist/include/llvm/Object/COFF.h vendor/llvm/dist/include/llvm/Object/Wasm.h vendor/llvm/dist/include/llvm/ObjectYAML/WasmYAML.h vendor/llvm/dist/include/llvm/Support/AArch64TargetParser.def vendor/llvm/dist/include/llvm/Support/BinaryStreamArray.h vendor/llvm/dist/include/llvm/Support/COFF.h vendor/llvm/dist/include/llvm/Support/KnownBits.h vendor/llvm/dist/include/llvm/Support/MathExtras.h vendor/llvm/dist/include/llvm/Target/GlobalISel/SelectionDAGCompat.td vendor/llvm/dist/include/llvm/Target/Target.td vendor/llvm/dist/include/llvm/Target/TargetOpcodes.def vendor/llvm/dist/include/llvm/Transforms/Instrumentation.h vendor/llvm/dist/include/llvm/Transforms/Scalar/Float2Int.h vendor/llvm/dist/lib/Analysis/ConstantFolding.cpp vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist/lib/Analysis/LazyValueInfo.cpp vendor/llvm/dist/lib/Analysis/Lint.cpp vendor/llvm/dist/lib/Analysis/ModuleSummaryAnalysis.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/TargetLibraryInfo.cpp vendor/llvm/dist/lib/Analysis/ValueTracking.cpp vendor/llvm/dist/lib/Bitcode/Reader/BitcodeReader.cpp vendor/llvm/dist/lib/Bitcode/Writer/BitcodeWriter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp vendor/llvm/dist/lib/CodeGen/BranchFolding.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/IRTranslator.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/InstructionSelect.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/Legalizer.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/RegBankSelect.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp vendor/llvm/dist/lib/CodeGen/MIRParser/MIParser.cpp vendor/llvm/dist/lib/CodeGen/MIRPrinter.cpp vendor/llvm/dist/lib/CodeGen/MIRPrintingPass.cpp vendor/llvm/dist/lib/CodeGen/MachineFrameInfo.cpp vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp vendor/llvm/dist/lib/CodeGen/PrologEpilogInserter.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/FastISel.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm/dist/lib/CodeGen/XRayInstrumentation.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeDatabase.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFContext.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFFormValue.cpp vendor/llvm/dist/lib/DebugInfo/PDB/CMakeLists.txt vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/NativeExeSymbol.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/TpiStream.cpp vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h vendor/llvm/dist/lib/Fuzzer/FuzzerLoop.cpp vendor/llvm/dist/lib/IR/ConstantRange.cpp vendor/llvm/dist/lib/IR/DataLayout.cpp vendor/llvm/dist/lib/IR/DebugInfo.cpp vendor/llvm/dist/lib/IR/Instruction.cpp vendor/llvm/dist/lib/IR/ModuleSummaryIndex.cpp vendor/llvm/dist/lib/LTO/LTO.cpp vendor/llvm/dist/lib/LTO/ThinLTOCodeGenerator.cpp vendor/llvm/dist/lib/MC/ConstantPools.cpp vendor/llvm/dist/lib/MC/MCParser/AsmParser.cpp vendor/llvm/dist/lib/Object/COFFObjectFile.cpp vendor/llvm/dist/lib/Object/WasmObjectFile.cpp vendor/llvm/dist/lib/ObjectYAML/WasmYAML.cpp vendor/llvm/dist/lib/Passes/PassBuilder.cpp vendor/llvm/dist/lib/Support/APInt.cpp vendor/llvm/dist/lib/Support/TargetParser.cpp vendor/llvm/dist/lib/Support/Unix/DynamicLibrary.inc vendor/llvm/dist/lib/Support/Unix/Path.inc vendor/llvm/dist/lib/Target/AArch64/AArch64.h vendor/llvm/dist/lib/Target/AArch64/AArch64.td vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.td vendor/llvm/dist/lib/Target/AArch64/AArch64RegisterBankInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64RegisterBankInfo.h vendor/llvm/dist/lib/Target/AArch64/AArch64TargetMachine.cpp vendor/llvm/dist/lib/Target/AArch64/CMakeLists.txt vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPURegisterBankInfo.h vendor/llvm/dist/lib/Target/AMDGPU/SIFrameLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInsertWaitcnts.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMBaseRegisterInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.h vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.td vendor/llvm/dist/lib/Target/ARM/ARMInstrNEON.td vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb2.td vendor/llvm/dist/lib/Target/ARM/ARMRegisterBankInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMRegisterBankInfo.h vendor/llvm/dist/lib/Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp vendor/llvm/dist/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp vendor/llvm/dist/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonDepITypes.h vendor/llvm/dist/lib/Target/Hexagon/HexagonDepITypes.td vendor/llvm/dist/lib/Target/Hexagon/HexagonDepInstrFormats.td vendor/llvm/dist/lib/Target/Hexagon/HexagonDepInstrInfo.td vendor/llvm/dist/lib/Target/Hexagon/HexagonIICHVX.td vendor/llvm/dist/lib/Target/Hexagon/HexagonIICScalar.td vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrFormats.td vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrFormatsV4.td vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrFormatsV60.td vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrInfo.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrInfo.h vendor/llvm/dist/lib/Target/Hexagon/HexagonMachineScheduler.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonPatterns.td vendor/llvm/dist/lib/Target/Hexagon/HexagonPseudo.td vendor/llvm/dist/lib/Target/Hexagon/HexagonRegisterInfo.td vendor/llvm/dist/lib/Target/Hexagon/HexagonSchedule.td vendor/llvm/dist/lib/Target/Hexagon/HexagonScheduleV4.td vendor/llvm/dist/lib/Target/Hexagon/HexagonScheduleV55.td vendor/llvm/dist/lib/Target/Hexagon/HexagonScheduleV60.td vendor/llvm/dist/lib/Target/Hexagon/HexagonScheduleV62.td vendor/llvm/dist/lib/Target/Hexagon/HexagonSubtarget.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonSubtarget.h vendor/llvm/dist/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonBaseInfo.h vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.cpp vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp vendor/llvm/dist/lib/Target/Hexagon/RDFLiveness.cpp vendor/llvm/dist/lib/Target/Hexagon/RDFRegisters.cpp vendor/llvm/dist/lib/Target/Hexagon/RDFRegisters.h vendor/llvm/dist/lib/Target/Mips/MipsAsmPrinter.cpp vendor/llvm/dist/lib/Target/NVPTX/NVPTXISelLowering.cpp vendor/llvm/dist/lib/Target/NVPTX/NVPTXInstrInfo.td vendor/llvm/dist/lib/Target/PowerPC/PPCFrameLowering.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist/lib/Target/Sparc/SparcISelLowering.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrInfo.cpp vendor/llvm/dist/lib/Target/X86/AsmParser/X86AsmParser.cpp vendor/llvm/dist/lib/Target/X86/AsmParser/X86Operand.h vendor/llvm/dist/lib/Target/X86/X86AsmPrinter.h vendor/llvm/dist/lib/Target/X86/X86FrameLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td vendor/llvm/dist/lib/Target/X86/X86InstrInfo.td vendor/llvm/dist/lib/Target/X86/X86InstrSSE.td vendor/llvm/dist/lib/Target/X86/X86InstructionSelector.cpp vendor/llvm/dist/lib/Target/X86/X86LegalizerInfo.cpp vendor/llvm/dist/lib/Target/X86/X86LegalizerInfo.h vendor/llvm/dist/lib/Target/X86/X86MCInstLower.cpp vendor/llvm/dist/lib/Target/X86/X86OptimizeLEAs.cpp vendor/llvm/dist/lib/Target/X86/X86RegisterBankInfo.cpp vendor/llvm/dist/lib/Target/X86/X86RegisterBankInfo.h vendor/llvm/dist/lib/Target/X86/X86Subtarget.cpp vendor/llvm/dist/lib/Target/X86/X86TargetTransformInfo.cpp vendor/llvm/dist/lib/Target/XCore/XCoreISelLowering.cpp vendor/llvm/dist/lib/Transforms/IPO/ArgumentPromotion.cpp vendor/llvm/dist/lib/Transforms/IPO/FunctionImport.cpp vendor/llvm/dist/lib/Transforms/IPO/LowerTypeTests.cpp vendor/llvm/dist/lib/Transforms/IPO/WholeProgramDevirt.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineAddSub.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstructionCombining.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/SanitizerCoverage.cpp vendor/llvm/dist/lib/Transforms/Scalar/Float2Int.cpp vendor/llvm/dist/lib/Transforms/Scalar/JumpThreading.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopIdiomRecognize.cpp vendor/llvm/dist/lib/Transforms/Scalar/NewGVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/TailRecursionElimination.cpp vendor/llvm/dist/lib/Transforms/Utils/BuildLibCalls.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp vendor/llvm/dist/lib/Transforms/Utils/ValueMapper.cpp vendor/llvm/dist/lib/Transforms/Vectorize/LoopVectorize.cpp vendor/llvm/dist/test/Analysis/CostModel/X86/bitreverse.ll vendor/llvm/dist/test/Analysis/CostModel/X86/ctbits-cost.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/debug-insts.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/select-dbg-value.mir vendor/llvm/dist/test/CodeGen/AArch64/loh.mir vendor/llvm/dist/test/CodeGen/AArch64/machine-copy-remove.mir vendor/llvm/dist/test/CodeGen/AArch64/machine-sink-zr.mir vendor/llvm/dist/test/CodeGen/AArch64/regcoal-physreg.mir vendor/llvm/dist/test/CodeGen/AArch64/xray-attribute-instrumentation.ll vendor/llvm/dist/test/CodeGen/AArch64/xray-tail-call-sled.ll vendor/llvm/dist/test/CodeGen/AMDGPU/detect-dead-lanes.mir vendor/llvm/dist/test/CodeGen/AMDGPU/fmuladd.f32.ll vendor/llvm/dist/test/CodeGen/AMDGPU/inserted-wait-states.mir vendor/llvm/dist/test/CodeGen/AMDGPU/invert-br-undef-vcc.mir vendor/llvm/dist/test/CodeGen/AMDGPU/lds-size.ll vendor/llvm/dist/test/CodeGen/AMDGPU/liveness.mir vendor/llvm/dist/test/CodeGen/AMDGPU/optimize-if-exec-masking.mir vendor/llvm/dist/test/CodeGen/AMDGPU/rename-independent-subregs.mir vendor/llvm/dist/test/CodeGen/AMDGPU/si-fix-sgpr-copies.mir vendor/llvm/dist/test/CodeGen/AMDGPU/subreg-intervals.mir vendor/llvm/dist/test/CodeGen/AMDGPU/vccz-corrupt-bug-workaround.mir vendor/llvm/dist/test/CodeGen/ARM/ARMLoadStoreDBG.mir vendor/llvm/dist/test/CodeGen/ARM/cmp1-peephole-thumb.mir vendor/llvm/dist/test/CodeGen/ARM/cmp2-peephole-thumb.mir vendor/llvm/dist/test/CodeGen/ARM/dbg-range-extension.mir vendor/llvm/dist/test/CodeGen/ARM/vabs.ll vendor/llvm/dist/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll vendor/llvm/dist/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll vendor/llvm/dist/test/CodeGen/BPF/dwarfdump.ll vendor/llvm/dist/test/CodeGen/Hexagon/swp-matmul-bitext.ll vendor/llvm/dist/test/CodeGen/MIR/X86/successor-basic-blocks.mir vendor/llvm/dist/test/CodeGen/X86/2014-08-29-CompactUnwind.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/regbankselect-X86_64.mir vendor/llvm/dist/test/CodeGen/X86/addcarry.ll vendor/llvm/dist/test/CodeGen/X86/avx-isa-check.ll vendor/llvm/dist/test/CodeGen/X86/avx1-logical-load-folding.ll vendor/llvm/dist/test/CodeGen/X86/avx512vl-arith.ll vendor/llvm/dist/test/CodeGen/X86/branchfolding-undef.mir vendor/llvm/dist/test/CodeGen/X86/combine-abs.ll vendor/llvm/dist/test/CodeGen/X86/commuted-blend-mask.ll vendor/llvm/dist/test/CodeGen/X86/ctpop-combine.ll vendor/llvm/dist/test/CodeGen/X86/dbg-baseptr.ll vendor/llvm/dist/test/CodeGen/X86/eflags-copy-expansion.mir vendor/llvm/dist/test/CodeGen/X86/frame-lowering-debug-intrinsic.ll vendor/llvm/dist/test/CodeGen/X86/implicit-null-checks.mir vendor/llvm/dist/test/CodeGen/X86/invalid-liveness.mir vendor/llvm/dist/test/CodeGen/X86/machine-region-info.mir vendor/llvm/dist/test/CodeGen/X86/pr27681.mir vendor/llvm/dist/test/CodeGen/X86/pre-coalesce.mir vendor/llvm/dist/test/CodeGen/X86/shuffle-vs-trunc-512.ll vendor/llvm/dist/test/CodeGen/X86/stack-folding-int-avx512.ll vendor/llvm/dist/test/CodeGen/X86/vec_partial.ll vendor/llvm/dist/test/CodeGen/X86/vec_reassociate.ll vendor/llvm/dist/test/CodeGen/X86/vector-lzcnt-512.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-variable-128.ll vendor/llvm/dist/test/CodeGen/X86/win64_eh_leaf.ll vendor/llvm/dist/test/CodeGen/X86/xray-attribute-instrumentation.ll vendor/llvm/dist/test/CodeGen/X86/xray-tail-call-sled.ll vendor/llvm/dist/test/MC/AArch64/basic-a64-instructions.s vendor/llvm/dist/test/MC/AArch64/directive-arch-negative.s vendor/llvm/dist/test/MC/ARM/negative-immediates-fail.s vendor/llvm/dist/test/MC/ARM/negative-immediates-thumb1-fail.s vendor/llvm/dist/test/MC/ARM/negative-immediates.s vendor/llvm/dist/test/MC/Disassembler/AArch64/basic-a64-instructions.txt vendor/llvm/dist/test/Other/new-pm-defaults.ll vendor/llvm/dist/test/Transforms/CodeExtractor/PartialInlineOptRemark.ll vendor/llvm/dist/test/Transforms/Inline/inline-hot-callsite.ll vendor/llvm/dist/test/Transforms/Inline/prof-update.ll vendor/llvm/dist/test/Transforms/InstCombine/AddOverFlow.ll vendor/llvm/dist/test/Transforms/InstCombine/and-or-icmps.ll vendor/llvm/dist/test/Transforms/InstCombine/debuginfo-dce.ll vendor/llvm/dist/test/Transforms/InstCombine/demand_shrink_nsw.ll vendor/llvm/dist/test/Transforms/InstCombine/or.ll vendor/llvm/dist/test/Transforms/InstCombine/strlen-1.ll vendor/llvm/dist/test/Transforms/InstSimplify/AndOrXor.ll vendor/llvm/dist/test/Transforms/InstSimplify/compare.ll vendor/llvm/dist/test/Transforms/InstSimplify/icmp-ranges.ll vendor/llvm/dist/test/Transforms/InstSimplify/shufflevector.ll vendor/llvm/dist/test/Transforms/LoopRotate/dbgvalue.ll vendor/llvm/dist/test/Transforms/SampleProfile/Inputs/indirect-call.prof vendor/llvm/dist/test/Transforms/SampleProfile/indirect-call.ll vendor/llvm/dist/test/Unit/lit.cfg vendor/llvm/dist/test/tools/llvm-readobj/resources.test vendor/llvm/dist/tools/llvm-link/llvm-link.cpp vendor/llvm/dist/tools/llvm-lto/llvm-lto.cpp vendor/llvm/dist/tools/llvm-pdbdump/Analyze.cpp vendor/llvm/dist/tools/llvm-pdbdump/LLVMOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbdump/LLVMOutputStyle.h vendor/llvm/dist/tools/llvm-pdbdump/StreamUtil.cpp vendor/llvm/dist/tools/llvm-pdbdump/YAMLOutputStyle.cpp vendor/llvm/dist/tools/llvm-readobj/COFFDumper.cpp vendor/llvm/dist/tools/llvm-rtdyld/llvm-rtdyld.cpp vendor/llvm/dist/tools/obj2yaml/wasm2yaml.cpp vendor/llvm/dist/tools/yaml2obj/yaml2wasm.cpp vendor/llvm/dist/unittests/ADT/APIntTest.cpp vendor/llvm/dist/unittests/ADT/BitVectorTest.cpp vendor/llvm/dist/unittests/Analysis/TargetLibraryInfoTest.cpp vendor/llvm/dist/unittests/Support/TargetParserTest.cpp vendor/llvm/dist/utils/release/test-release.sh vendor/llvm/dist/utils/unittest/googletest/README.LLVM vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-port-arch.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-port.h Modified: vendor/llvm/dist/docs/Lexicon.rst ============================================================================== --- vendor/llvm/dist/docs/Lexicon.rst Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/docs/Lexicon.rst Mon May 8 17:12:57 2017 (r317948) @@ -38,6 +38,13 @@ B **BB Vectorization** Basic-Block Vectorization +**BDCE** + Bit-tracking dead code elimination. Some bit-wise instructions (shifts, + ands, ors, etc.) "kill" some of their input bits -- that is, they make it + such that those bits can be either zero or one without affecting control or + data flow of a program. The BDCE pass removes instructions that only + compute these dead bits. + **BURS** Bottom Up Rewriting System --- A method of instruction selection for code generation. An example is the `BURG Modified: vendor/llvm/dist/docs/MIRLangRef.rst ============================================================================== --- vendor/llvm/dist/docs/MIRLangRef.rst Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/docs/MIRLangRef.rst Mon May 8 17:12:57 2017 (r317948) @@ -78,6 +78,8 @@ Simplifying MIR files The MIR code coming out of ``-stop-after``/``-stop-before`` is very verbose; Tests are more accessible and future proof when simplified: +- Use the ``-simplify-mir`` option with llc. + - Machine function attributes often have default values or the test works just as well with default values. Typical candidates for this are: `alignment:`, `exposesReturnsTwice`, `legalized`, `regBankSelected`, `selected`. Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp Mon May 8 17:12:57 2017 (r317948) @@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() { TheFunction->eraseFromParent(); if (P.isBinaryOp()) - BinopPrecedence.erase(Proto->getOperatorName()); + BinopPrecedence.erase(P.getOperatorName()); return nullptr; } Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp Mon May 8 17:12:57 2017 (r317948) @@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() { TheFunction->eraseFromParent(); if (P.isBinaryOp()) - BinopPrecedence.erase(Proto->getOperatorName()); + BinopPrecedence.erase(P.getOperatorName()); return nullptr; } Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp Mon May 8 17:12:57 2017 (r317948) @@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() { TheFunction->eraseFromParent(); if (P.isBinaryOp()) - BinopPrecedence.erase(Proto->getOperatorName()); + BinopPrecedence.erase(P.getOperatorName()); return nullptr; } Modified: vendor/llvm/dist/examples/Kaleidoscope/Chapter6/toy.cpp ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/Chapter6/toy.cpp Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/examples/Kaleidoscope/Chapter6/toy.cpp Mon May 8 17:12:57 2017 (r317948) @@ -932,7 +932,7 @@ Function *FunctionAST::codegen() { TheFunction->eraseFromParent(); if (P.isBinaryOp()) - BinopPrecedence.erase(Proto->getOperatorName()); + BinopPrecedence.erase(P.getOperatorName()); return nullptr; } Modified: vendor/llvm/dist/examples/Kaleidoscope/Chapter7/toy.cpp ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/Chapter7/toy.cpp Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/examples/Kaleidoscope/Chapter7/toy.cpp Mon May 8 17:12:57 2017 (r317948) @@ -1099,7 +1099,7 @@ Function *FunctionAST::codegen() { TheFunction->eraseFromParent(); if (P.isBinaryOp()) - BinopPrecedence.erase(Proto->getOperatorName()); + BinopPrecedence.erase(P.getOperatorName()); return nullptr; } Modified: vendor/llvm/dist/examples/Kaleidoscope/Chapter8/toy.cpp ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/Chapter8/toy.cpp Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/examples/Kaleidoscope/Chapter8/toy.cpp Mon May 8 17:12:57 2017 (r317948) @@ -1097,7 +1097,7 @@ Function *FunctionAST::codegen() { TheFunction->eraseFromParent(); if (P.isBinaryOp()) - BinopPrecedence.erase(Proto->getOperatorName()); + BinopPrecedence.erase(P.getOperatorName()); return nullptr; } Modified: vendor/llvm/dist/include/llvm/ADT/APInt.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/APInt.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/ADT/APInt.h Mon May 8 17:12:57 2017 (r317948) @@ -842,6 +842,7 @@ public: /// /// \returns *this APInt &operator*=(const APInt &RHS); + APInt &operator*=(uint64_t RHS); /// \brief Addition assignment operator. /// @@ -2043,6 +2044,16 @@ inline APInt operator-(uint64_t LHS, API return b; } +inline APInt operator*(APInt a, uint64_t RHS) { + a *= RHS; + return a; +} + +inline APInt operator*(uint64_t LHS, APInt b) { + b *= LHS; + return b; +} + namespace APIntOps { Modified: vendor/llvm/dist/include/llvm/ADT/BitVector.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/BitVector.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/ADT/BitVector.h Mon May 8 17:12:57 2017 (r317948) @@ -217,7 +217,7 @@ public: unsigned BitPos = Prev % BITWORD_SIZE; BitWord Copy = Bits[WordPos]; // Mask off previous bits. - Copy &= ~0UL << BitPos; + Copy &= maskTrailingZeros(BitPos); if (Copy != 0) return WordPos * BITWORD_SIZE + countTrailingZeros(Copy); @@ -229,7 +229,7 @@ public: return -1; } - /// find_next_unset - Returns the index of the next usnet bit following the + /// find_next_unset - Returns the index of the next unset bit following the /// "Prev" bit. Returns -1 if all remaining bits are set. int find_next_unset(unsigned Prev) const { ++Prev; @@ -253,7 +253,34 @@ public: return -1; } - /// clear - Clear all bits. + /// find_prev - Returns the index of the first set bit that precedes the + /// the bit at \p PriorTo. Returns -1 if all previous bits are unset. + int find_prev(unsigned PriorTo) { + if (PriorTo == 0) + return -1; + + --PriorTo; + + unsigned WordPos = PriorTo / BITWORD_SIZE; + unsigned BitPos = PriorTo % BITWORD_SIZE; + BitWord Copy = Bits[WordPos]; + // Mask off next bits. + Copy &= maskTrailingOnes(BitPos + 1); + + if (Copy != 0) + return (WordPos + 1) * BITWORD_SIZE - countLeadingZeros(Copy) - 1; + + // Check previous words. + for (unsigned i = 1; i <= WordPos; ++i) { + unsigned Index = WordPos - i; + if (Bits[Index] == 0) + continue; + return (Index + 1) * BITWORD_SIZE - countLeadingZeros(Bits[Index]) - 1; + } + return -1; + } + + /// clear - Removes all bits from the bitvector. Does not change capacity. void clear() { Size = 0; } Modified: vendor/llvm/dist/include/llvm/ADT/SmallBitVector.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/SmallBitVector.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/ADT/SmallBitVector.h Mon May 8 17:12:57 2017 (r317948) @@ -278,6 +278,24 @@ public: return getPointer()->find_next_unset(Prev); } + /// find_prev - Returns the index of the first set bit that precedes the + /// the bit at \p PriorTo. Returns -1 if all previous bits are unset. + int find_prev(unsigned PriorTo) const { + if (isSmall()) { + if (PriorTo == 0) + return -1; + + --PriorTo; + uintptr_t Bits = getSmallBits(); + Bits &= maskTrailingOnes(PriorTo + 1); + if (Bits == 0) + return -1; + + return NumBaseBits - countLeadingZeros(Bits) - 1; + } + return getPointer()->find_prev(PriorTo); + } + /// Clear all bits. void clear() { if (!isSmall()) Modified: vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h Mon May 8 17:12:57 2017 (r317948) @@ -220,8 +220,8 @@ void LoopBase::verifyLoop BI = df_ext_begin(getHeader(), VisitSet), BE = df_ext_end(getHeader(), VisitSet); - // Keep track of the number of BBs visited. - unsigned NumVisited = 0; + // Keep track of the BBs visited. + SmallPtrSet VisitedBBs; // Check the individual blocks. for ( ; BI != BE; ++BI) { @@ -259,10 +259,18 @@ void LoopBase::verifyLoop assert(BB != &getHeader()->getParent()->front() && "Loop contains function entry block!"); - NumVisited++; + VisitedBBs.insert(BB); } - assert(NumVisited == getNumBlocks() && "Unreachable block in loop"); + if (VisitedBBs.size() != getNumBlocks()) { + dbgs() << "The following blocks are unreachable in the loop: "; + for (auto BB : Blocks) { + if (!VisitedBBs.count(BB)) { + dbgs() << *BB << "\n"; + } + } + assert(false && "Unreachable block in loop"); + } // Check the subloops. for (iterator I = begin(), E = end(); I != E; ++I) Modified: vendor/llvm/dist/include/llvm/Analysis/ProfileSummaryInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ProfileSummaryInfo.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/Analysis/ProfileSummaryInfo.h Mon May 8 17:12:57 2017 (r317948) @@ -54,6 +54,18 @@ public: ProfileSummaryInfo(Module &M) : M(M) {} ProfileSummaryInfo(ProfileSummaryInfo &&Arg) : M(Arg.M), Summary(std::move(Arg.Summary)) {} + + /// Handle the invalidation of this information. + /// + /// When used as a result of \c ProfileSummaryAnalysis this method will be + /// called when the module this was computed for changes. Since profile + /// summary is immutable after it is annotated on the module, we return false + /// here. + bool invalidate(Module &, const PreservedAnalyses &, + ModuleAnalysisManager::Invalidator &) { + return false; + } + /// Returns the profile count for \p CallInst. static Optional getProfileCount(const Instruction *CallInst, BlockFrequencyInfo *BFI); Modified: vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Mon May 8 17:12:57 2017 (r317948) @@ -782,13 +782,13 @@ private: /// Set the memoized range for the given SCEV. const ConstantRange &setRange(const SCEV *S, RangeSignHint Hint, - const ConstantRange &CR) { + ConstantRange &&CR) { DenseMap &Cache = Hint == HINT_RANGE_UNSIGNED ? UnsignedRanges : SignedRanges; - auto Pair = Cache.insert({S, CR}); + auto Pair = Cache.try_emplace(S, std::move(CR)); if (!Pair.second) - Pair.first->second = CR; + Pair.first->second = std::move(CR); return Pair.first->second; } @@ -816,6 +816,10 @@ private: /// Helper function called from createNodeForPHI. const SCEV *createAddRecFromPHI(PHINode *PN); + /// A helper function for createAddRecFromPHI to handle simple cases. + const SCEV *createSimpleAffineAddRec(PHINode *PN, Value *BEValueV, + Value *StartValueV); + /// Helper function called from createNodeForPHI. const SCEV *createNodeFromSelectLikePHI(PHINode *PN); @@ -1565,7 +1569,7 @@ public: /// delinearization). void findArrayDimensions(SmallVectorImpl &Terms, SmallVectorImpl &Sizes, - const SCEV *ElementSize) const; + const SCEV *ElementSize); void print(raw_ostream &OS) const; void verify() const; Modified: vendor/llvm/dist/include/llvm/Analysis/TargetLibraryInfo.def ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetLibraryInfo.def Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/Analysis/TargetLibraryInfo.def Mon May 8 17:12:57 2017 (r317948) @@ -1115,6 +1115,9 @@ TLI_DEFINE_STRING_INTERNAL("vsprintf") /// int vsscanf(const char *s, const char *format, va_list arg); TLI_DEFINE_ENUM_INTERNAL(vsscanf) TLI_DEFINE_STRING_INTERNAL("vsscanf") +/// size_t wcslen (const wchar_t* wcs); +TLI_DEFINE_ENUM_INTERNAL(wcslen) +TLI_DEFINE_STRING_INTERNAL("wcslen") /// ssize_t write(int fildes, const void *buf, size_t nbyte); TLI_DEFINE_ENUM_INTERNAL(write) TLI_DEFINE_STRING_INTERNAL("write") Modified: vendor/llvm/dist/include/llvm/CodeGen/AsmPrinter.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/AsmPrinter.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/CodeGen/AsmPrinter.h Mon May 8 17:12:57 2017 (r317948) @@ -226,6 +226,7 @@ public: FUNCTION_EXIT = 1, TAIL_CALL = 2, LOG_ARGS_ENTER = 3, + CUSTOM_EVENT = 4, }; // The table will contain these structs that point to the sled, the function @@ -242,7 +243,7 @@ public: }; // All the sleds to be emitted. - std::vector Sleds; + SmallVector Sleds; // Helper function to record a given XRay sled. void recordSled(MCSymbol *Sled, const MachineInstr &MI, SledKind Kind); Modified: vendor/llvm/dist/include/llvm/CodeGen/FastISel.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/FastISel.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/CodeGen/FastISel.h Mon May 8 17:12:57 2017 (r317948) @@ -506,6 +506,7 @@ protected: bool selectCast(const User *I, unsigned Opcode); bool selectExtractValue(const User *I); bool selectInsertValue(const User *I); + bool selectXRayCustomEvent(const CallInst *II); private: /// \brief Handle PHI nodes in successor blocks. Modified: vendor/llvm/dist/include/llvm/CodeGen/FunctionLoweringInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/FunctionLoweringInfo.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/CodeGen/FunctionLoweringInfo.h Mon May 8 17:12:57 2017 (r317948) @@ -249,7 +249,7 @@ public: void AddLiveOutRegInfo(unsigned Reg, unsigned NumSignBits, const KnownBits &Known) { // Only install this information if it tells us something. - if (NumSignBits == 1 && Known.Zero == 0 && Known.One == 0) + if (NumSignBits == 1 && Known.isUnknown()) return; LiveOutRegInfo.grow(Reg); Modified: vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/IRTranslator.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/IRTranslator.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/IRTranslator.h Mon May 8 17:12:57 2017 (r317948) @@ -78,7 +78,7 @@ private: /// this function. DenseMap FrameIndices; - /// Methods for translating form LLVM IR to MachineInstr. + /// \name Methods for translating form LLVM IR to MachineInstr. /// \see ::translate for general information on the translate methods. /// @{ Modified: vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h Mon May 8 17:12:57 2017 (r317948) @@ -45,7 +45,7 @@ class MachineIRBuilder { /// Debug location to be set to any instruction we create. DebugLoc DL; - /// Fields describing the insertion point. + /// \name Fields describing the insertion point. /// @{ MachineBasicBlock *MBB; MachineBasicBlock::iterator II; @@ -84,7 +84,7 @@ public: void setInsertPt(MachineBasicBlock &MBB, MachineBasicBlock::iterator II); /// @} - /// Setters for the insertion point. + /// \name Setters for the insertion point. /// @{ /// Set the MachineFunction where to build instructions. void setMF(MachineFunction &); @@ -98,7 +98,7 @@ public: void setInstr(MachineInstr &MI); /// @} - /// Control where instructions we create are recorded (typically for + /// \name Control where instructions we create are recorded (typically for /// visiting again later during legalization). /// @{ void recordInsertions(std::function InsertedInstr); Modified: vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegBankSelect.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegBankSelect.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegBankSelect.h Mon May 8 17:12:57 2017 (r317948) @@ -309,7 +309,7 @@ public: Impossible }; - /// Convenient types for a list of insertion points. + /// \name Convenient types for a list of insertion points. /// @{ typedef SmallVector, 2> InsertionPoints; typedef InsertionPoints::iterator insertpt_iterator; @@ -341,7 +341,7 @@ public: const TargetRegisterInfo &TRI, Pass &P, RepairingKind Kind = RepairingKind::Insert); - /// Getters. + /// \name Getters. /// @{ RepairingKind getKind() const { return Kind; } unsigned getOpIdx() const { return OpIdx; } @@ -349,7 +349,7 @@ public: bool hasSplit() { return HasSplit; } /// @} - /// Overloaded methods to add an insertion point. + /// \name Overloaded methods to add an insertion point. /// @{ /// Add a MBBInsertionPoint to the list of InsertPoints. void addInsertPoint(MachineBasicBlock &MBB, bool Beginning); @@ -362,7 +362,7 @@ public: void addInsertPoint(InsertPoint &Point); /// @} - /// Accessors related to the insertion points. + /// \name Accessors related to the insertion points. /// @{ insertpt_iterator begin() { return InsertPoints.begin(); } insertpt_iterator end() { return InsertPoints.end(); } @@ -561,7 +561,7 @@ private: /// Find the best mapping for \p MI from \p PossibleMappings. /// \return a reference on the best mapping in \p PossibleMappings. - RegisterBankInfo::InstructionMapping & + const RegisterBankInfo::InstructionMapping & findBestMapping(MachineInstr &MI, RegisterBankInfo::InstructionMappings &PossibleMappings, SmallVectorImpl &RepairPts); Modified: vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h Mon May 8 17:12:57 2017 (r317948) @@ -264,7 +264,7 @@ public: /// Convenient type to represent the alternatives for mapping an /// instruction. /// \todo When we move to TableGen this should be an array ref. - typedef SmallVector InstructionMappings; + typedef SmallVector InstructionMappings; /// Helper class used to get/create the virtual registers that will be used /// to replace the MachineOperand when applying a mapping. @@ -310,7 +310,7 @@ public: OperandsMapper(MachineInstr &MI, const InstructionMapping &InstrMapping, MachineRegisterInfo &MRI); - /// Getters. + /// \name Getters. /// @{ /// The MachineInstr being remapped. MachineInstr &getMI() const { return MI; } @@ -378,15 +378,23 @@ protected: /// Keep dynamically allocated PartialMapping in a separate map. /// This shouldn't be needed when everything gets TableGen'ed. - mutable DenseMap> MapOfPartialMappings; + mutable DenseMap> + MapOfPartialMappings; /// Keep dynamically allocated ValueMapping in a separate map. /// This shouldn't be needed when everything gets TableGen'ed. - mutable DenseMap > MapOfValueMappings; + mutable DenseMap> + MapOfValueMappings; /// Keep dynamically allocated array of ValueMapping in a separate map. /// This shouldn't be needed when everything gets TableGen'ed. - mutable DenseMap> MapOfOperandsMappings; + mutable DenseMap> + MapOfOperandsMappings; + + /// Keep dynamically allocated InstructionMapping in a separate map. + /// This shouldn't be needed when everything gets TableGen'ed. + mutable DenseMap> + MapOfInstructionMappings; /// Create a RegisterBankInfo that can accomodate up to \p NumRegBanks /// RegisterBank instances. @@ -425,14 +433,14 @@ protected: /// register, a register class, or a register bank. /// In other words, this method will likely fail to find a mapping for /// any generic opcode that has not been lowered by target specific code. - InstructionMapping getInstrMappingImpl(const MachineInstr &MI) const; + const InstructionMapping &getInstrMappingImpl(const MachineInstr &MI) const; /// Get the uniquely generated PartialMapping for the /// given arguments. const PartialMapping &getPartialMapping(unsigned StartIdx, unsigned Length, const RegisterBank &RegBank) const; - /// Methods to get a uniquely generated ValueMapping. + /// \name Methods to get a uniquely generated ValueMapping. /// @{ /// The most common ValueMapping consists of a single PartialMapping. @@ -445,7 +453,7 @@ protected: unsigned NumBreakDowns) const; /// @} - /// Methods to get a uniquely generated array of ValueMapping. + /// \name Methods to get a uniquely generated array of ValueMapping. /// @{ /// Get the uniquely generated array of ValueMapping for the @@ -478,6 +486,33 @@ protected: std::initializer_list OpdsMapping) const; /// @} + /// \name Methods to get a uniquely generated InstructionMapping. + /// @{ + +private: + /// Method to get a uniquely generated InstructionMapping. + const InstructionMapping & + getInstructionMappingImpl(bool IsInvalid, unsigned ID = InvalidMappingID, + unsigned Cost = 0, + const ValueMapping *OperandsMapping = nullptr, + unsigned NumOperands = 0) const; + +public: + /// Method to get a uniquely generated InstructionMapping. + const InstructionMapping & + getInstructionMapping(unsigned ID, unsigned Cost, + const ValueMapping *OperandsMapping, + unsigned NumOperands) const { + return getInstructionMappingImpl(/*IsInvalid*/ false, ID, Cost, + OperandsMapping, NumOperands); + } + + /// Method to get a uniquely generated invalid InstructionMapping. + const InstructionMapping &getInvalidInstructionMapping() const { + return getInstructionMappingImpl(/*IsInvalid*/ true); + } + /// @} + /// Get the register bank for the \p OpIdx-th operand of \p MI form /// the encoding constraints, if any. /// @@ -603,7 +638,8 @@ public: /// /// \note If returnedVal does not verify MI, this would probably mean /// that the target does not support that instruction. - virtual InstructionMapping getInstrMapping(const MachineInstr &MI) const; + virtual const InstructionMapping & + getInstrMapping(const MachineInstr &MI) const; /// Get the alternative mappings for \p MI. /// Alternative in the sense different from getInstrMapping. Added: vendor/llvm/dist/include/llvm/CodeGen/MIRPrinter.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/CodeGen/MIRPrinter.h Mon May 8 17:12:57 2017 (r317948) @@ -0,0 +1,46 @@ +//===- MIRPrinter.h - MIR serialization format printer --------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file declares the functions that print out the LLVM IR and the machine +// functions using the MIR serialization format. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIB_CODEGEN_MIRPRINTER_H +#define LLVM_LIB_CODEGEN_MIRPRINTER_H + +namespace llvm { + +class MachineBasicBlock; +class MachineFunction; +class Module; +class raw_ostream; +template class SmallVectorImpl; + +/// Print LLVM IR using the MIR serialization format to the given output stream. +void printMIR(raw_ostream &OS, const Module &M); + +/// Print a machine function using the MIR serialization format to the given +/// output stream. +void printMIR(raw_ostream &OS, const MachineFunction &MF); + +/// Determine a possible list of successors of a basic block based on the +/// basic block machine operand being used inside the block. This should give +/// you the correct list of successor blocks in most cases except for things +/// like jump tables where the basic block references can't easily be found. +/// The MIRPRinter will skip printing successors if they match the result of +/// this funciton and the parser will use this function to construct a list if +/// it is missing. +void guessSuccessors(const MachineBasicBlock &MBB, + SmallVectorImpl &Successors, + bool &IsFallthrough); + +} // end namespace llvm + +#endif Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineFrameInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineFrameInfo.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineFrameInfo.h Mon May 8 17:12:57 2017 (r317948) @@ -520,6 +520,14 @@ public: bool hasTailCall() const { return HasTailCall; } void setHasTailCall() { HasTailCall = true; } + /// Computes the maximum size of a callframe and the AdjustsStack property. + /// This only works for targets defining + /// TargetInstrInfo::getCallFrameSetupOpcode(), getCallFrameDestroyOpcode(), + /// and getFrameSize(). + /// This is usually computed by the prologue epilogue inserter but some + /// targets may call this to compute it earlier. + void computeMaxCallFrameSize(const MachineFunction &MF); + /// Return the maximum size of a call frame that must be /// allocated for an outgoing function call. This is only available if /// CallFrameSetup/Destroy pseudo instructions are used by the target, and Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineModuleInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineModuleInfo.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineModuleInfo.h Mon May 8 17:12:57 2017 (r317948) @@ -116,7 +116,7 @@ class MachineModuleInfo : public Immutab // TODO: Ideally, what we'd like is to have a switch that allows emitting // synchronous (precise at call-sites only) CFA into .eh_frame. However, - // even under this switch, we'd like .debug_frame to be precise when using. + // even under this switch, we'd like .debug_frame to be precise when using // -g. At this moment, there's no way to specify that some CFI directives // go into .eh_frame only, while others go into .debug_frame only. Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDatabase.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDatabase.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDatabase.h Mon May 8 17:12:57 2017 (r317948) @@ -21,7 +21,7 @@ namespace llvm { namespace codeview { class TypeDatabase { public: - TypeDatabase() : TypeNameStorage(Allocator) {} + explicit TypeDatabase(uint32_t ExpectedSize); /// Gets the type index for the next type record. TypeIndex getNextTypeIndex() const; Modified: vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFContext.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFContext.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFContext.h Mon May 8 17:12:57 2017 (r317948) @@ -310,6 +310,11 @@ class DWARFContextInMemory : public DWAR StringRef *MapSectionToMember(StringRef Name); + /// If Sec is compressed section, decompresses and updates its contents + /// provided by Data. Otherwise leaves it unchanged. + Error maybeDecompress(const object::SectionRef &Sec, StringRef Name, + StringRef &Data); + public: DWARFContextInMemory(const object::ObjectFile &Obj, const LoadedObjectInfo *L = nullptr); Modified: vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFFormValue.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFFormValue.h Mon May 8 17:02:03 2017 (r317947) +++ vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFFormValue.h Mon May 8 17:12:57 2017 (r317948) @@ -39,20 +39,18 @@ public: private: struct ValueType { - ValueType() { - uval = 0; - } + ValueType() { uval = 0; } union { uint64_t uval; int64_t sval; - const char* cstr; + const char *cstr; }; - const uint8_t* data = nullptr; + const uint8_t *data = nullptr; }; - dwarf::Form Form; // Form for this value. - ValueType Value; // Contains all data for the form. + dwarf::Form Form; // Form for this value. + ValueType Value; // Contains all data for the form. const DWARFUnit *U = nullptr; // Remember the DWARFUnit at extract time. public: @@ -84,7 +82,7 @@ public: const DWARFUnit *U); bool isInlinedCStr() const { - return Value.data != nullptr && Value.data == (const uint8_t*)Value.cstr; + return Value.data != nullptr && Value.data == (const uint8_t *)Value.cstr; } /// getAsFoo functions below return the extracted value as Foo if only @@ -135,45 +133,45 @@ public: uint8_t AddrSize, llvm::dwarf::DwarfFormat Format); - /// Skip a form in \p debug_info_data at offset specified by \p offset_ptr. + /// Skip a form in \p DebugInfoData at offset specified by \p OffsetPtr. /// /// Skips the bytes for this form in the debug info and updates the offset. /// - /// \param debug_info_data the .debug_info data to use to skip the value. - /// \param offset_ptr a reference to the offset that will be updated. + /// \param DebugInfoData the .debug_info data to use to skip the value. + /// \param OffsetPtr a reference to the offset that will be updated. /// \param U the DWARFUnit to use when skipping the form in case the form /// size differs according to data in the DWARFUnit. /// \returns true on success, false if the form was not skipped. - bool skipValue(DataExtractor debug_info_data, uint32_t *offset_ptr, + bool skipValue(DataExtractor DebugInfoData, uint32_t *OffsetPtr, const DWARFUnit *U) const; - /// Skip a form in \p debug_info_data at offset specified by \p offset_ptr. + /// Skip a form in \p DebugInfoData at offset specified by \p OffsetPtr. /// /// Skips the bytes for this form in the debug info and updates the offset. /// - /// \param form the DW_FORM enumeration that indicates the form to skip. - /// \param debug_info_data the .debug_info data to use to skip the value. - /// \param offset_ptr a reference to the offset that will be updated. + /// \param Form the DW_FORM enumeration that indicates the form to skip. + /// \param DebugInfoData the .debug_info data to use to skip the value. + /// \param OffsetPtr a reference to the offset that will be updated. /// \param U the DWARFUnit to use when skipping the form in case the form /// size differs according to data in the DWARFUnit. /// \returns true on success, false if the form was not skipped. - static bool skipValue(dwarf::Form form, DataExtractor debug_info_data, - uint32_t *offset_ptr, const DWARFUnit *U); + static bool skipValue(dwarf::Form Form, DataExtractor DebugInfoData, + uint32_t *OffsetPtr, const DWARFUnit *U); - /// Skip a form in \p debug_info_data at offset specified by \p offset_ptr. + /// Skip a form in \p DebugInfoData at offset specified by \p OffsetPtr. /// /// Skips the bytes for this form in the debug info and updates the offset. /// - /// \param form the DW_FORM enumeration that indicates the form to skip. - /// \param debug_info_data the .debug_info data to use to skip the value. - /// \param offset_ptr a reference to the offset that will be updated. + /// \param Form the DW_FORM enumeration that indicates the form to skip. + /// \param DebugInfoData the .debug_info data to use to skip the value. + /// \param OffsetPtr a reference to the offset that will be updated. /// \param Version DWARF version number. /// \param AddrSize size of an address in bytes. /// \param Format enum value from llvm::dwarf::DwarfFormat. /// \returns true on success, false if the form was not skipped. - static bool skipValue(dwarf::Form form, DataExtractor debug_info_data, - uint32_t *offset_ptr, uint16_t Version, - uint8_t AddrSize, llvm::dwarf::DwarfFormat Format); + static bool skipValue(dwarf::Form Form, DataExtractor DebugInfoData, + uint32_t *OffsetPtr, uint16_t Version, uint8_t AddrSize, + llvm::dwarf::DwarfFormat Format); private: void dumpString(raw_ostream &OS) const; @@ -181,149 +179,146 @@ private: namespace dwarf { - /// Take an optional DWARFFormValue and try to extract a string value from it. - /// - /// \param V and optional DWARFFormValue to attempt to extract the value from. - /// \returns an optional value that contains a value if the form value - /// was valid and was a string. - inline Optional toString(const Optional& V) { - if (V) - return V->getAsCString(); - return None; - } - - /// Take an optional DWARFFormValue and extract a string value from it. - /// - /// \param V and optional DWARFFormValue to attempt to extract the value from. - /// \param Default the default value to return in case of failure. - /// \returns the string value or Default if the V doesn't have a value or the - /// form value's encoding wasn't a string. - inline const char* - toString(const Optional& V, const char *Default) { - return toString(V).getValueOr(Default); - } - - /// Take an optional DWARFFormValue and try to extract an unsigned constant. - /// - /// \param V and optional DWARFFormValue to attempt to extract the value from. - /// \returns an optional value that contains a value if the form value - /// was valid and has a unsigned constant form. - inline Optional toUnsigned(const Optional& V) { - if (V) - return V->getAsUnsignedConstant(); - return None; - } - - /// Take an optional DWARFFormValue and extract a unsigned constant. - /// - /// \param V and optional DWARFFormValue to attempt to extract the value from. - /// \param Default the default value to return in case of failure. - /// \returns the extracted unsigned value or Default if the V doesn't have a - /// value or the form value's encoding wasn't an unsigned constant form. - inline uint64_t - toUnsigned(const Optional& V, uint64_t Default) { - return toUnsigned(V).getValueOr(Default); - } - - /// Take an optional DWARFFormValue and try to extract an reference. - /// - /// \param V and optional DWARFFormValue to attempt to extract the value from. - /// \returns an optional value that contains a value if the form value - /// was valid and has a reference form. - inline Optional toReference(const Optional& V) { - if (V) - return V->getAsReference(); - return None; - } - - /// Take an optional DWARFFormValue and extract a reference. - /// - /// \param V and optional DWARFFormValue to attempt to extract the value from. - /// \param Default the default value to return in case of failure. - /// \returns the extracted reference value or Default if the V doesn't have a - /// value or the form value's encoding wasn't a reference form. - inline uint64_t - toReference(const Optional& V, uint64_t Default) { - return toReference(V).getValueOr(Default); - } - - /// Take an optional DWARFFormValue and try to extract an signed constant. - /// - /// \param V and optional DWARFFormValue to attempt to extract the value from. - /// \returns an optional value that contains a value if the form value - /// was valid and has a signed constant form. - inline Optional toSigned(const Optional& V) { - if (V) - return V->getAsSignedConstant(); - return None; - } - - /// Take an optional DWARFFormValue and extract a signed integer. - /// - /// \param V and optional DWARFFormValue to attempt to extract the value from. - /// \param Default the default value to return in case of failure. - /// \returns the extracted signed integer value or Default if the V doesn't - /// have a value or the form value's encoding wasn't a signed integer form. - inline int64_t - toSigned(const Optional& V, int64_t Default) { - return toSigned(V).getValueOr(Default); - } - - /// Take an optional DWARFFormValue and try to extract an address. - /// - /// \param V and optional DWARFFormValue to attempt to extract the value from. - /// \returns an optional value that contains a value if the form value - /// was valid and has a address form. - inline Optional toAddress(const Optional& V) { - if (V) - return V->getAsAddress(); - return None; - } - - /// Take an optional DWARFFormValue and extract a address. - /// - /// \param V and optional DWARFFormValue to attempt to extract the value from. - /// \param Default the default value to return in case of failure. - /// \returns the extracted address value or Default if the V doesn't have a - /// value or the form value's encoding wasn't an address form. - inline uint64_t - toAddress(const Optional& V, uint64_t Default) { - return toAddress(V).getValueOr(Default); - } - - /// Take an optional DWARFFormValue and try to extract an section offset. - /// - /// \param V and optional DWARFFormValue to attempt to extract the value from. - /// \returns an optional value that contains a value if the form value - /// was valid and has a section offset form. - inline Optional toSectionOffset(const Optional& V) { - if (V) - return V->getAsSectionOffset(); - return None; - } - - /// Take an optional DWARFFormValue and extract a section offset. - /// - /// \param V and optional DWARFFormValue to attempt to extract the value from. - /// \param Default the default value to return in case of failure. - /// \returns the extracted section offset value or Default if the V doesn't - /// have a value or the form value's encoding wasn't a section offset form. - inline uint64_t - toSectionOffset(const Optional& V, uint64_t Default) { - return toSectionOffset(V).getValueOr(Default); - } - - /// Take an optional DWARFFormValue and try to extract block data. - /// - /// \param V and optional DWARFFormValue to attempt to extract the value from. - /// \returns an optional value that contains a value if the form value - /// was valid and has a block form. - inline Optional> - toBlock(const Optional& V) { - if (V) - return V->getAsBlock(); - return None; - } +/// Take an optional DWARFFormValue and try to extract a string value from it. +/// +/// \param V and optional DWARFFormValue to attempt to extract the value from. +/// \returns an optional value that contains a value if the form value +/// was valid and was a string. +inline Optional toString(const Optional &V) { + if (V) + return V->getAsCString(); + return None; +} + +/// Take an optional DWARFFormValue and extract a string value from it. +/// +/// \param V and optional DWARFFormValue to attempt to extract the value from. +/// \param Default the default value to return in case of failure. +/// \returns the string value or Default if the V doesn't have a value or the +/// form value's encoding wasn't a string. +inline const char *toString(const Optional &V, + const char *Default) { + return toString(V).getValueOr(Default); +} + +/// Take an optional DWARFFormValue and try to extract an unsigned constant. +/// +/// \param V and optional DWARFFormValue to attempt to extract the value from. +/// \returns an optional value that contains a value if the form value +/// was valid and has a unsigned constant form. +inline Optional toUnsigned(const Optional &V) { + if (V) + return V->getAsUnsignedConstant(); + return None; +} + +/// Take an optional DWARFFormValue and extract a unsigned constant. +/// +/// \param V and optional DWARFFormValue to attempt to extract the value from. +/// \param Default the default value to return in case of failure. +/// \returns the extracted unsigned value or Default if the V doesn't have a +/// value or the form value's encoding wasn't an unsigned constant form. +inline uint64_t toUnsigned(const Optional &V, + uint64_t Default) { + return toUnsigned(V).getValueOr(Default); +} + +/// Take an optional DWARFFormValue and try to extract an reference. +/// +/// \param V and optional DWARFFormValue to attempt to extract the value from. +/// \returns an optional value that contains a value if the form value +/// was valid and has a reference form. +inline Optional toReference(const Optional &V) { + if (V) + return V->getAsReference(); + return None; +} + +/// Take an optional DWARFFormValue and extract a reference. +/// +/// \param V and optional DWARFFormValue to attempt to extract the value from. +/// \param Default the default value to return in case of failure. +/// \returns the extracted reference value or Default if the V doesn't have a +/// value or the form value's encoding wasn't a reference form. +inline uint64_t toReference(const Optional &V, + uint64_t Default) { + return toReference(V).getValueOr(Default); +} + +/// Take an optional DWARFFormValue and try to extract an signed constant. +/// +/// \param V and optional DWARFFormValue to attempt to extract the value from. +/// \returns an optional value that contains a value if the form value +/// was valid and has a signed constant form. +inline Optional toSigned(const Optional &V) { + if (V) + return V->getAsSignedConstant(); + return None; +} + +/// Take an optional DWARFFormValue and extract a signed integer. +/// +/// \param V and optional DWARFFormValue to attempt to extract the value from. +/// \param Default the default value to return in case of failure. +/// \returns the extracted signed integer value or Default if the V doesn't +/// have a value or the form value's encoding wasn't a signed integer form. +inline int64_t toSigned(const Optional &V, int64_t Default) { + return toSigned(V).getValueOr(Default); +} + +/// Take an optional DWARFFormValue and try to extract an address. +/// +/// \param V and optional DWARFFormValue to attempt to extract the value from. +/// \returns an optional value that contains a value if the form value +/// was valid and has a address form. +inline Optional toAddress(const Optional &V) { + if (V) + return V->getAsAddress(); + return None; +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Mon May 8 17:13:07 2017 Return-Path: Delivered-To: svn-src-vendor@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 0FCFCD634E5; Mon, 8 May 2017 17:13:07 +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 9001D850; Mon, 8 May 2017 17:13:06 +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 v48HD50V042594; Mon, 8 May 2017 17:13:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v48HD5vw042593; Mon, 8 May 2017 17:13:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705081713.v48HD5vw042593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 8 May 2017 17:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317950 - vendor/llvm/llvm-trunk-r302418 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2017 17:13:07 -0000 Author: dim Date: Mon May 8 17:13:05 2017 New Revision: 317950 URL: https://svnweb.freebsd.org/changeset/base/317950 Log: Tag llvm trunk r302418. Added: vendor/llvm/llvm-trunk-r302418/ - copied from r317949, vendor/llvm/dist/ From owner-svn-src-vendor@freebsd.org Mon May 8 17:13:21 2017 Return-Path: Delivered-To: svn-src-vendor@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 13046D6358F; Mon, 8 May 2017 17:13:21 +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 B3A0D932; Mon, 8 May 2017 17:13:20 +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 v48HDJCs042726; Mon, 8 May 2017 17:13:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v48HDJ3T042725; Mon, 8 May 2017 17:13:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705081713.v48HDJ3T042725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 8 May 2017 17:13:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317952 - vendor/clang/clang-trunk-r302418 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2017 17:13:21 -0000 Author: dim Date: Mon May 8 17:13:19 2017 New Revision: 317952 URL: https://svnweb.freebsd.org/changeset/base/317952 Log: Tag clang trunk r302418. Added: vendor/clang/clang-trunk-r302418/ - copied from r317951, vendor/clang/dist/ From owner-svn-src-vendor@freebsd.org Mon May 8 17:13:16 2017 Return-Path: Delivered-To: svn-src-vendor@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 A9B91D63533; Mon, 8 May 2017 17:13:16 +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 577748EA; Mon, 8 May 2017 17:13:16 +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 v48HDFI2042679; Mon, 8 May 2017 17:13:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v48HDBaA042642; Mon, 8 May 2017 17:13:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705081713.v48HDBaA042642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 8 May 2017 17:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317951 - in vendor/clang/dist: docs include/clang/AST include/clang/ASTMatchers include/clang/Basic include/clang/Driver include/clang/Frontend include/clang/Lex include/clang/Sema inc... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2017 17:13:17 -0000 Author: dim Date: Mon May 8 17:13:11 2017 New Revision: 317951 URL: https://svnweb.freebsd.org/changeset/base/317951 Log: Vendor import of clang trunk r302418: https://llvm.org/svn/llvm-project/cfe/trunk@302418 Added: vendor/clang/dist/lib/Headers/lwpintrin.h (contents, props changed) vendor/clang/dist/test/CodeGen/aarch64-args.cpp (contents, props changed) vendor/clang/dist/test/CodeGen/lwp-builtins.c (contents, props changed) vendor/clang/dist/test/FixIt/fixit-availability.c (contents, props changed) vendor/clang/dist/test/FixIt/fixit-availability.mm vendor/clang/dist/test/Index/KeepGoingWithLotsOfErrors.mm vendor/clang/dist/test/Modules/Inputs/preprocess/file2.h (contents, props changed) vendor/clang/dist/test/OpenMP/varargs.cpp (contents, props changed) vendor/clang/dist/test/SemaCXX/warn-zero-nullptr.cpp (contents, props changed) Modified: vendor/clang/dist/docs/LanguageExtensions.rst vendor/clang/dist/docs/LibASTMatchersReference.html vendor/clang/dist/docs/SanitizerCoverage.rst vendor/clang/dist/docs/ThreadSafetyAnalysis.rst vendor/clang/dist/include/clang/AST/ODRHash.h vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h vendor/clang/dist/include/clang/Basic/Attr.td vendor/clang/dist/include/clang/Basic/AttrDocs.td vendor/clang/dist/include/clang/Basic/BuiltinsARM.def vendor/clang/dist/include/clang/Basic/BuiltinsX86.def vendor/clang/dist/include/clang/Basic/BuiltinsX86_64.def vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Driver/CC1Options.td vendor/clang/dist/include/clang/Driver/Distro.h vendor/clang/dist/include/clang/Driver/Multilib.h vendor/clang/dist/include/clang/Driver/Options.td vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def vendor/clang/dist/include/clang/Frontend/FrontendAction.h vendor/clang/dist/include/clang/Lex/HeaderSearch.h vendor/clang/dist/include/clang/Lex/Lexer.h vendor/clang/dist/include/clang/Lex/ModuleMap.h vendor/clang/dist/include/clang/Lex/Preprocessor.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/Tooling/FixIt.h vendor/clang/dist/lib/ASTMatchers/Dynamic/Registry.cpp vendor/clang/dist/lib/Basic/Diagnostic.cpp vendor/clang/dist/lib/Basic/DiagnosticIDs.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/BackendUtil.cpp vendor/clang/dist/lib/CodeGen/CGBlocks.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/CodeGen/TargetInfo.cpp vendor/clang/dist/lib/Driver/Distro.cpp vendor/clang/dist/lib/Driver/Multilib.cpp vendor/clang/dist/lib/Driver/SanitizerArgs.cpp vendor/clang/dist/lib/Driver/ToolChains/CrossWindows.cpp vendor/clang/dist/lib/Driver/ToolChains/Gnu.cpp vendor/clang/dist/lib/Format/FormatToken.h vendor/clang/dist/lib/Format/FormatTokenLexer.cpp vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/lib/Frontend/FrontendAction.cpp vendor/clang/dist/lib/Frontend/FrontendActions.cpp vendor/clang/dist/lib/Frontend/PrintPreprocessedOutput.cpp vendor/clang/dist/lib/Frontend/Rewrite/FrontendActions.cpp vendor/clang/dist/lib/Frontend/Rewrite/InclusionRewriter.cpp vendor/clang/dist/lib/Headers/CMakeLists.txt vendor/clang/dist/lib/Headers/arm_acle.h vendor/clang/dist/lib/Headers/x86intrin.h vendor/clang/dist/lib/Index/IndexDecl.cpp vendor/clang/dist/lib/Lex/HeaderSearch.cpp vendor/clang/dist/lib/Lex/Lexer.cpp vendor/clang/dist/lib/Lex/ModuleMap.cpp vendor/clang/dist/lib/Lex/PPDirectives.cpp vendor/clang/dist/lib/Lex/PPLexerChange.cpp vendor/clang/dist/lib/Lex/PPMacroExpansion.cpp vendor/clang/dist/lib/Lex/Pragma.cpp vendor/clang/dist/lib/Lex/Preprocessor.cpp vendor/clang/dist/lib/Lex/TokenLexer.cpp vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp vendor/clang/dist/lib/Sema/Sema.cpp vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp vendor/clang/dist/lib/Sema/SemaDeclObjC.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaStmt.cpp vendor/clang/dist/lib/Tooling/JSONCompilationDatabase.cpp vendor/clang/dist/test/CodeGen/arm_acle.c vendor/clang/dist/test/CodeGen/mozilla-ms-inline-asm.c vendor/clang/dist/test/CodeGen/ms-inline-asm-64.c vendor/clang/dist/test/CodeGen/ms-inline-asm-avx512.c vendor/clang/dist/test/CodeGen/ms-inline-asm.c vendor/clang/dist/test/CodeGen/ms-inline-asm.cpp vendor/clang/dist/test/CodeGen/thinlto_backend.ll vendor/clang/dist/test/CodeGenCXX/ms-inline-asm-fields.cpp vendor/clang/dist/test/CodeGenObjC/arc-foreach.m vendor/clang/dist/test/CodeGenOpenCL/kernel-attributes.cl vendor/clang/dist/test/Driver/android-ndk-standalone.cpp vendor/clang/dist/test/Driver/darwin-version.c vendor/clang/dist/test/Driver/fsanitize-coverage.c vendor/clang/dist/test/Driver/windows-cross.c vendor/clang/dist/test/Index/Core/index-source.cpp vendor/clang/dist/test/Misc/pragma-attribute-supported-attributes-list.test vendor/clang/dist/test/Modules/Inputs/preprocess/module.modulemap vendor/clang/dist/test/Modules/preprocess-module.cpp vendor/clang/dist/test/Parser/MicrosoftExtensions.cpp vendor/clang/dist/test/Parser/ms-square-bracket-attributes.mm vendor/clang/dist/test/Preprocessor/aarch64-target-features.c vendor/clang/dist/test/Preprocessor/macro_paste_commaext.c vendor/clang/dist/test/Preprocessor/pragma_module.c vendor/clang/dist/test/Preprocessor/stringize_space.c vendor/clang/dist/test/Sema/arm-interrupt-attr.c vendor/clang/dist/test/Sema/attr-availability.c vendor/clang/dist/test/SemaCXX/ms-uuid.cpp vendor/clang/dist/test/SemaCXX/varargs.cpp vendor/clang/dist/test/SemaObjC/x86-method-vector-values.m vendor/clang/dist/test/SemaOpenCL/invalid-kernel-attrs.cl vendor/clang/dist/test/SemaOpenCL/sampler_t.cl vendor/clang/dist/unittests/ASTMatchers/ASTMatchersNodeTest.cpp vendor/clang/dist/unittests/Format/FormatTestJS.cpp Modified: vendor/clang/dist/docs/LanguageExtensions.rst ============================================================================== --- vendor/clang/dist/docs/LanguageExtensions.rst Mon May 8 17:13:05 2017 (r317950) +++ vendor/clang/dist/docs/LanguageExtensions.rst Mon May 8 17:13:11 2017 (r317951) @@ -780,14 +780,14 @@ Use ``__has_feature(cxx_variadic_templat ``__has_extension(cxx_variadic_templates)`` to determine if support for variadic templates is enabled. -C++1y +C++14 ----- -The features listed below are part of the committee draft for the C++1y -standard. As a result, all these features are enabled with the ``-std=c++1y`` -or ``-std=gnu++1y`` option when compiling C++ code. +The features listed below are part of the C++14 standard. As a result, all +these features are enabled with the ``-std=C++14`` or ``-std=gnu++14`` option +when compiling C++ code. -C++1y binary literals +C++14 binary literals ^^^^^^^^^^^^^^^^^^^^^ Use ``__has_feature(cxx_binary_literals)`` or @@ -795,37 +795,37 @@ Use ``__has_feature(cxx_binary_literals) binary literals (for instance, ``0b10010``) are recognized. Clang supports this feature as an extension in all language modes. -C++1y contextual conversions +C++14 contextual conversions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use ``__has_feature(cxx_contextual_conversions)`` or -``__has_extension(cxx_contextual_conversions)`` to determine if the C++1y rules +``__has_extension(cxx_contextual_conversions)`` to determine if the C++14 rules are used when performing an implicit conversion for an array bound in a *new-expression*, the operand of a *delete-expression*, an integral constant expression, or a condition in a ``switch`` statement. -C++1y decltype(auto) +C++14 decltype(auto) ^^^^^^^^^^^^^^^^^^^^ Use ``__has_feature(cxx_decltype_auto)`` or ``__has_extension(cxx_decltype_auto)`` to determine if support for the ``decltype(auto)`` placeholder type is enabled. -C++1y default initializers for aggregates +C++14 default initializers for aggregates ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use ``__has_feature(cxx_aggregate_nsdmi)`` or ``__has_extension(cxx_aggregate_nsdmi)`` to determine if support for default initializers in aggregate members is enabled. -C++1y digit separators +C++14 digit separators ^^^^^^^^^^^^^^^^^^^^^^ Use ``__cpp_digit_separators`` to determine if support for digit separators using single quotes (for instance, ``10'000``) is enabled. At this time, there is no corresponding ``__has_feature`` name -C++1y generalized lambda capture +C++14 generalized lambda capture ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use ``__has_feature(cxx_init_captures)`` or @@ -833,7 +833,7 @@ Use ``__has_feature(cxx_init_captures)`` lambda captures with explicit initializers is enabled (for instance, ``[n(0)] { return ++n; }``). -C++1y generic lambdas +C++14 generic lambdas ^^^^^^^^^^^^^^^^^^^^^ Use ``__has_feature(cxx_generic_lambdas)`` or @@ -841,7 +841,7 @@ Use ``__has_feature(cxx_generic_lambdas) (polymorphic) lambdas is enabled (for instance, ``[] (auto x) { return x + 1; }``). -C++1y relaxed constexpr +C++14 relaxed constexpr ^^^^^^^^^^^^^^^^^^^^^^^ Use ``__has_feature(cxx_relaxed_constexpr)`` or @@ -849,7 +849,7 @@ Use ``__has_feature(cxx_relaxed_constexp declarations, local variable modification, and control flow constructs are permitted in ``constexpr`` functions. -C++1y return type deduction +C++14 return type deduction ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use ``__has_feature(cxx_return_type_deduction)`` or @@ -857,7 +857,7 @@ Use ``__has_feature(cxx_return_type_dedu for return type deduction for functions (using ``auto`` as a return type) is enabled. -C++1y runtime-sized arrays +C++14 runtime-sized arrays ^^^^^^^^^^^^^^^^^^^^^^^^^^ Use ``__has_feature(cxx_runtime_array)`` or @@ -866,7 +866,7 @@ for arrays of runtime bound (a restricte is enabled. Clang's implementation of this feature is incomplete. -C++1y variable templates +C++14 variable templates ^^^^^^^^^^^^^^^^^^^^^^^^ Use ``__has_feature(cxx_variable_templates)`` or Modified: vendor/clang/dist/docs/LibASTMatchersReference.html ============================================================================== --- vendor/clang/dist/docs/LibASTMatchersReference.html Mon May 8 17:13:05 2017 (r317950) +++ vendor/clang/dist/docs/LibASTMatchersReference.html Mon May 8 17:13:11 2017 (r317951) @@ -924,6 +924,19 @@ in +Matcher<Stmt>cxxStdInitializerListExprMatcher<CXXStdInitializerListExpr>... +
Matches C++ initializer list expressions.
+
+Given
+  std::vector<int> a({ 1, 2, 3 });
+  std::vector<int> b = { 4, 5 };
+  int c[] = { 6, 7 };
+  std::pair<int, int> d = { 8, 9 };
+cxxStdInitializerListExpr()
+  matches "{ 1, 2, 3 }" and "{ 4, 5 }"
+
+ + Matcher<Stmt>cxxTemporaryObjectExprMatcher<CXXTemporaryObjectExpr>...
Matches functional cast expressions having N != 1 arguments
 
@@ -1160,7 +1173,7 @@ Example matches [&](){return 5;}
 
Matches nodes where temporaries are materialized.
 
 Example: Given
-  struct T {void func()};
+  struct T {void func();};
   T f();
   void g(T);
 materializeTemporaryExpr() matches 'f()' in these statements
@@ -5233,7 +5246,7 @@ Example matches y in x(y)
 
Matches on the receiver of an ObjectiveC Message expression.
 
 Example
-matcher = objCMessageExpr(hasRecieverType(asString("UIWebView *")));
+matcher = objCMessageExpr(hasReceiverType(asString("UIWebView *")));
 matches the [webView ...] message invocation.
   NSString *webViewJavaScript = ...
   UIWebView *webView = ...

Modified: vendor/clang/dist/docs/SanitizerCoverage.rst
==============================================================================
--- vendor/clang/dist/docs/SanitizerCoverage.rst	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/docs/SanitizerCoverage.rst	Mon May  8 17:13:11 2017	(r317951)
@@ -144,8 +144,9 @@ Use these flags together with ``trace-pc
 like this: ``-fsanitize-coverage=func,trace-pc-guard``.
 
 When ``edge`` or ``bb`` is used, some of the edges/blocks may still be left
-uninstrumented if such instrumentation is considered redundant.
-**TODO**: add a user-visible option to disable the optimization.
+uninstrumented (pruned) if such instrumentation is considered redundant.
+Use ``no-prune`` (e.g. ``-fsanitize-coverage=bb,no-prune,trace-pc-guard``)
+to disable pruning. This could be useful for better coverage visualization.
 
 
 Edge coverage

Modified: vendor/clang/dist/docs/ThreadSafetyAnalysis.rst
==============================================================================
--- vendor/clang/dist/docs/ThreadSafetyAnalysis.rst	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/docs/ThreadSafetyAnalysis.rst	Mon May  8 17:13:11 2017	(r317951)
@@ -764,8 +764,6 @@ implementation.
   #define THREAD_ANNOTATION_ATTRIBUTE__(x)   // no-op
   #endif
 
-  #define THREAD_ANNOTATION_ATTRIBUTE__(x)   __attribute__((x))
-
   #define CAPABILITY(x) \
     THREAD_ANNOTATION_ATTRIBUTE__(capability(x))
 

Modified: vendor/clang/dist/include/clang/AST/ODRHash.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/ODRHash.h	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/AST/ODRHash.h	Mon May  8 17:13:11 2017	(r317951)
@@ -25,7 +25,7 @@ namespace clang {
 
 class Decl;
 class IdentifierInfo;
-class NestedNameSpecifer;
+class NestedNameSpecifier;
 class Stmt;
 class TemplateParameterList;
 

Modified: vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h
==============================================================================
--- vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h	Mon May  8 17:13:11 2017	(r317951)
@@ -1223,6 +1223,20 @@ AST_MATCHER_P(InitListExpr, hasSyntactic
           InnerMatcher.matches(*SyntForm, Finder, Builder));
 }
 
+/// \brief Matches C++ initializer list expressions.
+///
+/// Given
+/// \code
+///   std::vector a({ 1, 2, 3 });
+///   std::vector b = { 4, 5 };
+///   int c[] = { 6, 7 };
+///   std::pair d = { 8, 9 };
+/// \endcode
+/// cxxStdInitializerListExpr()
+///   matches "{ 1, 2, 3 }" and "{ 4, 5 }"
+const internal::VariadicDynCastAllOfMatcher cxxStdInitializerListExpr;
+
 /// \brief Matches implicit initializers of init list expressions.
 ///
 /// Given

Modified: vendor/clang/dist/include/clang/Basic/Attr.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/Attr.td	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Basic/Attr.td	Mon May  8 17:13:11 2017	(r317951)
@@ -864,6 +864,13 @@ def OpenCLUnrollHint : InheritableAttr {
   let Documentation = [OpenCLUnrollHintDocs];
 }
 
+def OpenCLIntelReqdSubGroupSize: InheritableAttr {
+  let Spellings = [GNU<"intel_reqd_sub_group_size">];
+  let Args = [UnsignedArgument<"SubGroupSize">];
+  let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [OpenCLIntelReqdSubGroupSizeDocs];
+}
+
 // This attribute is both a type attribute, and a declaration attribute (for
 // parameter variables).
 def OpenCLAccess : Attr {

Modified: vendor/clang/dist/include/clang/Basic/AttrDocs.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/AttrDocs.td	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Basic/AttrDocs.td	Mon May  8 17:13:11 2017	(r317951)
@@ -2216,6 +2216,21 @@ s6.11.5 for details.
   }];
 }
 
+def OpenCLIntelReqdSubGroupSizeDocs : Documentation {
+  let Category = DocCatStmt;
+  let Heading = "__attribute__((intel_reqd_sub_group_size))";
+  let Content = [{
+The optional attribute intel_reqd_sub_group_size can be used to indicate that
+the kernel must be compiled and executed with the specified subgroup size. When
+this attribute is present, get_max_sub_group_size() is guaranteed to return the
+specified integer value. This is important for the correctness of many subgroup
+algorithms, and in some cases may be used by the compiler to generate more optimal
+code. See `cl_intel_required_subgroup_size
+`
+for details.
+  }];
+}
+
 def OpenCLAccessDocs : Documentation {
   let Category = DocCatStmt;
   let Heading = "__read_only, __write_only, __read_write (read_only, write_only, read_write)";

Modified: vendor/clang/dist/include/clang/Basic/BuiltinsARM.def
==============================================================================
--- vendor/clang/dist/include/clang/Basic/BuiltinsARM.def	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Basic/BuiltinsARM.def	Mon May  8 17:13:11 2017	(r317951)
@@ -25,11 +25,93 @@
 // In libgcc
 BUILTIN(__clear_cache, "vv*v*", "i")
 
+// 16-bit multiplications
+BUILTIN(__builtin_arm_smulbb, "iii", "nc")
+BUILTIN(__builtin_arm_smulbt, "iii", "nc")
+BUILTIN(__builtin_arm_smultb, "iii", "nc")
+BUILTIN(__builtin_arm_smultt, "iii", "nc")
+BUILTIN(__builtin_arm_smulwb, "iii", "nc")
+BUILTIN(__builtin_arm_smulwt, "iii", "nc")
+
 // Saturating arithmetic
 BUILTIN(__builtin_arm_qadd, "iii", "nc")
 BUILTIN(__builtin_arm_qsub, "iii", "nc")
 BUILTIN(__builtin_arm_ssat, "iiUi", "nc")
-BUILTIN(__builtin_arm_usat, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_usat, "UiiUi", "nc")
+
+BUILTIN(__builtin_arm_smlabb, "iiii", "nc")
+BUILTIN(__builtin_arm_smlabt, "iiii", "nc")
+BUILTIN(__builtin_arm_smlatb, "iiii", "nc")
+BUILTIN(__builtin_arm_smlatt, "iiii", "nc")
+BUILTIN(__builtin_arm_smlawb, "iiii", "nc")
+BUILTIN(__builtin_arm_smlawt, "iiii", "nc")
+
+BUILTIN(__builtin_arm_ssat16, "iii", "nc")
+BUILTIN(__builtin_arm_usat16, "iii", "nc")
+
+BUILTIN(__builtin_arm_sxtab16, "iii", "nc")
+BUILTIN(__builtin_arm_sxtb16, "ii", "nc")
+BUILTIN(__builtin_arm_uxtab16, "iii", "nc")
+BUILTIN(__builtin_arm_uxtb16, "ii", "nc")
+
+BUILTIN(__builtin_arm_sel, "iii", "nc")
+
+BUILTIN(__builtin_arm_qadd8, "iii", "nc")
+BUILTIN(__builtin_arm_qsub8, "iii", "nc")
+BUILTIN(__builtin_arm_sadd8, "iii", "nc")
+BUILTIN(__builtin_arm_shadd8, "iii", "nc")
+BUILTIN(__builtin_arm_shsub8, "iii", "nc")
+BUILTIN(__builtin_arm_ssub8, "iii", "nc")
+BUILTIN(__builtin_arm_uadd8, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uhadd8, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uhsub8, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uqadd8, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uqsub8, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_usub8, "UiUiUi", "nc")
+
+// Sum of 8-bit absolute differences
+BUILTIN(__builtin_arm_usad8, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_usada8, "UiUiUiUi", "nc")
+
+// Parallel 16-bit addition and subtraction
+BUILTIN(__builtin_arm_qadd16, "iii", "nc")
+BUILTIN(__builtin_arm_qasx, "iii", "nc")
+BUILTIN(__builtin_arm_qsax, "iii", "nc")
+BUILTIN(__builtin_arm_qsub16, "iii", "nc")
+BUILTIN(__builtin_arm_sadd16, "iii", "nc")
+BUILTIN(__builtin_arm_sasx, "iii", "nc")
+BUILTIN(__builtin_arm_shadd16, "iii", "nc")
+BUILTIN(__builtin_arm_shasx, "iii", "nc")
+BUILTIN(__builtin_arm_shsax, "iii", "nc")
+BUILTIN(__builtin_arm_shsub16, "iii", "nc")
+BUILTIN(__builtin_arm_ssax, "iii", "nc")
+BUILTIN(__builtin_arm_ssub16, "iii", "nc")
+BUILTIN(__builtin_arm_uadd16, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uasx, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uhadd16, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uhasx, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uhsax, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uhsub16, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uqadd16, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uqasx, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uqsax, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uqsub16, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_usax, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_usub16, "UiUiUi", "nc")
+
+// Parallel 16-bit multiplication
+BUILTIN(__builtin_arm_smlad, "iiii", "nc")
+BUILTIN(__builtin_arm_smladx, "iiii", "nc")
+BUILTIN(__builtin_arm_smlald, "LLiiiLLi", "nc")
+BUILTIN(__builtin_arm_smlaldx, "LLiiiLLi", "nc")
+BUILTIN(__builtin_arm_smlsd, "iiii", "nc")
+BUILTIN(__builtin_arm_smlsdx, "iiii", "nc")
+BUILTIN(__builtin_arm_smlsld, "LLiiiLLi", "nc")
+BUILTIN(__builtin_arm_smlsldx, "LLiiiLLi", "nc")
+BUILTIN(__builtin_arm_smuad, "iii", "nc")
+BUILTIN(__builtin_arm_smuadx, "iii", "nc")
+BUILTIN(__builtin_arm_smusd, "iii", "nc")
+BUILTIN(__builtin_arm_smusdx, "iii", "nc")
 
 // Bit manipulation
 BUILTIN(__builtin_arm_rbit, "UiUi", "nc")

Modified: vendor/clang/dist/include/clang/Basic/BuiltinsX86.def
==============================================================================
--- vendor/clang/dist/include/clang/Basic/BuiltinsX86.def	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Basic/BuiltinsX86.def	Mon May  8 17:13:11 2017	(r317951)
@@ -668,6 +668,12 @@ TARGET_BUILTIN(__builtin_ia32_pext_si, "
 // TBM
 TARGET_BUILTIN(__builtin_ia32_bextri_u32, "UiUiIUi", "", "tbm")
 
+// LWP
+TARGET_BUILTIN(__builtin_ia32_llwpcb, "vv*", "", "lwp")
+TARGET_BUILTIN(__builtin_ia32_slwpcb, "v*", "", "lwp")
+TARGET_BUILTIN(__builtin_ia32_lwpins32, "UcUiUiUi", "", "lwp")
+TARGET_BUILTIN(__builtin_ia32_lwpval32, "vUiUiUi", "", "lwp")
+
 // SHA
 TARGET_BUILTIN(__builtin_ia32_sha1rnds4, "V4iV4iV4iIc", "", "sha")
 TARGET_BUILTIN(__builtin_ia32_sha1nexte, "V4iV4iV4i", "", "sha")

Modified: vendor/clang/dist/include/clang/Basic/BuiltinsX86_64.def
==============================================================================
--- vendor/clang/dist/include/clang/Basic/BuiltinsX86_64.def	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Basic/BuiltinsX86_64.def	Mon May  8 17:13:11 2017	(r317951)
@@ -69,6 +69,8 @@ TARGET_BUILTIN(__builtin_ia32_bzhi_di, "
 TARGET_BUILTIN(__builtin_ia32_pdep_di, "ULLiULLiULLi", "", "bmi2")
 TARGET_BUILTIN(__builtin_ia32_pext_di, "ULLiULLiULLi", "", "bmi2")
 TARGET_BUILTIN(__builtin_ia32_bextri_u64, "ULLiULLiIULLi", "", "tbm")
+TARGET_BUILTIN(__builtin_ia32_lwpins64, "UcULLiUiUi", "", "lwp")
+TARGET_BUILTIN(__builtin_ia32_lwpval64, "vULLiUiUi", "", "lwp")
 TARGET_BUILTIN(__builtin_ia32_pbroadcastq512_gpr_mask, "V8LLiLLiV8LLiUc", "", "avx512f")
 TARGET_BUILTIN(__builtin_ia32_pbroadcastq128_gpr_mask, "V2LLiULLiV2LLiUc","","avx512vl")
 TARGET_BUILTIN(__builtin_ia32_pbroadcastq256_gpr_mask, "V4LLiULLiV4LLiUc","","avx512vl")

Modified: vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td	Mon May  8 17:13:11 2017	(r317951)
@@ -475,8 +475,6 @@ def warn_pragma_pop_macro_no_push : Warn
 def warn_pragma_message : Warning<"%0">,
    InGroup, DefaultWarnNoWerror;
 def err_pragma_message : Error<"%0">;
-def err_pragma_module_import_expected_module_name : Error<
-  "expected %select{identifier in|'.' or end of directive after}0 module name">;
 def warn_pragma_ignored : Warning<"unknown pragma ignored">,
    InGroup, DefaultIgnore;
 def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">,
@@ -511,6 +509,22 @@ def warn_pragma_debug_unexpected_command
   "unexpected debug command '%0'">, InGroup;
 def warn_pragma_debug_missing_argument : Warning<
   "missing argument to debug command '%0'">, InGroup;
+// #pragma module
+def err_pp_expected_module_name : Error<
+  "expected %select{identifier after '.' in |}0module name">;
+def err_pp_module_begin_wrong_module : Error<
+  "must specify '-fmodule-name=%0' to enter %select{|submodule of }1"
+  "this module%select{ (current module is %3)|}2">;
+def err_pp_module_begin_no_module_map : Error<
+  "no module map available for module %0">;
+def err_pp_module_begin_no_submodule : Error<
+  "submodule %0.%1 not declared in module map">;
+def err_pp_module_begin_without_module_end : Error<
+  "no matching '#pragma clang module end' for this "
+  "'#pragma clang module begin'">;
+def err_pp_module_end_without_module_begin : Error<
+  "no matching '#pragma clang module begin' for this "
+  "'#pragma clang module end'">;
 
 def err_defined_macro_name : Error<"'defined' cannot be used as a macro name">;
 def err_paste_at_start : Error<

Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td	Mon May  8 17:13:11 2017	(r317951)
@@ -730,6 +730,9 @@ def err_super_in_lambda_unsupported : Er
 def warn_pragma_unused_undeclared_var : Warning<
   "undeclared variable %0 used as an argument for '#pragma unused'">,
   InGroup;
+def warn_atl_uuid_deprecated : Warning<
+  "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">,
+  InGroup;
 def warn_pragma_unused_expected_var_arg : Warning<
   "only variables can be arguments to '#pragma unused'">,
   InGroup;
@@ -2088,7 +2091,7 @@ def err_enum_invalid_underlying : Error<
   "non-integral type %0 is an invalid underlying type">;
 def err_enumerator_too_large : Error<
   "enumerator value is not representable in the underlying type %0">;
-def ext_enumerator_too_large : ExtWarn<
+def ext_enumerator_too_large : Extension<
   "enumerator value is not representable in the underlying type %0">,
   InGroup;
 def err_enumerator_wrapped : Error<
@@ -2868,7 +2871,8 @@ def warn_partial_availability : Warning<
 def note_partial_availability_silence : Note<
   "explicitly redeclare %0 to silence this warning">;
 def note_unguarded_available_silence : Note<
-  "enclose %0 in an @available check to silence this warning">;
+  "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
+  " this warning">;
 def warn_partial_message : Warning<"%0 is partial: %1">,
     InGroup, DefaultIgnore;
 def warn_partial_fwdclass_message : Warning<
@@ -4759,7 +4763,7 @@ def ext_forward_ref_enum : Extension<
   "ISO C forbids forward references to 'enum' types">;
 def err_forward_ref_enum : Error<
   "ISO C++ forbids forward references to 'enum' types">;
-def ext_ms_forward_ref_enum : Extension<
+def ext_ms_forward_ref_enum : ExtWarn<
   "forward references to 'enum' types are a Microsoft extension">,
   InGroup;
 def ext_forward_ref_enum_def : Extension<
@@ -7920,7 +7924,11 @@ def warn_empty_switch_body : Warning<
 def note_empty_body_on_separate_line : Note<
   "put the semicolon on a separate line to silence this warning">;
 
-def err_va_start_used_in_non_variadic_function : Error<
+def err_va_start_captured_stmt : Error<
+  "'va_start' cannot be used in a captured statement">;
+def err_va_start_outside_function : Error<
+  "'va_start' cannot be used outside a function">;
+def err_va_start_fixed_function : Error<
   "'va_start' used in function with fixed args">;
 def err_va_start_used_in_wrong_abi_function : Error<
   "'va_start' used in %select{System V|Win64}0 ABI function">;
@@ -8297,6 +8305,8 @@ def err_sampler_argument_required : Erro
   "sampler_t variable required - got %0">;
 def err_wrong_sampler_addressspace: Error<
   "sampler type cannot be used with the __local and __global address space qualifiers">;
+def err_opencl_nonconst_global_sampler : Error<
+  "global sampler requires a const or constant address space qualifier">;
 def err_opencl_cast_non_zero_to_event_t : Error<
   "cannot cast non-zero value '%0' to 'event_t'">;
 def err_opencl_global_invalid_addr_space : Error<
@@ -8971,6 +8981,9 @@ def warn_nullability_lost : Warning<
   "implicit conversion from nullable pointer %0 to non-nullable pointer "
   "type %1">,
   InGroup, DefaultIgnore;
+def warn_zero_as_null_pointer_constant : Warning<
+  "zero as null pointer constant">,
+  InGroup>, DefaultIgnore;
 
 def err_nullability_cs_multilevel : Error<
   "nullability keyword %0 cannot be applied to multi-level pointer type %1">;

Modified: vendor/clang/dist/include/clang/Driver/CC1Options.td
==============================================================================
--- vendor/clang/dist/include/clang/Driver/CC1Options.td	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Driver/CC1Options.td	Mon May  8 17:13:11 2017	(r317951)
@@ -297,6 +297,9 @@ def fsanitize_coverage_trace_pc
 def fsanitize_coverage_trace_pc_guard
     : Flag<["-"], "fsanitize-coverage-trace-pc-guard">,
       HelpText<"Enable PC tracing with guard in sanitizer coverage">;
+def fsanitize_coverage_no_prune
+    : Flag<["-"], "fsanitize-coverage-no-prune">,
+      HelpText<"Disable coverage pruning (i.e. instrument all blocks/edges)">;
 def fprofile_instrument_EQ : Joined<["-"], "fprofile-instrument=">,
     HelpText<"Enable PGO instrumentation. The accepted value is clang, llvm, "
              "or none">;

Modified: vendor/clang/dist/include/clang/Driver/Distro.h
==============================================================================
--- vendor/clang/dist/include/clang/Driver/Distro.h	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Driver/Distro.h	Mon May  8 17:13:11 2017	(r317951)
@@ -57,6 +57,7 @@ public:
     UbuntuXenial,
     UbuntuYakkety,
     UbuntuZesty,
+    UbuntuArtful,
     UnknownDistro
   };
 
@@ -110,9 +111,9 @@ public:
   }
 
   bool IsUbuntu() const {
-    return DistroVal >= UbuntuHardy && DistroVal <= UbuntuZesty;
+    return DistroVal >= UbuntuHardy && DistroVal <= UbuntuArtful;
   }
- 
+
   /// @}
 };
 

Modified: vendor/clang/dist/include/clang/Driver/Multilib.h
==============================================================================
--- vendor/clang/dist/include/clang/Driver/Multilib.h	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Driver/Multilib.h	Mon May  8 17:13:11 2017	(r317951)
@@ -70,13 +70,21 @@ public:
   /// All elements begin with either '+' or '-'
   const flags_list &flags() const { return Flags; }
   flags_list &flags() { return Flags; }
+
   /// Add a flag to the flags list
+  /// \p Flag must be a flag accepted by the driver with its leading '-' removed,
+  ///     and replaced with either:
+  ///       '-' which contraindicates using this multilib with that flag
+  ///     or:
+  ///       '+' which promotes using this multilib in the presence of that flag
+  ///     otherwise '-print-multi-lib' will not emit them correctly.
   Multilib &flag(StringRef F) {
     assert(F.front() == '+' || F.front() == '-');
     Flags.push_back(F);
     return *this;
   }
 
+  LLVM_DUMP_METHOD void dump() const;
   /// \brief print summary of the Multilib
   void print(raw_ostream &OS) const;
 
@@ -150,6 +158,7 @@ public:
 
   unsigned size() const { return Multilibs.size(); }
 
+  LLVM_DUMP_METHOD void dump() const;
   void print(raw_ostream &OS) const;
 
   MultilibSet &setIncludeDirsCallback(IncludeDirsFunc F) {

Modified: vendor/clang/dist/include/clang/Driver/Options.td
==============================================================================
--- vendor/clang/dist/include/clang/Driver/Options.td	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Driver/Options.td	Mon May  8 17:13:11 2017	(r317951)
@@ -1688,6 +1688,8 @@ def mllvm : Separate<["-"], "mllvm">, Fl
   HelpText<"Additional arguments to forward to LLVM's option processing">;
 def mmacosx_version_min_EQ : Joined<["-"], "mmacosx-version-min=">,
   Group, HelpText<"Set Mac OS X deployment target">;
+def mmacos_version_min_EQ : Joined<["-"], "mmacos-version-min=">,
+  Group, Alias;
 def mms_bitfields : Flag<["-"], "mms-bitfields">, Group, Flags<[CC1Option]>,
   HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard">;
 def mno_ms_bitfields : Flag<["-"], "mno-ms-bitfields">, Group,
@@ -1750,6 +1752,7 @@ def mno_bmi : Flag<["-"], "mno-bmi">, Gr
 def mno_bmi2 : Flag<["-"], "mno-bmi2">, Group;
 def mno_popcnt : Flag<["-"], "mno-popcnt">, Group;
 def mno_tbm : Flag<["-"], "mno-tbm">, Group;
+def mno_lwp : Flag<["-"], "mno-lwp">, Group;
 def mno_fma4 : Flag<["-"], "mno-fma4">, Group;
 def mno_fma : Flag<["-"], "mno-fma">, Group;
 def mno_xop : Flag<["-"], "mno-xop">, Group;
@@ -1949,6 +1952,7 @@ def mbmi : Flag<["-"], "mbmi">, Group, Group;
 def mpopcnt : Flag<["-"], "mpopcnt">, Group;
 def mtbm : Flag<["-"], "mtbm">, Group;
+def mlwp : Flag<["-"], "mlwp">, Group;
 def mfma4 : Flag<["-"], "mfma4">, Group;
 def mfma : Flag<["-"], "mfma">, Group;
 def mxop : Flag<["-"], "mxop">, Group;

Modified: vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def
==============================================================================
--- vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def	Mon May  8 17:13:11 2017	(r317951)
@@ -160,6 +160,7 @@ CODEGENOPT(SanitizeCoverageTracePC, 1, 0
                                           ///< in sanitizer coverage.
 CODEGENOPT(SanitizeCoverageTracePCGuard, 1, 0) ///< Enable PC tracing with guard
                                                ///< in sanitizer coverage.
+CODEGENOPT(SanitizeCoverageNoPrune, 1, 0) ///< Disable coverage pruning.
 CODEGENOPT(SanitizeStats     , 1, 0) ///< Collect statistics for sanitizers.
 CODEGENOPT(SimplifyLibCalls  , 1, 1) ///< Set when -fbuiltin is enabled.
 CODEGENOPT(SoftFloat         , 1, 0) ///< -soft-float.

Modified: vendor/clang/dist/include/clang/Frontend/FrontendAction.h
==============================================================================
--- vendor/clang/dist/include/clang/Frontend/FrontendAction.h	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Frontend/FrontendAction.h	Mon May  8 17:13:11 2017	(r317951)
@@ -146,6 +146,8 @@ public:
     return *CurrentASTUnit;
   }
 
+  Module *getCurrentModule() const;
+
   std::unique_ptr takeCurrentASTUnit() {
     return std::move(CurrentASTUnit);
   }

Modified: vendor/clang/dist/include/clang/Lex/HeaderSearch.h
==============================================================================
--- vendor/clang/dist/include/clang/Lex/HeaderSearch.h	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Lex/HeaderSearch.h	Mon May  8 17:13:11 2017	(r317951)
@@ -538,9 +538,15 @@ public:
   ///
   /// \param File The module map file.
   /// \param IsSystem Whether this file is in a system header directory.
+  /// \param ID If the module map file is already mapped (perhaps as part of
+  ///        processing a preprocessed module), the ID of the file.
+  /// \param Offset [inout] An offset within ID to start parsing. On exit,
+  ///        filled by the end of the parsed contents (either EOF or the
+  ///        location of an end-of-module-map pragma).
   ///
   /// \returns true if an error occurred, false otherwise.
-  bool loadModuleMapFile(const FileEntry *File, bool IsSystem);
+  bool loadModuleMapFile(const FileEntry *File, bool IsSystem,
+                         FileID ID = FileID(), unsigned *Offset = nullptr);
 
   /// \brief Collect the set of all known, top-level modules.
   ///
@@ -686,7 +692,9 @@ private:
 
   LoadModuleMapResult loadModuleMapFileImpl(const FileEntry *File,
                                             bool IsSystem,
-                                            const DirectoryEntry *Dir);
+                                            const DirectoryEntry *Dir,
+                                            FileID ID = FileID(),
+                                            unsigned *Offset = nullptr);
 
   /// \brief Try to load the module map file in the given directory.
   ///

Modified: vendor/clang/dist/include/clang/Lex/Lexer.h
==============================================================================
--- vendor/clang/dist/include/clang/Lex/Lexer.h	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Lex/Lexer.h	Mon May  8 17:13:11 2017	(r317951)
@@ -478,6 +478,11 @@ public:
     return getCharAndSizeSlowNoWarn(Ptr, Size, LangOpts);
   }
 
+  /// Returns the leading whitespace for line that corresponds to the given
+  /// location \p Loc.
+  static StringRef getIndentationForLine(SourceLocation Loc,
+                                         const SourceManager &SM);
+
   //===--------------------------------------------------------------------===//
   // Internal implementation interfaces.
 private:

Modified: vendor/clang/dist/include/clang/Lex/ModuleMap.h
==============================================================================
--- vendor/clang/dist/include/clang/Lex/ModuleMap.h	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Lex/ModuleMap.h	Mon May  8 17:13:11 2017	(r317951)
@@ -546,14 +546,20 @@ public:
   /// \param HomeDir The directory in which relative paths within this module
   ///        map file will be resolved.
   ///
+  /// \param ID The FileID of the file to process, if we've already entered it.
+  ///
+  /// \param Offset [inout] On input the offset at which to start parsing. On
+  ///        output, the offset at which the module map terminated.
+  ///
   /// \param ExternModuleLoc The location of the "extern module" declaration
   ///        that caused us to load this module map file, if any.
   ///
   /// \returns true if an error occurred, false otherwise.
   bool parseModuleMapFile(const FileEntry *File, bool IsSystem,
-                          const DirectoryEntry *HomeDir,
+                          const DirectoryEntry *HomeDir, FileID ID = FileID(),
+                          unsigned *Offset = nullptr,
                           SourceLocation ExternModuleLoc = SourceLocation());
-    
+
   /// \brief Dump the contents of the module map, for debugging purposes.
   void dump();
   

Modified: vendor/clang/dist/include/clang/Lex/Preprocessor.h
==============================================================================
--- vendor/clang/dist/include/clang/Lex/Preprocessor.h	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Lex/Preprocessor.h	Mon May  8 17:13:11 2017	(r317951)
@@ -324,7 +324,7 @@ class Preprocessor {
 
   /// \brief If the current lexer is for a submodule that is being built, this
   /// is that submodule.
-  Module *CurSubmodule;
+  Module *CurLexerSubmodule;
 
   /// \brief Keeps track of the stack of files currently
   /// \#included, and macros currently being expanded from, not counting
@@ -507,16 +507,19 @@ class Preprocessor {
 
   /// \brief Information about a submodule that we're currently building.
   struct BuildingSubmoduleInfo {
-    BuildingSubmoduleInfo(Module *M, SourceLocation ImportLoc,
+    BuildingSubmoduleInfo(Module *M, SourceLocation ImportLoc, bool IsPragma,
                           SubmoduleState *OuterSubmoduleState,
                           unsigned OuterPendingModuleMacroNames)
-        : M(M), ImportLoc(ImportLoc), OuterSubmoduleState(OuterSubmoduleState),
+        : M(M), ImportLoc(ImportLoc), IsPragma(IsPragma),
+          OuterSubmoduleState(OuterSubmoduleState),
           OuterPendingModuleMacroNames(OuterPendingModuleMacroNames) {}
 
     /// The module that we are building.
     Module *M;
     /// The location at which the module was included.
     SourceLocation ImportLoc;
+    /// Whether we entered this submodule via a pragma.
+    bool IsPragma;
     /// The previous SubmoduleState.
     SubmoduleState *OuterSubmoduleState;
     /// The number of pending module macro names when we started building this.
@@ -773,8 +776,9 @@ public:
   /// expansions going on at the time.
   PreprocessorLexer *getCurrentFileLexer() const;
 
-  /// \brief Return the submodule owning the file being lexed.
-  Module *getCurrentSubmodule() const { return CurSubmodule; }
+  /// \brief Return the submodule owning the file being lexed. This may not be
+  /// the current module if we have changed modules since entering the file.
+  Module *getCurrentLexerSubmodule() const { return CurLexerSubmodule; }
 
   /// \brief Returns the FileID for the preprocessor predefines.
   FileID getPredefinesFileID() const { return PredefinesFileID; }
@@ -1726,13 +1730,16 @@ public:
   bool CheckMacroName(Token &MacroNameTok, MacroUse isDefineUndef,
                       bool *ShadowFlag = nullptr);
 
-private:
+  void EnterSubmodule(Module *M, SourceLocation ImportLoc, bool ForPragma);
+  Module *LeaveSubmodule(bool ForPragma);
 
+private:
   void PushIncludeMacroStack() {
     assert(CurLexerKind != CLK_CachingLexer && "cannot push a caching lexer");
-    IncludeMacroStack.emplace_back(
-        CurLexerKind, CurSubmodule, std::move(CurLexer), std::move(CurPTHLexer),
-        CurPPLexer, std::move(CurTokenLexer), CurDirLookup);
+    IncludeMacroStack.emplace_back(CurLexerKind, CurLexerSubmodule,
+                                   std::move(CurLexer), std::move(CurPTHLexer),
+                                   CurPPLexer, std::move(CurTokenLexer),
+                                   CurDirLookup);
     CurPPLexer = nullptr;
   }
 
@@ -1742,16 +1749,13 @@ private:
     CurPPLexer = IncludeMacroStack.back().ThePPLexer;
     CurTokenLexer = std::move(IncludeMacroStack.back().TheTokenLexer);
     CurDirLookup  = IncludeMacroStack.back().TheDirLookup;
-    CurSubmodule = IncludeMacroStack.back().TheSubmodule;
+    CurLexerSubmodule = IncludeMacroStack.back().TheSubmodule;
     CurLexerKind = IncludeMacroStack.back().CurLexerKind;
     IncludeMacroStack.pop_back();
   }
 
   void PropagateLineStartLeadingSpaceInfo(Token &Result);
 
-  void EnterSubmodule(Module *M, SourceLocation ImportLoc);
-  void LeaveSubmodule();
-
   /// Determine whether we need to create module macros for #defines in the
   /// current context.
   bool needModuleMacros() const;
@@ -1967,7 +1971,6 @@ public:
   void HandlePragmaPoison();
   void HandlePragmaSystemHeader(Token &SysHeaderTok);
   void HandlePragmaDependency(Token &DependencyTok);
-  void HandlePragmaModuleImport(Token &Tok);
   void HandlePragmaPushMacro(Token &Tok);
   void HandlePragmaPopMacro(Token &Tok);
   void HandlePragmaIncludeAlias(Token &Tok);

Modified: vendor/clang/dist/include/clang/Sema/Sema.h
==============================================================================
--- vendor/clang/dist/include/clang/Sema/Sema.h	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Sema/Sema.h	Mon May  8 17:13:11 2017	(r317951)
@@ -3766,6 +3766,9 @@ public:
   void diagnoseNullableToNonnullConversion(QualType DstType, QualType SrcType,
                                            SourceLocation Loc);
 
+  /// Warn when implicitly casting 0 to nullptr.
+  void diagnoseZeroToNullptrConversion(CastKind Kind, const Expr *E);
+
   ParsingDeclState PushParsingDeclaration(sema::DelayedDiagnosticPool &pool) {
     return DelayedDiagnostics.push(pool);
   }

Modified: vendor/clang/dist/include/clang/Tooling/FixIt.h
==============================================================================
--- vendor/clang/dist/include/clang/Tooling/FixIt.h	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/include/clang/Tooling/FixIt.h	Mon May  8 17:13:11 2017	(r317951)
@@ -65,6 +65,13 @@ FixItHint createReplacement(const D &Des
                                       getText(Source, Context));
 }
 
+// \brief Returns a FixItHint to replace \p Destination by \p Source.
+template 
+FixItHint createReplacement(const D &Destination, StringRef Source) {
+  return FixItHint::CreateReplacement(internal::getSourceRange(Destination),
+                                      Source);
+}
+
 } // end namespace fixit
 } // end namespace tooling
 } // end namespace clang

Modified: vendor/clang/dist/lib/ASTMatchers/Dynamic/Registry.cpp
==============================================================================
--- vendor/clang/dist/lib/ASTMatchers/Dynamic/Registry.cpp	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/lib/ASTMatchers/Dynamic/Registry.cpp	Mon May  8 17:13:11 2017	(r317951)
@@ -153,6 +153,7 @@ RegistryMaps::RegistryMaps() {
   REGISTER_MATCHER(cxxRecordDecl);
   REGISTER_MATCHER(cxxReinterpretCastExpr);
   REGISTER_MATCHER(cxxStaticCastExpr);
+  REGISTER_MATCHER(cxxStdInitializerListExpr);
   REGISTER_MATCHER(cxxTemporaryObjectExpr);
   REGISTER_MATCHER(cxxThisExpr);
   REGISTER_MATCHER(cxxThrowExpr);

Modified: vendor/clang/dist/lib/Basic/Diagnostic.cpp
==============================================================================
--- vendor/clang/dist/lib/Basic/Diagnostic.cpp	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/lib/Basic/Diagnostic.cpp	Mon May  8 17:13:11 2017	(r317951)
@@ -146,10 +146,9 @@ void DiagnosticsEngine::SetDelayedDiagno
 }
 
 void DiagnosticsEngine::ReportDelayed() {
-  Report(DelayedDiagID) << DelayedDiagArg1 << DelayedDiagArg2;
+  unsigned ID = DelayedDiagID;
   DelayedDiagID = 0;
-  DelayedDiagArg1.clear();
-  DelayedDiagArg2.clear();
+  Report(ID) << DelayedDiagArg1 << DelayedDiagArg2;
 }
 
 void DiagnosticsEngine::DiagStateMap::appendFirst(
@@ -420,11 +419,10 @@ bool DiagnosticsEngine::EmitCurrentDiagn
   }
 
   // Clear out the current diagnostic object.
-  unsigned DiagID = CurDiagID;
   Clear();
 
   // If there was a delayed diagnostic, emit it now.
-  if (!Force && DelayedDiagID && DelayedDiagID != DiagID)
+  if (!Force && DelayedDiagID)
     ReportDelayed();
 
   return Emitted;

Modified: vendor/clang/dist/lib/Basic/DiagnosticIDs.cpp
==============================================================================
--- vendor/clang/dist/lib/Basic/DiagnosticIDs.cpp	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/lib/Basic/DiagnosticIDs.cpp	Mon May  8 17:13:11 2017	(r317951)
@@ -666,6 +666,10 @@ bool DiagnosticIDs::ProcessDiag(Diagnost
     }
   }
 
+  // Make sure we set FatalErrorOccurred to ensure that the notes from the
+  // diagnostic that caused `fatal_too_many_errors` won't be emitted.
+  if (Diag.CurDiagID == diag::fatal_too_many_errors)
+    Diag.FatalErrorOccurred = true;
   // Finally, report it.
   EmitDiag(Diag, DiagLevel);
   return true;

Modified: vendor/clang/dist/lib/Basic/Targets.cpp
==============================================================================
--- vendor/clang/dist/lib/Basic/Targets.cpp	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/lib/Basic/Targets.cpp	Mon May  8 17:13:11 2017	(r317951)
@@ -2591,6 +2591,7 @@ class X86TargetInfo : public TargetInfo 
   bool HasRDSEED = false;
   bool HasADX = false;
   bool HasTBM = false;
+  bool HasLWP = false;
   bool HasFMA = false;
   bool HasF16C = false;
   bool HasAVX512CD = false;
@@ -3363,6 +3364,7 @@ bool X86TargetInfo::initFeatureMap(
   case CK_BDVER1:
     // xop implies avx, sse4a and fma4.
     setFeatureEnabledImpl(Features, "xop", true);
+    setFeatureEnabledImpl(Features, "lwp", true);
     setFeatureEnabledImpl(Features, "lzcnt", true);
     setFeatureEnabledImpl(Features, "aes", true);
     setFeatureEnabledImpl(Features, "pclmul", true);
@@ -3634,6 +3636,8 @@ bool X86TargetInfo::handleTargetFeatures
       HasADX = true;
     } else if (Feature == "+tbm") {
       HasTBM = true;
+    } else if (Feature == "+lwp") {
+      HasLWP = true;
     } else if (Feature == "+fma") {
       HasFMA = true;
     } else if (Feature == "+f16c") {
@@ -3949,6 +3953,9 @@ void X86TargetInfo::getTargetDefines(con
   if (HasTBM)
     Builder.defineMacro("__TBM__");
 
+  if (HasLWP)
+    Builder.defineMacro("__LWP__");
+
   if (HasMWAITX)
     Builder.defineMacro("__MWAITX__");
 
@@ -4132,6 +4139,7 @@ bool X86TargetInfo::hasFeature(StringRef
       .Case("sse4.2", SSELevel >= SSE42)
       .Case("sse4a", XOPLevel >= SSE4A)
       .Case("tbm", HasTBM)
+      .Case("lwp", HasLWP)
       .Case("x86", true)
       .Case("x86_32", getTriple().getArch() == llvm::Triple::x86)
       .Case("x86_64", getTriple().getArch() == llvm::Triple::x86_64)
@@ -5443,6 +5451,7 @@ public:
         .Case("softfloat", SoftFloat)
         .Case("thumb", isThumb())
         .Case("neon", (FPU & NeonFPU) && !SoftFloat)
+        .Case("vfp", FPU && !SoftFloat)
         .Case("hwdiv", HWDiv & HWDivThumb)
         .Case("hwdiv-arm", HWDiv & HWDivARM)
         .Default(false);

Modified: vendor/clang/dist/lib/CodeGen/BackendUtil.cpp
==============================================================================
--- vendor/clang/dist/lib/CodeGen/BackendUtil.cpp	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/lib/CodeGen/BackendUtil.cpp	Mon May  8 17:13:11 2017	(r317951)
@@ -185,6 +185,7 @@ static void addSanitizerCoveragePass(con
   Opts.Use8bitCounters = CGOpts.SanitizeCoverage8bitCounters;
   Opts.TracePC = CGOpts.SanitizeCoverageTracePC;
   Opts.TracePCGuard = CGOpts.SanitizeCoverageTracePCGuard;
+  Opts.NoPrune = CGOpts.SanitizeCoverageNoPrune;
   PM.add(createSanitizerCoverageModulePass(Opts));
 }
 
@@ -974,10 +975,14 @@ static void runThinLTOBackend(ModuleSumm
   // via a WriteIndexesThinBackend.
   FunctionImporter::ImportMapTy ImportList;
   for (auto &GlobalList : *CombinedIndex) {
+    // Ignore entries for undefined references.
+    if (GlobalList.second.SummaryList.empty())
+      continue;
+
     auto GUID = GlobalList.first;
-    assert(GlobalList.second.size() == 1 &&
+    assert(GlobalList.second.SummaryList.size() == 1 &&
            "Expected individual combined index to have one summary per GUID");
-    auto &Summary = GlobalList.second[0];
+    auto &Summary = GlobalList.second.SummaryList[0];
     // Skip the summaries for the importing module. These are included to
     // e.g. record required linkage changes.
     if (Summary->modulePath() == M->getModuleIdentifier())

Modified: vendor/clang/dist/lib/CodeGen/CGBlocks.cpp
==============================================================================
--- vendor/clang/dist/lib/CodeGen/CGBlocks.cpp	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/lib/CodeGen/CGBlocks.cpp	Mon May  8 17:13:11 2017	(r317951)
@@ -623,9 +623,13 @@ static void enterBlockScope(CodeGenFunct
     // For const-qualified captures, emit clang.arc.use to ensure the captured
     // object doesn't get released while we are still depending on its validity
     // within the block.
-    if (VT.isConstQualified() && VT.getObjCLifetime() == Qualifiers::OCL_Strong)
+    if (VT.isConstQualified() &&
+        VT.getObjCLifetime() == Qualifiers::OCL_Strong &&
+        CGF.CGM.getCodeGenOpts().OptimizationLevel != 0) {
+      assert(CGF.CGM.getLangOpts().ObjCAutoRefCount &&
+             "expected ObjC ARC to be enabled");
       destroyer = CodeGenFunction::emitARCIntrinsicUse;
-    else if (dtorKind == QualType::DK_objc_strong_lifetime) {
+    } else if (dtorKind == QualType::DK_objc_strong_lifetime) {
       destroyer = CodeGenFunction::destroyARCStrongImprecise;
     } else {
       destroyer = CGF.getDestroyer(dtorKind);

Modified: vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp
==============================================================================
--- vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp	Mon May  8 17:13:11 2017	(r317951)
@@ -2751,7 +2751,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(
 
     // Push a clang.arc.use cleanup for each object in RetainableOperands. The
     // cleanup will cause the use to appear after the final log call, keeping
-    // the object valid while it’s held in the log buffer.  Note that if there’s
+    // the object valid while it's held in the log buffer.  Note that if there's
     // a release cleanup on the object, it will already be active; since
     // cleanups are emitted in reverse order, the use will occur before the
     // object is released.

Modified: vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp
==============================================================================
--- vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp	Mon May  8 17:13:05 2017	(r317950)
+++ vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp	Mon May  8 17:13:11 2017	(r317951)
@@ -658,34 +658,42 @@ void CodeGenFunction::EmitOpenCLKernelMe
   GenOpenCLArgMetadata(FD, Fn, CGM, Context, Builder, getContext());
 
   if (const VecTypeHintAttr *A = FD->getAttr()) {
-    QualType hintQTy = A->getTypeHint();
-    const ExtVectorType *hintEltQTy = hintQTy->getAs();
-    bool isSignedInteger =
-        hintQTy->isSignedIntegerType() ||
-        (hintEltQTy && hintEltQTy->getElementType()->isSignedIntegerType());
-    llvm::Metadata *attrMDArgs[] = {
+    QualType HintQTy = A->getTypeHint();
+    const ExtVectorType *HintEltQTy = HintQTy->getAs();
+    bool IsSignedInteger =
+        HintQTy->isSignedIntegerType() ||
+        (HintEltQTy && HintEltQTy->getElementType()->isSignedIntegerType());
+    llvm::Metadata *AttrMDArgs[] = {
         llvm::ConstantAsMetadata::get(llvm::UndefValue::get(
             CGM.getTypes().ConvertType(A->getTypeHint()))),
         llvm::ConstantAsMetadata::get(llvm::ConstantInt::get(
             llvm::IntegerType::get(Context, 32),
-            llvm::APInt(32, (uint64_t)(isSignedInteger ? 1 : 0))))};
-    Fn->setMetadata("vec_type_hint", llvm::MDNode::get(Context, attrMDArgs));
+            llvm::APInt(32, (uint64_t)(IsSignedInteger ? 1 : 0))))};
+    Fn->setMetadata("vec_type_hint", llvm::MDNode::get(Context, AttrMDArgs));
   }
 
   if (const WorkGroupSizeHintAttr *A = FD->getAttr()) {
-    llvm::Metadata *attrMDArgs[] = {
+    llvm::Metadata *AttrMDArgs[] = {
         llvm::ConstantAsMetadata::get(Builder.getInt32(A->getXDim())),
         llvm::ConstantAsMetadata::get(Builder.getInt32(A->getYDim())),
         llvm::ConstantAsMetadata::get(Builder.getInt32(A->getZDim()))};
-    Fn->setMetadata("work_group_size_hint", llvm::MDNode::get(Context, attrMDArgs));
+    Fn->setMetadata("work_group_size_hint", llvm::MDNode::get(Context, AttrMDArgs));
   }
 
   if (const ReqdWorkGroupSizeAttr *A = FD->getAttr()) {
-    llvm::Metadata *attrMDArgs[] = {
+    llvm::Metadata *AttrMDArgs[] = {
         llvm::ConstantAsMetadata::get(Builder.getInt32(A->getXDim())),
         llvm::ConstantAsMetadata::get(Builder.getInt32(A->getYDim())),
         llvm::ConstantAsMetadata::get(Builder.getInt32(A->getZDim()))};
-    Fn->setMetadata("reqd_work_group_size", llvm::MDNode::get(Context, attrMDArgs));
+    Fn->setMetadata("reqd_work_group_size", llvm::MDNode::get(Context, AttrMDArgs));
+  }
+
+  if (const OpenCLIntelReqdSubGroupSizeAttr *A =
+          FD->getAttr()) {
+    llvm::Metadata *AttrMDArgs[] = {
+        llvm::ConstantAsMetadata::get(Builder.getInt32(A->getSubGroupSize()))};
+    Fn->setMetadata("intel_reqd_sub_group_size",
+                    llvm::MDNode::get(Context, AttrMDArgs));
   }
 }
 

Modified: vendor/clang/dist/lib/CodeGen/CodeGenFunction.h
==============================================================================
--- vendor/clang/dist/lib/CodeGen/CodeGenFunction.h	Mon May  8 17:13:05 2017	(r317950)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-vendor@freebsd.org  Mon May  8 17:13:26 2017
Return-Path: 
Delivered-To: svn-src-vendor@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 152F5D635B6;
 Mon,  8 May 2017 17:13:26 +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 B2862995;
 Mon,  8 May 2017 17:13:25 +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 v48HDO5b042799;
 Mon, 8 May 2017 17:13:24 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v48HDMAm042774;
 Mon, 8 May 2017 17:13:22 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201705081713.v48HDMAm042774@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric 
Date: Mon, 8 May 2017 17:13:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r317953 - in vendor/compiler-rt/dist: include/xray
 lib/asan lib/builtins lib/cfi lib/scudo lib/ubsan lib/xray
 test/asan/TestCases/Linux test/builtins/Unit
 test/sanitizer_common/TestCase...
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-vendor@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 May 2017 17:13:26 -0000

Author: dim
Date: Mon May  8 17:13:22 2017
New Revision: 317953
URL: https://svnweb.freebsd.org/changeset/base/317953

Log:
  Vendor import of compiler-rt trunk r302418:
  https://llvm.org/svn/llvm-project/compiler-rt/trunk@302418

Added:
  vendor/compiler-rt/dist/lib/scudo/scudo_tls_android.cpp   (contents, props changed)
  vendor/compiler-rt/dist/lib/scudo/scudo_tls_android.inc   (contents, props changed)
  vendor/compiler-rt/dist/lib/scudo/scudo_tls_context_android.inc   (contents, props changed)
  vendor/compiler-rt/dist/lib/scudo/scudo_tls_context_linux.inc   (contents, props changed)
  vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.inc   (contents, props changed)
  vendor/compiler-rt/dist/lib/ubsan/ubsan_diag_standalone.cc   (contents, props changed)
  vendor/compiler-rt/dist/test/asan/TestCases/Linux/longjmp_chk.c   (contents, props changed)
  vendor/compiler-rt/dist/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cc   (contents, props changed)
  vendor/compiler-rt/dist/test/ubsan/TestCases/Misc/Linux/print_stack_trace.cc   (contents, props changed)
  vendor/compiler-rt/dist/test/ubsan/TestCases/Misc/bool.m
  vendor/compiler-rt/dist/test/xray/TestCases/Linux/coverage-sample.cc   (contents, props changed)
  vendor/compiler-rt/dist/test/xray/TestCases/Linux/func-id-utils.cc   (contents, props changed)
Deleted:
  vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.h
Modified:
  vendor/compiler-rt/dist/include/xray/xray_interface.h
  vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc
  vendor/compiler-rt/dist/lib/asan/asan_interceptors.h
  vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt
  vendor/compiler-rt/dist/lib/builtins/emutls.c
  vendor/compiler-rt/dist/lib/builtins/int_types.h
  vendor/compiler-rt/dist/lib/cfi/cfi_blacklist.txt
  vendor/compiler-rt/dist/lib/scudo/CMakeLists.txt
  vendor/compiler-rt/dist/lib/scudo/scudo_allocator.cpp
  vendor/compiler-rt/dist/lib/scudo/scudo_allocator.h
  vendor/compiler-rt/dist/lib/scudo/scudo_tls.h
  vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.cpp
  vendor/compiler-rt/dist/lib/ubsan/CMakeLists.txt
  vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc
  vendor/compiler-rt/dist/lib/xray/xray_init.cc
  vendor/compiler-rt/dist/lib/xray/xray_interface.cc
  vendor/compiler-rt/dist/lib/xray/xray_interface_internal.h
  vendor/compiler-rt/dist/test/builtins/Unit/divxc3_test.c
  vendor/compiler-rt/dist/test/builtins/Unit/fixunstfti_test.c
  vendor/compiler-rt/dist/test/builtins/Unit/fixunsxfti_test.c
  vendor/compiler-rt/dist/test/builtins/Unit/fixxfti_test.c
  vendor/compiler-rt/dist/test/builtins/Unit/floattixf_test.c
  vendor/compiler-rt/dist/test/builtins/Unit/floatuntixf_test.c
  vendor/compiler-rt/dist/test/builtins/Unit/mulxc3_test.c

Modified: vendor/compiler-rt/dist/include/xray/xray_interface.h
==============================================================================
--- vendor/compiler-rt/dist/include/xray/xray_interface.h	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/include/xray/xray_interface.h	Mon May  8 17:13:22 2017	(r317953)
@@ -15,10 +15,11 @@
 #define XRAY_XRAY_INTERFACE_H
 
 #include 
+#include 
 
 extern "C" {
 
-// Synchronize this with AsmPrinter::SledKind in LLVM.
+/// Synchronize this with AsmPrinter::SledKind in LLVM.
 enum XRayEntryType {
   ENTRY = 0,
   EXIT = 1,
@@ -26,32 +27,43 @@ enum XRayEntryType {
   LOG_ARGS_ENTRY = 3,
 };
 
-// Provide a function to invoke for when instrumentation points are hit. This is
-// a user-visible control surface that overrides the default implementation. The
-// function provided should take the following arguments:
-//
-//   - function id: an identifier that indicates the id of a function; this id
-//                  is generated by xray; the mapping between the function id
-//                  and the actual function pointer is available through
-//                  __xray_table.
-//   - entry type: identifies what kind of instrumentation point was encountered
-//                 (function entry, function exit, etc.). See the enum
-//                 XRayEntryType for more details.
-//
-// The user handler must handle correctly spurious calls after this handler is
-// removed or replaced with another handler, because it would be too costly for
-// XRay runtime to avoid spurious calls.
-// To prevent circular calling, the handler function itself and all its
-// direct&indirect callees must not be instrumented with XRay, which can be
-// achieved by marking them all with: __attribute__((xray_never_instrument))
-//
-// Returns 1 on success, 0 on error.
+/// Provide a function to invoke for when instrumentation points are hit. This
+/// is a user-visible control surface that overrides the default implementation.
+/// The function provided should take the following arguments:
+///
+///   - function id: an identifier that indicates the id of a function; this id
+///                  is generated by xray; the mapping between the function id
+///                  and the actual function pointer is available through
+///                  __xray_table.
+///   - entry type: identifies what kind of instrumentation point was
+///                 encountered (function entry, function exit, etc.). See the
+///                 enum XRayEntryType for more details.
+///
+/// The user handler must handle correctly spurious calls after this handler is
+/// removed or replaced with another handler, because it would be too costly for
+/// XRay runtime to avoid spurious calls.
+/// To prevent circular calling, the handler function itself and all its
+/// direct&indirect callees must not be instrumented with XRay, which can be
+/// achieved by marking them all with: __attribute__((xray_never_instrument))
+///
+/// Returns 1 on success, 0 on error.
 extern int __xray_set_handler(void (*entry)(int32_t, XRayEntryType));
 
-// This removes whatever the currently provided handler is. Returns 1 on
-// success, 0 on error.
+/// This removes whatever the currently provided handler is. Returns 1 on
+/// success, 0 on error.
 extern int __xray_remove_handler();
 
+/// Use XRay to log the first argument of each (instrumented) function call.
+/// When this function exits, all threads will have observed the effect and
+/// start logging their subsequent affected function calls (if patched).
+///
+/// Returns 1 on success, 0 on error.
+extern int __xray_set_handler_arg1(void (*)(int32_t, XRayEntryType, uint64_t));
+
+/// Disables the XRay handler used to log first arguments of function calls.
+/// Returns 1 on success, 0 on error.
+extern int __xray_remove_handler_arg1();
+
 enum XRayPatchingStatus {
   NOT_INITIALIZED = 0,
   SUCCESS = 1,
@@ -59,24 +71,31 @@ enum XRayPatchingStatus {
   FAILED = 3,
 };
 
-// This tells XRay to patch the instrumentation points. See XRayPatchingStatus
-// for possible result values.
+/// This tells XRay to patch the instrumentation points. See XRayPatchingStatus
+/// for possible result values.
 extern XRayPatchingStatus __xray_patch();
 
-// Reverses the effect of __xray_patch(). See XRayPatchingStatus for possible
-// result values.
+/// Reverses the effect of __xray_patch(). See XRayPatchingStatus for possible
+/// result values.
 extern XRayPatchingStatus __xray_unpatch();
 
-// Use XRay to log the first argument of each (instrumented) function call.
-// When this function exits, all threads will have observed the effect and
-// start logging their subsequent affected function calls (if patched).
-//
-// Returns 1 on success, 0 on error.
-extern int __xray_set_handler_arg1(void (*)(int32_t, XRayEntryType, uint64_t));
+/// This patches a specific function id. See XRayPatchingStatus for possible
+/// result values.
+extern XRayPatchingStatus __xray_patch_function(int32_t FuncId);
+
+/// This unpatches a specific function id. See XRayPatchingStatus for possible
+/// result values.
+extern XRayPatchingStatus __xray_unpatch_function(int32_t FuncId);
+
+/// This function returns the address of the function provided a valid function
+/// id. We return 0 if we encounter any error, even if 0 may be a valid function
+/// address.
+extern uintptr_t __xray_function_address(int32_t FuncId);
+
+/// This function returns the maximum valid function id. Returns 0 if we
+/// encounter errors (when there are no instrumented functions, etc.).
+extern size_t __xray_max_function_id();
 
-// Disables the XRay handler used to log first arguments of function calls.
-// Returns 1 on success, 0 on error.
-extern int __xray_remove_handler_arg1();
 }
 
 #endif

Modified: vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc
==============================================================================
--- vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc	Mon May  8 17:13:22 2017	(r317953)
@@ -443,6 +443,13 @@ INTERCEPTOR(void, _longjmp, void *env, i
 }
 #endif
 
+#if ASAN_INTERCEPT___LONGJMP_CHK
+INTERCEPTOR(void, __longjmp_chk, void *env, int val) {
+  __asan_handle_no_return();
+  REAL(__longjmp_chk)(env, val);
+}
+#endif
+
 #if ASAN_INTERCEPT_SIGLONGJMP
 INTERCEPTOR(void, siglongjmp, void *env, int val) {
   __asan_handle_no_return();
@@ -758,6 +765,9 @@ void InitializeAsanInterceptors() {
 #if ASAN_INTERCEPT__LONGJMP
   ASAN_INTERCEPT_FUNC(_longjmp);
 #endif
+#if ASAN_INTERCEPT___LONGJMP_CHK
+  ASAN_INTERCEPT_FUNC(__longjmp_chk);
+#endif
 #if ASAN_INTERCEPT_SIGLONGJMP
   ASAN_INTERCEPT_FUNC(siglongjmp);
 #endif

Modified: vendor/compiler-rt/dist/lib/asan/asan_interceptors.h
==============================================================================
--- vendor/compiler-rt/dist/lib/asan/asan_interceptors.h	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/asan/asan_interceptors.h	Mon May  8 17:13:22 2017	(r317953)
@@ -58,6 +58,12 @@
 # define ASAN_INTERCEPT_SIGLONGJMP 0
 #endif
 
+#if SANITIZER_LINUX && !SANITIZER_ANDROID
+# define ASAN_INTERCEPT___LONGJMP_CHK 1
+#else
+# define ASAN_INTERCEPT___LONGJMP_CHK 0
+#endif
+
 // Android bug: https://code.google.com/p/android/issues/detail?id=61799
 #if ASAN_HAS_EXCEPTIONS && !SANITIZER_WINDOWS && \
     !(SANITIZER_ANDROID && defined(__i386))

Modified: vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt
==============================================================================
--- vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt	Mon May  8 17:13:22 2017	(r317953)
@@ -167,6 +167,26 @@ set(GENERIC_SOURCES
   umodti3.c
   emutls.c)
 
+set(GENERIC_TF_SOURCES
+  comparetf2.c
+  extenddftf2.c
+  extendsftf2.c
+  fixtfdi.c
+  fixtfsi.c
+  fixtfti.c
+  fixunstfdi.c
+  fixunstfsi.c
+  fixunstfti.c
+  floatditf.c
+  floatsitf.c
+  floattitf.c
+  floatunditf.c
+  floatunsitf.c
+  floatuntitf.c
+  multc3.c
+  trunctfdf2.c
+  trunctfsf2.c)
+
 option(COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN
   "Skip the atomic builtin (this may be needed if system headers are unavailable)"
   Off)
@@ -390,7 +410,8 @@ if(MINGW)
       udivmoddi4.c
       udivmodsi4.c
       udivsi3.c
-      umoddi3.c)
+      umoddi3.c
+      emutls.c)
 elseif(NOT WIN32)
   # TODO the EABI sources should only be added to EABI targets
   set(arm_SOURCES
@@ -404,24 +425,7 @@ elseif(NOT WIN32)
 endif()
 
 set(aarch64_SOURCES
-  comparetf2.c
-  extenddftf2.c
-  extendsftf2.c
-  fixtfdi.c
-  fixtfsi.c
-  fixtfti.c
-  fixunstfdi.c
-  fixunstfsi.c
-  fixunstfti.c
-  floatditf.c
-  floatsitf.c
-  floattitf.c
-  floatunditf.c
-  floatunsitf.c
-  floatuntitf.c
-  multc3.c
-  trunctfdf2.c
-  trunctfsf2.c
+  ${GENERIC_TF_SOURCES}
   ${GENERIC_SOURCES})
 
 set(armhf_SOURCES ${arm_SOURCES})
@@ -437,8 +441,10 @@ set(armv7em_SOURCES ${arm_SOURCES})
 
 set(mips_SOURCES ${GENERIC_SOURCES})
 set(mipsel_SOURCES ${mips_SOURCES})
-set(mips64_SOURCES ${mips_SOURCES})
-set(mips64el_SOURCES ${mips_SOURCES})
+set(mips64_SOURCES ${GENERIC_TF_SOURCES}
+                   ${mips_SOURCES})
+set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
+                     ${mips_SOURCES})
 
 set(wasm32_SOURCES ${GENERIC_SOURCES})
 set(wasm64_SOURCES ${GENERIC_SOURCES})

Modified: vendor/compiler-rt/dist/lib/builtins/emutls.c
==============================================================================
--- vendor/compiler-rt/dist/lib/builtins/emutls.c	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/builtins/emutls.c	Mon May  8 17:13:22 2017	(r317953)
@@ -98,7 +98,7 @@ static __inline emutls_address_array* em
 
 #else
 
-#include 
+#include 
 #include 
 #include 
 #include 

Modified: vendor/compiler-rt/dist/lib/builtins/int_types.h
==============================================================================
--- vendor/compiler-rt/dist/lib/builtins/int_types.h	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/builtins/int_types.h	Mon May  8 17:13:22 2017	(r317953)
@@ -60,9 +60,7 @@ typedef union
     }s;
 } udwords;
 
-/* MIPS64 issue: PR 20098 */
-#if (defined(__LP64__) || defined(__wasm__)) && \
-    !(defined(__mips__) && defined(__clang__))
+#if (defined(__LP64__) || defined(__wasm__) || defined(__mips64))
 #define CRT_HAS_128BIT
 #endif
 

Modified: vendor/compiler-rt/dist/lib/cfi/cfi_blacklist.txt
==============================================================================
--- vendor/compiler-rt/dist/lib/cfi/cfi_blacklist.txt	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/cfi/cfi_blacklist.txt	Mon May  8 17:13:22 2017	(r317953)
@@ -24,3 +24,8 @@ fun:_ZNSt3__19addressof*
 # Windows C++ stdlib headers that contain bad unrelated casts.
 src:*xmemory0
 src:*xstddef
+
+# std::_Sp_counted_ptr_inplace::_Sp_counted_ptr_inplace() (libstdc++).
+# This ctor is used by std::make_shared and needs to cast to uninitialized T*
+# in order to call std::allocator_traits::construct.
+fun:_ZNSt23_Sp_counted_ptr_inplace*

Modified: vendor/compiler-rt/dist/lib/scudo/CMakeLists.txt
==============================================================================
--- vendor/compiler-rt/dist/lib/scudo/CMakeLists.txt	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/scudo/CMakeLists.txt	Mon May  8 17:13:22 2017	(r317953)
@@ -14,6 +14,7 @@ set(SCUDO_SOURCES
   scudo_interceptors.cpp
   scudo_new_delete.cpp
   scudo_termination.cpp
+  scudo_tls_android.cpp
   scudo_tls_linux.cpp
   scudo_utils.cpp)
 

Modified: vendor/compiler-rt/dist/lib/scudo/scudo_allocator.cpp
==============================================================================
--- vendor/compiler-rt/dist/lib/scudo/scudo_allocator.cpp	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/scudo/scudo_allocator.cpp	Mon May  8 17:13:22 2017	(r317953)
@@ -368,11 +368,12 @@ struct ScudoAllocator {
     void *Ptr;
     uptr Salt;
     uptr AllocationAlignment = FromPrimary ? MinAlignment : Alignment;
-    ScudoThreadContext *ThreadContext = getThreadContext();
+    ScudoThreadContext *ThreadContext = getThreadContextAndLock();
     if (LIKELY(ThreadContext)) {
       Salt = getPrng(ThreadContext)->getNext();
       Ptr = BackendAllocator.Allocate(getAllocatorCache(ThreadContext),
                                       NeededSize, AllocationAlignment);
+      ThreadContext->unlock();
     } else {
       SpinMutexLock l(&FallbackMutex);
       Salt = FallbackPrng.getNext();
@@ -434,9 +435,10 @@ struct ScudoAllocator {
     if (BypassQuarantine) {
       Chunk->eraseHeader();
       void *Ptr = Chunk->getAllocBeg(Header);
-      ScudoThreadContext *ThreadContext = getThreadContext();
+      ScudoThreadContext *ThreadContext = getThreadContextAndLock();
       if (LIKELY(ThreadContext)) {
         getBackendAllocator().Deallocate(getAllocatorCache(ThreadContext), Ptr);
+        ThreadContext->unlock();
       } else {
         SpinMutexLock Lock(&FallbackMutex);
         getBackendAllocator().Deallocate(&FallbackAllocatorCache, Ptr);
@@ -445,12 +447,13 @@ struct ScudoAllocator {
       UnpackedHeader NewHeader = *Header;
       NewHeader.State = ChunkQuarantine;
       Chunk->compareExchangeHeader(&NewHeader, Header);
-      ScudoThreadContext *ThreadContext = getThreadContext();
+      ScudoThreadContext *ThreadContext = getThreadContextAndLock();
       if (LIKELY(ThreadContext)) {
         AllocatorQuarantine.Put(getQuarantineCache(ThreadContext),
                                 QuarantineCallback(
                                     getAllocatorCache(ThreadContext)),
                                 Chunk, Size);
+        ThreadContext->unlock();
       } else {
         SpinMutexLock l(&FallbackMutex);
         AllocatorQuarantine.Put(&FallbackQuarantineCache,

Modified: vendor/compiler-rt/dist/lib/scudo/scudo_allocator.h
==============================================================================
--- vendor/compiler-rt/dist/lib/scudo/scudo_allocator.h	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/scudo/scudo_allocator.h	Mon May  8 17:13:22 2017	(r317953)
@@ -72,7 +72,13 @@ const uptr AlignedChunkHeaderSize =
 
 #if SANITIZER_CAN_USE_ALLOCATOR64
 const uptr AllocatorSpace = ~0ULL;
-const uptr AllocatorSize = 0x40000000000ULL;  // 4TB.
+# if defined(__aarch64__) && SANITIZER_ANDROID
+const uptr AllocatorSize = 0x4000000000ULL;  // 256G.
+# elif defined(__aarch64__)
+const uptr AllocatorSize = 0x10000000000ULL;  // 1T.
+# else
+const uptr AllocatorSize = 0x40000000000ULL;  // 4T.
+# endif
 typedef DefaultSizeClassMap SizeClassMap;
 struct AP {
   static const uptr kSpaceBeg = AllocatorSpace;

Modified: vendor/compiler-rt/dist/lib/scudo/scudo_tls.h
==============================================================================
--- vendor/compiler-rt/dist/lib/scudo/scudo_tls.h	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/scudo/scudo_tls.h	Mon May  8 17:13:22 2017	(r317953)
@@ -19,10 +19,16 @@
 #include "scudo_allocator.h"
 #include "scudo_utils.h"
 
+#include "sanitizer_common/sanitizer_linux.h"
+#include "sanitizer_common/sanitizer_platform.h"
+
 namespace __scudo {
 
-struct ALIGNED(64) ScudoThreadContext {
- public:
+// Platform specific base thread context definitions.
+#include "scudo_tls_context_android.inc"
+#include "scudo_tls_context_linux.inc"
+
+struct ALIGNED(64) ScudoThreadContext : public ScudoThreadContextPlatform {
   AllocatorCache Cache;
   Xorshift128Plus Prng;
   uptr QuarantineCachePlaceHolder[4];
@@ -32,8 +38,9 @@ struct ALIGNED(64) ScudoThreadContext {
 
 void initThread();
 
-// Fastpath functions are defined in the following platform specific headers.
-#include "scudo_tls_linux.h"
+// Platform specific dastpath functions definitions.
+#include "scudo_tls_android.inc"
+#include "scudo_tls_linux.inc"
 
 }  // namespace __scudo
 

Added: vendor/compiler-rt/dist/lib/scudo/scudo_tls_android.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/lib/scudo/scudo_tls_android.cpp	Mon May  8 17:13:22 2017	(r317953)
@@ -0,0 +1,95 @@
+//===-- scudo_tls_android.cpp -----------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// Scudo thread local structure implementation for Android.
+///
+//===----------------------------------------------------------------------===//
+
+#include "sanitizer_common/sanitizer_platform.h"
+
+#if SANITIZER_LINUX && SANITIZER_ANDROID
+
+#include "scudo_tls.h"
+
+#include 
+
+namespace __scudo {
+
+static pthread_once_t GlobalInitialized = PTHREAD_ONCE_INIT;
+static pthread_key_t PThreadKey;
+
+static atomic_uint32_t ThreadContextCurrentIndex;
+static ScudoThreadContext *ThreadContexts;
+static uptr NumberOfContexts;
+
+// sysconf(_SC_NPROCESSORS_{CONF,ONLN}) cannot be used as they allocate memory.
+static uptr getNumberOfCPUs() {
+  cpu_set_t CPUs;
+  CHECK_EQ(sched_getaffinity(0, sizeof(cpu_set_t), &CPUs), 0);
+  return CPU_COUNT(&CPUs);
+}
+
+static void initOnce() {
+  // Hack: TLS_SLOT_TSAN was introduced in N. To be able to use it on M for
+  // testing, we create an unused key. Since the key_data array follows the tls
+  // array, it basically gives us the extra entry we need.
+  // TODO(kostyak): remove and restrict to N and above.
+  CHECK_EQ(pthread_key_create(&PThreadKey, NULL), 0);
+  initScudo();
+  NumberOfContexts = getNumberOfCPUs();
+  ThreadContexts = reinterpret_cast(
+      MmapOrDie(sizeof(ScudoThreadContext) * NumberOfContexts, __func__));
+  for (int i = 0; i < NumberOfContexts; i++)
+    ThreadContexts[i].init();
+}
+
+void initThread() {
+  pthread_once(&GlobalInitialized, initOnce);
+  // Initial context assignment is done in a plain round-robin fashion.
+  u32 Index = atomic_fetch_add(&ThreadContextCurrentIndex, 1,
+                               memory_order_relaxed);
+  ScudoThreadContext *ThreadContext =
+      &ThreadContexts[Index % NumberOfContexts];
+  *get_android_tls_ptr() = reinterpret_cast(ThreadContext);
+}
+
+ScudoThreadContext *getThreadContextAndLockSlow() {
+  ScudoThreadContext *ThreadContext;
+  // Go through all the contexts and find the first unlocked one. 
+  for (u32 i = 0; i < NumberOfContexts; i++) {
+    ThreadContext = &ThreadContexts[i];
+    if (ThreadContext->tryLock()) {
+      *get_android_tls_ptr() = reinterpret_cast(ThreadContext);
+      return ThreadContext;
+    }
+  }
+  // No luck, find the one with the lowest precedence, and slow lock it.
+  u64 Precedence = UINT64_MAX;
+  for (u32 i = 0; i < NumberOfContexts; i++) {
+    u64 SlowLockPrecedence = ThreadContexts[i].getSlowLockPrecedence();
+    if (SlowLockPrecedence && SlowLockPrecedence < Precedence) {
+      ThreadContext = &ThreadContexts[i];
+      Precedence = SlowLockPrecedence;
+    }
+  }
+  if (LIKELY(Precedence != UINT64_MAX)) {
+    ThreadContext->lock();
+    *get_android_tls_ptr() = reinterpret_cast(ThreadContext);
+    return ThreadContext;
+  }
+  // Last resort (can this happen?), stick with the current one.
+  ThreadContext =
+      reinterpret_cast(*get_android_tls_ptr());
+  ThreadContext->lock();
+  return ThreadContext;
+}
+
+}  // namespace __scudo
+
+#endif  // SANITIZER_LINUX && SANITIZER_ANDROID

Added: vendor/compiler-rt/dist/lib/scudo/scudo_tls_android.inc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/lib/scudo/scudo_tls_android.inc	Mon May  8 17:13:22 2017	(r317953)
@@ -0,0 +1,44 @@
+//===-- scudo_tls_android.inc -----------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// Scudo thread local structure fastpath functions implementation for Android.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef SCUDO_TLS_ANDROID_H_
+#define SCUDO_TLS_ANDROID_H_
+
+#ifndef SCUDO_TLS_H_
+# error "This file must be included inside scudo_tls.h."
+#endif  // SCUDO_TLS_H_
+
+#if SANITIZER_LINUX && SANITIZER_ANDROID
+
+ALWAYS_INLINE void initThreadMaybe() {
+  if (LIKELY(*get_android_tls_ptr()))
+    return;
+  initThread();
+}
+
+ScudoThreadContext *getThreadContextAndLockSlow();
+
+ALWAYS_INLINE ScudoThreadContext *getThreadContextAndLock() {
+  ScudoThreadContext *ThreadContext =
+      reinterpret_cast(*get_android_tls_ptr());
+  CHECK(ThreadContext);
+  // Try to lock the currently associated context.
+  if (ThreadContext->tryLock())
+    return ThreadContext;
+  // If it failed, go the slow path.
+  return getThreadContextAndLockSlow();
+}
+
+#endif  // SANITIZER_LINUX && SANITIZER_ANDROID
+
+#endif  // SCUDO_TLS_ANDROID_H_

Added: vendor/compiler-rt/dist/lib/scudo/scudo_tls_context_android.inc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/lib/scudo/scudo_tls_context_android.inc	Mon May  8 17:13:22 2017	(r317953)
@@ -0,0 +1,54 @@
+//===-- scudo_tls_context_android.inc ---------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// Android specific base thread context definition.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef SCUDO_TLS_CONTEXT_ANDROID_INC_
+#define SCUDO_TLS_CONTEXT_ANDROID_INC_
+
+#ifndef SCUDO_TLS_H_
+# error "This file must be included inside scudo_tls.h."
+#endif  // SCUDO_TLS_H_
+
+#if SANITIZER_LINUX && SANITIZER_ANDROID
+
+struct ScudoThreadContextPlatform {
+  INLINE bool tryLock() {
+    if (Mutex.TryLock()) {
+      atomic_store_relaxed(&SlowLockPrecedence, 0);
+      return true;
+    }
+    if (atomic_load_relaxed(&SlowLockPrecedence) == 0)
+      atomic_store_relaxed(&SlowLockPrecedence, NanoTime());
+    return false;
+  }
+
+  INLINE void lock() {
+    Mutex.Lock();
+    atomic_store_relaxed(&SlowLockPrecedence, 0);
+  }
+
+  INLINE void unlock() {
+    Mutex.Unlock();
+  }
+
+  INLINE u64 getSlowLockPrecedence() {
+    return atomic_load_relaxed(&SlowLockPrecedence);
+  }
+
+ private:
+  StaticSpinMutex Mutex;
+  atomic_uint64_t SlowLockPrecedence;
+};
+
+#endif  // SANITIZER_LINUX && SANITIZER_ANDROID
+
+#endif  // SCUDO_TLS_CONTEXT_ANDROID_INC_

Added: vendor/compiler-rt/dist/lib/scudo/scudo_tls_context_linux.inc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/lib/scudo/scudo_tls_context_linux.inc	Mon May  8 17:13:22 2017	(r317953)
@@ -0,0 +1,29 @@
+//===-- scudo_tls_context_linux.inc -----------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// Linux specific base thread context definition.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef SCUDO_TLS_CONTEXT_LINUX_INC_
+#define SCUDO_TLS_CONTEXT_LINUX_INC_
+
+#ifndef SCUDO_TLS_H_
+# error "This file must be included inside scudo_tls.h."
+#endif  // SCUDO_TLS_H_
+
+#if SANITIZER_LINUX && !SANITIZER_ANDROID
+
+struct ScudoThreadContextPlatform {
+  ALWAYS_INLINE void unlock() {}
+};
+
+#endif  // SANITIZER_LINUX && !SANITIZER_ANDROID
+
+#endif  // SCUDO_TLS_CONTEXT_LINUX_INC_

Modified: vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.cpp
==============================================================================
--- vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.cpp	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.cpp	Mon May  8 17:13:22 2017	(r317953)
@@ -14,7 +14,7 @@
 
 #include "sanitizer_common/sanitizer_platform.h"
 
-#if SANITIZER_LINUX
+#if SANITIZER_LINUX && !SANITIZER_ANDROID
 
 #include "scudo_tls.h"
 
@@ -26,8 +26,10 @@ namespace __scudo {
 static pthread_once_t GlobalInitialized = PTHREAD_ONCE_INIT;
 static pthread_key_t PThreadKey;
 
-thread_local ThreadState ScudoThreadState = ThreadNotInitialized;
-thread_local ScudoThreadContext ThreadLocalContext;
+__attribute__((tls_model("initial-exec")))
+THREADLOCAL ThreadState ScudoThreadState = ThreadNotInitialized;
+__attribute__((tls_model("initial-exec")))
+THREADLOCAL ScudoThreadContext ThreadLocalContext;
 
 static void teardownThread(void *Ptr) {
   uptr Iteration = reinterpret_cast(Ptr);
@@ -59,4 +61,4 @@ void initThread() {
 
 }  // namespace __scudo
 
-#endif  // SANITIZER_LINUX
+#endif  // SANITIZER_LINUX && !SANITIZER_ANDROID

Added: vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.inc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.inc	Mon May  8 17:13:22 2017	(r317953)
@@ -0,0 +1,48 @@
+//===-- scudo_tls_linux.inc -------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+///
+/// Scudo thread local structure fastpath functions implementation for platforms
+/// supporting thread_local.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef SCUDO_TLS_LINUX_H_
+#define SCUDO_TLS_LINUX_H_
+
+#ifndef SCUDO_TLS_H_
+# error "This file must be included inside scudo_tls.h."
+#endif  // SCUDO_TLS_H_
+
+#if SANITIZER_LINUX && !SANITIZER_ANDROID
+
+enum ThreadState : u8 {
+  ThreadNotInitialized = 0,
+  ThreadInitialized,
+  ThreadTornDown,
+};
+__attribute__((tls_model("initial-exec")))
+extern THREADLOCAL ThreadState ScudoThreadState;
+__attribute__((tls_model("initial-exec")))
+extern THREADLOCAL ScudoThreadContext ThreadLocalContext;
+
+ALWAYS_INLINE void initThreadMaybe() {
+  if (LIKELY(ScudoThreadState != ThreadNotInitialized))
+    return;
+  initThread();
+}
+
+ALWAYS_INLINE ScudoThreadContext *getThreadContextAndLock() {
+  if (UNLIKELY(ScudoThreadState == ThreadTornDown))
+    return nullptr;
+  return &ThreadLocalContext;
+}
+
+#endif  // SANITIZER_LINUX && !SANITIZER_ANDROID
+
+#endif  // SCUDO_TLS_LINUX_H_

Modified: vendor/compiler-rt/dist/lib/ubsan/CMakeLists.txt
==============================================================================
--- vendor/compiler-rt/dist/lib/ubsan/CMakeLists.txt	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/ubsan/CMakeLists.txt	Mon May  8 17:13:22 2017	(r317953)
@@ -9,6 +9,7 @@ set(UBSAN_SOURCES
   )
 
 set(UBSAN_STANDALONE_SOURCES
+  ubsan_diag_standalone.cc
   ubsan_init_standalone.cc
   )
 

Added: vendor/compiler-rt/dist/lib/ubsan/ubsan_diag_standalone.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/lib/ubsan/ubsan_diag_standalone.cc	Mon May  8 17:13:22 2017	(r317953)
@@ -0,0 +1,37 @@
+//===-- ubsan_diag_standalone.cc ------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Diagnostic reporting for the standalone UBSan runtime.
+//
+//===----------------------------------------------------------------------===//
+
+#include "ubsan_platform.h"
+#if CAN_SANITIZE_UB
+#include "ubsan_diag.h"
+
+using namespace __ubsan;
+
+extern "C" {
+SANITIZER_INTERFACE_ATTRIBUTE
+void __sanitizer_print_stack_trace() {
+  uptr top = 0;
+  uptr bottom = 0;
+  bool request_fast_unwind = common_flags()->fast_unwind_on_fatal;
+  if (request_fast_unwind)
+    __sanitizer::GetThreadStackTopAndBottom(false, &top, &bottom);
+
+  GET_REPORT_OPTIONS(false);
+  BufferedStackTrace stack;
+  stack.Unwind(kStackTraceMax, Opts.pc, Opts.bp, nullptr, top, bottom,
+               request_fast_unwind);
+  stack.Print();
+}
+} // extern "C"
+
+#endif  // CAN_SANITIZE_UB

Modified: vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc
==============================================================================
--- vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc	Mon May  8 17:13:22 2017	(r317953)
@@ -410,7 +410,8 @@ static void handleLoadInvalidValue(Inval
   SourceLocation Loc = Data->Loc.acquire();
   // This check could be more precise if we used different handlers for
   // -fsanitize=bool and -fsanitize=enum.
-  bool IsBool = (0 == internal_strcmp(Data->Type.getTypeName(), "'bool'"));
+  bool IsBool = (0 == internal_strcmp(Data->Type.getTypeName(), "'bool'")) ||
+                (0 == internal_strncmp(Data->Type.getTypeName(), "'BOOL'", 6));
   ErrorType ET =
       IsBool ? ErrorType::InvalidBoolLoad : ErrorType::InvalidEnumLoad;
 

Modified: vendor/compiler-rt/dist/lib/xray/xray_init.cc
==============================================================================
--- vendor/compiler-rt/dist/lib/xray/xray_init.cc	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/xray/xray_init.cc	Mon May  8 17:13:22 2017	(r317953)
@@ -25,6 +25,8 @@ extern "C" {
 void __xray_init();
 extern const XRaySledEntry __start_xray_instr_map[] __attribute__((weak));
 extern const XRaySledEntry __stop_xray_instr_map[] __attribute__((weak));
+extern const XRayFunctionSledIndex __start_xray_fn_idx[] __attribute__((weak));
+extern const XRayFunctionSledIndex __stop_xray_fn_idx[] __attribute__((weak));
 }
 
 using namespace __xray;
@@ -55,6 +57,8 @@ void __xray_init() XRAY_NEVER_INSTRUMENT
     __sanitizer::SpinMutexLock Guard(&XRayInstrMapMutex);
     XRayInstrMap.Sleds = __start_xray_instr_map;
     XRayInstrMap.Entries = __stop_xray_instr_map - __start_xray_instr_map;
+    XRayInstrMap.SledsIndex = __start_xray_fn_idx;
+    XRayInstrMap.Functions = __stop_xray_fn_idx - __start_xray_fn_idx;
   }
   __sanitizer::atomic_store(&XRayInitialized, true,
                             __sanitizer::memory_order_release);

Modified: vendor/compiler-rt/dist/lib/xray/xray_interface.cc
==============================================================================
--- vendor/compiler-rt/dist/lib/xray/xray_interface.cc	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/xray/xray_interface.cc	Mon May  8 17:13:22 2017	(r317953)
@@ -132,12 +132,48 @@ CleanupInvoker scopeCleanup(Fu
   return CleanupInvoker{Fn};
 }
 
+inline bool patchSled(const XRaySledEntry &Sled, bool Enable,
+                      int32_t FuncId) XRAY_NEVER_INSTRUMENT {
+  // While we're here, we should patch the nop sled. To do that we mprotect
+  // the page containing the function to be writeable.
+  const uint64_t PageSize = GetPageSizeCached();
+  void *PageAlignedAddr =
+      reinterpret_cast(Sled.Address & ~(PageSize - 1));
+  std::size_t MProtectLen = (Sled.Address + cSledLength) -
+                            reinterpret_cast(PageAlignedAddr);
+  MProtectHelper Protector(PageAlignedAddr, MProtectLen);
+  if (Protector.MakeWriteable() == -1) {
+    printf("Failed mprotect: %d\n", errno);
+    return XRayPatchingStatus::FAILED;
+  }
+
+  bool Success = false;
+  switch (Sled.Kind) {
+  case XRayEntryType::ENTRY:
+    Success = patchFunctionEntry(Enable, FuncId, Sled, __xray_FunctionEntry);
+    break;
+  case XRayEntryType::EXIT:
+    Success = patchFunctionExit(Enable, FuncId, Sled);
+    break;
+  case XRayEntryType::TAIL:
+    Success = patchFunctionTailExit(Enable, FuncId, Sled);
+    break;
+  case XRayEntryType::LOG_ARGS_ENTRY:
+    Success = patchFunctionEntry(Enable, FuncId, Sled, __xray_ArgLoggerEntry);
+    break;
+  default:
+    Report("Unsupported sled kind '%d' @%04x\n", Sled.Address, int(Sled.Kind));
+    return false;
+  }
+  return Success;
+}
+
 // controlPatching implements the common internals of the patching/unpatching
 // implementation. |Enable| defines whether we're enabling or disabling the
 // runtime XRay instrumentation.
 XRayPatchingStatus controlPatching(bool Enable) XRAY_NEVER_INSTRUMENT {
   if (!__sanitizer::atomic_load(&XRayInitialized,
-                               __sanitizer::memory_order_acquire))
+                                __sanitizer::memory_order_acquire))
     return XRayPatchingStatus::NOT_INITIALIZED; // Not initialized.
 
   uint8_t NotPatching = false;
@@ -179,38 +215,7 @@ XRayPatchingStatus controlPatching(bool 
       ++FuncId;
       CurFun = F;
     }
-
-    // While we're here, we should patch the nop sled. To do that we mprotect
-    // the page containing the function to be writeable.
-    void *PageAlignedAddr =
-        reinterpret_cast(Sled.Address & ~(PageSize - 1));
-    std::size_t MProtectLen = (Sled.Address + cSledLength) -
-                              reinterpret_cast(PageAlignedAddr);
-    MProtectHelper Protector(PageAlignedAddr, MProtectLen);
-    if (Protector.MakeWriteable() == -1) {
-      printf("Failed mprotect: %d\n", errno);
-      return XRayPatchingStatus::FAILED;
-    }
-
-    bool Success = false;
-    switch (Sled.Kind) {
-    case XRayEntryType::ENTRY:
-      Success = patchFunctionEntry(Enable, FuncId, Sled, __xray_FunctionEntry);
-      break;
-    case XRayEntryType::EXIT:
-      Success = patchFunctionExit(Enable, FuncId, Sled);
-      break;
-    case XRayEntryType::TAIL:
-      Success = patchFunctionTailExit(Enable, FuncId, Sled);
-      break;
-    case XRayEntryType::LOG_ARGS_ENTRY:
-      Success = patchFunctionEntry(Enable, FuncId, Sled, __xray_ArgLoggerEntry);
-      break;
-    default:
-      Report("Unsupported sled kind: %d\n", int(Sled.Kind));
-      continue;
-    }
-    (void)Success;
+    patchSled(Sled, Enable, FuncId);
   }
   __sanitizer::atomic_store(&XRayPatching, false,
                             __sanitizer::memory_order_release);
@@ -226,6 +231,64 @@ XRayPatchingStatus __xray_unpatch() XRAY
   return controlPatching(false);
 }
 
+XRayPatchingStatus patchFunction(int32_t FuncId,
+                                 bool Enable) XRAY_NEVER_INSTRUMENT {
+  if (!__sanitizer::atomic_load(&XRayInitialized,
+                                __sanitizer::memory_order_acquire))
+    return XRayPatchingStatus::NOT_INITIALIZED; // Not initialized.
+
+  uint8_t NotPatching = false;
+  if (!__sanitizer::atomic_compare_exchange_strong(
+          &XRayPatching, &NotPatching, true, __sanitizer::memory_order_acq_rel))
+    return XRayPatchingStatus::ONGOING; // Already patching.
+
+  // Next, we look for the function index.
+  XRaySledMap InstrMap;
+  {
+    __sanitizer::SpinMutexLock Guard(&XRayInstrMapMutex);
+    InstrMap = XRayInstrMap;
+  }
+
+  // If we don't have an index, we can't patch individual functions.
+  if (InstrMap.Functions == 0)
+    return XRayPatchingStatus::NOT_INITIALIZED;
+
+  // FuncId must be a positive number, less than the number of functions
+  // instrumented.
+  if (FuncId <= 0 || static_cast(FuncId) > InstrMap.Functions) {
+    Report("Invalid function id provided: %d\n", FuncId);
+    return XRayPatchingStatus::FAILED;
+  }
+
+  // Now we patch ths sleds for this specific function.
+  auto SledRange = InstrMap.SledsIndex[FuncId - 1];
+  auto *f = SledRange.Begin;
+  auto *e = SledRange.End;
+
+  bool SucceedOnce = false;
+  while (f != e)
+    SucceedOnce |= patchSled(*f++, Enable, FuncId);
+
+  __sanitizer::atomic_store(&XRayPatching, false,
+                            __sanitizer::memory_order_release);
+
+  if (!SucceedOnce) {
+    Report("Failed patching any sled for function '%d'.", FuncId);
+    return XRayPatchingStatus::FAILED;
+  }
+
+  return XRayPatchingStatus::SUCCESS;
+}
+
+XRayPatchingStatus __xray_patch_function(int32_t FuncId) XRAY_NEVER_INSTRUMENT {
+  return patchFunction(FuncId, true);
+}
+
+XRayPatchingStatus
+__xray_unpatch_function(int32_t FuncId) XRAY_NEVER_INSTRUMENT {
+  return patchFunction(FuncId, false);
+}
+
 int __xray_set_handler_arg1(void (*Handler)(int32_t, XRayEntryType, uint64_t)) {
   if (!__sanitizer::atomic_load(&XRayInitialized,
                                 __sanitizer::memory_order_acquire))
@@ -239,3 +302,15 @@ int __xray_set_handler_arg1(void (*Handl
   return 1;
 }
 int __xray_remove_handler_arg1() { return __xray_set_handler_arg1(nullptr); }
+
+uintptr_t __xray_function_address(int32_t FuncId) XRAY_NEVER_INSTRUMENT {
+  __sanitizer::SpinMutexLock Guard(&XRayInstrMapMutex);
+  if (FuncId <= 0 || static_cast(FuncId) > XRayInstrMap.Functions)
+    return 0;
+  return XRayInstrMap.SledsIndex[FuncId - 1].Begin->Address;
+}
+
+size_t __xray_max_function_id() XRAY_NEVER_INSTRUMENT {
+  __sanitizer::SpinMutexLock Guard(&XRayInstrMapMutex);
+  return XRayInstrMap.Functions;
+}

Modified: vendor/compiler-rt/dist/lib/xray/xray_interface_internal.h
==============================================================================
--- vendor/compiler-rt/dist/lib/xray/xray_interface_internal.h	Mon May  8 17:13:19 2017	(r317952)
+++ vendor/compiler-rt/dist/lib/xray/xray_interface_internal.h	Mon May  8 17:13:22 2017	(r317953)
@@ -39,6 +39,11 @@ struct XRaySledEntry {
 #error "Unsupported word size."
 #endif
 };
+
+struct XRayFunctionSledIndex {
+  const XRaySledEntry* Begin;
+  const XRaySledEntry* End;
+};
 }
 
 namespace __xray {
@@ -46,6 +51,8 @@ namespace __xray {
 struct XRaySledMap {
   const XRaySledEntry *Sleds;
   size_t Entries;
+  const XRayFunctionSledIndex *SledsIndex;
+  size_t Functions;
 };
 
 bool patchFunctionEntry(bool Enable, uint32_t FuncId,

Added: vendor/compiler-rt/dist/test/asan/TestCases/Linux/longjmp_chk.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/test/asan/TestCases/Linux/longjmp_chk.c	Mon May  8 17:13:22 2017	(r317953)
@@ -0,0 +1,51 @@
+// Verify that use of longjmp() in a _FORTIFY_SOURCE'd library (without ASAN)
+// is correctly intercepted such that the stack is unpoisoned.
+// Note: it is essential that the external library is not built with ASAN,
+// otherwise it would be able to unpoison the stack before use.
+//
+// RUN: %clang -DIS_LIBRARY -D_FORTIFY_SOURCE=2 -O2 %s -c -o %t.o
+// RUN: %clang_asan -O2 %s %t.o -o %t
+// RUN: %run %t
+
+#ifdef IS_LIBRARY
+/* the library */
+#include 
+#include 
+#include 
+
+static jmp_buf jenv;
+
+void external_callme(void (*callback)(void)) {
+  if (setjmp(jenv) == 0) {
+    callback();
+  }

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-vendor@freebsd.org  Mon May  8 17:13:31 2017
Return-Path: 
Delivered-To: svn-src-vendor@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 753CFD635F7;
 Mon,  8 May 2017 17:13:31 +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 E34689EA;
 Mon,  8 May 2017 17:13:30 +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 v48HDTle042846;
 Mon, 8 May 2017 17:13:29 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v48HDTgR042845;
 Mon, 8 May 2017 17:13:29 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201705081713.v48HDTgR042845@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric 
Date: Mon, 8 May 2017 17:13:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r317954 - vendor/compiler-rt/compiler-rt-trunk-r302418
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-vendor@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 May 2017 17:13:31 -0000

Author: dim
Date: Mon May  8 17:13:29 2017
New Revision: 317954
URL: https://svnweb.freebsd.org/changeset/base/317954

Log:
  Tag compiler-rt trunk r302418.

Added:
  vendor/compiler-rt/compiler-rt-trunk-r302418/
     - copied from r317953, vendor/compiler-rt/dist/

From owner-svn-src-vendor@freebsd.org  Mon May  8 17:14:02 2017
Return-Path: 
Delivered-To: svn-src-vendor@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 92A66D6379E;
 Mon,  8 May 2017 17:14:02 +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 44537CCF;
 Mon,  8 May 2017 17:14:02 +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 v48HE1Lv043199;
 Mon, 8 May 2017 17:14:01 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v48HE1dg043198;
 Mon, 8 May 2017 17:14:01 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201705081714.v48HE1dg043198@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric 
Date: Mon, 8 May 2017 17:14:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r317960 - vendor/lldb/lldb-trunk-r302418
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-vendor@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 May 2017 17:14:02 -0000

Author: dim
Date: Mon May  8 17:14:01 2017
New Revision: 317960
URL: https://svnweb.freebsd.org/changeset/base/317960

Log:
  Tag lldb trunk r302418.

Added:
  vendor/lldb/lldb-trunk-r302418/
     - copied from r317959, vendor/lldb/dist/

From owner-svn-src-vendor@freebsd.org  Mon May  8 17:13:52 2017
Return-Path: 
Delivered-To: svn-src-vendor@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 2D09FD636DF;
 Mon,  8 May 2017 17:13:52 +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 C1E15B86;
 Mon,  8 May 2017 17:13:51 +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 v48HDoM3043075;
 Mon, 8 May 2017 17:13:50 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v48HDo49043074;
 Mon, 8 May 2017 17:13:50 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201705081713.v48HDo49043074@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric 
Date: Mon, 8 May 2017 17:13:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r317958 - vendor/lld/lld-trunk-r302418
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-vendor@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 May 2017 17:13:52 -0000

Author: dim
Date: Mon May  8 17:13:50 2017
New Revision: 317958
URL: https://svnweb.freebsd.org/changeset/base/317958

Log:
  Tag lld trunk r302418.

Added:
  vendor/lld/lld-trunk-r302418/
     - copied from r317957, vendor/lld/dist/

From owner-svn-src-vendor@freebsd.org  Mon May  8 17:13:37 2017
Return-Path: 
Delivered-To: svn-src-vendor@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 96138D6362C;
 Mon,  8 May 2017 17:13:37 +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 3304AA47;
 Mon,  8 May 2017 17:13:37 +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 v48HDa6k042911;
 Mon, 8 May 2017 17:13:36 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v48HDYuG042894;
 Mon, 8 May 2017 17:13:34 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201705081713.v48HDYuG042894@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric 
Date: Mon, 8 May 2017 17:13:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r317955 - in vendor/libc++/dist: . docs docs/DesignDocs
 include include/experimental include/support/win32 lib src
 src/experimental/filesystem src/support/runtime test/libcxx/algorithms...
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-vendor@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 May 2017 17:13:37 -0000

Author: dim
Date: Mon May  8 17:13:34 2017
New Revision: 317955
URL: https://svnweb.freebsd.org/changeset/base/317955

Log:
  Vendor import of libc++ trunk r302418:
  https://llvm.org/svn/llvm-project/libcxx/trunk@302418

Added:
  vendor/libc++/dist/docs/DesignDocs/AvailabilityMarkup.rst
  vendor/libc++/dist/install-appveyor-reqs.cmd
  vendor/libc++/dist/src/support/runtime/exception_pointer_msvc.ipp
  vendor/libc++/dist/test/libcxx/experimental/containers/sequences/dynarray/lit.local.cfg
  vendor/libc++/dist/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minmax_showbase.pass.cpp   (contents, props changed)
  vendor/libc++/dist/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/lit.local.cfg
  vendor/libc++/dist/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/lit.local.cfg
  vendor/libc++/dist/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/lit.local.cfg
  vendor/libc++/dist/test/support/test.workarounds/c1xx_broken_is_trivially_copyable.pass.cpp   (contents, props changed)
Modified:
  vendor/libc++/dist/CMakeLists.txt
  vendor/libc++/dist/appveyor.yml
  vendor/libc++/dist/docs/index.rst
  vendor/libc++/dist/include/__config
  vendor/libc++/dist/include/__locale
  vendor/libc++/dist/include/__threading_support
  vendor/libc++/dist/include/exception
  vendor/libc++/dist/include/experimental/dynarray
  vendor/libc++/dist/include/experimental/optional
  vendor/libc++/dist/include/functional
  vendor/libc++/dist/include/future
  vendor/libc++/dist/include/istream
  vendor/libc++/dist/include/locale
  vendor/libc++/dist/include/memory
  vendor/libc++/dist/include/new
  vendor/libc++/dist/include/ostream
  vendor/libc++/dist/include/random
  vendor/libc++/dist/include/shared_mutex
  vendor/libc++/dist/include/streambuf
  vendor/libc++/dist/include/support/win32/locale_win32.h
  vendor/libc++/dist/include/typeinfo
  vendor/libc++/dist/lib/CMakeLists.txt
  vendor/libc++/dist/src/exception.cpp
  vendor/libc++/dist/src/experimental/filesystem/operations.cpp
  vendor/libc++/dist/src/locale.cpp
  vendor/libc++/dist/src/memory.cpp
  vendor/libc++/dist/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp
  vendor/libc++/dist/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp
  vendor/libc++/dist/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp
  vendor/libc++/dist/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
  vendor/libc++/dist/test/libcxx/debug/containers/db_string.pass.cpp
  vendor/libc++/dist/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp
  vendor/libc++/dist/test/libcxx/debug/debug_abort.pass.cpp
  vendor/libc++/dist/test/libcxx/debug/debug_throw.pass.cpp
  vendor/libc++/dist/test/libcxx/debug/debug_throw_register.pass.cpp
  vendor/libc++/dist/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp
  vendor/libc++/dist/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
  vendor/libc++/dist/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp
  vendor/libc++/dist/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp
  vendor/libc++/dist/test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp
  vendor/libc++/dist/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp
  vendor/libc++/dist/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp
  vendor/libc++/dist/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp
  vendor/libc++/dist/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp
  vendor/libc++/dist/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp
  vendor/libc++/dist/test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp
  vendor/libc++/dist/test/libcxx/language.support/support.dynamic/alloc.errors/new.badlength/bad_array_length.pass.cpp
  vendor/libc++/dist/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp
  vendor/libc++/dist/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
  vendor/libc++/dist/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
  vendor/libc++/dist/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp
  vendor/libc++/dist/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp
  vendor/libc++/dist/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp
  vendor/libc++/dist/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp
  vendor/libc++/dist/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
  vendor/libc++/dist/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
  vendor/libc++/dist/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/overflow.pass.cpp
  vendor/libc++/dist/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
  vendor/libc++/dist/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
  vendor/libc++/dist/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
  vendor/libc++/dist/test/std/experimental/any/any.class/any.assign/move.pass.cpp
  vendor/libc++/dist/test/std/experimental/any/any.class/any.assign/value.pass.cpp
  vendor/libc++/dist/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
  vendor/libc++/dist/test/std/experimental/any/any.class/any.cons/move.pass.cpp
  vendor/libc++/dist/test/std/experimental/any/any.class/any.cons/value.pass.cpp
  vendor/libc++/dist/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
  vendor/libc++/dist/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
  vendor/libc++/dist/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
  vendor/libc++/dist/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp
  vendor/libc++/dist/test/std/experimental/any/any.nonmembers/swap.pass.cpp
  vendor/libc++/dist/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp
  vendor/libc++/dist/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp
  vendor/libc++/dist/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp
  vendor/libc++/dist/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp
  vendor/libc++/dist/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp
  vendor/libc++/dist/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp
  vendor/libc++/dist/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp
  vendor/libc++/dist/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp
  vendor/libc++/dist/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp
  vendor/libc++/dist/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
  vendor/libc++/dist/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
  vendor/libc++/dist/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp
  vendor/libc++/dist/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
  vendor/libc++/dist/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp
  vendor/libc++/dist/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
  vendor/libc++/dist/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
  vendor/libc++/dist/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
  vendor/libc++/dist/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
  vendor/libc++/dist/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp
  vendor/libc++/dist/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp
  vendor/libc++/dist/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp
  vendor/libc++/dist/test/std/language.support/support.exception/except.nested/assign.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.exception/propagation/current_exception.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.types/byte.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.types/byteops/lshift.assign.fail.cpp
  vendor/libc++/dist/test/std/language.support/support.types/byteops/lshift.assign.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.types/byteops/lshift.fail.cpp
  vendor/libc++/dist/test/std/language.support/support.types/byteops/lshift.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.types/byteops/rshift.assign.fail.cpp
  vendor/libc++/dist/test/std/language.support/support.types/byteops/rshift.assign.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.types/byteops/rshift.fail.cpp
  vendor/libc++/dist/test/std/language.support/support.types/byteops/rshift.pass.cpp
  vendor/libc++/dist/test/std/language.support/support.types/byteops/to_integer.fail.cpp
  vendor/libc++/dist/test/std/language.support/support.types/byteops/to_integer.pass.cpp
  vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/ctype_base.pass.cpp
  vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
  vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
  vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
  vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
  vendor/libc++/dist/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
  vendor/libc++/dist/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
  vendor/libc++/dist/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp
  vendor/libc++/dist/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp
  vendor/libc++/dist/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp
  vendor/libc++/dist/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp
  vendor/libc++/dist/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
  vendor/libc++/dist/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
  vendor/libc++/dist/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
  vendor/libc++/dist/test/std/localization/locales/locale/locale.types/locale.category/category.pass.cpp
  vendor/libc++/dist/test/std/numerics/complex.number/complex.ops/stream_input.pass.cpp
  vendor/libc++/dist/test/std/numerics/rand/rand.device/ctor.pass.cpp
  vendor/libc++/dist/test/std/numerics/rand/rand.device/eval.pass.cpp
  vendor/libc++/dist/test/std/re/re.alg/re.alg.match/awk.pass.cpp
  vendor/libc++/dist/test/std/re/re.traits/translate_nocase.pass.cpp
  vendor/libc++/dist/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
  vendor/libc++/dist/test/std/strings/string.conversions/stof.pass.cpp
  vendor/libc++/dist/test/std/strings/string.conversions/stol.pass.cpp
  vendor/libc++/dist/test/std/strings/string.conversions/stoll.pass.cpp
  vendor/libc++/dist/test/std/strings/string.conversions/stoul.pass.cpp
  vendor/libc++/dist/test/std/strings/string.conversions/stoull.pass.cpp
  vendor/libc++/dist/test/std/thread/futures/futures.future_error/what.pass.cpp
  vendor/libc++/dist/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/mutex.pass.cpp
  vendor/libc++/dist/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/mutex.pass.cpp
  vendor/libc++/dist/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.class/any.assign/copy.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.class/any.assign/move.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.class/any.assign/value.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.class/any.cons/copy.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.class/any.cons/move.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.class/any.cons/value.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.class/any.modifiers/reset.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
  vendor/libc++/dist/test/std/utilities/any/any.nonmembers/swap.pass.cpp
  vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp
  vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp
  vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp
  vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp
  vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp
  vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp
  vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp
  vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp
  vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp
  vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp
  vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp
  vendor/libc++/dist/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp
  vendor/libc++/dist/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp
  vendor/libc++/dist/test/std/utilities/optional/optional.bad_optional_access/default.pass.cpp
  vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp
  vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/const_T.pass.cpp
  vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/copy.fail.cpp
  vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/move.fail.cpp
  vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
  vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
  vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp
  vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp
  vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp
  vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.cons/default.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/count.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/index.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
  vendor/libc++/dist/test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
  vendor/libc++/dist/test/std/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp
  vendor/libc++/dist/test/std/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp
  vendor/libc++/dist/test/std/utilities/time/time.clock/time.clock.system/consistency.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.get/get_index.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.get/get_type.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.ctor/default.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_args.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_args.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_init_list_args.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
  vendor/libc++/dist/test/std/utilities/variant/variant.visit/visit.pass.cpp
  vendor/libc++/dist/test/support/msvc_stdlib_force_include.hpp
  vendor/libc++/dist/test/support/test_macros.h
  vendor/libc++/dist/test/support/test_workarounds.h
  vendor/libc++/dist/utils/libcxx/test/config.py
  vendor/libc++/dist/utils/libcxx/test/target_info.py

Modified: vendor/libc++/dist/CMakeLists.txt
==============================================================================
--- vendor/libc++/dist/CMakeLists.txt	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/CMakeLists.txt	Mon May  8 17:13:34 2017	(r317955)
@@ -344,7 +344,11 @@ set(LIBCXX_COMPILER    ${CMAKE_CXX_COMPI
 set(LIBCXX_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
 set(LIBCXX_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})
 set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build")
-set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
+if (LLVM_LIBRARY_OUTPUT_INTDIR)
+  set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+else()
+  set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
+endif()
 file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}")
 
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
@@ -627,7 +631,12 @@ endif()
 # Create the lit.site.cfg file even when LIBCXX_INCLUDE_TESTS is OFF or
 # LLVM_FOUND is OFF. This allows users to run the tests manually using
 # LIT without requiring a full LLVM checkout.
-add_subdirectory(test)
+#
+# However, since some submission systems strip test/ subdirectories, check for
+# it before adding it.
+if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test")
+  add_subdirectory(test)
+endif()
 if (LIBCXX_INCLUDE_TESTS)
   add_subdirectory(lib/abi)
 endif()

Modified: vendor/libc++/dist/appveyor.yml
==============================================================================
--- vendor/libc++/dist/appveyor.yml	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/appveyor.yml	Mon May  8 17:13:34 2017	(r317955)
@@ -2,65 +2,34 @@ version: '{build}'
 
 shallow_clone: true
 
-os:
-  - Visual Studio 2015
-
 build:
   verbosity: detailed
 
-branches:
-  only:
-    - master
-
 configuration:
   - Debug
 
 environment:
   matrix:
-    - COMPILER: Clang-CL 4.0
+    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+      CLANG_VERSION: ToT
+      MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
+      MSVC_SETUP_ARG: x86
+      APPVEYOR_SAVE_CACHE_ON_ERROR: true
+    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+      CLANG_VERSION: 4
+      MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
+      MSVC_SETUP_ARG: x86_amd64
+      APPVEYOR_SAVE_CACHE_ON_ERROR: true
 
 install:
   ############################################################################
   # All external dependencies are installed in C:\projects\deps
   ############################################################################
-  - mkdir C:\projects\deps
-  - cd C:\projects\deps
-
-  ############################################################################
-  # Install Ninja
-  ############################################################################
-  - set NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip"
-  - appveyor DownloadFile %NINJA_URL% -FileName ninja.zip
-  - 7z x ninja.zip -oC:\projects\deps\ninja > nul
-  - set PATH=C:\projects\deps\ninja;%PATH%
-  - ninja --version
-
-  ############################################################################
-  # Install a recent CMake
-  ############################################################################
-  - set CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-win64-x64.zip"
-  - appveyor DownloadFile %CMAKE_URL% -FileName cmake.zip
-  - 7z x cmake.zip -oC:\projects\deps > nul
-  - move C:\projects\deps\cmake-* C:\projects\deps\cmake # Move to a version-agnostic directory
-  - set PATH=C:\projects\deps\cmake\bin;%PATH%
-  - cmake --version
-
-  ############################################################################
-  # Setup the path to Clang-cl
-  ############################################################################
-  - set PATH="C:\Program Files\LLVM\bin";%PATH%
-  - clang-cl -v
-
-  ############################################################################
-  # Setup the cached copy of LLVM
-  ############################################################################
-  - if exist llvm (git -C llvm pull --rebase=true --ff-only)
-  - if not exist llvm (git clone --depth=1 http://llvm.org/git/llvm.git)
-
+  - call "%APPVEYOR_BUILD_FOLDER%\\install-appveyor-reqs.cmd"
 
 before_build:
-  - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
-  - cd C:\projects\libcxx
+  - call "%MSVC_SETUP_PATH%" %MSVC_SETUP_ARG%
+  - cd %APPVEYOR_BUILD_FOLDER%
 
 build_script:
   - md C:\projects\build-libcxx
@@ -74,8 +43,8 @@ build_script:
     -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe
     "-DCMAKE_BUILD_TYPE=%configuration%"
     "-DLLVM_PATH=C:\projects\deps\llvm" -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
-    -DLLVM_LIT_ARGS="-sv --no-progress-bar --show-xfail --show-unsupported"
-    C:\projects\libcxx
+    -DLLVM_LIT_ARGS="-sv --show-xfail --show-unsupported"
+    %APPVEYOR_BUILD_FOLDER%
 
   #############################################################################
   # Build Step
@@ -94,4 +63,6 @@ artifacts:
     name: logs
 
 cache:
-  - C:\projects\deps\llvm
+ - C:\projects\deps\ninja
+ - C:\projects\deps\cmake
+ - C:\projects\deps\llvm-installer.exe

Added: vendor/libc++/dist/docs/DesignDocs/AvailabilityMarkup.rst
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libc++/dist/docs/DesignDocs/AvailabilityMarkup.rst	Mon May  8 17:13:34 2017	(r317955)
@@ -0,0 +1,114 @@
+===================
+Availability Markup
+===================
+
+.. contents::
+   :local:
+
+Overview
+========
+
+Libc++ is used as a system library on macOS and iOS (amongst others). In order
+for users to be able to compile a binary that is intended to be deployed to an
+older version of the platform, clang provides the
+`availability attribute `_
+that can be placed on declarations to describe the lifecycle of a symbol in the
+library.
+
+Design
+======
+
+When a new feature is introduced that requires dylib support, a macro should be
+created in include/__config to mark this feature as unavailable for all the
+systems. For example::
+
+    // Define availability macros.
+    #if defined(_LIBCPP_USE_AVAILABILITY_APPLE)
+    #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
+    #else  if defined(_LIBCPP_USE_AVAILABILITY_SOME_OTHER_VENDOR)
+    #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
+	#else
+    #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+    #endif
+
+When the library is updated by the platform vendor, the markup can be updated.
+For example::
+
+    #define _LIBCPP_AVAILABILITY_SHARED_MUTEX                                  \
+      __attribute__((availability(macosx,strict,introduced=10.12)))            \
+      __attribute__((availability(ios,strict,introduced=10.0)))                \
+      __attribute__((availability(tvos,strict,introduced=10.0)))               \
+      __attribute__((availability(watchos,strict,introduced=3.0)))
+
+In the source code, the macro can be added on a class if the full class requires
+type info from the library for example::
+
+	_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
+	class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
+	    : public std::logic_error {
+
+or on a particular symbol:
+
+    _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
+
+
+Testing
+=======
+
+Some parameters can be passed to lit to run the test-suite and exercising the
+availability.
+
+* The `platform` parameter controls the deployement target. For example lit can
+  be invoked with `--param=platform=macosx10.8`. Default is the current host.
+* The `use_system_cxx_lib` parameter indicates to use another library than the
+  just built one. Invoking lit with `--param=use_system_cxx_lib=true` will run
+  the test-suite against the host system library. Alternatively a path to the
+  directory containing a specific prebuilt libc++ can be used, for example:
+  `--param=use_system_cxx_lib=/path/to/macOS/10.8/`.
+* The `with_availability` boolean parameter enables the availability markup.
+
+Tests can be marked as XFAIL based on multiple features made available by lit:
+
+
+* if either `use_system_cxx_lib` or  `with_availability` is passed to lit,
+  assuming `--param=platform=macosx10.8` is passed as well the following
+  features will be available:
+
+  - availability
+  - availability=x86_64
+  - availability=macosx
+  - availability=x86_64-macosx
+  - availability=x86_64-apple-macosx10.8
+  - availability=macosx10.8
+
+  This feature is used to XFAIL a test that *is* using a class of a method marked
+  as unavailable *and* that is expected to *fail* if deployed on an older system.
+
+* if `use_system_cxx_lib` is passed to lit, the following features will also
+  be available:
+
+  - with_system_cxx_lib
+  - with_system_cxx_lib=x86_64
+  - with_system_cxx_lib=macosx
+  - with_system_cxx_lib=x86_64-macosx
+  - with_system_cxx_lib=x86_64-apple-macosx10.8
+  - with_system_cxx_lib=macosx10.8
+
+  This feature is used to XFAIL a test that is *not* using a class of a method
+  marked as unavailable *but* that is expected to fail if deployed on an older
+  system. For example if we know that it exhibits a but in the libc on a
+  particular system version.
+
+* if `with_availability` is passed to lit, the following features will also
+  be available:
+
+  - availability_markup
+  - availability_markup=x86_64
+  - availability_markup=macosx
+  - availability_markup=x86_64-macosx
+  - availability_markup=x86_64-apple-macosx10.8
+  - availability_markup=macosx10.8
+
+  This feature is used to XFAIL a test that *is* using a class of a method
+  marked as unavailable *but* that is expected to *pass* if deployed on an older
+  system. For example if it is using a symbol in a statically evaluated context.

Modified: vendor/libc++/dist/docs/index.rst
==============================================================================
--- vendor/libc++/dist/docs/index.rst	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/docs/index.rst	Mon May  8 17:13:34 2017	(r317955)
@@ -128,6 +128,7 @@ Design Documents
 .. toctree::
    :maxdepth: 1
 
+   DesignDocs/AvailabilityMarkup
    DesignDocs/DebugMode
    DesignDocs/CapturingConfigInfo
    DesignDocs/ABIVersioning
@@ -145,7 +146,7 @@ Build Bots and Test Coverage
 
 * `LLVM Buildbot Builders `_
 * `Apple Jenkins Builders `_
-* `EricWF's Nightly Builders `_
+* `Windows Appveyor Builders `_
 * `Code Coverage Results `_
 
 Getting Involved

Modified: vendor/libc++/dist/include/__config
==============================================================================
--- vendor/libc++/dist/include/__config	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/include/__config	Mon May  8 17:13:34 2017	(r317955)
@@ -314,7 +314,7 @@ typedef __char32_t char32_t;
 #define _LIBCPP_NO_EXCEPTIONS
 #endif
 
-#if !(__has_feature(cxx_rtti))
+#if !(__has_feature(cxx_rtti)) && !defined(_LIBCPP_NO_RTTI)
 #define _LIBCPP_NO_RTTI
 #endif
 
@@ -1089,6 +1089,13 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit
 # define _LIBCPP_DIAGNOSE_ERROR(...)
 #endif
 
+#if __has_attribute(fallthough) || _GNUC_VER >= 700
+// Use a function like macro to imply that it must be followed by a semicolon
+#define _LIBCPP_FALLTHROUGH() __attribute__((__fallthrough__))
+#else
+#define _LIBCPP_FALLTHROUGH() ((void)0)
+#endif
+
 #if defined(_LIBCPP_ABI_MICROSOFT) && \
    (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases))
 # define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
@@ -1113,4 +1120,77 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit
 
 #endif // __cplusplus
 
+// Decide whether to use availability macros.
+#if !defined(_LIBCPP_BUILDING_LIBRARY) &&                                      \
+    !defined(_LIBCPP_DISABLE_AVAILABILITY) &&                                  \
+    __has_feature(attribute_availability_with_strict) &&                       \
+    __has_feature(attribute_availability_in_templates)
+#ifdef __APPLE__
+#define _LIBCPP_USE_AVAILABILITY_APPLE
+#endif
+#endif
+
+// Define availability macros.
+#if defined(_LIBCPP_USE_AVAILABILITY_APPLE)
+#define _LIBCPP_AVAILABILITY_SHARED_MUTEX                                      \
+  __attribute__((availability(macosx,strict,introduced=10.12)))                \
+  __attribute__((availability(ios,strict,introduced=10.0)))                    \
+  __attribute__((availability(tvos,strict,introduced=10.0)))                   \
+  __attribute__((availability(watchos,strict,introduced=3.0)))
+#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
+#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH __attribute__((unavailable))
+#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS                               \
+  __attribute__((availability(macosx,strict,introduced=10.12)))                \
+  __attribute__((availability(ios,strict,introduced=10.0)))                    \
+  __attribute__((availability(tvos,strict,introduced=10.0)))                   \
+  __attribute__((availability(watchos,strict,introduced=3.0)))
+#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE                                  \
+  __attribute__((availability(macosx,strict,introduced=10.12)))                \
+  __attribute__((availability(ios,strict,introduced=10.0)))                    \
+  __attribute__((availability(tvos,strict,introduced=10.0)))                   \
+  __attribute__((availability(watchos,strict,introduced=3.0)))
+#define _LIBCPP_AVAILABILITY_FUTURE_ERROR                                      \
+  __attribute__((availability(ios,strict,introduced=6.0)))
+#define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE                                   \
+  __attribute__((availability(macosx,strict,introduced=10.9)))                 \
+  __attribute__((availability(ios,strict,introduced=7.0)))
+#define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY                                   \
+  __attribute__((availability(macosx,strict,introduced=10.9)))                 \
+  __attribute__((availability(ios,strict,introduced=7.0)))
+#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR                                 \
+  __attribute__((availability(macosx,strict,introduced=10.9)))                 \
+  __attribute__((availability(ios,strict,introduced=7.0)))
+#else
+#define _LIBCPP_AVAILABILITY_SHARED_MUTEX
+#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
+#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
+#define _LIBCPP_AVAILABILITY_FUTURE_ERROR
+#define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
+#define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
+#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+#endif
+
+// Define availability that depends on _LIBCPP_NO_EXCEPTIONS.
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#define _LIBCPP_AVAILABILITY_DYNARRAY
+#define _LIBCPP_AVAILABILITY_FUTURE
+#else
+#define _LIBCPP_AVAILABILITY_DYNARRAY _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+#define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
+#endif
+
+// Availability of stream API in the dylib got dropped and re-added.  The
+// extern template should effectively be available at:
+//    availability(macosx,introduced=10.9)
+//    availability(ios,introduced=7.0)
+#if defined(_LIBCPP_USE_AVAILABILITY_APPLE) &&                                 \
+    ((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) &&                \
+      __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1090) ||                \
+     (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) &&               \
+      __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ <= 70000))
+#define _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
+#endif
+
 #endif // _LIBCPP_CONFIG

Modified: vendor/libc++/dist/include/__locale
==============================================================================
--- vendor/libc++/dist/include/__locale	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/include/__locale	Mon May  8 17:13:34 2017	(r317955)
@@ -69,6 +69,7 @@ public:
     class _LIBCPP_TYPE_VIS id;
 
     typedef int category;
+    _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
     static const category // values assigned here are for exposition only
         none     = 0,
         collate  = LC_COLLATE_MASK,

Modified: vendor/libc++/dist/include/__threading_support
==============================================================================
--- vendor/libc++/dist/include/__threading_support	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/include/__threading_support	Mon May  8 17:13:34 2017	(r317955)
@@ -474,7 +474,10 @@ int __libcpp_condvar_timedwait(__libcpp_
                                  timeout_ms.count() > 0 ? timeout_ms.count()
                                                         : 0,
                                  0))
-    return GetLastError();
+    {
+      auto __ec = GetLastError();
+      return __ec == ERROR_TIMEOUT ? ETIMEDOUT : __ec;
+    }
   return 0;
 }
 

Modified: vendor/libc++/dist/include/exception
==============================================================================
--- vendor/libc++/dist/include/exception	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/include/exception	Mon May  8 17:13:34 2017	(r317955)
@@ -127,30 +127,33 @@ _LIBCPP_FUNC_VIS terminate_handler get_t
 _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void terminate() _NOEXCEPT;
 
 _LIBCPP_FUNC_VIS bool uncaught_exception() _NOEXCEPT;
-_LIBCPP_FUNC_VIS int uncaught_exceptions() _NOEXCEPT;
+_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS int uncaught_exceptions() _NOEXCEPT;
 
 class _LIBCPP_TYPE_VIS exception_ptr;
 
 _LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
 _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
 
+#ifndef _LIBCPP_ABI_MICROSOFT
+
 class _LIBCPP_TYPE_VIS exception_ptr
 {
     void* __ptr_;
 public:
     _LIBCPP_INLINE_VISIBILITY exception_ptr() _NOEXCEPT : __ptr_() {}
     _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
+
     exception_ptr(const exception_ptr&) _NOEXCEPT;
     exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
     ~exception_ptr() _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_EXPLICIT
-        operator bool() const _NOEXCEPT {return __ptr_ != nullptr;}
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT
+    {return __ptr_ != nullptr;}
 
     friend _LIBCPP_INLINE_VISIBILITY
     bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
         {return __x.__ptr_ == __y.__ptr_;}
+
     friend _LIBCPP_INLINE_VISIBILITY
     bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
         {return !(__x == __y);}
@@ -178,6 +181,54 @@ make_exception_ptr(_Ep __e) _NOEXCEPT
 #endif
 }
 
+#else // _LIBCPP_ABI_MICROSOFT
+
+class _LIBCPP_TYPE_VIS exception_ptr
+{
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-private-field"
+#endif
+    void* __ptr1_;
+    void* __ptr2_;
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+public:
+    exception_ptr() _NOEXCEPT;
+    exception_ptr(nullptr_t) _NOEXCEPT;
+    exception_ptr(const exception_ptr& __other) _NOEXCEPT;
+    exception_ptr& operator=(const exception_ptr& __other) _NOEXCEPT;
+    exception_ptr& operator=(nullptr_t) _NOEXCEPT;
+    ~exception_ptr() _NOEXCEPT;
+    _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT;
+};
+
+_LIBCPP_FUNC_VIS
+bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT;
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
+    {return !(__x == __y);}
+
+_LIBCPP_FUNC_VIS void swap(exception_ptr&, exception_ptr&) _NOEXCEPT;
+
+_LIBCPP_FUNC_VIS exception_ptr __copy_exception_ptr(void *__except, const void* __ptr);
+_LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr p);
+
+// This is a built-in template function which automagically extracts the required
+// information.
+template  void *__GetExceptionInfo(_E);
+
+template
+exception_ptr
+make_exception_ptr(_Ep __e) _NOEXCEPT
+{
+  return __copy_exception_ptr(_VSTD::addressof(__e), __GetExceptionInfo(__e));
+}
+
+#endif // _LIBCPP_ABI_MICROSOFT
 // nested_exception
 
 class _LIBCPP_EXCEPTION_ABI nested_exception

Modified: vendor/libc++/dist/include/experimental/dynarray
==============================================================================
--- vendor/libc++/dist/include/experimental/dynarray	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/include/experimental/dynarray	Mon May  8 17:13:34 2017	(r317955)
@@ -110,7 +110,7 @@ public:
 namespace std { namespace experimental { inline namespace __array_extensions_v1 {
 
 template 
-struct _LIBCPP_TEMPLATE_VIS dynarray
+struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_DYNARRAY dynarray
 {
 public:
     // types:

Modified: vendor/libc++/dist/include/experimental/optional
==============================================================================
--- vendor/libc++/dist/include/experimental/optional	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/include/experimental/optional	Mon May  8 17:13:34 2017	(r317955)
@@ -145,7 +145,7 @@ namespace std { namespace experimental {
 #include 
 
 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
-class _LIBCPP_EXCEPTION_ABI bad_optional_access
+class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
     : public std::logic_error
 {
 public:
@@ -523,6 +523,9 @@ public:
     constexpr explicit operator bool() const noexcept {return this->__engaged_;}
 
 	_LIBCPP_NORETURN _LIBCPP_INLINE_VISIBILITY 
+#ifndef _LIBCPP_NO_EXCEPTIONS
+_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+#endif
 	constexpr void __throw_bad_optional_access() const
 	{
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -532,7 +535,7 @@ public:
 #endif
 	}
 	
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
     constexpr value_type const& value() const
     {
         if (!this->__engaged_)
@@ -540,7 +543,7 @@ public:
         return this->__val_;
     }
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
     value_type& value()
     {
         if (!this->__engaged_)

Modified: vendor/libc++/dist/include/functional
==============================================================================
--- vendor/libc++/dist/include/functional	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/include/functional	Mon May  8 17:13:34 2017	(r317955)
@@ -2224,7 +2224,7 @@ typename __bind_return<_Fp, _BoundArgs, 
 __apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
                 _Args&& __args)
 {
-    return __invoke(__f, __mu(_VSTD::get<_Indx>(__bound_args), __args)...);
+    return _VSTD::__invoke(__f, _VSTD::__mu(_VSTD::get<_Indx>(__bound_args), __args)...);
 }
 
 template
@@ -2257,7 +2257,7 @@ public:
         typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
         operator()(_Args&& ...__args)
         {
-            return __apply_functor(__f_, __bound_args_, __indices(),
+            return _VSTD::__apply_functor(__f_, __bound_args_, __indices(),
                                   tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
         }
 
@@ -2266,7 +2266,7 @@ public:
         typename __bind_return >::type
         operator()(_Args&& ...__args) const
         {
-            return __apply_functor(__f_, __bound_args_, __indices(),
+            return _VSTD::__apply_functor(__f_, __bound_args_, __indices(),
                                    tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
         }
 };

Modified: vendor/libc++/dist/include/future
==============================================================================
--- vendor/libc++/dist/include/future	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/include/future	Mon May  8 17:13:34 2017	(r317955)
@@ -499,7 +499,7 @@ make_error_condition(future_errc __e) _N
     return error_condition(static_cast(__e), future_category());
 }
 
-class _LIBCPP_EXCEPTION_ABI future_error
+class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_FUTURE_ERROR future_error
     : public logic_error
 {
     error_code __ec_;
@@ -515,6 +515,9 @@ public:
 };
 
 _LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+#ifndef _LIBCPP_NO_EXCEPTIONS
+_LIBCPP_AVAILABILITY_FUTURE_ERROR
+#endif
 void __throw_future_error(future_errc _Ev)
 {
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -525,7 +528,7 @@ void __throw_future_error(future_errc _E
 #endif
 }
 
-class _LIBCPP_TYPE_VIS __assoc_sub_state
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state
     : public __shared_count
 {
 protected:
@@ -612,7 +615,7 @@ __assoc_sub_state::wait_for(const chrono
 }
 
 template 
-class __assoc_state
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_state
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -652,6 +655,7 @@ __assoc_state<_Rp>::__on_zero_shared() _
 
 template 
 template 
+_LIBCPP_AVAILABILITY_FUTURE
 void
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 __assoc_state<_Rp>::set_value(_Arg&& __arg)
@@ -707,7 +711,7 @@ __assoc_state<_Rp>::copy()
 }
 
 template 
-class __assoc_state<_Rp&>
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_state<_Rp&>
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -767,7 +771,7 @@ __assoc_state<_Rp&>::copy()
 }
 
 template 
-class __assoc_state_alloc
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc
     : public __assoc_state<_Rp>
 {
     typedef __assoc_state<_Rp> base;
@@ -795,7 +799,7 @@ __assoc_state_alloc<_Rp, _Alloc>::__on_z
 }
 
 template 
-class __assoc_state_alloc<_Rp&, _Alloc>
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc<_Rp&, _Alloc>
     : public __assoc_state<_Rp&>
 {
     typedef __assoc_state<_Rp&> base;
@@ -821,7 +825,7 @@ __assoc_state_alloc<_Rp&, _Alloc>::__on_
 }
 
 template 
-class __assoc_sub_state_alloc
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state_alloc
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -847,7 +851,7 @@ __assoc_sub_state_alloc<_Alloc>::__on_ze
 }
 
 template 
-class __deferred_assoc_state
+class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state
     : public __assoc_state<_Rp>
 {
     typedef __assoc_state<_Rp> base;
@@ -894,7 +898,7 @@ __deferred_assoc_state<_Rp, _Fp>::__exec
 }
 
 template 
-class __deferred_assoc_state
+class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -942,7 +946,7 @@ __deferred_assoc_state::__exe
 }
 
 template 
-class __async_assoc_state
+class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state
     : public __assoc_state<_Rp>
 {
     typedef __assoc_state<_Rp> base;
@@ -997,7 +1001,7 @@ __async_assoc_state<_Rp, _Fp>::__on_zero
 }
 
 template 
-class __async_assoc_state
+class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -1076,7 +1080,7 @@ __make_async_assoc_state(_Fp __f);
 #endif
 
 template 
-class _LIBCPP_TEMPLATE_VIS future
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
 {
     __assoc_state<_Rp>* __state_;
 
@@ -1179,7 +1183,7 @@ future<_Rp>::get()
 }
 
 template 
-class _LIBCPP_TEMPLATE_VIS future<_Rp&>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future<_Rp&>
 {
     __assoc_state<_Rp&>* __state_;
 
@@ -1277,7 +1281,7 @@ future<_Rp&>::get()
 }
 
 template <>
-class _LIBCPP_TYPE_VIS future
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE future
 {
     __assoc_sub_state* __state_;
 
@@ -1360,7 +1364,7 @@ swap(future<_Rp>& __x, future<_Rp>& __y)
 template  class packaged_task;
 
 template 
-class _LIBCPP_TEMPLATE_VIS promise
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE promise
 {
     __assoc_state<_Rp>* __state_;
 
@@ -1527,7 +1531,7 @@ promise<_Rp>::set_exception_at_thread_ex
 // promise
 
 template 
-class _LIBCPP_TEMPLATE_VIS promise<_Rp&>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE promise<_Rp&>
 {
     __assoc_state<_Rp&>* __state_;
 
@@ -1663,7 +1667,7 @@ promise<_Rp&>::set_exception_at_thread_e
 // promise
 
 template <>
-class _LIBCPP_TYPE_VIS promise
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE promise
 {
     __assoc_sub_state* __state_;
 
@@ -1749,7 +1753,7 @@ template 
 template class __packaged_task_base;
 
 template
-class __packaged_task_base<_Rp(_ArgTypes...)>
+class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_base<_Rp(_ArgTypes...)>
 {
     __packaged_task_base(const __packaged_task_base&);
     __packaged_task_base& operator=(const __packaged_task_base&);
@@ -1767,7 +1771,7 @@ public:
 template class __packaged_task_func;
 
 template
-class __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>
+class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>
     : public  __packaged_task_base<_Rp(_ArgTypes...)>
 {
     __compressed_pair<_Fp, _Alloc> __f_;
@@ -1825,7 +1829,7 @@ __packaged_task_func<_Fp, _Alloc, _Rp(_A
 template  class __packaged_task_function;
 
 template
-class __packaged_task_function<_Rp(_ArgTypes...)>
+class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_function<_Rp(_ArgTypes...)>
 {
     typedef __packaged_task_base<_Rp(_ArgTypes...)> __base;
     typename aligned_storage<3*sizeof(void*)>::type __buf_;
@@ -2000,7 +2004,7 @@ __packaged_task_function<_Rp(_ArgTypes..
 }
 
 template
-class _LIBCPP_TEMPLATE_VIS packaged_task<_Rp(_ArgTypes...)>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE packaged_task<_Rp(_ArgTypes...)>
 {
 public:
     typedef _Rp result_type; // extension
@@ -2129,7 +2133,7 @@ packaged_task<_Rp(_ArgTypes...)>::reset(
 }
 
 template
-class _LIBCPP_TEMPLATE_VIS packaged_task
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE packaged_task
 {
 public:
     typedef void result_type; // extension
@@ -2517,7 +2521,7 @@ shared_future<_Rp&>::operator=(const sha
 }
 
 template <>
-class _LIBCPP_TYPE_VIS shared_future
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE shared_future
 {
     __assoc_sub_state* __state_;
 

Modified: vendor/libc++/dist/include/istream
==============================================================================
--- vendor/libc++/dist/include/istream	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/include/istream	Mon May  8 17:13:34 2017	(r317955)
@@ -1675,9 +1675,11 @@ operator>>(basic_istream<_CharT, _Traits
     return __is;
 }
 
+#ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream)
+#endif
 
 _LIBCPP_END_NAMESPACE_STD
 

Modified: vendor/libc++/dist/include/locale
==============================================================================
--- vendor/libc++/dist/include/locale	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/include/locale	Mon May  8 17:13:34 2017	(r317955)
@@ -1402,6 +1402,7 @@ num_put<_CharT, _OutputIterator>::do_put
     this->__format_int(__fmt+1, __len, true, __iob.flags());
     const unsigned __nbuf = (numeric_limits::digits / 3)
                           + ((numeric_limits::digits % 3) != 0)
+                          + ((__iob.flags() & ios_base::showbase) != 0)
                           + 2;
     char __nar[__nbuf];
     int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
@@ -1428,6 +1429,7 @@ num_put<_CharT, _OutputIterator>::do_put
     this->__format_int(__fmt+1, __len, true, __iob.flags());
     const unsigned __nbuf = (numeric_limits::digits / 3)
                           + ((numeric_limits::digits % 3) != 0)
+                          + ((__iob.flags() & ios_base::showbase) != 0)
                           + 2;
     char __nar[__nbuf];
     int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
@@ -1454,6 +1456,7 @@ num_put<_CharT, _OutputIterator>::do_put
     this->__format_int(__fmt+1, __len, false, __iob.flags());
     const unsigned __nbuf = (numeric_limits::digits / 3)
                           + ((numeric_limits::digits % 3) != 0)
+                          + ((__iob.flags() & ios_base::showbase) != 0)
                           + 1;
     char __nar[__nbuf];
     int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
@@ -1480,6 +1483,7 @@ num_put<_CharT, _OutputIterator>::do_put
     this->__format_int(__fmt+1, __len, false, __iob.flags());
     const unsigned __nbuf = (numeric_limits::digits / 3)
                           + ((numeric_limits::digits % 3) != 0)
+                          + ((__iob.flags() & ios_base::showbase) != 0)
                           + 1;
     char __nar[__nbuf];
     int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
@@ -1685,6 +1689,22 @@ protected:
     ~__time_get_c_storage() {}
 };
 
+template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage::__weeks() const;
+template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage::__months() const;
+template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage::__am_pm() const;
+template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage::__c() const;
+template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage::__r() const;
+template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage::__x() const;
+template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage::__X() const;
+
+template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage::__weeks() const;
+template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage::__months() const;
+template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage::__am_pm() const;
+template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage::__c() const;
+template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage::__r() const;
+template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage::__x() const;
+template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage::__X() const;
+
 template  >
 class _LIBCPP_TEMPLATE_VIS time_get
     : public locale::facet,
@@ -2825,7 +2845,7 @@ money_get<_CharT, _InputIterator>::__do_
                     return false;
                 }
             }
-            // drop through
+            _LIBCPP_FALLTHROUGH();
         case money_base::none:
             if (__p != 3)
             {

Modified: vendor/libc++/dist/include/memory
==============================================================================
--- vendor/libc++/dist/include/memory	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/include/memory	Mon May  8 17:13:34 2017	(r317955)
@@ -3559,7 +3559,7 @@ template ::__get_deleter(const type_info& __t) const _NOEXCEPT
 {
-    return __t == typeid(_Dp) ? _VSTD::addressof(__data_.first().second()) : 0;
+    return __t == typeid(_Dp) ? _VSTD::addressof(__data_.first().second()) : nullptr;
 }
 
 #endif  // _LIBCPP_NO_RTTI
@@ -5293,7 +5293,8 @@ private:
     friend _LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
 };
 
-_LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
+_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+__sp_mut& __get_sp_mut(const void*);
 
 template 
 inline _LIBCPP_INLINE_VISIBILITY
@@ -5304,6 +5305,7 @@ atomic_is_lock_free(const shared_ptr<_Tp
 }
 
 template 
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 atomic_load(const shared_ptr<_Tp>* __p)
 {
@@ -5316,6 +5318,7 @@ atomic_load(const shared_ptr<_Tp>* __p)
   
 template 
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
 {
@@ -5323,6 +5326,7 @@ atomic_load_explicit(const shared_ptr<_T
 }
 
 template 
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 void
 atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
 {
@@ -5334,6 +5338,7 @@ atomic_store(shared_ptr<_Tp>* __p, share
 
 template 
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 void
 atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
 {
@@ -5341,6 +5346,7 @@ atomic_store_explicit(shared_ptr<_Tp>* _
 }
 
 template 
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
 {
@@ -5353,6 +5359,7 @@ atomic_exchange(shared_ptr<_Tp>* __p, sh
   
 template 
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
 {
@@ -5360,6 +5367,7 @@ atomic_exchange_explicit(shared_ptr<_Tp>
 }
 
 template 
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
 {
@@ -5381,6 +5389,7 @@ atomic_compare_exchange_strong(shared_pt
 
 template 
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
 {
@@ -5389,6 +5398,7 @@ atomic_compare_exchange_weak(shared_ptr<
 
 template 
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
                                         shared_ptr<_Tp> __w, memory_order, memory_order)
@@ -5398,6 +5408,7 @@ atomic_compare_exchange_strong_explicit(
 
 template 
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
                                       shared_ptr<_Tp> __w, memory_order, memory_order)

Modified: vendor/libc++/dist/include/new
==============================================================================
--- vendor/libc++/dist/include/new	Mon May  8 17:13:29 2017	(r317954)
+++ vendor/libc++/dist/include/new	Mon May  8 17:13:34 2017	(r317955)
@@ -146,9 +146,8 @@ _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void _
 
 #if defined(_LIBCPP_BUILDING_LIBRARY) || (_LIBCPP_STD_VER > 11)
 
-class _LIBCPP_EXCEPTION_ABI bad_array_length
-    : public bad_alloc
-{
+class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+    bad_array_length : public bad_alloc {
 public:
     bad_array_length() _NOEXCEPT;
     virtual ~bad_array_length() _NOEXCEPT;
@@ -182,7 +181,7 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS void* opera
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
 #ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
 #endif
 
 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
@@ -190,7 +189,7 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS void* opera
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-vendor@freebsd.org  Mon May  8 17:13:42 2017
Return-Path: 
Delivered-To: svn-src-vendor@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 AAE34D6366E;
 Mon,  8 May 2017 17:13:42 +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 53C75AA8;
 Mon,  8 May 2017 17:13:42 +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 v48HDfHR042959;
 Mon, 8 May 2017 17:13:41 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v48HDffn042958;
 Mon, 8 May 2017 17:13:41 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201705081713.v48HDffn042958@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric 
Date: Mon, 8 May 2017 17:13:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r317956 - vendor/libc++/libc++-trunk-r302418
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-vendor@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 May 2017 17:13:43 -0000

Author: dim
Date: Mon May  8 17:13:41 2017
New Revision: 317956
URL: https://svnweb.freebsd.org/changeset/base/317956

Log:
  Tag libc++ trunk r302418.

Added:
  vendor/libc++/libc++-trunk-r302418/
     - copied from r317955, vendor/libc++/dist/

From owner-svn-src-vendor@freebsd.org  Mon May  8 17:13:47 2017
Return-Path: 
Delivered-To: svn-src-vendor@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 96B1ED63692;
 Mon,  8 May 2017 17:13:47 +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 4A716B09;
 Mon,  8 May 2017 17:13:47 +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 v48HDkKY043026;
 Mon, 8 May 2017 17:13:46 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v48HDiRV043006;
 Mon, 8 May 2017 17:13:44 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201705081713.v48HDiRV043006@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric 
Date: Mon, 8 May 2017 17:13:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r317957 - in vendor/lld/dist: . COFF ELF include/lld/Core
 include/lld/Support lib/Core test/ELF test/ELF/Inputs test/ELF/linkerscript
 test/ELF/linkerscript/Inputs test/ELF/lto test/ELF/...
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-vendor@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 May 2017 17:13:47 -0000

Author: dim
Date: Mon May  8 17:13:44 2017
New Revision: 317957
URL: https://svnweb.freebsd.org/changeset/base/317957

Log:
  Vendor import of lld trunk r302418:
  https://llvm.org/svn/llvm-project/lld/trunk@302418

Added:
  vendor/lld/dist/include/lld/Core/TaskGroup.h   (contents, props changed)
  vendor/lld/dist/lib/Core/TaskGroup.cpp   (contents, props changed)
  vendor/lld/dist/test/ELF/Inputs/i386-static-tls-model1.s   (contents, props changed)
  vendor/lld/dist/test/ELF/Inputs/i386-static-tls-model2.s   (contents, props changed)
  vendor/lld/dist/test/ELF/Inputs/i386-static-tls-model3.s   (contents, props changed)
  vendor/lld/dist/test/ELF/Inputs/i386-static-tls-model4.s   (contents, props changed)
  vendor/lld/dist/test/ELF/i386-static-tls-model.s   (contents, props changed)
  vendor/lld/dist/test/ELF/linkerscript/Inputs/compress-debug-sections.s   (contents, props changed)
  vendor/lld/dist/test/ELF/linkerscript/compress-debug-sections.s   (contents, props changed)
  vendor/lld/dist/test/ELF/lto/Inputs/duplicated-name.ll
  vendor/lld/dist/test/ELF/lto/duplicated-name.ll
Deleted:
  vendor/lld/dist/include/lld/Support/
Modified:
  vendor/lld/dist/CMakeLists.txt
  vendor/lld/dist/COFF/Chunks.h
  vendor/lld/dist/COFF/ICF.cpp
  vendor/lld/dist/COFF/PDB.cpp
  vendor/lld/dist/ELF/Config.h
  vendor/lld/dist/ELF/Driver.cpp
  vendor/lld/dist/ELF/InputFiles.cpp
  vendor/lld/dist/ELF/InputFiles.h
  vendor/lld/dist/ELF/LinkerScript.cpp
  vendor/lld/dist/ELF/LinkerScript.h
  vendor/lld/dist/ELF/Options.td
  vendor/lld/dist/ELF/OutputSections.cpp
  vendor/lld/dist/ELF/Relocations.cpp
  vendor/lld/dist/ELF/SymbolTable.cpp
  vendor/lld/dist/ELF/Symbols.cpp
  vendor/lld/dist/ELF/SyntheticSections.cpp
  vendor/lld/dist/ELF/Target.cpp
  vendor/lld/dist/ELF/Target.h
  vendor/lld/dist/ELF/Writer.cpp
  vendor/lld/dist/ELF/Writer.h
  vendor/lld/dist/include/lld/Core/Parallel.h
  vendor/lld/dist/lib/Core/CMakeLists.txt
  vendor/lld/dist/test/ELF/defsym.s
  vendor/lld/dist/test/ELF/i386-tls-ie-shared.s
  vendor/lld/dist/test/ELF/lto/archive-no-index.ll
  vendor/lld/dist/test/ELF/lto/thin-archivecollision.ll
  vendor/lld/dist/test/ELF/tls-dynamic-i686.s
  vendor/lld/dist/test/ELF/tls-offset.s
  vendor/lld/dist/test/ELF/tls-opt-iele-i686-nopic.s
  vendor/lld/dist/unittests/CoreTests/CMakeLists.txt

Modified: vendor/lld/dist/CMakeLists.txt
==============================================================================
--- vendor/lld/dist/CMakeLists.txt	Mon May  8 17:13:41 2017	(r317956)
+++ vendor/lld/dist/CMakeLists.txt	Mon May  8 17:13:44 2017	(r317957)
@@ -221,3 +221,4 @@ endif()
 add_subdirectory(docs)
 add_subdirectory(COFF)
 add_subdirectory(ELF)
+

Modified: vendor/lld/dist/COFF/Chunks.h
==============================================================================
--- vendor/lld/dist/COFF/Chunks.h	Mon May  8 17:13:41 2017	(r317956)
+++ vendor/lld/dist/COFF/Chunks.h	Mon May  8 17:13:44 2017	(r317957)
@@ -201,7 +201,7 @@ private:
 
   // Used for ICF (Identical COMDAT Folding)
   void replace(SectionChunk *Other);
-  uint32_t Color[2] = {0, 0};
+  uint32_t Class[2] = {0, 0};
 
   // Sym points to a section symbol if this is a COMDAT chunk.
   DefinedRegular *Sym = nullptr;

Modified: vendor/lld/dist/COFF/ICF.cpp
==============================================================================
--- vendor/lld/dist/COFF/ICF.cpp	Mon May  8 17:13:41 2017	(r317956)
+++ vendor/lld/dist/COFF/ICF.cpp	Mon May  8 17:13:44 2017	(r317957)
@@ -49,10 +49,10 @@ private:
 
   size_t findBoundary(size_t Begin, size_t End);
 
-  void forEachColorRange(size_t Begin, size_t End,
+  void forEachClassRange(size_t Begin, size_t End,
                          std::function Fn);
 
-  void forEachColor(std::function Fn);
+  void forEachClass(std::function Fn);
 
   std::vector Chunks;
   int Cnt = 0;
@@ -85,7 +85,7 @@ bool ICF::isEligible(SectionChunk *C) {
   return C->isCOMDAT() && C->isLive() && Global && Executable && !Writable;
 }
 
-// Split a range into smaller ranges by recoloring sections
+// Split an equivalence class into smaller classes.
 void ICF::segregate(size_t Begin, size_t End, bool Constant) {
   while (Begin < End) {
     // Divide [Begin, End) into two. Let Mid be the start index of the
@@ -101,7 +101,7 @@ void ICF::segregate(size_t Begin, size_t
     // Split [Begin, End) into [Begin, Mid) and [Mid, End).
     uint32_t Id = NextId++;
     for (size_t I = Begin; I < Mid; ++I)
-      Chunks[I]->Color[(Cnt + 1) % 2] = Id;
+      Chunks[I]->Class[(Cnt + 1) % 2] = Id;
 
     // If we created a group, we need to iterate the main loop again.
     if (Mid != End)
@@ -130,7 +130,7 @@ bool ICF::equalsConstant(const SectionCh
     if (auto *D1 = dyn_cast(B1))
       if (auto *D2 = dyn_cast(B2))
         return D1->getValue() == D2->getValue() &&
-               D1->getChunk()->Color[Cnt % 2] == D2->getChunk()->Color[Cnt % 2];
+               D1->getChunk()->Class[Cnt % 2] == D2->getChunk()->Class[Cnt % 2];
     return false;
   };
   if (!std::equal(A->Relocs.begin(), A->Relocs.end(), B->Relocs.begin(), Eq))
@@ -155,7 +155,7 @@ bool ICF::equalsVariable(const SectionCh
       return true;
     if (auto *D1 = dyn_cast(B1))
       if (auto *D2 = dyn_cast(B2))
-        return D1->getChunk()->Color[Cnt % 2] == D2->getChunk()->Color[Cnt % 2];
+        return D1->getChunk()->Class[Cnt % 2] == D2->getChunk()->Class[Cnt % 2];
     return false;
   };
   return std::equal(A->Relocs.begin(), A->Relocs.end(), B->Relocs.begin(), Eq);
@@ -163,12 +163,12 @@ bool ICF::equalsVariable(const SectionCh
 
 size_t ICF::findBoundary(size_t Begin, size_t End) {
   for (size_t I = Begin + 1; I < End; ++I)
-    if (Chunks[Begin]->Color[Cnt % 2] != Chunks[I]->Color[Cnt % 2])
+    if (Chunks[Begin]->Class[Cnt % 2] != Chunks[I]->Class[Cnt % 2])
       return I;
   return End;
 }
 
-void ICF::forEachColorRange(size_t Begin, size_t End,
+void ICF::forEachClassRange(size_t Begin, size_t End,
                             std::function Fn) {
   if (Begin > 0)
     Begin = findBoundary(Begin - 1, End);
@@ -180,12 +180,12 @@ void ICF::forEachColorRange(size_t Begin
   }
 }
 
-// Call Fn on each color group.
-void ICF::forEachColor(std::function Fn) {
+// Call Fn on each class group.
+void ICF::forEachClass(std::function Fn) {
   // If the number of sections are too small to use threading,
   // call Fn sequentially.
   if (Chunks.size() < 1024) {
-    forEachColorRange(0, Chunks.size(), Fn);
+    forEachClassRange(0, Chunks.size(), Fn);
     return;
   }
 
@@ -193,9 +193,9 @@ void ICF::forEachColor(std::function
       continue;
 
     if (isEligible(SC)) {
-      // Set MSB to 1 to avoid collisions with non-hash colors.
-      SC->Color[0] = getHash(SC) | (1 << 31);
+      // Set MSB to 1 to avoid collisions with non-hash classs.
+      SC->Class[0] = getHash(SC) | (1 << 31);
       Chunks.push_back(SC);
     } else {
-      SC->Color[0] = NextId++;
+      SC->Class[0] = NextId++;
     }
   }
 
@@ -224,25 +224,25 @@ void ICF::run(const std::vector
   // the same group are consecutive in the vector.
   std::stable_sort(Chunks.begin(), Chunks.end(),
                    [](SectionChunk *A, SectionChunk *B) {
-                     return A->Color[0] < B->Color[0];
+                     return A->Class[0] < B->Class[0];
                    });
 
   // Compare static contents and assign unique IDs for each static content.
-  forEachColor([&](size_t Begin, size_t End) { segregate(Begin, End, true); });
+  forEachClass([&](size_t Begin, size_t End) { segregate(Begin, End, true); });
   ++Cnt;
 
   // Split groups by comparing relocations until convergence is obtained.
   do {
     Repeat = false;
-    forEachColor(
+    forEachClass(
         [&](size_t Begin, size_t End) { segregate(Begin, End, false); });
     ++Cnt;
   } while (Repeat);
 
   log("ICF needed " + Twine(Cnt) + " iterations");
 
-  // Merge sections in the same colors.
-  forEachColor([&](size_t Begin, size_t End) {
+  // Merge sections in the same classs.
+  forEachClass([&](size_t Begin, size_t End) {
     if (End - Begin == 1)
       return;
 

Modified: vendor/lld/dist/COFF/PDB.cpp
==============================================================================
--- vendor/lld/dist/COFF/PDB.cpp	Mon May  8 17:13:41 2017	(r317956)
+++ vendor/lld/dist/COFF/PDB.cpp	Mon May  8 17:13:44 2017	(r317957)
@@ -133,7 +133,7 @@ static void dumpDebugT(ScopedPrinter &W,
   if (Data.empty())
     return;
 
-  TypeDatabase TDB;
+  TypeDatabase TDB(0);
   TypeDumpVisitor TDV(TDB, &W, false);
   // Use a default implementation that does not follow type servers and instead
   // just dumps the contents of the TypeServer2 record.
@@ -154,7 +154,7 @@ static void dumpDebugS(ScopedPrinter &W,
   if (auto EC = Reader.readArray(Symbols, Reader.getLength()))
     fatal(EC, "StreamReader.readArray failed");
 
-  TypeDatabase TDB;
+  TypeDatabase TDB(0);
   CVSymbolDumper SymbolDumper(W, TDB, nullptr, false);
   if (auto EC = SymbolDumper.dump(Symbols))
     fatal(EC, "CVSymbolDumper::dump failed");

Modified: vendor/lld/dist/ELF/Config.h
==============================================================================
--- vendor/lld/dist/ELF/Config.h	Mon May  8 17:13:41 2017	(r317956)
+++ vendor/lld/dist/ELF/Config.h	Mon May  8 17:13:44 2017	(r317957)
@@ -73,6 +73,7 @@ struct VersionDefinition {
 // Most fields are initialized by the driver.
 struct Configuration {
   InputFile *FirstElf = nullptr;
+  bool HasStaticTlsModel = false;
   uint8_t OSABI = 0;
   llvm::CachePruningPolicy ThinLTOCachePolicy;
   llvm::StringMap SectionStartMap;
@@ -99,7 +100,6 @@ struct Configuration {
   std::vector VersionScriptLocals;
   std::vector BuildIdVector;
   bool AllowMultipleDefinition;
-  bool ArchiveWithoutSymbolsSeen = false;
   bool AsNeeded = false;
   bool Bsymbolic;
   bool BsymbolicFunctions;

Modified: vendor/lld/dist/ELF/Driver.cpp
==============================================================================
--- vendor/lld/dist/ELF/Driver.cpp	Mon May  8 17:13:41 2017	(r317956)
+++ vendor/lld/dist/ELF/Driver.cpp	Mon May  8 17:13:44 2017	(r317957)
@@ -123,13 +123,13 @@ static std::tuple
-static getArchiveMembers(MemoryBufferRef MB) {
+std::vector> static getArchiveMembers(
+    MemoryBufferRef MB) {
   std::unique_ptr File =
       check(Archive::create(MB),
             MB.getBufferIdentifier() + ": failed to parse archive");
 
-  std::vector V;
+  std::vector> V;
   Error Err = Error::success();
   for (const ErrorOr &COrErr : File->children(Err)) {
     Archive::Child C =
@@ -139,7 +139,7 @@ static getArchiveMembers(MemoryBufferRef
         check(C.getMemoryBufferRef(),
               MB.getBufferIdentifier() +
                   ": could not get the buffer for a child of the archive");
-    V.push_back(MBRef);
+    V.push_back(std::make_pair(MBRef, C.getChildOffset()));
   }
   if (Err)
     fatal(MB.getBufferIdentifier() + ": Archive::children failed: " +
@@ -152,8 +152,7 @@ static getArchiveMembers(MemoryBufferRef
   return V;
 }
 
-// Opens and parses a file. Path has to be resolved already.
-// Newly created memory buffers are owned by this driver.
+// Opens a file and create a file object. Path has to be resolved already.
 void LinkerDriver::addFile(StringRef Path, bool WithLOption) {
   using namespace sys::fs;
 
@@ -171,14 +170,31 @@ void LinkerDriver::addFile(StringRef Pat
   case file_magic::unknown:
     readLinkerScript(MBRef);
     return;
-  case file_magic::archive:
+  case file_magic::archive: {
+    // Handle -whole-archive.
     if (InWholeArchive) {
-      for (MemoryBufferRef MB : getArchiveMembers(MBRef))
-        Files.push_back(createObjectFile(MB, Path));
+      for (const auto &P : getArchiveMembers(MBRef))
+        Files.push_back(createObjectFile(P.first, Path, P.second));
       return;
     }
-    Files.push_back(make(MBRef));
+
+    std::unique_ptr File =
+        check(Archive::create(MBRef), Path + ": failed to parse archive");
+
+    // If an archive file has no symbol table, it is likely that a user
+    // is attempting LTO and using a default ar command that doesn't
+    // understand the LLVM bitcode file. It is a pretty common error, so
+    // we'll handle it as if it had a symbol table.
+    if (!File->hasSymbolTable()) {
+      for (const auto &P : getArchiveMembers(MBRef))
+        Files.push_back(make(P.first, Path, P.second));
+      return;
+    }
+
+    // Handle the regular case.
+    Files.push_back(make(std::move(File)));
     return;
+  }
   case file_magic::elf_shared_object:
     if (Config->Relocatable) {
       error("attempted static link of dynamic object " + Path);
@@ -199,7 +215,7 @@ void LinkerDriver::addFile(StringRef Pat
     return;
   default:
     if (InLib)
-      Files.push_back(make(MBRef));
+      Files.push_back(make(MBRef, "", 0));
     else
       Files.push_back(createObjectFile(MBRef));
   }

Modified: vendor/lld/dist/ELF/InputFiles.cpp
==============================================================================
--- vendor/lld/dist/ELF/InputFiles.cpp	Mon May  8 17:13:41 2017	(r317956)
+++ vendor/lld/dist/ELF/InputFiles.cpp	Mon May  8 17:13:44 2017	(r317957)
@@ -596,17 +596,13 @@ SymbolBody *elf::ObjectFile::creat
   }
 }
 
-template  void ArchiveFile::parse() {
-  File = check(Archive::create(MB),
-               MB.getBufferIdentifier() + ": failed to parse archive");
+ArchiveFile::ArchiveFile(std::unique_ptr &&File)
+    : InputFile(ArchiveKind, File->getMemoryBufferRef()),
+      File(std::move(File)) {}
 
-  // Read the symbol table to construct Lazy objects.
-  for (const Archive::Symbol &Sym : File->symbols()) {
+template  void ArchiveFile::parse() {
+  for (const Archive::Symbol &Sym : File->symbols())
     Symtab::X->addLazyArchive(this, Sym);
-  }
-
-  if (File->symbols().begin() == File->symbols().end())
-    Config->ArchiveWithoutSymbolsSeen = true;
 }
 
 // Returns a buffer pointing to a member file containing a given symbol.
@@ -981,6 +977,13 @@ MemoryBufferRef LazyObjectFile::getBuffe
   return MB;
 }
 
+InputFile *LazyObjectFile::fetch() {
+  MemoryBufferRef MBRef = getBuffer();
+  if (MBRef.getBuffer().empty())
+    return nullptr;
+  return createObjectFile(MBRef, ArchiveName, OffsetInArchive);
+}
+
 template  void LazyObjectFile::parse() {
   for (StringRef Sym : getSymbols())
     Symtab::X->addLazyObject(Sym, *this);

Modified: vendor/lld/dist/ELF/InputFiles.h
==============================================================================
--- vendor/lld/dist/ELF/InputFiles.h	Mon May  8 17:13:41 2017	(r317956)
+++ vendor/lld/dist/ELF/InputFiles.h	Mon May  8 17:13:44 2017	(r317957)
@@ -219,7 +219,11 @@ private:
 // archive file semantics.
 class LazyObjectFile : public InputFile {
 public:
-  explicit LazyObjectFile(MemoryBufferRef M) : InputFile(LazyObjectKind, M) {}
+  LazyObjectFile(MemoryBufferRef M, StringRef ArchiveName,
+                 uint64_t OffsetInArchive)
+      : InputFile(LazyObjectKind, M), OffsetInArchive(OffsetInArchive) {
+    this->ArchiveName = ArchiveName;
+  }
 
   static bool classof(const InputFile *F) {
     return F->kind() == LazyObjectKind;
@@ -227,6 +231,7 @@ public:
 
   template  void parse();
   MemoryBufferRef getBuffer();
+  InputFile *fetch();
 
 private:
   std::vector getSymbols();
@@ -234,12 +239,13 @@ private:
   std::vector getBitcodeSymbols();
 
   bool Seen = false;
+  uint64_t OffsetInArchive;
 };
 
 // An ArchiveFile object represents a .a file.
 class ArchiveFile : public InputFile {
 public:
-  explicit ArchiveFile(MemoryBufferRef M) : InputFile(ArchiveKind, M) {}
+  explicit ArchiveFile(std::unique_ptr &&File);
   static bool classof(const InputFile *F) { return F->kind() == ArchiveKind; }
   template  void parse();
 

Modified: vendor/lld/dist/ELF/LinkerScript.cpp
==============================================================================
--- vendor/lld/dist/ELF/LinkerScript.cpp	Mon May  8 17:13:41 2017	(r317956)
+++ vendor/lld/dist/ELF/LinkerScript.cpp	Mon May  8 17:13:44 2017	(r317957)
@@ -406,27 +406,22 @@ void LinkerScript::processCommands(Outpu
       }
 
       // Add input sections to an output section.
-      unsigned Pos = 0;
-      for (InputSectionBase *S : V) {
-        // The actual offset will be computed during
-        // assignAddresses. For now, use the index as a very crude
-        // approximation so that it is at least easy for other code to
-        // know the section order.
-        cast(S)->OutSecOff = Pos++;
+      for (InputSectionBase *S : V)
         Factory.addInputSec(S, Cmd->Name, Cmd->Sec);
+      if (OutputSection *Sec = Cmd->Sec) {
+        assert(Sec->SectionIndex == INT_MAX);
+        Sec->SectionIndex = I;
       }
     }
   }
   CurOutSec = nullptr;
 }
 
-void LinkerScript::fabricateDefaultCommands(bool AllocateHeader) {
+void LinkerScript::fabricateDefaultCommands() {
   std::vector Commands;
 
   // Define start address
-  uint64_t StartAddr = Config->ImageBase;
-  if (AllocateHeader)
-    StartAddr += elf::getHeaderSize();
+  uint64_t StartAddr = Config->ImageBase + elf::getHeaderSize();
 
   // The Sections with -T
have been sorted in order of ascending // address. We must lower StartAddr if the lowest -T
as @@ -488,6 +483,11 @@ void LinkerScript::addOrphanSections(Out } else { auto *Cmd = cast(*I); Factory.addInputSec(S, Name, Cmd->Sec); + if (OutputSection *Sec = Cmd->Sec) { + unsigned Index = std::distance(Opt.Commands.begin(), I); + assert(Sec->SectionIndex == INT_MAX || Sec->SectionIndex == Index); + Sec->SectionIndex = Index; + } auto *ISD = make(""); ISD->Sections.push_back(S); Cmd->Commands.push_back(ISD); @@ -495,17 +495,22 @@ void LinkerScript::addOrphanSections(Out } } -static bool isTbss(OutputSection *Sec) { - return (Sec->Flags & SHF_TLS) && Sec->Type == SHT_NOBITS; +uint64_t LinkerScript::advance(uint64_t Size, unsigned Align) { + bool IsTbss = (CurOutSec->Flags & SHF_TLS) && CurOutSec->Type == SHT_NOBITS; + uint64_t Start = IsTbss ? Dot + ThreadBssOffset : Dot; + Start = alignTo(Start, Align); + uint64_t End = Start + Size; + + if (IsTbss) + ThreadBssOffset = End - Dot; + else + Dot = End; + return End; } void LinkerScript::output(InputSection *S) { - bool IsTbss = isTbss(CurOutSec); - - uint64_t Pos = IsTbss ? Dot + ThreadBssOffset : Dot; - Pos = alignTo(Pos, S->Alignment); - S->OutSecOff = Pos - CurOutSec->Addr; - Pos += S->getSize(); + uint64_t Pos = advance(S->getSize(), S->Alignment); + S->OutSecOff = Pos - S->getSize() - CurOutSec->Addr; // Update output section size after adding each section. This is so that // SIZEOF works correctly in the case below: @@ -524,11 +529,6 @@ void LinkerScript::output(InputSection * " bytes"); } } - - if (IsTbss) - ThreadBssOffset = Pos - Dot; - else - Dot = Pos; } void LinkerScript::switchTo(OutputSection *Sec) { @@ -536,9 +536,7 @@ void LinkerScript::switchTo(OutputSectio return; CurOutSec = Sec; - - Dot = alignTo(Dot, CurOutSec->Alignment); - CurOutSec->Addr = isTbss(CurOutSec) ? Dot + ThreadBssOffset : Dot; + CurOutSec->Addr = advance(0, CurOutSec->Alignment); // If neither AT nor AT> is specified for an allocatable section, the linker // will set the LMA such that the difference between VMA and LMA for the @@ -643,6 +641,11 @@ void LinkerScript::assignOffsets(OutputS Dot = CurMemRegion->Offset; switchTo(Sec); + // We do not support custom layout for compressed debug sectons. + // At this point we already know their size and have compressed content. + if (CurOutSec->Flags & SHF_COMPRESSED) + return; + for (BaseCommand *C : Cmd->Commands) process(*C); } @@ -678,8 +681,9 @@ void LinkerScript::adjustSectionsBeforeS // consequeces and gives us a section to put the symbol in. uint64_t Flags = SHF_ALLOC; uint32_t Type = SHT_PROGBITS; - for (BaseCommand *Base : Opt.Commands) { - auto *Cmd = dyn_cast(Base); + + for (int I = 0, E = Opt.Commands.size(); I != E; ++I) { + auto *Cmd = dyn_cast(Opt.Commands[I]); if (!Cmd) continue; if (OutputSection *Sec = Cmd->Sec) { @@ -692,6 +696,7 @@ void LinkerScript::adjustSectionsBeforeS continue; auto *OutSec = make(Cmd->Name, Type, Flags); + OutSec->SectionIndex = I; OutputSections->push_back(OutSec); Cmd->Sec = OutSec; } @@ -894,6 +899,48 @@ void LinkerScript::synchronize() { } } +static bool allocateHeaders(std::vector &Phdrs, + ArrayRef OutputSections, + uint64_t Min) { + auto FirstPTLoad = + std::find_if(Phdrs.begin(), Phdrs.end(), + [](const PhdrEntry &E) { return E.p_type == PT_LOAD; }); + if (FirstPTLoad == Phdrs.end()) + return false; + + uint64_t HeaderSize = getHeaderSize(); + if (HeaderSize <= Min || Script->hasPhdrsCommands()) { + Min = alignDown(Min - HeaderSize, Config->MaxPageSize); + Out::ElfHeader->Addr = Min; + Out::ProgramHeaders->Addr = Min + Out::ElfHeader->Size; + return true; + } + + assert(FirstPTLoad->First == Out::ElfHeader); + OutputSection *ActualFirst = nullptr; + for (OutputSection *Sec : OutputSections) { + if (Sec->FirstInPtLoad == Out::ElfHeader) { + ActualFirst = Sec; + break; + } + } + if (ActualFirst) { + for (OutputSection *Sec : OutputSections) + if (Sec->FirstInPtLoad == Out::ElfHeader) + Sec->FirstInPtLoad = ActualFirst; + FirstPTLoad->First = ActualFirst; + } else { + Phdrs.erase(FirstPTLoad); + } + + auto PhdrI = std::find_if(Phdrs.begin(), Phdrs.end(), [](const PhdrEntry &E) { + return E.p_type == PT_PHDR; + }); + if (PhdrI != Phdrs.end()) + Phdrs.erase(PhdrI); + return false; +} + void LinkerScript::assignAddresses(std::vector &Phdrs) { // Assign addresses as instructed by linker script SECTIONS sub-commands. Dot = 0; @@ -994,12 +1041,17 @@ static void writeInt(uint8_t *Buf, uint6 llvm_unreachable("unsupported Size argument"); } -void LinkerScript::writeDataBytes(StringRef Name, uint8_t *Buf) { - int I = getSectionIndex(Name); - if (I == INT_MAX) +void LinkerScript::writeDataBytes(OutputSection *Sec, uint8_t *Buf) { + auto I = std::find_if(Opt.Commands.begin(), Opt.Commands.end(), + [=](BaseCommand *Base) { + if (auto *Cmd = dyn_cast(Base)) + if (Cmd->Sec == Sec) + return true; + return false; + }); + if (I == Opt.Commands.end()) return; - - auto *Cmd = dyn_cast(Opt.Commands[I]); + auto *Cmd = cast(*I); for (BaseCommand *Base : Cmd->Commands) if (auto *Data = dyn_cast(Base)) writeInt(Buf + Data->Offset, Data->Expression().getValue(), Data->Size); @@ -1013,18 +1065,6 @@ bool LinkerScript::hasLMA(StringRef Name return false; } -// Returns the index of the given section name in linker script -// SECTIONS commands. Sections are laid out as the same order as they -// were in the script. If a given name did not appear in the script, -// it returns INT_MAX, so that it will be laid out at end of file. -int LinkerScript::getSectionIndex(StringRef Name) { - for (int I = 0, E = Opt.Commands.size(); I != E; ++I) - if (auto *Cmd = dyn_cast(Opt.Commands[I])) - if (Cmd->Name == Name) - return I; - return INT_MAX; -} - ExprValue LinkerScript::getSymbolValue(const Twine &Loc, StringRef S) { if (S == ".") return {CurOutSec, Dot - CurOutSec->Addr}; Modified: vendor/lld/dist/ELF/LinkerScript.h ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.h Mon May 8 17:13:41 2017 (r317956) +++ vendor/lld/dist/ELF/LinkerScript.h Mon May 8 17:13:44 2017 (r317957) @@ -228,6 +228,7 @@ protected: MemoryRegion *findMemoryRegion(OutputSectionCommand *Cmd); void switchTo(OutputSection *Sec); + uint64_t advance(uint64_t Size, unsigned Align); void output(InputSection *Sec); void process(BaseCommand &Base); @@ -252,7 +253,7 @@ public: bool isDefined(StringRef S); std::vector *OutputSections; - void fabricateDefaultCommands(bool AllocateHeader); + void fabricateDefaultCommands(); void addOrphanSections(OutputSectionFactory &Factory); void removeEmptyCommands(); void adjustSectionsBeforeSorting(); @@ -269,9 +270,8 @@ public: void processNonSectionCommands(); void synchronize(); void assignAddresses(std::vector &Phdrs); - int getSectionIndex(StringRef Name); - void writeDataBytes(StringRef Name, uint8_t *Buf); + void writeDataBytes(OutputSection *Sec, uint8_t *Buf); void addSymbol(SymbolAssignment *Cmd); void processCommands(OutputSectionFactory &Factory); Modified: vendor/lld/dist/ELF/Options.td ============================================================================== --- vendor/lld/dist/ELF/Options.td Mon May 8 17:13:41 2017 (r317956) +++ vendor/lld/dist/ELF/Options.td Mon May 8 17:13:44 2017 (r317957) @@ -290,6 +290,7 @@ def alias_L__library_path: J<"library-pa def alias_define_common_d: Flag<["-"], "d">, Alias; def alias_define_common_dc: F<"dc">, Alias; def alias_define_common_dp: F<"dp">, Alias; +def alias_defsym: S<"defsym">, Alias; def alias_discard_all_x: Flag<["-"], "x">, Alias; def alias_discard_locals_X: Flag<["-"], "X">, Alias; def alias_dynamic_list: J<"dynamic-list=">, Alias; Modified: vendor/lld/dist/ELF/OutputSections.cpp ============================================================================== --- vendor/lld/dist/ELF/OutputSections.cpp Mon May 8 17:13:41 2017 (r317956) +++ vendor/lld/dist/ELF/OutputSections.cpp Mon May 8 17:13:44 2017 (r317957) @@ -68,7 +68,8 @@ void OutputSection::writeHeaderTo(typena OutputSection::OutputSection(StringRef Name, uint32_t Type, uint64_t Flags) : SectionBase(Output, Name, Flags, /*Entsize*/ 0, /*Alignment*/ 1, Type, /*Info*/ 0, - /*Link*/ 0) {} + /*Link*/ 0), + SectionIndex(INT_MAX) {} static bool compareByFilePosition(InputSection *A, InputSection *B) { // Synthetic doesn't have link order dependecy, stable_sort will keep it last @@ -139,12 +140,24 @@ template void OutputSection this->Info = S->OutSec->SectionIndex; } +static uint64_t updateOffset(uint64_t Off, InputSection *S) { + Off = alignTo(Off, S->Alignment); + S->OutSecOff = Off; + return Off + S->getSize(); +} + void OutputSection::addSection(InputSection *S) { assert(S->Live); Sections.push_back(S); S->OutSec = this; this->updateAlignment(S->Alignment); + // The actual offsets will be computed by assignAddresses. For now, use + // crude approximation so that it is at least easy for other code to know the + // section order. It is also used to calculate the output section size early + // for compressed debug sections. + this->Size = updateOffset(Size, S); + // If this section contains a table of fixed-size entries, sh_entsize // holds the element size. Consequently, if this contains two or more // input sections, all of them must have the same sh_entsize. However, @@ -159,11 +172,8 @@ void OutputSection::addSection(InputSect // and scan relocations to setup sections' offsets. void OutputSection::assignOffsets() { uint64_t Off = 0; - for (InputSection *S : Sections) { - Off = alignTo(Off, S->Alignment); - S->OutSecOff = Off; - Off += S->getSize(); - } + for (InputSection *S : Sections) + Off = updateOffset(Off, S); this->Size = Off; } @@ -305,7 +315,7 @@ template void OutputSection // Linker scripts may have BYTE()-family commands with which you // can write arbitrary bytes to the output. Process them if any. - Script->writeDataBytes(Name, Buf); + Script->writeDataBytes(this, Buf); } static uint64_t getOutFlags(InputSectionBase *S) { Modified: vendor/lld/dist/ELF/Relocations.cpp ============================================================================== --- vendor/lld/dist/ELF/Relocations.cpp Mon May 8 17:13:41 2017 (r317956) +++ vendor/lld/dist/ELF/Relocations.cpp Mon May 8 17:13:44 2017 (r317957) @@ -233,7 +233,7 @@ handleTlsRelocation(uint32_t Type, Symbo } // Local-Dynamic relocs can be relaxed to Local-Exec. - if (Target->isTlsLocalDynamicRel(Type) && !Config->Shared) { + if (isRelExprOneOf(Expr) && !Config->Shared) { C.Relocations.push_back( {R_RELAX_TLS_LD_TO_LE, Type, Offset, Addend, &Body}); return 1; @@ -282,7 +282,8 @@ handleTlsRelocation(uint32_t Type, Symbo // Initial-Exec relocs can be relaxed to Local-Exec if the symbol is locally // defined. - if (Target->isTlsInitialExecRel(Type) && !Config->Shared && !IsPreemptible) { + if (isRelExprOneOf(Expr) && + !Config->Shared && !IsPreemptible) { C.Relocations.push_back( {R_RELAX_TLS_IE_TO_LE, Type, Offset, Addend, &Body}); return 1; @@ -694,17 +695,6 @@ static void reportUndefined(SymbolBody & warn(Msg); } else { error(Msg); - - if (Config->ArchiveWithoutSymbolsSeen) { - message("At least one archive listed no symbols in its index." - " This can happen when creating archives with a version" - " of ar that does not understand the object files in" - " the archive. For example, if you are using LLVM" - " bitcode objects (such as created by -flto), you may" - " need to use llvm-ar or GNU ar with a plugin."); - // Reset to false so that we print the message only once. - Config->ArchiveWithoutSymbolsSeen = false; - } } } Modified: vendor/lld/dist/ELF/SymbolTable.cpp ============================================================================== --- vendor/lld/dist/ELF/SymbolTable.cpp Mon May 8 17:13:41 2017 (r317956) +++ vendor/lld/dist/ELF/SymbolTable.cpp Mon May 8 17:13:44 2017 (r317957) @@ -540,13 +540,10 @@ void SymbolTable::addLazyObject(St return; // See comment for addLazyArchive above. - if (S->isWeak()) { + if (S->isWeak()) replaceBody(S, Name, Obj, S->body()->Type); - } else { - MemoryBufferRef MBRef = Obj.getBuffer(); - if (!MBRef.getBuffer().empty()) - addFile(createObjectFile(MBRef)); - } + else if (InputFile *F = Obj.fetch()) + addFile(F); } // Process undefined (-u) flags by loading lazy symbols named by those flags. Modified: vendor/lld/dist/ELF/Symbols.cpp ============================================================================== --- vendor/lld/dist/ELF/Symbols.cpp Mon May 8 17:13:41 2017 (r317956) +++ vendor/lld/dist/ELF/Symbols.cpp Mon May 8 17:13:44 2017 (r317957) @@ -327,12 +327,7 @@ InputFile *LazyArchive::fetch() { return createObjectFile(MBInfo.first, file()->getName(), MBInfo.second); } -InputFile *LazyObject::fetch() { - MemoryBufferRef MBRef = file()->getBuffer(); - if (MBRef.getBuffer().empty()) - return nullptr; - return createObjectFile(MBRef); -} +InputFile *LazyObject::fetch() { return file()->fetch(); } uint8_t Symbol::computeBinding() const { if (Config->Relocatable) Modified: vendor/lld/dist/ELF/SyntheticSections.cpp ============================================================================== --- vendor/lld/dist/ELF/SyntheticSections.cpp Mon May 8 17:13:41 2017 (r317956) +++ vendor/lld/dist/ELF/SyntheticSections.cpp Mon May 8 17:13:44 2017 (r317957) @@ -1038,6 +1038,15 @@ template void DynamicSectio if (!Config->SoName.empty()) add({DT_SONAME, In::DynStrTab->addString(Config->SoName)}); + if (!Config->Shared && !Config->Relocatable) + add({DT_DEBUG, (uint64_t)0}); +} + +// Add remaining entries to complete .dynamic contents. +template void DynamicSection::finalizeContents() { + if (this->Size) + return; // Already finalized. + // Set DT_FLAGS and DT_FLAGS_1. uint32_t DtFlags = 0; uint32_t DtFlags1 = 0; @@ -1055,21 +1064,14 @@ template void DynamicSectio DtFlags |= DF_ORIGIN; DtFlags1 |= DF_1_ORIGIN; } + if (Config->HasStaticTlsModel) + DtFlags |= DF_STATIC_TLS; if (DtFlags) add({DT_FLAGS, DtFlags}); if (DtFlags1) add({DT_FLAGS_1, DtFlags1}); - if (!Config->Shared && !Config->Relocatable) - add({DT_DEBUG, (uint64_t)0}); -} - -// Add remaining entries to complete .dynamic contents. -template void DynamicSection::finalizeContents() { - if (this->Size) - return; // Already finalized. - this->Link = In::DynStrTab->OutSec->SectionIndex; if (In::RelaDyn->OutSec->Size > 0) { bool IsRela = Config->IsRela; Modified: vendor/lld/dist/ELF/Target.cpp ============================================================================== --- vendor/lld/dist/ELF/Target.cpp Mon May 8 17:13:41 2017 (r317956) +++ vendor/lld/dist/ELF/Target.cpp Mon May 8 17:13:44 2017 (r317957) @@ -124,8 +124,6 @@ public: int64_t getImplicitAddend(const uint8_t *Buf, uint32_t Type) const override; void writeGotPltHeader(uint8_t *Buf) const override; uint32_t getDynRel(uint32_t Type) const override; - bool isTlsLocalDynamicRel(uint32_t Type) const override; - bool isTlsInitialExecRel(uint32_t Type) const override; void writeGotPlt(uint8_t *Buf, const SymbolBody &S) const override; void writeIgotPlt(uint8_t *Buf, const SymbolBody &S) const override; void writePltHeader(uint8_t *Buf) const override; @@ -147,8 +145,6 @@ public: RelExpr getRelExpr(uint32_t Type, const SymbolBody &S, const uint8_t *Loc) const override; bool isPicRel(uint32_t Type) const override; - bool isTlsLocalDynamicRel(uint32_t Type) const override; - bool isTlsInitialExecRel(uint32_t Type) const override; void writeGotPltHeader(uint8_t *Buf) const override; void writeGotPlt(uint8_t *Buf, const SymbolBody &S) const override; void writePltHeader(uint8_t *Buf) const override; @@ -193,7 +189,6 @@ public: RelExpr getRelExpr(uint32_t Type, const SymbolBody &S, const uint8_t *Loc) const override; bool isPicRel(uint32_t Type) const override; - bool isTlsInitialExecRel(uint32_t Type) const override; void writeGotPlt(uint8_t *Buf, const SymbolBody &S) const override; void writePltHeader(uint8_t *Buf) const override; void writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, uint64_t PltEntryAddr, @@ -303,10 +298,6 @@ bool TargetInfo::needsThunk(RelExpr Expr return false; } -bool TargetInfo::isTlsInitialExecRel(uint32_t Type) const { return false; } - -bool TargetInfo::isTlsLocalDynamicRel(uint32_t Type) const { return false; } - void TargetInfo::writeIgotPlt(uint8_t *Buf, const SymbolBody &S) const { writeGotPlt(Buf, S); } @@ -360,6 +351,15 @@ X86TargetInfo::X86TargetInfo() { RelExpr X86TargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S, const uint8_t *Loc) const { + // There are 4 different TLS variable models with varying degrees of + // flexibility and performance. LocalExec and InitialExec models are fast but + // less-flexible models. They cannot be used for dlopen(). If they are in use, + // we set DF_STATIC_TLS in the ELF header so that the runtime can reject such + // DSOs. + if (Type == R_386_TLS_LE || Type == R_386_TLS_LE_32 || Type == R_386_TLS_IE || + Type == R_386_TLS_GOTIE) + Config->HasStaticTlsModel = true; + switch (Type) { case R_386_8: case R_386_16: @@ -451,14 +451,6 @@ uint32_t X86TargetInfo::getDynRel(uint32 return Type; } -bool X86TargetInfo::isTlsLocalDynamicRel(uint32_t Type) const { - return Type == R_386_TLS_LDO_32 || Type == R_386_TLS_LDM; -} - -bool X86TargetInfo::isTlsInitialExecRel(uint32_t Type) const { - return Type == R_386_TLS_IE || Type == R_386_TLS_GOTIE; -} - void X86TargetInfo::writePltHeader(uint8_t *Buf) const { if (Config->Pic) { const uint8_t V[] = { @@ -772,17 +764,6 @@ bool X86_64TargetInfo::isPicRel(ui } template -bool X86_64TargetInfo::isTlsInitialExecRel(uint32_t Type) const { - return Type == R_X86_64_GOTTPOFF; -} - -template -bool X86_64TargetInfo::isTlsLocalDynamicRel(uint32_t Type) const { - return Type == R_X86_64_DTPOFF32 || Type == R_X86_64_DTPOFF64 || - Type == R_X86_64_TLSLD; -} - -template void X86_64TargetInfo::relaxTlsGdToLe(uint8_t *Loc, uint32_t Type, uint64_t Val) const { // Convert @@ -1383,11 +1364,6 @@ bool AArch64TargetInfo::usesOnlyLowPageB } } -bool AArch64TargetInfo::isTlsInitialExecRel(uint32_t Type) const { - return Type == R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 || - Type == R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC; -} - bool AArch64TargetInfo::isPicRel(uint32_t Type) const { return Type == R_AARCH64_ABS32 || Type == R_AARCH64_ABS64; } Modified: vendor/lld/dist/ELF/Target.h ============================================================================== --- vendor/lld/dist/ELF/Target.h Mon May 8 17:13:41 2017 (r317956) +++ vendor/lld/dist/ELF/Target.h Mon May 8 17:13:44 2017 (r317957) @@ -23,8 +23,6 @@ class SymbolBody; class TargetInfo { public: - virtual bool isTlsInitialExecRel(uint32_t Type) const; - virtual bool isTlsLocalDynamicRel(uint32_t Type) const; virtual bool isPicRel(uint32_t Type) const { return true; } virtual uint32_t getDynRel(uint32_t Type) const { return Type; } virtual void writeGotPltHeader(uint8_t *Buf) const {} Modified: vendor/lld/dist/ELF/Writer.cpp ============================================================================== --- vendor/lld/dist/ELF/Writer.cpp Mon May 8 17:13:41 2017 (r317956) +++ vendor/lld/dist/ELF/Writer.cpp Mon May 8 17:13:44 2017 (r317957) @@ -62,7 +62,6 @@ private: void assignFileOffsets(); void assignFileOffsetsBinary(); void setPhdrs(); - void fixHeaders(); void fixSectionAlignments(); void fixPredefinedSymbols(); void openFile(); @@ -86,7 +85,6 @@ private: uint64_t FileSize; uint64_t SectionHeaderOff; - bool AllocateHeader = true; }; } // anonymous namespace @@ -252,7 +250,7 @@ template void Writer: } else { if (!Script->Opt.HasSections) { fixSectionAlignments(); - Script->fabricateDefaultCommands(AllocateHeader); + Script->fabricateDefaultCommands(); } Script->synchronize(); Script->assignAddresses(Phdrs); @@ -747,15 +745,12 @@ static bool compareSectionsNonScript(con // Output section ordering is determined by this function. template static bool compareSections(const OutputSection *A, const OutputSection *B) { - // For now, put sections mentioned in a linker script first. - int AIndex = Script->getSectionIndex(A->Name); - int BIndex = Script->getSectionIndex(B->Name); - bool AInScript = AIndex != INT_MAX; - bool BInScript = BIndex != INT_MAX; - if (AInScript != BInScript) - return AInScript; - // If both are in the script, use that order. - if (AInScript) + // For now, put sections mentioned in a linker script + // first. Sections not on linker script will have a SectionIndex of + // INT_MAX. + int AIndex = A->SectionIndex; + int BIndex = B->SectionIndex; + if (AIndex != BIndex) return AIndex < BIndex; return compareSectionsNonScript(A, B); @@ -1021,9 +1016,8 @@ template void Writer: auto I = OutputSections.begin(); auto E = OutputSections.end(); auto NonScriptI = - std::find_if(OutputSections.begin(), E, [](OutputSection *S) { - return Script->getSectionIndex(S->Name) == INT_MAX; - }); + std::find_if(OutputSections.begin(), E, + [](OutputSection *S) { return S->SectionIndex == INT_MAX; }); while (NonScriptI != E) { auto BestPos = std::max_element( I, NonScriptI, [&](OutputSection *&A, OutputSection *&B) { @@ -1176,7 +1170,7 @@ template void Writer: if (!Config->Relocatable && !Config->OFormatBinary) { Phdrs = Script->hasPhdrsCommands() ? Script->createPhdrs() : createPhdrs(); addPtArmExid(Phdrs); - fixHeaders(); + Out::ProgramHeaders->Size = sizeof(Elf_Phdr) * Phdrs.size(); } // Dynamic section must be the last one in this list and dynamic @@ -1321,6 +1315,11 @@ template std::vectoradd(Out::ElfHeader); + Load->add(Out::ProgramHeaders); + for (OutputSection *Sec : OutputSections) { if (!(Sec->Flags & SHF_ALLOC)) break; @@ -1447,64 +1446,6 @@ template void Writer: } } -bool elf::allocateHeaders(std::vector &Phdrs, - ArrayRef OutputSections, - uint64_t Min) { - auto FirstPTLoad = - std::find_if(Phdrs.begin(), Phdrs.end(), - [](const PhdrEntry &E) { return E.p_type == PT_LOAD; }); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Mon May 8 17:13:58 2017 Return-Path: Delivered-To: svn-src-vendor@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 0ED96D63758; Mon, 8 May 2017 17:13:58 +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 C7C40C4A; Mon, 8 May 2017 17:13:57 +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 v48HDuXR043147; Mon, 8 May 2017 17:13:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v48HDsFW043121; Mon, 8 May 2017 17:13:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705081713.v48HDsFW043121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 8 May 2017 17:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317959 - in vendor/lldb/dist: include/lldb/API include/lldb/Core include/lldb/Expression include/lldb/Host include/lldb/Host/common include/lldb/Target include/lldb/Utility packages/Py... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2017 17:13:58 -0000 Author: dim Date: Mon May 8 17:13:54 2017 New Revision: 317959 URL: https://svnweb.freebsd.org/changeset/base/317959 Log: Vendor import of lldb trunk r302418: https://llvm.org/svn/llvm-project/lldb/trunk@302418 Added: vendor/lldb/dist/unittests/Host/MainLoopTest.cpp (contents, props changed) Modified: vendor/lldb/dist/include/lldb/API/SBAddress.h vendor/lldb/dist/include/lldb/API/SBInstruction.h vendor/lldb/dist/include/lldb/API/SBInstructionList.h vendor/lldb/dist/include/lldb/Core/Disassembler.h vendor/lldb/dist/include/lldb/Expression/Expression.h vendor/lldb/dist/include/lldb/Host/MainLoop.h vendor/lldb/dist/include/lldb/Host/common/UDPSocket.h vendor/lldb/dist/include/lldb/Target/ThreadPlanCallFunction.h vendor/lldb/dist/include/lldb/Target/ThreadPlanCallUserExpression.h vendor/lldb/dist/include/lldb/Utility/TaskPool.h vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteHostInfo.py vendor/lldb/dist/scripts/interface/SBInstruction.i vendor/lldb/dist/scripts/interface/SBInstructionList.i vendor/lldb/dist/source/API/SBAddress.cpp vendor/lldb/dist/source/API/SBInstruction.cpp vendor/lldb/dist/source/API/SBInstructionList.cpp vendor/lldb/dist/source/API/SBProcess.cpp vendor/lldb/dist/source/Core/Disassembler.cpp vendor/lldb/dist/source/Host/common/Editline.cpp vendor/lldb/dist/source/Host/common/MainLoop.cpp vendor/lldb/dist/source/Host/common/UDPSocket.cpp vendor/lldb/dist/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp vendor/lldb/dist/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp vendor/lldb/dist/source/Target/ThreadPlanCallUserExpression.cpp vendor/lldb/dist/source/Utility/TaskPool.cpp vendor/lldb/dist/unittests/Host/CMakeLists.txt vendor/lldb/dist/unittests/Utility/TaskPoolTest.cpp vendor/lldb/dist/www/lldb-gdb.html Modified: vendor/lldb/dist/include/lldb/API/SBAddress.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBAddress.h Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/include/lldb/API/SBAddress.h Mon May 8 17:13:54 2017 (r317959) @@ -103,6 +103,8 @@ protected: const lldb_private::Address *operator->() const; + friend bool operator==(const SBAddress &lhs, const SBAddress &rhs); + lldb_private::Address *get(); lldb_private::Address &ref(); @@ -117,6 +119,8 @@ private: std::unique_ptr m_opaque_ap; }; +bool operator==(const SBAddress &lhs, const SBAddress &rhs); + } // namespace lldb #endif // LLDB_SBAddress_h_ Modified: vendor/lldb/dist/include/lldb/API/SBInstruction.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBInstruction.h Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/include/lldb/API/SBInstruction.h Mon May 8 17:13:54 2017 (r317959) @@ -53,6 +53,8 @@ public: bool HasDelaySlot(); + bool CanSetBreakpoint(); + void Print(FILE *out); bool GetDescription(lldb::SBStream &description); Modified: vendor/lldb/dist/include/lldb/API/SBInstructionList.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBInstructionList.h Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/include/lldb/API/SBInstructionList.h Mon May 8 17:13:54 2017 (r317959) @@ -32,6 +32,15 @@ public: lldb::SBInstruction GetInstructionAtIndex(uint32_t idx); + // ---------------------------------------------------------------------- + // Returns the number of instructions between the start and end address. + // If canSetBreakpoint is true then the count will be the number of + // instructions on which a breakpoint can be set. + // ---------------------------------------------------------------------- + size_t GetInstructionsCount(const SBAddress &start, + const SBAddress &end, + bool canSetBreakpoint = false); + void Clear(); void AppendInstruction(lldb::SBInstruction inst); Modified: vendor/lldb/dist/include/lldb/Core/Disassembler.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/Disassembler.h Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/include/lldb/Core/Disassembler.h Mon May 8 17:13:54 2017 (r317959) @@ -173,6 +173,8 @@ public: virtual bool HasDelaySlot(); + bool CanSetBreakpoint (); + virtual size_t Decode(const Disassembler &disassembler, const DataExtractor &data, lldb::offset_t data_offset) = 0; Modified: vendor/lldb/dist/include/lldb/Expression/Expression.h ============================================================================== --- vendor/lldb/dist/include/lldb/Expression/Expression.h Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/include/lldb/Expression/Expression.h Mon May 8 17:13:54 2017 (r317959) @@ -99,6 +99,16 @@ public: //------------------------------------------------------------------ lldb::addr_t StartAddress() { return m_jit_start_addr; } + //------------------------------------------------------------------ + /// Called to notify the expression that it is about to be executed. + //------------------------------------------------------------------ + virtual void WillStartExecuting() {} + + //------------------------------------------------------------------ + /// Called to notify the expression that its execution has finished. + //------------------------------------------------------------------ + virtual void DidFinishExecuting() {} + virtual ExpressionTypeSystemHelper *GetTypeSystemHelper() { return nullptr; } protected: Modified: vendor/lldb/dist/include/lldb/Host/MainLoop.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/MainLoop.h Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/include/lldb/Host/MainLoop.h Mon May 8 17:13:54 2017 (r317959) @@ -42,6 +42,7 @@ private: public: typedef std::unique_ptr SignalHandleUP; + MainLoop(); ~MainLoop() override; ReadHandleUP RegisterReadObject(const lldb::IOObjectSP &object_sp, @@ -71,6 +72,9 @@ protected: void UnregisterSignal(int signo); private: + void ProcessReadObject(IOObject::WaitableHandle handle); + void ProcessSignal(int signo); + class SignalHandle { public: ~SignalHandle() { m_mainloop.UnregisterSignal(m_signo); } @@ -97,6 +101,9 @@ private: llvm::DenseMap m_read_fds; llvm::DenseMap m_signals; +#if HAVE_SYS_EVENT_H + int m_kqueue; +#endif bool m_terminate_request : 1; }; Modified: vendor/lldb/dist/include/lldb/Host/common/UDPSocket.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/common/UDPSocket.h Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/include/lldb/Host/common/UDPSocket.h Mon May 8 17:13:54 2017 (r317959) @@ -21,15 +21,13 @@ public: Socket *&socket); private: - UDPSocket(NativeSocket socket, const UDPSocket &listen_socket); + UDPSocket(NativeSocket socket); size_t Send(const void *buf, const size_t num_bytes) override; Error Connect(llvm::StringRef name) override; Error Listen(llvm::StringRef name, int backlog) override; Error Accept(Socket *&socket) override; - Error CreateSocket(); - SocketAddress m_sockaddr; }; } Modified: vendor/lldb/dist/include/lldb/Target/ThreadPlanCallFunction.h ============================================================================== --- vendor/lldb/dist/include/lldb/Target/ThreadPlanCallFunction.h Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/include/lldb/Target/ThreadPlanCallFunction.h Mon May 8 17:13:54 2017 (r317959) @@ -117,7 +117,7 @@ protected: lldb::addr_t &start_load_addr, lldb::addr_t &function_load_addr); - void DoTakedown(bool success); + virtual void DoTakedown(bool success); void SetBreakpoints(); Modified: vendor/lldb/dist/include/lldb/Target/ThreadPlanCallUserExpression.h ============================================================================== --- vendor/lldb/dist/include/lldb/Target/ThreadPlanCallUserExpression.h Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/include/lldb/Target/ThreadPlanCallUserExpression.h Mon May 8 17:13:54 2017 (r317959) @@ -35,6 +35,8 @@ public: void GetDescription(Stream *s, lldb::DescriptionLevel level) override; + void DidPush() override; + void WillPop() override; lldb::StopInfoSP GetRealStopInfo() override; @@ -48,6 +50,7 @@ public: } protected: + void DoTakedown(bool success) override; private: lldb::UserExpressionSP m_user_expression_sp; // This is currently just used to ensure the Modified: vendor/lldb/dist/include/lldb/Utility/TaskPool.h ============================================================================== --- vendor/lldb/dist/include/lldb/Utility/TaskPool.h Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/include/lldb/Utility/TaskPool.h Mon May 8 17:13:54 2017 (r317959) @@ -53,50 +53,6 @@ private: static void AddTaskImpl(std::function &&task_fn); }; -// Wrapper class around the global TaskPool implementation to make it possible -// to create a set of -// tasks and then wait for the tasks to be completed by the -// WaitForNextCompletedTask call. This -// class should be used when WaitForNextCompletedTask is needed because this -// class add no other -// extra functionality to the TaskPool class and it have a very minor -// performance overhead. -template // The return type of the tasks what will be added to this - // task runner - class TaskRunner { -public: - // Add a task to the task runner what will also add the task to the global - // TaskPool. The - // function doesn't return the std::future for the task because it will be - // supplied by the - // WaitForNextCompletedTask after the task is completed. - template void AddTask(F &&f, Args &&... args); - - // Wait for the next task in this task runner to finish and then return the - // std::future what - // belongs to the finished task. If there is no task in this task runner - // (neither pending nor - // comleted) then this function will return an invalid future. Usually this - // function should be - // called in a loop processing the results of the tasks until it returns an - // invalid std::future - // what means that all task in this task runner is completed. - std::future WaitForNextCompletedTask(); - - // Convenience method to wait for all task in this TaskRunner to finish. Do - // NOT use this class - // just because of this method. Use TaskPool instead and wait for each - // std::future returned by - // AddTask in a loop. - void WaitForAllTasks(); - -private: - std::list> m_ready; - std::list> m_pending; - std::mutex m_mutex; - std::condition_variable m_cv; -}; - template std::future::type> TaskPool::AddTask(F &&f, Args &&... args) { @@ -126,64 +82,10 @@ template <> struct TaskPool::RunTaskImpl static void Run() {} }; -template -template -void TaskRunner::AddTask(F &&f, Args &&... args) { - std::unique_lock lock(m_mutex); - auto it = m_pending.emplace(m_pending.end()); - *it = std::move(TaskPool::AddTask( - [this, it](F f, Args... args) { - T &&r = f(std::forward(args)...); - - std::unique_lock lock(this->m_mutex); - this->m_ready.splice(this->m_ready.end(), this->m_pending, it); - lock.unlock(); - - this->m_cv.notify_one(); - return r; - }, - std::forward(f), std::forward(args)...)); -} - -template <> -template -void TaskRunner::AddTask(F &&f, Args &&... args) { - std::unique_lock lock(m_mutex); - auto it = m_pending.emplace(m_pending.end()); - *it = std::move(TaskPool::AddTask( - [this, it](F f, Args... args) { - f(std::forward(args)...); - - std::unique_lock lock(this->m_mutex); - this->m_ready.emplace_back(std::move(*it)); - this->m_pending.erase(it); - lock.unlock(); - - this->m_cv.notify_one(); - }, - std::forward(f), std::forward(args)...)); -} - -template std::future TaskRunner::WaitForNextCompletedTask() { - std::unique_lock lock(m_mutex); - if (m_ready.empty() && m_pending.empty()) - return std::future(); // No more tasks - - if (m_ready.empty()) - m_cv.wait(lock, [this]() { return !this->m_ready.empty(); }); - - std::future res = std::move(m_ready.front()); - m_ready.pop_front(); - - lock.unlock(); - res.wait(); - - return std::move(res); -} - -template void TaskRunner::WaitForAllTasks() { - while (WaitForNextCompletedTask().valid()) - ; -} +// Run 'func' on every value from begin .. end-1. Each worker will grab +// 'batch_size' numbers at a time to work on, so for very fast functions, batch +// should be large enough to avoid too much cache line contention. +void TaskMapOverInt(size_t begin, size_t end, + std::function const &func); #endif // #ifndef utility_TaskPool_h_ Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py Mon May 8 17:13:54 2017 (r317959) @@ -12,6 +12,7 @@ from lldbsuite.test import lldbutil class MultilineExpressionsTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) + NO_DEBUG_INFO_TESTCASE = True def setUp(self): # Call super's setUp(). @@ -60,3 +61,30 @@ class MultilineExpressionsTestCase(TestB child.expect_exact(prompt) self.expect(child.before, exe=False, patterns=['= 5']) + + @skipIfRemote + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr22274: need a pexpect replacement for windows") + def test_empty_list(self): + """Test printing an empty list of expressions""" + import pexpect + prompt = "(lldb) " + + # So that the child gets torn down after the test + self.child = pexpect.spawn( + "%s %s" % + (lldbtest_config.lldbExec, self.lldbOption)) + child = self.child + + # Turn on logging for what the child sends back. + if self.TraceOn(): + child.logfile_read = sys.stdout + + # We expect a prompt, then send "print" to start a list of expressions, + # then an empty line. We expect a prompt back. + child.expect_exact(prompt) + child.sendline("print") + child.expect_exact('1:') + child.sendline("") + child.expect_exact(prompt) Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py Mon May 8 17:13:54 2017 (r317959) @@ -62,12 +62,11 @@ class StepOverBreakpointsTestCase(TestBa instructions = function.GetInstructions(self.target) addr_1 = self.breakpoint1.GetLocationAtIndex(0).GetAddress() addr_4 = self.breakpoint4.GetLocationAtIndex(0).GetAddress() - for i in range(instructions.GetSize()) : - addr = instructions.GetInstructionAtIndex(i).GetAddress() - if (addr == addr_1) : index_1 = i - if (addr == addr_4) : index_4 = i - steps_expected = index_4 - index_1 + # if third argument is true then the count will be the number of + # instructions on which a breakpoint can be set. + # start = addr_1, end = addr_4, canSetBreakpoint = True + steps_expected = instructions.GetInstructionsCount(addr_1, addr_4, True) step_count = 0 # Step from breakpoint_1 to breakpoint_4 while True: Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py Mon May 8 17:13:54 2017 (r317959) @@ -171,17 +171,45 @@ class ReturnValueTestCase(TestBase): #self.return_and_test_struct_value ("return_one_int_one_double_packed") self.return_and_test_struct_value("return_one_int_one_long") - # icc and gcc don't support this extension. - if self.getCompiler().endswith('clang'): - self.return_and_test_struct_value("return_vector_size_float32_8") - self.return_and_test_struct_value("return_vector_size_float32_16") - self.return_and_test_struct_value("return_vector_size_float32_32") - self.return_and_test_struct_value( - "return_ext_vector_size_float32_2") - self.return_and_test_struct_value( - "return_ext_vector_size_float32_4") - self.return_and_test_struct_value( - "return_ext_vector_size_float32_8") + @expectedFailureAll(oslist=["freebsd"], archs=["i386"]) + @expectedFailureAll(oslist=["macosx"], archs=["i386"], bugnumber="") + @expectedFailureAll( + oslist=["linux"], + compiler="clang", + compiler_version=[ + "<=", + "3.6"], + archs=["i386"]) + @expectedFailureAll( + bugnumber="llvm.org/pr25785", + hostoslist=["windows"], + compiler="gcc", + archs=["i386"], + triple='.*-android') + @expectedFailureAll(compiler=["gcc"], archs=["x86_64", "i386"]) + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778") + def test_vector_values(self): + self.build() + exe = os.path.join(os.getcwd(), "a.out") + error = lldb.SBError() + + self.target = self.dbg.CreateTarget(exe) + self.assertTrue(self.target, VALID_TARGET) + + main_bktp = self.target.BreakpointCreateByName("main", exe) + self.assertTrue(main_bktp, VALID_BREAKPOINT) + + self.process = self.target.LaunchSimple( + None, None, self.get_process_working_directory()) + self.assertEqual(len(lldbutil.get_threads_stopped_at_breakpoint( + self.process, main_bktp)), 1) + + self.return_and_test_struct_value("return_vector_size_float32_8") + self.return_and_test_struct_value("return_vector_size_float32_16") + self.return_and_test_struct_value("return_vector_size_float32_32") + self.return_and_test_struct_value("return_ext_vector_size_float32_2") + self.return_and_test_struct_value("return_ext_vector_size_float32_4") + self.return_and_test_struct_value("return_ext_vector_size_float32_8") def return_and_test_struct_value(self, func_name): """Pass in the name of the function to return from - takes in value, returns value.""" Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteHostInfo.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteHostInfo.py Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteHostInfo.py Mon May 8 17:13:54 2017 (r317959) @@ -14,6 +14,7 @@ class TestGdbRemoteHostInfo(GdbRemoteTes mydir = TestBase.compute_mydir(__file__) KNOWN_HOST_INFO_KEYS = set([ + "arch", "cputype", "cpusubtype", "distribution_id", Modified: vendor/lldb/dist/scripts/interface/SBInstruction.i ============================================================================== --- vendor/lldb/dist/scripts/interface/SBInstruction.i Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/scripts/interface/SBInstruction.i Mon May 8 17:13:54 2017 (r317959) @@ -54,6 +54,9 @@ public: bool HasDelaySlot (); + bool + CanSetBreakpoint (); + void Print (FILE *out); Modified: vendor/lldb/dist/scripts/interface/SBInstructionList.i ============================================================================== --- vendor/lldb/dist/scripts/interface/SBInstructionList.i Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/scripts/interface/SBInstructionList.i Mon May 8 17:13:54 2017 (r317959) @@ -44,6 +44,9 @@ public: lldb::SBInstruction GetInstructionAtIndex (uint32_t idx); + size_t GetInstructionsCount(const SBAddress &start, const SBAddress &end, + bool canSetBreakpoint); + void Clear (); Modified: vendor/lldb/dist/source/API/SBAddress.cpp ============================================================================== --- vendor/lldb/dist/source/API/SBAddress.cpp Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/source/API/SBAddress.cpp Mon May 8 17:13:54 2017 (r317959) @@ -55,6 +55,12 @@ const SBAddress &SBAddress::operator=(co return *this; } +bool lldb::operator==(const SBAddress &lhs, const SBAddress &rhs) { + if (lhs.IsValid() && rhs.IsValid()) + return lhs.ref() == rhs.ref(); + return false; +} + bool SBAddress::IsValid() const { return m_opaque_ap.get() != NULL && m_opaque_ap->IsValid(); } Modified: vendor/lldb/dist/source/API/SBInstruction.cpp ============================================================================== --- vendor/lldb/dist/source/API/SBInstruction.cpp Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/source/API/SBInstruction.cpp Mon May 8 17:13:54 2017 (r317959) @@ -176,6 +176,13 @@ bool SBInstruction::HasDelaySlot() { return false; } +bool SBInstruction::CanSetBreakpoint () { + lldb::InstructionSP inst_sp(GetOpaque()); + if (inst_sp) + return inst_sp->CanSetBreakpoint(); + return false; +} + lldb::InstructionSP SBInstruction::GetOpaque() { if (m_opaque_sp) return m_opaque_sp->GetSP(); Modified: vendor/lldb/dist/source/API/SBInstructionList.cpp ============================================================================== --- vendor/lldb/dist/source/API/SBInstructionList.cpp Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/source/API/SBInstructionList.cpp Mon May 8 17:13:54 2017 (r317959) @@ -9,6 +9,7 @@ #include "lldb/API/SBInstructionList.h" #include "lldb/API/SBInstruction.h" +#include "lldb/API/SBAddress.h" #include "lldb/API/SBStream.h" #include "lldb/Core/Disassembler.h" #include "lldb/Core/Module.h" @@ -49,6 +50,31 @@ SBInstruction SBInstructionList::GetInst return inst; } +size_t SBInstructionList::GetInstructionsCount(const SBAddress &start, + const SBAddress &end, + bool canSetBreakpoint) { + size_t num_instructions = GetSize(); + size_t i = 0; + SBAddress addr; + size_t lower_index = 0; + size_t upper_index = 0; + size_t instructions_to_skip = 0; + for (i = 0; i < num_instructions; ++i) { + addr = GetInstructionAtIndex(i).GetAddress(); + if (start == addr) + lower_index = i; + if (end == addr) + upper_index = i; + } + if (canSetBreakpoint) + for (i = lower_index; i <= upper_index; ++i) { + SBInstruction insn = GetInstructionAtIndex(i); + if (!insn.CanSetBreakpoint()) + ++instructions_to_skip; + } + return upper_index - lower_index - instructions_to_skip; +} + void SBInstructionList::Clear() { m_opaque_sp.reset(); } void SBInstructionList::AppendInstruction(SBInstruction insn) {} Modified: vendor/lldb/dist/source/API/SBProcess.cpp ============================================================================== --- vendor/lldb/dist/source/API/SBProcess.cpp Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/source/API/SBProcess.cpp Mon May 8 17:13:54 2017 (r317959) @@ -1157,22 +1157,34 @@ uint32_t SBProcess::LoadImage(lldb::SBFi uint32_t SBProcess::LoadImage(const lldb::SBFileSpec &sb_local_image_spec, const lldb::SBFileSpec &sb_remote_image_spec, lldb::SBError &sb_error) { + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); ProcessSP process_sp(GetSP()); if (process_sp) { Process::StopLocker stop_locker; if (stop_locker.TryLock(&process_sp->GetRunLock())) { + if (log) + log->Printf("SBProcess(%p)::LoadImage() => calling Platform::LoadImage" + "for: %s", + static_cast(process_sp.get()), + sb_local_image_spec.GetFilename()); + std::lock_guard guard( - process_sp->GetTarget().GetAPIMutex()); + process_sp->GetTarget().GetAPIMutex()); PlatformSP platform_sp = process_sp->GetTarget().GetPlatform(); return platform_sp->LoadImage(process_sp.get(), *sb_local_image_spec, *sb_remote_image_spec, sb_error.ref()); } else { - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); if (log) log->Printf("SBProcess(%p)::LoadImage() => error: process is running", static_cast(process_sp.get())); sb_error.SetErrorString("process is running"); } + } else { + if (log) + log->Printf("SBProcess(%p)::LoadImage() => error: called with invalid" + " process", + static_cast(process_sp.get())); + sb_error.SetErrorString("process is invalid"); } return LLDB_INVALID_IMAGE_TOKEN; } Modified: vendor/lldb/dist/source/Core/Disassembler.cpp ============================================================================== --- vendor/lldb/dist/source/Core/Disassembler.cpp Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/source/Core/Disassembler.cpp Mon May 8 17:13:54 2017 (r317959) @@ -759,6 +759,10 @@ bool Instruction::DumpEmulation(const Ar return false; } +bool Instruction::CanSetBreakpoint () { + return !HasDelaySlot(); +} + bool Instruction::HasDelaySlot() { // Default is false. return false; Modified: vendor/lldb/dist/source/Host/common/Editline.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/Editline.cpp Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/source/Host/common/Editline.cpp Mon May 8 17:13:54 2017 (r317959) @@ -367,7 +367,7 @@ void Editline::MoveCursor(CursorLocation if (to == CursorLocation::EditingCursor) { toColumn = editline_cursor_position - (editline_cursor_row * m_terminal_width) + 1; - } else if (to == CursorLocation::BlockEnd) { + } else if (to == CursorLocation::BlockEnd && !m_input_lines.empty()) { toColumn = ((m_input_lines[m_input_lines.size() - 1].length() + GetPromptWidth()) % 80) + Modified: vendor/lldb/dist/source/Host/common/MainLoop.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/MainLoop.cpp Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/source/Host/common/MainLoop.cpp Mon May 8 17:13:54 2017 (r317959) @@ -18,6 +18,11 @@ #include #include +// Multiplexing is implemented using kqueue on systems that support it (BSD +// variants including OSX). On linux we use ppoll, while android uses pselect +// (ppoll is present but not implemented properly). On windows we use WSApoll +// (which does not support signals). + #if HAVE_SYS_EVENT_H #include #elif defined(LLVM_ON_WIN32) @@ -65,92 +70,72 @@ static void SignalHandler(int signo, sig class MainLoop::RunImpl { public: - // TODO: Use llvm::Expected - static std::unique_ptr Create(MainLoop &loop, Error &error); - ~RunImpl(); + RunImpl(MainLoop &loop); + ~RunImpl() = default; Error Poll(); - - template void ForEachReadFD(F &&f); - template void ForEachSignal(F &&f); + void ProcessEvents(); private: MainLoop &loop; #if HAVE_SYS_EVENT_H - int queue_id; std::vector in_events; struct kevent out_events[4]; int num_events = -1; - RunImpl(MainLoop &loop, int queue_id) : loop(loop), queue_id(queue_id) { - in_events.reserve(loop.m_read_fds.size() + loop.m_signals.size()); - } #else - std::vector signals; #ifdef FORCE_PSELECT fd_set read_fd_set; #else std::vector read_fds; #endif - RunImpl(MainLoop &loop) : loop(loop) { - signals.reserve(loop.m_signals.size()); - } - sigset_t get_sigmask(); #endif }; #if HAVE_SYS_EVENT_H -MainLoop::RunImpl::~RunImpl() { - int r = close(queue_id); - assert(r == 0); - (void)r; -} -std::unique_ptr MainLoop::RunImpl::Create(MainLoop &loop, Error &error) -{ - error.Clear(); - int queue_id = kqueue(); - if(queue_id < 0) { - error = Error(errno, eErrorTypePOSIX); - return nullptr; - } - return std::unique_ptr(new RunImpl(loop, queue_id)); +MainLoop::RunImpl::RunImpl(MainLoop &loop) : loop(loop) { + in_events.reserve(loop.m_read_fds.size()); } Error MainLoop::RunImpl::Poll() { - in_events.resize(loop.m_read_fds.size() + loop.m_signals.size()); + in_events.resize(loop.m_read_fds.size()); unsigned i = 0; for (auto &fd : loop.m_read_fds) EV_SET(&in_events[i++], fd.first, EVFILT_READ, EV_ADD, 0, 0, 0); - for (const auto &sig : loop.m_signals) - EV_SET(&in_events[i++], sig.first, EVFILT_SIGNAL, EV_ADD, 0, 0, 0); - - num_events = kevent(queue_id, in_events.data(), in_events.size(), out_events, - llvm::array_lengthof(out_events), nullptr); + num_events = kevent(loop.m_kqueue, in_events.data(), in_events.size(), + out_events, llvm::array_lengthof(out_events), nullptr); if (num_events < 0) return Error("kevent() failed with error %d\n", num_events); return Error(); } -template void MainLoop::RunImpl::ForEachReadFD(F &&f) { +void MainLoop::RunImpl::ProcessEvents() { assert(num_events >= 0); for (int i = 0; i < num_events; ++i) { - f(out_events[i].ident); if (loop.m_terminate_request) return; + switch (out_events[i].filter) { + case EVFILT_READ: + loop.ProcessReadObject(out_events[i].ident); + break; + case EVFILT_SIGNAL: + loop.ProcessSignal(out_events[i].ident); + break; + default: + llvm_unreachable("Unknown event"); + } } } -template void MainLoop::RunImpl::ForEachSignal(F && f) {} #else -MainLoop::RunImpl::~RunImpl() {} -std::unique_ptr MainLoop::RunImpl::Create(MainLoop &loop, Error &error) -{ - error.Clear(); - return std::unique_ptr(new RunImpl(loop)); +MainLoop::RunImpl::RunImpl(MainLoop &loop) : loop(loop) { +#ifndef FORCE_PSELECT + read_fds.reserve(loop.m_read_fds.size()); +#endif } sigset_t MainLoop::RunImpl::get_sigmask() { @@ -162,18 +147,14 @@ sigset_t MainLoop::RunImpl::get_sigmask( assert(ret == 0); (void) ret; - for (const auto &sig : loop.m_signals) { - signals.push_back(sig.first); + for (const auto &sig : loop.m_signals) sigdelset(&sigmask, sig.first); - } return sigmask; #endif } #ifdef FORCE_PSELECT Error MainLoop::RunImpl::Poll() { - signals.clear(); - FD_ZERO(&read_fd_set); int nfds = 0; for (const auto &fd : loop.m_read_fds) { @@ -188,20 +169,8 @@ Error MainLoop::RunImpl::Poll() { return Error(); } - -template void MainLoop::RunImpl::ForEachReadFD(F &&f) { - for (const auto &fd : loop.m_read_fds) { - if(!FD_ISSET(fd.first, &read_fd_set)) - continue; - - f(fd.first); - if (loop.m_terminate_request) - return; - } -} #else Error MainLoop::RunImpl::Poll() { - signals.clear(); read_fds.clear(); sigset_t sigmask = get_sigmask(); @@ -220,33 +189,47 @@ Error MainLoop::RunImpl::Poll() { return Error(); } +#endif -template void MainLoop::RunImpl::ForEachReadFD(F &&f) { +void MainLoop::RunImpl::ProcessEvents() { +#ifdef FORCE_PSELECT + for (const auto &fd : loop.m_read_fds) { + if (!FD_ISSET(fd.first, &read_fd_set)) + continue; + IOObject::WaitableHandle handle = fd.first; +#else for (const auto &fd : read_fds) { if ((fd.revents & POLLIN) == 0) continue; - - f(fd.fd); + IOObject::WaitableHandle handle = fd.fd; +#endif if (loop.m_terminate_request) return; - } -} -#endif -template void MainLoop::RunImpl::ForEachSignal(F &&f) { - for (int sig : signals) { - if (g_signal_flags[sig] == 0) - continue; // No signal - g_signal_flags[sig] = 0; - f(sig); + loop.ProcessReadObject(handle); + } + for (const auto &entry : loop.m_signals) { if (loop.m_terminate_request) return; + if (g_signal_flags[entry.first] == 0) + continue; // No signal + g_signal_flags[entry.first] = 0; + loop.ProcessSignal(entry.first); } } #endif +MainLoop::MainLoop() { +#if HAVE_SYS_EVENT_H + m_kqueue = kqueue(); + assert(m_kqueue >= 0); +#endif +} MainLoop::~MainLoop() { +#if HAVE_SYS_EVENT_H + close(m_kqueue); +#endif assert(m_read_fds.size() == 0); assert(m_signals.size() == 0); } @@ -298,24 +281,30 @@ MainLoop::RegisterSignal(int signo, cons new_action.sa_flags = SA_SIGINFO; sigemptyset(&new_action.sa_mask); sigaddset(&new_action.sa_mask, signo); - sigset_t old_set; - if (int ret = pthread_sigmask(SIG_BLOCK, &new_action.sa_mask, &old_set)) { - error.SetErrorStringWithFormat("pthread_sigmask failed with error %d\n", - ret); - return nullptr; - } - info.was_blocked = sigismember(&old_set, signo); - if (sigaction(signo, &new_action, &info.old_action) == -1) { - error.SetErrorToErrno(); - if (!info.was_blocked) - pthread_sigmask(SIG_UNBLOCK, &new_action.sa_mask, nullptr); - return nullptr; - } + g_signal_flags[signo] = 0; + + // Even if using kqueue, the signal handler will still be invoked, so it's + // important to replace it with our "bening" handler. + int ret = sigaction(signo, &new_action, &info.old_action); + assert(ret == 0 && "sigaction failed"); + +#if HAVE_SYS_EVENT_H + struct kevent ev; + EV_SET(&ev, signo, EVFILT_SIGNAL, EV_ADD, 0, 0, 0); + ret = kevent(m_kqueue, &ev, 1, nullptr, 0, nullptr); + assert(ret == 0); +#endif + // If we're using kqueue, the signal needs to be unblocked in order to recieve + // it. If using pselect/ppoll, we need to block it, and later unblock it as a + // part of the system call. + ret = pthread_sigmask(HAVE_SYS_EVENT_H ? SIG_UNBLOCK : SIG_BLOCK, + &new_action.sa_mask, &old_set); + assert(ret == 0 && "pthread_sigmask failed"); + info.was_blocked = sigismember(&old_set, signo); m_signals.insert({signo, info}); - g_signal_flags[signo] = 0; return SignalHandleUP(new SignalHandle(*this, signo)); #endif @@ -331,7 +320,6 @@ void MainLoop::UnregisterSignal(int sign #if SIGNAL_POLLING_UNSUPPORTED Error("Signal polling is not supported on this platform."); #else - // We undo the actions of RegisterSignal on a best-effort basis. auto it = m_signals.find(signo); assert(it != m_signals.end()); @@ -340,8 +328,17 @@ void MainLoop::UnregisterSignal(int sign sigset_t set; sigemptyset(&set); sigaddset(&set, signo); - pthread_sigmask(it->second.was_blocked ? SIG_BLOCK : SIG_UNBLOCK, &set, - nullptr); + int ret = pthread_sigmask(it->second.was_blocked ? SIG_BLOCK : SIG_UNBLOCK, + &set, nullptr); + assert(ret == 0); + (void)ret; + +#if HAVE_SYS_EVENT_H + struct kevent ev; + EV_SET(&ev, signo, EVFILT_SIGNAL, EV_DELETE, 0, 0, 0); + ret = kevent(m_kqueue, &ev, 1, nullptr, 0, nullptr); + assert(ret == 0); +#endif m_signals.erase(it); #endif @@ -351,32 +348,31 @@ Error MainLoop::Run() { m_terminate_request = false; Error error; - auto impl = RunImpl::Create(*this, error); - if (!impl) - return error; + RunImpl impl(*this); // run until termination or until we run out of things to listen to while (!m_terminate_request && (!m_read_fds.empty() || !m_signals.empty())) { - error = impl->Poll(); + error = impl.Poll(); if (error.Fail()) return error; - impl->ForEachSignal([&](int sig) { - auto it = m_signals.find(sig); - if (it != m_signals.end()) - it->second.callback(*this); // Do the work - }); - if (m_terminate_request) - return Error(); + impl.ProcessEvents(); - impl->ForEachReadFD([&](int fd) { - auto it = m_read_fds.find(fd); - if (it != m_read_fds.end()) - it->second(*this); // Do the work - }); if (m_terminate_request) return Error(); } return Error(); } + +void MainLoop::ProcessSignal(int signo) { + auto it = m_signals.find(signo); + if (it != m_signals.end()) + it->second.callback(*this); // Do the work +} + +void MainLoop::ProcessReadObject(IOObject::WaitableHandle handle) { + auto it = m_read_fds.find(handle); + if (it != m_read_fds.end()) + it->second(*this); // Do the work +} Modified: vendor/lldb/dist/source/Host/common/UDPSocket.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/UDPSocket.cpp Mon May 8 17:13:50 2017 (r317958) +++ vendor/lldb/dist/source/Host/common/UDPSocket.cpp Mon May 8 17:13:54 2017 (r317959) @@ -28,31 +28,41 @@ const int kDomain = AF_INET; const int kType = SOCK_DGRAM; static const char *g_not_supported_error = "Not supported"; -} // namespace - -UDPSocket::UDPSocket(bool should_close, bool child_processes_inherit) - : Socket(ProtocolUdp, should_close, child_processes_inherit) {} +} -UDPSocket::UDPSocket(NativeSocket socket, const UDPSocket &listen_socket) - : Socket(ProtocolUdp, listen_socket.m_should_close_fd, - listen_socket.m_child_processes_inherit) { +UDPSocket::UDPSocket(NativeSocket socket) : Socket(ProtocolUdp, true, true) { m_socket = socket; } +UDPSocket::UDPSocket(bool should_close, bool child_processes_inherit) + : Socket(ProtocolUdp, should_close, child_processes_inherit) {} + size_t UDPSocket::Send(const void *buf, const size_t num_bytes) { return ::sendto(m_socket, static_cast(buf), num_bytes, 0, m_sockaddr, m_sockaddr.GetLength()); } Error UDPSocket::Connect(llvm::StringRef name) { + return Error("%s", g_not_supported_error); +} + +Error UDPSocket::Listen(llvm::StringRef name, int backlog) { + return Error("%s", g_not_supported_error); +} + +Error UDPSocket::Accept(Socket *&socket) { + return Error("%s", g_not_supported_error); +} + +Error UDPSocket::Connect(llvm::StringRef name, bool child_processes_inherit, + Socket *&socket) { + std::unique_ptr final_socket; + Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION)); if (log) log->Printf("UDPSocket::%s (host/port = %s)", __FUNCTION__, name.data()); Error error; - if (error.Fail()) - return error; - std::string host_str; std::string port_str; int32_t port = INT32_MIN; @@ -84,11 +94,12 @@ Error UDPSocket::Connect(llvm::StringRef for (struct addrinfo *service_info_ptr = service_info_list; service_info_ptr != nullptr; service_info_ptr = service_info_ptr->ai_next) { - m_socket = Socket::CreateSocket( + auto send_fd = CreateSocket( service_info_ptr->ai_family, service_info_ptr->ai_socktype, - service_info_ptr->ai_protocol, m_child_processes_inherit, error); + service_info_ptr->ai_protocol, child_processes_inherit, error); if (error.Success()) { - m_sockaddr = service_info_ptr; + final_socket.reset(new UDPSocket(send_fd)); + final_socket->m_sockaddr = service_info_ptr; break; } else continue; @@ -96,17 +107,16 @@ Error UDPSocket::Connect(llvm::StringRef ::freeaddrinfo(service_info_list); - if (IsValid()) + if (!final_socket) return error; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Wed May 10 22:40:32 2017 Return-Path: Delivered-To: svn-src-vendor@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 2740BD66DF6; Wed, 10 May 2017 22:40:32 +0000 (UTC) (envelope-from sjg@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 E4BEA1656; Wed, 10 May 2017 22:40:31 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4AMeV8k083370; Wed, 10 May 2017 22:40:31 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4AMeRQD083338; Wed, 10 May 2017 22:40:27 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201705102240.v4AMeRQD083338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 10 May 2017 22:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r318162 - in vendor/NetBSD/bmake/dist: . mk mk/sys unit-tests X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 May 2017 22:40:32 -0000 Author: sjg Date: Wed May 10 22:40:27 2017 New Revision: 318162 URL: https://svnweb.freebsd.org/changeset/base/318162 Log: Import bmake-20170510 Added: vendor/NetBSD/bmake/dist/mk/files.mk (contents, props changed) Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/main.c vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/FILES vendor/NetBSD/bmake/dist/mk/dirdeps.mk vendor/NetBSD/bmake/dist/mk/doc.mk vendor/NetBSD/bmake/dist/mk/final.mk vendor/NetBSD/bmake/dist/mk/inc.mk vendor/NetBSD/bmake/dist/mk/init.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/lib.mk vendor/NetBSD/bmake/dist/mk/meta2deps.py vendor/NetBSD/bmake/dist/mk/own.mk vendor/NetBSD/bmake/dist/mk/prog.mk vendor/NetBSD/bmake/dist/mk/scripts.mk vendor/NetBSD/bmake/dist/mk/sys/AIX.mk vendor/NetBSD/bmake/dist/mk/sys/Darwin.mk vendor/NetBSD/bmake/dist/mk/sys/Generic.mk vendor/NetBSD/bmake/dist/mk/sys/HP-UX.mk vendor/NetBSD/bmake/dist/mk/sys/IRIX.mk vendor/NetBSD/bmake/dist/mk/sys/Linux.mk vendor/NetBSD/bmake/dist/mk/sys/NetBSD.mk vendor/NetBSD/bmake/dist/mk/sys/OSF1.mk vendor/NetBSD/bmake/dist/mk/sys/OpenBSD.mk vendor/NetBSD/bmake/dist/mk/sys/SunOS.mk vendor/NetBSD/bmake/dist/mk/sys/UnixWare.mk vendor/NetBSD/bmake/dist/parse.c vendor/NetBSD/bmake/dist/str.c vendor/NetBSD/bmake/dist/unit-tests/modmatch.exp vendor/NetBSD/bmake/dist/unit-tests/modmatch.mk Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/ChangeLog Wed May 10 22:40:27 2017 (r318162) @@ -1,3 +1,29 @@ +2017-05-10 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170510 + Merge with NetBSD make, pick up + o main.c: Main_SetObjdir: ensure buf2 is in scope + +2017-05-08 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170505 + see mk/ChangeLog + +2017-05-05 Simon J. Gerraty + + * parse.c: not everyone has stdint.h + +2017-05-01 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170501 + see mk/ChangeLog + +2017-04-21 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170421 + Merge with NetBSD make, pick up + o str.c: Str_Match: fix closure tests for [^] and add unit-test. + 2017-04-20 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20170420 Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/Makefile Wed May 10 22:40:27 2017 (r318162) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.88 2017/04/20 14:51:14 sjg Exp $ +# $Id: Makefile,v 1.92 2017/05/10 22:29:04 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20170420 +_MAKE_VERSION= 20170510 PROG= bmake Modified: vendor/NetBSD/bmake/dist/main.c ============================================================================== --- vendor/NetBSD/bmake/dist/main.c Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/main.c Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.264 2017/04/20 03:57:27 sjg Exp $ */ +/* $NetBSD: main.c,v 1.265 2017/05/10 22:26:14 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.264 2017/04/20 03:57:27 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.265 2017/05/10 22:26:14 sjg Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.264 2017/04/20 03:57:27 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.265 2017/05/10 22:26:14 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -751,6 +751,7 @@ Main_SetObjdir(const char *fmt, ...) struct stat sb; char *path; char buf[MAXPATHLEN + 1]; + char buf2[MAXPATHLEN + 1]; Boolean rc = FALSE; va_list ap; @@ -759,8 +760,6 @@ Main_SetObjdir(const char *fmt, ...) va_end(ap); if (path[0] != '/') { - char buf2[MAXPATHLEN + 1]; - snprintf(buf2, MAXPATHLEN, "%s/%s", curdir, path); path = buf2; } Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ChangeLog Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/ChangeLog Wed May 10 22:40:27 2017 (r318162) @@ -1,3 +1,37 @@ +2017-05-08 Simon J. Gerraty + + * install-mk (MK_VERSION): 20170505 + + * meta2deps.py: fix botched indenation. + +2017-05-05 Simon J. Gerraty + + * sys/*.mk: Remove setting of MAKE it is unnecessary and + in many cases wrong (basname rather than full path) + + * scripts.mk (SCRIPTSGROUPS): make this more like files.mk and inc.mk + + * init.mk: define realbuild to simplify logic in {lib,prog}.mk etc + +2017-05-01 Simon J. Gerraty + + * install-mk (MK_VERSION): 20170501 + + * doc.mk: fix typo in DOC_INSTALL_OWN + + * inc.mk: handle INCGROUPS similar to freebsd + + * files.mk: add something for files too + + * add staging logic to lib.mk prog.mk etc. + +2017-04-24 Simon J. Gerraty + + * install-mk (MK_VERSION): 20170424 + + * dirdeps.mk: set NO_DIRDEPS when bootstrapping. + also target of bootstrap-this when sed is needed should be ${_want:T} + 2017-04-18 Simon J. Gerraty * install-mk (MK_VERSION): 20170418 Modified: vendor/NetBSD/bmake/dist/mk/FILES ============================================================================== --- vendor/NetBSD/bmake/dist/mk/FILES Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/FILES Wed May 10 22:40:27 2017 (r318162) @@ -9,6 +9,7 @@ cython.mk dep.mk doc.mk dpadd.mk +files.mk final.mk host-target.mk host.libnames.mk Modified: vendor/NetBSD/bmake/dist/mk/dirdeps.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/dirdeps.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/dirdeps.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.87 2017/03/07 01:49:03 sjg Exp $ +# $Id: dirdeps.mk,v 1.88 2017/04/24 20:34:59 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -137,6 +137,14 @@ # built for. # +.if !target(bootstrap) && (make(bootstrap) || \ + make(bootstrap-this) || \ + make(bootstrap-recurse) || \ + make(bootstrap-empty)) +# disable most of below +.MAKE.LEVEL = 1 +.endif + # touch this at your peril _DIRDEP_USE_LEVEL?= 0 .if ${.MAKE.LEVEL} == ${_DIRDEP_USE_LEVEL} @@ -757,7 +765,7 @@ bootstrap-this: .NOTMAIN @echo Bootstrapping ${RELDIR}/${_want:T} from ${_src:T}; \ echo You need to build ${RELDIR} to correctly populate it. .if ${_src:T} != ${.MAKE.DEPENDFILE_PREFIX:T} - (cd ${.CURDIR} && sed ${.MAKE.DEPENDFILE_BOOTSTRAP_SED} ${_src} > ${_want}) + (cd ${.CURDIR} && sed ${.MAKE.DEPENDFILE_BOOTSTRAP_SED} ${_src} > ${_want:T}) .else cp ${.CURDIR}/${_src:T} ${_want} .endif Modified: vendor/NetBSD/bmake/dist/mk/doc.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/doc.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/doc.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: doc.mk,v 1.5 2015/09/08 06:15:31 sjg Exp $ +# $Id: doc.mk,v 1.6 2017/05/01 21:24:10 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -59,7 +59,7 @@ spell: ${SRCS} .include .if !empty(DOCOWN) -DOC_INSTALL_OWN?= -o ${DOCOWN} -g ${DOGGRP} +DOC_INSTALL_OWN?= -o ${DOCOWN} -g ${DOCGRP} .endif .endif Added: vendor/NetBSD/bmake/dist/mk/files.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/bmake/dist/mk/files.mk Wed May 10 22:40:27 2017 (r318162) @@ -0,0 +1,83 @@ +# $Id: files.mk,v 1.6 2017/05/07 02:21:02 sjg Exp $ +# +# @(#) Copyright (c) 2017, Simon J. Gerraty +# +# This file is provided in the hope that it will +# be of use. There is absolutely NO WARRANTY. +# Permission to copy, redistribute or otherwise +# use this file is hereby granted provided that +# the above copyright notice and this notice are +# left intact. +# +# Please send copies of changes and bug-fixes to: +# sjg@crufty.net +# + +.include + +FILES_INSTALL_OWN ?= -o ${SHAREOWN} -g ${SHAREGRP} +FILESMODE ?= ${SHAREMODE} +FILES_COPY ?= -C + +FILESGROUPS ?= FILES +FILESGROUPS := ${FILESGROUPS:O:u} + +.if !target(buildfiles) +.for group in ${FILESGROUPS} +buildfiles: ${${group}} +.endfor +.endif +buildfiles: +realbuild: buildfiles + +# there is no default FILESDIR so +# ignore group if ${group}DIR is not defined +.for group in ${FILESGROUPS} +.if !empty(${group}) && defined(${group}DIR) +.if ${group} != "FILES" +${group}_INSTALL_OWN ?= ${FILES_INSTALL_OWN} +.endif +# incase we are staging +STAGE_DIR.${group} ?= ${STAGE_OBJTOP}${${group}DIR} + +.for file in ${${group}:O:u} +${group}_INSTALL_OWN.${file:T} ?= ${${group}_INSTALL_OWN} +${group}DIR.${file:T} ?= ${${group}DIR} +file_mkdir_list += ${${group}DIR.${file:T}} + +.if defined(${group}NAME.${file:T}) +STAGE_AS_SETS += ${group} +STAGE_AS_${file} = ${${group}NAME.${file:T}} +stage_as.${group}: ${file} + +installfiles: installfiles.${group}.${file:T} +installfiles.${group}.${file:T}: ${file} file_mkdirs + ${INSTALL} ${FILES_COPY} ${${group}_INSTALL_OWN.${file:T}} \ + -m ${FILESMODE} ${.ALLSRC:Nfile_mkdirs} ${DESTDIR}${${group}DIR}/${${group}NAME.${file:T}} + +.else +STAGE_SETS += ${group} +stage_files.${group}: ${file} +installfiles.${group}: ${file} +installfiles: installfiles.${group} +.endif + +.endfor # file + +installfiles.${group}: file_mkdirs + ${INSTALL} ${FILES_COPY} ${${group}_INSTALL_OWN} -m ${FILESMODE} \ + ${.ALLSRC:Nfile_mkdirs:O:u} ${DESTDIR}${${group}DIR} + +.endif # !empty +.endfor # group + +file_mkdirs: + @for d in ${file_mkdir_list:O:u}; do \ + test -d ${DESTDIR}$$d || \ + ${INSTALL} -d ${FILES_INSTALL_OWN} -m 775 ${DESTDIR}$$d; \ + done + +beforeinstall: +installfiles: +realinstall: installfiles +.ORDER: beforeinstall installfiles Modified: vendor/NetBSD/bmake/dist/mk/final.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/final.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/final.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: final.mk,v 1.6 2016/04/05 15:58:37 sjg Exp $ +# $Id: final.mk,v 1.8 2017/05/07 20:30:08 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -6,9 +6,17 @@ __${.PARSEFILE}__: # provide a hook for folk who want to do scary stuff .-include <${.CURDIR:H}/Makefile-final.inc> -.if !empty(STAGE) +.if ${MK_STAGING} == "yes" +.include +.elif !empty(STAGE) .-include .endif .-include + +.if empty(_SKIP_BUILD) +install: realinstall +.endif +realinstall: + .endif Modified: vendor/NetBSD/bmake/dist/mk/inc.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/inc.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/inc.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: inc.mk,v 1.3 2011/03/11 05:23:05 sjg Exp $ +# $Id: inc.mk,v 1.7 2017/05/06 17:29:45 sjg Exp $ # # @(#) Copyright (c) 2008, Simon J. Gerraty # @@ -15,8 +15,6 @@ .include -includes: ${INCS} - .if !empty(LIBOWN) INC_INSTALL_OWN ?= -o ${LIBOWN} -g ${LIBGRP} .endif @@ -24,12 +22,68 @@ INCMODE ?= 444 INC_COPY ?= -C INCSDIR ?= ${INCDIR} -realinstall: incinstall +STAGE_INCSDIR?= ${STAGE_OBJTOP}${INCSDIR} + +# accommodate folk used to freebsd +INCGROUPS ?= ${INCSGROUPS:UINCS} +INCGROUPS := ${INCGROUPS:O:u} + +.if !target(buildincludes) +.for group in ${INCGROUPS} +buildincludes: ${${group}} +.endfor +.endif +buildincludes: +includes: buildincludes + .if !target(incinstall) -incinstall: -.if !empty(INCS) - [ -d ${DESTDIR}${INCSDIR} ] || \ - ${INSTALL} -d ${INC_INSTALL_OWN} -m 775 ${DESTDIR}${INCSDIR} - ${INSTALL} ${INC_COPY} ${INC_INSTALL_OWN} -m ${INCMODE} ${INCS} ${DESTDIR}${INCSDIR} +.for group in ${INCGROUPS} +.if !empty(${group}) +.if ${group} != "INC" +${group}_INSTALL_OWN ?= ${INC_INSTALL_OWN} +${group}DIR ?= ${INCDIR} .endif +# incase we are staging +STAGE_DIR.${group} ?= ${STAGE_OBJTOP}${${group}DIR} + +.for header in ${${group}:O:u} +${group}_INSTALL_OWN.${header:T} ?= ${${group}_INSTALL_OWN} +${group}DIR.${header:T} ?= ${${group}DIR} +inc_mkdir_list += ${${group}DIR.${header:T}} + +.if defined(${group}NAME.${header:T}) +STAGE_AS_SETS += ${group} +STAGE_AS_${header} = ${${group}NAME.${header:T}} +stage_as.${group}: ${header} + +incinstall: incinstall.${group}.${header:T} +incinstall.${group}.${header:T}: ${header} inc_mkdirs + ${INSTALL} ${INC_COPY} ${${group}_INSTALL_OWN.${header:T}} -m ${INCMODE} ${.ALLSRC:Ninc_mkdirs} ${DESTDIR}${${group}DIR}/${${group}NAME.${header:T}} + +.else +STAGE_SETS += ${group} +stage_files.${group}: ${header} +incinstall.${group}: ${header} +incinstall: incinstall.${group} .endif + +.endfor # header + +incinstall.${group}: inc_mkdirs + ${INSTALL} ${INC_COPY} ${${group}_INSTALL_OWN} -m ${INCMODE} \ + ${.ALLSRC:Ninc_mkdirs:O:u} ${DESTDIR}${${group}DIR} + +.endif # !empty +.endfor # group + +inc_mkdirs: + @for d in ${inc_mkdir_list:O:u}; do \ + test -d ${DESTDIR}$$d || \ + ${INSTALL} -d ${INC_INSTALL_OWN} -m 775 ${DESTDIR}$$d; \ + done + +.endif # !target(incinstall) + +beforeinstall: +realinstall: incinstall +.ORDER: beforeinstall incinstall Modified: vendor/NetBSD/bmake/dist/mk/init.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/init.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/init.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: init.mk,v 1.12 2016/04/05 15:58:37 sjg Exp $ +# $Id: init.mk,v 1.15 2017/05/07 20:27:54 sjg Exp $ # # @(#) Copyright (c) 2002, Simon J. Gerraty # @@ -50,8 +50,20 @@ PROFFLAGS?= -DGPROF -DPROF _SKIP_BUILD = not building at level 0 .endif -.if !empty(_SKIP_BUILD) +.if !defined(.PARSEDIR) +# no-op is the best we can do if not bmake. +.WAIT: +.endif + +# define this once for consistency +.if empty(_SKIP_BUILD) +# beforebuild is a hook for things that must be done early +all: beforebuild .WAIT realbuild +.else all: .PHONY .warning ${_SKIP_BUILD} .endif +beforebuild: +realbuild: + .endif Modified: vendor/NetBSD/bmake/dist/mk/install-mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/install-mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/install-mk Wed May 10 22:40:27 2017 (r318162) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.141 2017/04/18 23:53:18 sjg Exp $ +# $Id: install-mk,v 1.145 2017/05/09 04:05:32 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20170418 +MK_VERSION=20170505 OWNER= GROUP= MODE=444 @@ -176,7 +176,7 @@ $SKIP_MKFILES Do chmod $BINMODE $mk_scri [ "$OWNER" ] && $SKIP_MKFILES Do chown $OWNER $mk_files $sys_mk_files # if this is a BSD system the bsd.*.mk should exist and be used. if [ -z "$SKIP_BSD_MK" ]; then - for f in dep doc init lib links man nls obj own prog subdir + for f in dep doc files inc init lib links man nls obj own prog subdir do b=bsd.$f.mk [ -s $b ] || Do ln -s $f.mk $b Modified: vendor/NetBSD/bmake/dist/mk/lib.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/lib.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/lib.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: lib.mk,v 1.55 2016/09/23 23:04:51 sjg Exp $ +# $Id: lib.mk,v 1.61 2017/05/06 17:30:09 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -37,7 +37,7 @@ PICO?= .pico CFLAGS+= ${COPTS} -# Derrived from NetBSD-1.6 +# Originally derrived from NetBSD-1.6 # Set PICFLAGS to cc flags for producing position-independent code, # if not already set. Includes -DPIC, if required. @@ -375,15 +375,14 @@ _LIBS+=llib-l${LIB}.ln .include .endif -.if !defined(_SKIP_BUILD) -all: prebuild .WAIT ${_LIBS} -# a hook for things that must be done early -prebuild: -.if !defined(.PARSEDIR) -# no-op is the best we can do if not bmake. -.WAIT: +.if empty(LIB) +_LIBS= .endif + +.if !defined(_SKIP_BUILD) +realbuild: ${_LIBS} .endif + all: _SUBDIRUSE .for s in ${SRCS:N*.h:M*/*} @@ -509,7 +508,7 @@ LIB_INSTALL_OWN ?= -o ${LIBOWN} -g ${LIB .include -.if !target(realinstall) +.if !target(realinstall) && !empty(LIB) realinstall: libinstall .endif .if !target(libinstall) @@ -552,13 +551,19 @@ libinstall: .endif .endif +.if ${MK_MAN} != "no" install: maninstall _SUBDIRUSE maninstall: afterinstall +.endif afterinstall: realinstall libinstall: beforeinstall realinstall: beforeinstall .endif +.if defined(FILES) || defined(FILESGROUPS) +.include +.endif + .if ${MK_MAN} != "no" .include .endif @@ -591,5 +596,10 @@ realinstall: beforeinstall .endfor @touch ${.TARGET} +.if !empty(LIB) +STAGE_LIBDIR?= ${STAGE_OBJTOP}${LIBDIR} +stage_libs: ${_LIBS} +.endif + .include .endif Modified: vendor/NetBSD/bmake/dist/mk/meta2deps.py ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta2deps.py Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/meta2deps.py Wed May 10 22:40:27 2017 (r318162) @@ -37,7 +37,7 @@ We only pay attention to a subset of the """ RCSid: - $Id: meta2deps.py,v 1.25 2017/04/03 21:04:09 sjg Exp $ + $Id: meta2deps.py,v 1.26 2017/05/09 04:04:16 sjg Exp $ Copyright (c) 2011-2013, Juniper Networks, Inc. All rights reserved. @@ -142,7 +142,7 @@ def sort_unique(list, cmp=None, key=None for e in list: if e == le: continue - le = e + le = e nl.append(e) return nl @@ -534,7 +534,7 @@ class MetaFile: # to the src dir, we may need to add dependencies for each rdir = dir dir = abspath(dir, cwd, self.last_dir, self.debug, self.debug_out) - rdir = os.path.realpath(dir) + rdir = os.path.realpath(dir) if rdir == dir: rdir = None # now put path back together Modified: vendor/NetBSD/bmake/dist/mk/own.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/own.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/own.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: own.mk,v 1.32 2016/05/18 20:54:29 sjg Exp $ +# $Id: own.mk,v 1.35 2017/05/03 18:09:44 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -117,6 +117,7 @@ OPTIONS_DEFAULT_DEPENDENT+= \ PICINSTALL/LINKLIB \ PICLIB/PIC \ PROFILE/LINKLIB \ + STAGING_PROG/STAGING \ .include @@ -128,7 +129,7 @@ _uid!= id -u USERGRP!= id -g .export USERGRP .endif -.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE +.for x in BIN CONF DOC INC INFO FILES KMOD LIB MAN NLS SHARE $xOWN= ${USER} $xGRP= ${USERGRP} $x_INSTALL_OWN= @@ -145,6 +146,9 @@ BINMODE?= 555 NONBINMODE?= 444 DIRMODE?= 755 +INCLUDEDIR?= ${prefix}/include +INCDIR?= ${INCLUDEDIR} + # Define MANZ to have the man pages compressed (gzip) #MANZ= 1 @@ -184,6 +188,10 @@ KMODGRP?= ${BINGRP} KMODOWN?= ${BINOWN} KMODMODE?= ${NONBINMODE} +SHAREGRP?= ${BINGRP} +SHAREOWN?= ${BINOWN} +SHAREMODE?= ${NONBINMODE} + COPY?= -c STRIP_FLAG?= -s @@ -244,4 +252,19 @@ MK_MAN= no MK_NLS= no .endif +# :U incase not using our sys.mk +.if ${MK_META_MODE:Uno} == "yes" +# should all be set by sys.mk if not default +TARGET_SPEC_VARS ?= MACHINE +.if ${TARGET_SPEC_VARS:[#]} > 1 +TARGET_SPEC_VARS_REV := ${TARGET_SPEC_VARS:[-1..1]} +.else +TARGET_SPEC_VARS_REV = ${TARGET_SPEC_VARS} +.endif +.if ${MK_STAGING} == "yes" +STAGE_ROOT?= ${OBJROOT}/stage +STAGE_OBJTOP?= ${STAGE_ROOT}/${TARGET_SPEC_VARS_REV:ts/} +.endif +.endif + .endif Modified: vendor/NetBSD/bmake/dist/mk/prog.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/prog.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/prog.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: prog.mk,v 1.28 2017/02/14 21:26:13 sjg Exp $ +# $Id: prog.mk,v 1.32 2017/05/06 17:30:09 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -75,6 +75,8 @@ ${CXX_SUFFIXES:%=%.o}: .if defined(PROG) +BINDIR ?= ${prefix}/bin + SRCS?= ${PROG}.c .for s in ${SRCS:N*.h:N*.sh:M*/*} ${.o .po .lo:L:@o@${s:T:R}$o@}: $s @@ -126,8 +128,9 @@ MAN= ${PROG}.1 .endif # defined(PROG) .if !defined(_SKIP_BUILD) -all: ${PROG} +realbuild: ${PROG} .endif + all: _SUBDIRUSE .if !target(clean) @@ -208,6 +211,10 @@ lint: ${LOBJS} .NOPATH: ${OBJS} .endif +.if defined(FILES) || defined(FILESGROUPS) +.include +.endif + .if ${MK_MAN} != "no" .include .endif @@ -219,6 +226,20 @@ lint: ${LOBJS} .include .include .include + +.if !empty(PROG) && ${MK_STAGING_PROG} == "yes" +STAGE_BINDIR ?= ${STAGE_OBJTOP}${BINDIR} +STAGE_DIR.prog ?= ${STAGE_BINDIR} +.if ${PROG_NAME:U${PROG}} != ${PROG} +STAGE_AS_SETS += prog +STAGE_AS_${PROG} = ${PROG_NAME} +stage_as.prog: ${PROG} +.else +STAGE_SETS += prog +stage_files.prog: ${PROG} +.endif +.endif + .include .endif Modified: vendor/NetBSD/bmake/dist/mk/scripts.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/scripts.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/scripts.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,52 +1,91 @@ -# $Id: scripts.mk,v 1.2 2006/11/09 01:55:18 sjg Exp $ +# $Id: scripts.mk,v 1.3 2017/05/06 17:29:45 sjg Exp $ +# +# @(#) Copyright (c) 2006, Simon J. Gerraty +# +# This file is provided in the hope that it will +# be of use. There is absolutely NO WARRANTY. +# Permission to copy, redistribute or otherwise +# use this file is hereby granted provided that +# the above copyright notice and this notice are +# left intact. +# +# Please send copies of changes and bug-fixes to: +# sjg@crufty.net +# .include -.if defined(SCRIPTS) +SCRIPTSGROUPS ?= SCRIPTS +SCRIPTSGROUPS := ${SCRIPTSGROUPS:O:u} -all: ${SCRIPTS} - -.PHONY: scriptsinstall -install: scriptsinstall - -.if !target(scriptsinstall) SCRIPTSDIR?= ${BINDIR} SCRIPTSOWN?= ${BINOWN} SCRIPTSGRP?= ${BINGRP} SCRIPTSMODE?= ${BINMODE} +SCRIPTS_INSTALL_OWN?= -o ${SCRIPTSOWN} -g ${SCRIPTSGRP} +SCRIPTS_COPY ?= -C + # how we get script name from src SCRIPTSNAME_MOD?=T:R -script_targets= ${SCRIPTS:@s@${DESTDIR}${SCRIPTSDIR_$s:U${SCRIPTSDIR}}/${SCRIPTSNAME_$s:U${s:${SCRIPTSNAME_MOD}}}@} - -scriptsinstall:: ${script_targets} - -.PRECIOUS: ${script_targets} -.if !defined(UPDATE) -.PHONY: ${script_targets} -.endif - -INSTALL_FLAGS?= ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \ - -o ${OWN_${.TARGET:T}:U${SCRIPTSOWN}} \ - -g ${GRP_${.TARGET:T}:U${SCRIPTSGRP}} \ - -m ${MODE_${.TARGET:T}:U${SCRIPTSMODE}} - -__SCRIPTINSTALL_USE: .USE - ${INSTALL} ${INSTALL_FLAGS_${.TARGET:T}:U${INSTALL_FLAGS}} \ - ${.ALLSRC} ${.TARGET} - -.for s in ${SCRIPTS} -.if !defined(BUILD) && !make(all) && !make(${s}) -${DESTDIR}${SCRIPTSDIR_$s:U${SCRIPTSDIR}}/${SCRIPTSNAME_$s:U${s:${SCRIPTSNAME_MOD}}}: .MADE -.endif -${DESTDIR}${SCRIPTSDIR_$s:U${SCRIPTSDIR}}/${SCRIPTSNAME_$s:U${s:${SCRIPTSNAME_MOD}}}: ${s} __SCRIPTINSTALL_USE +.if !target(buildfiles) +.for group in ${SCRIPTSGROUPS} +buildfiles: ${${group}} .endfor .endif +buildfiles: +realbuild: buildfiles +.for group in ${SCRIPTSGROUPS} +.if !empty(${group}) && defined(${group}DIR) +.if ${group} != "SCRIPTS" +${group}_INSTALL_OWN ?= ${SCRIPTS_INSTALL_OWN} .endif +# incase we are staging +STAGE_DIR.${group} ?= ${STAGE_OBJTOP}${${group}DIR} -.if !target(scriptsinstall) -scriptsinstall:: +.for script in ${${group}:O:u} +${group}_INSTALL_OWN.${script:T} ?= ${${group}_INSTALL_OWN} +${group}DIR.${script:T} ?= ${${group}DIR_${script:T}:U${${group}DIR}} +script_mkdir_list += ${${group}DIR.${script:T}} + +${group}NAME.${script} ?= ${${group}NAME_${script:T}:U${script:${SCRIPTSNAME_MOD}}} +.if ${${group}NAME.${script}:T} != ${script:T} +STAGE_AS_SETS += ${group} +STAGE_AS_${script} = ${${group}NAME.${script:T}} +stage_as.${group}: ${script} + +installscripts: installscripts.${group}.${script:T} +installscripts.${group}.${script:T}: ${script} script_mkdirs + ${INSTALL} ${SCRIPTS_COPY} ${${group}_INSTALL_OWN.${script:T}} \ + -m ${SCRIPTSMODE} ${.ALLSRC:Nscript_mkdirs} ${DESTDIR}${${group}DIR}/${${group}NAME.${script:T}} + +.else +STAGE_SETS += ${group} +stage_files.${group}: ${script} +installscripts.${group}: ${script} +installscripts: installscripts.${group} .endif +.endfor # script + +installscripts.${group}: script_mkdirs + ${INSTALL} ${SCRIPTS_COPY} ${${group}_INSTALL_OWN} -m ${SCRIPTSMODE} \ + ${.ALLSRC:Nscript_mkdirs:O:u} ${DESTDIR}${${group}DIR} + +.endif # !empty +.endfor # group + +script_mkdirs: + @for d in ${script_mkdir_list:O:u}; do \ + test -d ${DESTDIR}$$d || \ + ${INSTALL} -d ${SCRIPTS_INSTALL_OWN} -m 775 ${DESTDIR}$$d; \ + done + + +beforeinstall: +installscripts: +realinstall: installscripts +.ORDER: beforeinstall installscripts + Modified: vendor/NetBSD/bmake/dist/mk/sys/AIX.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/sys/AIX.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/sys/AIX.mk Wed May 10 22:40:27 2017 (r318162) @@ -67,8 +67,6 @@ LDFLAGS= LINT= lint LINTFLAGS= -chapbx -MAKE= bmake - PC= pc PFLAGS= COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c Modified: vendor/NetBSD/bmake/dist/mk/sys/Darwin.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/sys/Darwin.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/sys/Darwin.mk Wed May 10 22:40:27 2017 (r318162) @@ -84,8 +84,6 @@ LINTFLAGS?= -chapbx LORDER?= lorder -MAKE?= bmake - NM?= nm PC?= pc Modified: vendor/NetBSD/bmake/dist/mk/sys/Generic.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/sys/Generic.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/sys/Generic.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: Generic.mk,v 1.12 2016/03/22 20:45:14 sjg Exp $ +# $Id: Generic.mk,v 1.13 2017/05/05 18:02:16 sjg Exp $ # # some reasonable defaults @@ -80,8 +80,6 @@ LDFLAGS?= LINT?= lint LINTFLAGS?= -chapbxzF -MAKE?= ${.MAKE} - NM?= nm PC?= pc Modified: vendor/NetBSD/bmake/dist/mk/sys/HP-UX.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/sys/HP-UX.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/sys/HP-UX.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: HP-UX.mk,v 1.10 2016/03/22 20:45:14 sjg Exp $ +# $Id: HP-UX.mk,v 1.11 2017/05/05 18:02:16 sjg Exp $ # $NetBSD: sys.mk,v 1.19.2.1 1994/07/26 19:58:31 cgd Exp $ # @(#)sys.mk 5.11 (Berkeley) 3/13/91 @@ -101,8 +101,6 @@ LDFLAGS= LINT= lint LINTFLAGS= -chapbx -MAKE= bmake - PC= pc PFLAGS= COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c Modified: vendor/NetBSD/bmake/dist/mk/sys/IRIX.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/sys/IRIX.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/sys/IRIX.mk Wed May 10 22:40:27 2017 (r318162) @@ -70,8 +70,6 @@ LINTFLAGS?= -chapbxzF LORDER?= lorder -MAKE?= make - NM?= nm PC?= pc Modified: vendor/NetBSD/bmake/dist/mk/sys/Linux.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/sys/Linux.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/sys/Linux.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: Linux.mk,v 1.8 2016/03/22 20:45:14 sjg Exp $ +# $Id: Linux.mk,v 1.9 2017/05/05 18:02:16 sjg Exp $ # $NetBSD: sys.mk,v 1.19.2.1 1994/07/26 19:58:31 cgd Exp $ # @(#)sys.mk 5.11 (Berkeley) 3/13/91 @@ -70,8 +70,6 @@ LDFLAGS= LINT= lint LINTFLAGS= -chapbx -MAKE= bmake - PC= pc PFLAGS= COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c Modified: vendor/NetBSD/bmake/dist/mk/sys/NetBSD.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/sys/NetBSD.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/sys/NetBSD.mk Wed May 10 22:40:27 2017 (r318162) @@ -105,8 +105,6 @@ LINTFLAGS?= -chapbxzF LORDER?= lorder -MAKE?= make - NM?= nm PC?= pc Modified: vendor/NetBSD/bmake/dist/mk/sys/OSF1.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/sys/OSF1.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/sys/OSF1.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: OSF1.mk,v 1.7 2016/03/22 20:45:15 sjg Exp $ +# $Id: OSF1.mk,v 1.8 2017/05/05 18:02:16 sjg Exp $ # $NetBSD: sys.mk,v 1.19.2.1 1994/07/26 19:58:31 cgd Exp $ # @(#)sys.mk 5.11 (Berkeley) 3/13/91 @@ -77,8 +77,6 @@ LDFLAGS= LINT= lint LINTFLAGS= -chapbx -MAKE= bmake - PC= pc PFLAGS= COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c Modified: vendor/NetBSD/bmake/dist/mk/sys/OpenBSD.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/sys/OpenBSD.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/sys/OpenBSD.mk Wed May 10 22:40:27 2017 (r318162) @@ -80,8 +80,6 @@ LINTFLAGS?= -chapbxzF LORDER?= lorder -MAKE?= make - NM?= nm PC?= pc Modified: vendor/NetBSD/bmake/dist/mk/sys/SunOS.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/sys/SunOS.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/sys/SunOS.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: SunOS.mk,v 1.7 2016/03/22 20:45:15 sjg Exp $ +# $Id: SunOS.mk,v 1.8 2017/05/05 18:02:17 sjg Exp $ .if ${.PARSEFILE} == "sys.mk" .include @@ -98,8 +98,6 @@ LDFLAGS= LINT= lint LINTFLAGS= -chapbx -MAKE= bmake - PC= pc PFLAGS= COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c Modified: vendor/NetBSD/bmake/dist/mk/sys/UnixWare.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/sys/UnixWare.mk Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/mk/sys/UnixWare.mk Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -# $Id: UnixWare.mk,v 1.2 2016/03/22 20:45:15 sjg Exp $ +# $Id: UnixWare.mk,v 1.3 2017/05/05 18:02:17 sjg Exp $ # based on "Id: SunOS.5.sys.mk,v 1.6 2003/09/30 16:42:23 sjg Exp " # $NetBSD: sys.mk,v 1.19.2.1 1994/07/26 19:58:31 cgd Exp $ # @(#)sys.mk 5.11 (Berkeley) 3/13/91 @@ -114,8 +114,6 @@ LINTFLAGS?= -pF LORDER?= lorder -MAKE?= bmake - NM?= nm PC?= pc # XXX: UDK probably does not have pc Modified: vendor/NetBSD/bmake/dist/parse.c ============================================================================== --- vendor/NetBSD/bmake/dist/parse.c Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/parse.c Wed May 10 22:40:27 2017 (r318162) @@ -130,7 +130,6 @@ __RCSID("$NetBSD: parse.c,v 1.225 2017/0 #include #include #include -#include #include "make.h" #include "hash.h" @@ -139,6 +138,10 @@ __RCSID("$NetBSD: parse.c,v 1.225 2017/0 #include "buf.h" #include "pathnames.h" +#ifdef HAVE_STDINT_H +#include +#endif + #ifdef HAVE_MMAP #include Modified: vendor/NetBSD/bmake/dist/str.c ============================================================================== --- vendor/NetBSD/bmake/dist/str.c Wed May 10 22:24:09 2017 (r318161) +++ vendor/NetBSD/bmake/dist/str.c Wed May 10 22:40:27 2017 (r318162) @@ -1,4 +1,4 @@ -/* $NetBSD: str.c,v 1.37 2017/04/11 17:30:13 sjg Exp $ */ +/* $NetBSD: str.c,v 1.38 2017/04/21 22:15:44 sjg Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Thu May 11 11:13:04 2017 Return-Path: Delivered-To: svn-src-vendor@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 02A59D65091; Thu, 11 May 2017 11:13:04 +0000 (UTC) (envelope-from mm@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 C71EC115F; Thu, 11 May 2017 11:13:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4BBD25C091874; Thu, 11 May 2017 11:13:02 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4BBD2TL091873; Thu, 11 May 2017 11:13:02 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201705111113.v4BBD2TL091873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 11 May 2017 11:13:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r318184 - vendor/libarchive/dist/cpio/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 May 2017 11:13:04 -0000 Author: mm Date: Thu May 11 11:13:02 2017 New Revision: 318184 URL: https://svnweb.freebsd.org/changeset/base/318184 Log: Update vendor/libarchive to git f2230fcaed3159d10caed63d9a20caa9fdc94c62 Vendor fixes: #909: Fix use after free in cpio test_option_lz4 Reported by: Coverity (ngie@) Modified: vendor/libarchive/dist/cpio/test/test_option_lz4.c Modified: vendor/libarchive/dist/cpio/test/test_option_lz4.c ============================================================================== --- vendor/libarchive/dist/cpio/test/test_option_lz4.c Thu May 11 09:36:51 2017 (r318183) +++ vendor/libarchive/dist/cpio/test/test_option_lz4.c Thu May 11 11:13:02 2017 (r318184) @@ -74,8 +74,8 @@ DEFINE_TEST(test_option_lz4) free(p); return; } - free(p); failure("--lz4 option is broken: %s", p); + free(p); assertEqualInt(r, 0); return; }