From owner-svn-src-vendor@freebsd.org Wed Jul 19 07:02:15 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 A65D1DAAB52; Wed, 19 Jul 2017 07:02:15 +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 1DC856E16A; Wed, 19 Jul 2017 07:02:15 +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 v6J72Ewh090682; Wed, 19 Jul 2017 07:02:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72Bex090654; Wed, 19 Jul 2017 07:02:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72Bex090654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321184 - in vendor/llvm/dist: . docs docs/CommandGuide include/llvm/Analysis include/llvm/CodeGen include/llvm/DebugInfo/CodeView include/llvm/DebugInfo/DWARF include/llvm/DebugInfo/PD... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm/dist: . docs docs/CommandGuide include/llvm/Analysis include/llvm/CodeGen include/llvm/DebugInfo/CodeView include/llvm/DebugInfo/DWARF include/llvm/DebugInfo/PDB include/llvm/DebugInfo/... X-SVN-Commit-Revision: 321184 X-SVN-Commit-Repository: base 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, 19 Jul 2017 07:02:15 -0000 Author: dim Date: Wed Jul 19 07:02:10 2017 New Revision: 321184 URL: https://svnweb.freebsd.org/changeset/base/321184 Log: Vendor import of llvm trunk r308421: https://llvm.org/svn/llvm-project/llvm/trunk@308421 Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/GUID.h (contents, props changed) vendor/llvm/dist/include/llvm/ToolDrivers/llvm-dlltool/ vendor/llvm/dist/include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h (contents, props changed) vendor/llvm/dist/lib/Fuzzer/test/FlagsTest.cpp (contents, props changed) vendor/llvm/dist/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp (contents, props changed) vendor/llvm/dist/lib/Target/SystemZ/SystemZScheduleZ14.td vendor/llvm/dist/lib/Target/X86/X86CmovConversion.cpp (contents, props changed) vendor/llvm/dist/lib/Target/X86/X86ScheduleZnver1.td vendor/llvm/dist/lib/ToolDrivers/llvm-dlltool/ vendor/llvm/dist/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt (contents, props changed) vendor/llvm/dist/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp (contents, props changed) vendor/llvm/dist/lib/ToolDrivers/llvm-dlltool/LLVMBuild.txt (contents, props changed) vendor/llvm/dist/lib/ToolDrivers/llvm-dlltool/Options.td vendor/llvm/dist/test/Bitcode/upgrade-importedentity.ll vendor/llvm/dist/test/Bitcode/upgrade-importedentity.ll.bc (contents, props changed) vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/select-fma.mir vendor/llvm/dist/test/CodeGen/AArch64/aarch64_win64cc_vararg.ll vendor/llvm/dist/test/CodeGen/AArch64/falkor-hwpf-fix.ll vendor/llvm/dist/test/CodeGen/AArch64/falkor-hwpf-fix.mir vendor/llvm/dist/test/CodeGen/AArch64/falkor-hwpf.ll vendor/llvm/dist/test/CodeGen/AArch64/win64_vararg.ll vendor/llvm/dist/test/CodeGen/AMDGPU/annotate-kernel-features-hsa-call.ll vendor/llvm/dist/test/CodeGen/AMDGPU/move-to-valu-worklist.ll vendor/llvm/dist/test/CodeGen/BPF/select_ri.ll vendor/llvm/dist/test/CodeGen/Hexagon/switch-lut-explicit-section.ll vendor/llvm/dist/test/CodeGen/Hexagon/switch-lut-function-section.ll vendor/llvm/dist/test/CodeGen/Hexagon/switch-lut-multiple-functions.ll vendor/llvm/dist/test/CodeGen/Hexagon/switch-lut-text-section.ll vendor/llvm/dist/test/CodeGen/Hexagon/vect/vect-load-v4i16.ll vendor/llvm/dist/test/CodeGen/Hexagon/vect/vect-v4i16.ll vendor/llvm/dist/test/CodeGen/MIR/AMDGPU/fold-multiple.mir vendor/llvm/dist/test/CodeGen/Mips/long-calls.ll vendor/llvm/dist/test/CodeGen/PowerPC/PR33671.ll vendor/llvm/dist/test/CodeGen/SPARC/soft-mul-div.ll vendor/llvm/dist/test/CodeGen/SystemZ/branch-11.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-abs-03.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-abs-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-add-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-cmp-06.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-const-11.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-conv-15.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-conv-16.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-copysign-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-div-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-move-13.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-mul-10.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-mul-11.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-mul-12.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-neg-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-round-03.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-sqrt-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-sub-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/int-add-17.ll vendor/llvm/dist/test/CodeGen/SystemZ/int-mul-09.ll vendor/llvm/dist/test/CodeGen/SystemZ/int-mul-10.ll vendor/llvm/dist/test/CodeGen/SystemZ/int-mul-11.ll vendor/llvm/dist/test/CodeGen/SystemZ/int-sub-10.ll vendor/llvm/dist/test/CodeGen/SystemZ/tdc-07.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-abs-06.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-add-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-and-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-cmp-07.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-ctpop-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-div-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-intrinsics-01.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-intrinsics-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-max-05.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-min-05.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-move-18.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-mul-03.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-mul-04.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-mul-05.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-neg-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-or-03.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-round-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-sqrt-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-sub-02.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-xor-02.ll vendor/llvm/dist/test/CodeGen/Thumb/litpoolremat.ll vendor/llvm/dist/test/CodeGen/X86/alias-static-alloca.ll vendor/llvm/dist/test/CodeGen/X86/avx512-rotate.ll vendor/llvm/dist/test/CodeGen/X86/bmi-schedule.ll vendor/llvm/dist/test/CodeGen/X86/bmi2-schedule.ll vendor/llvm/dist/test/CodeGen/X86/bswap-rotate.ll vendor/llvm/dist/test/CodeGen/X86/f16c-schedule.ll vendor/llvm/dist/test/CodeGen/X86/lea32-schedule.ll vendor/llvm/dist/test/CodeGen/X86/lea64-schedule.ll vendor/llvm/dist/test/CodeGen/X86/lzcnt-schedule.ll vendor/llvm/dist/test/CodeGen/X86/memcmp-minsize.ll vendor/llvm/dist/test/CodeGen/X86/memcmp-optsize.ll vendor/llvm/dist/test/CodeGen/X86/popcnt-schedule.ll vendor/llvm/dist/test/CodeGen/X86/pr32282.ll vendor/llvm/dist/test/CodeGen/X86/pr32515.ll vendor/llvm/dist/test/CodeGen/X86/pr33772.ll vendor/llvm/dist/test/CodeGen/X86/pr33828.ll vendor/llvm/dist/test/CodeGen/X86/rotate_vec.ll vendor/llvm/dist/test/CodeGen/X86/vector-rotate-512.ll vendor/llvm/dist/test/CodeGen/X86/x86-cmov-converter.ll vendor/llvm/dist/test/DllTool/ vendor/llvm/dist/test/DllTool/coff-exports.def vendor/llvm/dist/test/DllTool/coff-weak-exports.def vendor/llvm/dist/test/DllTool/lit.local.cfg vendor/llvm/dist/test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll vendor/llvm/dist/test/Instrumentation/DataFlowSanitizer/unordered_atomic_mem_intrins.ll vendor/llvm/dist/test/Instrumentation/SanitizerCoverage/cmp-tracing-api-x86_32.ll vendor/llvm/dist/test/Instrumentation/SanitizerCoverage/cmp-tracing-api-x86_64.ll vendor/llvm/dist/test/MC/AArch64/coff-relocations.s (contents, props changed) vendor/llvm/dist/test/MC/AArch64/invalid-instructions-spellcheck.s (contents, props changed) vendor/llvm/dist/test/MC/Disassembler/SystemZ/insns-z14.txt (contents, props changed) vendor/llvm/dist/test/MC/SystemZ/insn-bad-z14.s (contents, props changed) vendor/llvm/dist/test/MC/SystemZ/insn-good-z14.s (contents, props changed) vendor/llvm/dist/test/MC/SystemZ/invalid-instructions-spellcheck.s (contents, props changed) vendor/llvm/dist/test/ObjectYAML/CodeView/ vendor/llvm/dist/test/ObjectYAML/CodeView/guid.yaml vendor/llvm/dist/test/Other/cgscc-libcall-update.ll vendor/llvm/dist/test/Transforms/EarlyCSE/globalsaa-memoryssa.ll vendor/llvm/dist/test/Transforms/GVN/PRE/2017-06-28-pre-load-dbgloc.ll vendor/llvm/dist/test/Transforms/GlobalOpt/pr33686.ll vendor/llvm/dist/test/Transforms/IRCE/eq_ne.ll vendor/llvm/dist/test/Transforms/IRCE/pre_post_loops.ll vendor/llvm/dist/test/Transforms/Inline/AArch64/ext.ll vendor/llvm/dist/test/Transforms/Inline/PowerPC/ vendor/llvm/dist/test/Transforms/Inline/PowerPC/ext.ll vendor/llvm/dist/test/Transforms/Inline/PowerPC/lit.local.cfg vendor/llvm/dist/test/Transforms/Inline/X86/ext.ll vendor/llvm/dist/test/Transforms/InstCombine/element-atomic-memintrins.ll vendor/llvm/dist/test/Transforms/InstCombine/pr33765.ll vendor/llvm/dist/test/Transforms/LoopInterchange/current-limitations-lcssa.ll vendor/llvm/dist/test/Transforms/LoopInterchange/interchange-flow-dep-outer.ll vendor/llvm/dist/test/Transforms/LoopInterchange/interchange-not-profitable.ll vendor/llvm/dist/test/Transforms/LoopInterchange/interchange-output-dependencies.ll vendor/llvm/dist/test/Transforms/LoopInterchange/interchange-simple-count-down.ll vendor/llvm/dist/test/Transforms/LoopInterchange/interchange-simple-count-up.ll vendor/llvm/dist/test/Transforms/LoopInterchange/loop-interchange-optimization-remarks.ll vendor/llvm/dist/test/Transforms/LoopInterchange/not-interchanged-dependencies-1.ll vendor/llvm/dist/test/Transforms/LoopInterchange/not-interchanged-loop-nest-3.ll vendor/llvm/dist/test/Transforms/LoopInterchange/not-interchanged-tightly-nested.ll vendor/llvm/dist/test/Transforms/LoopUnroll/runtime-loop-multiexit-dom-verify.ll vendor/llvm/dist/test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll vendor/llvm/dist/test/tools/llvm-dwarfdump/X86/verify_debug_info.s (contents, props changed) vendor/llvm/dist/test/tools/llvm-dwarfdump/X86/verify_unit_header_chain.s (contents, props changed) vendor/llvm/dist/test/tools/llvm-mt/ vendor/llvm/dist/test/tools/llvm-mt/help.test vendor/llvm/dist/test/tools/llvm-objdump/AArch64/Inputs/reloc-addend.obj.macho-aarch64 (contents, props changed) vendor/llvm/dist/test/tools/llvm-objdump/AArch64/macho-reloc-addend.test vendor/llvm/dist/tools/llvm-mt/ vendor/llvm/dist/tools/llvm-mt/CMakeLists.txt (contents, props changed) vendor/llvm/dist/tools/llvm-mt/LLVMBuild.txt (contents, props changed) vendor/llvm/dist/tools/llvm-mt/Opts.td vendor/llvm/dist/tools/llvm-mt/llvm-mt.cpp (contents, props changed) vendor/llvm/dist/unittests/IR/CFGBuilder.cpp (contents, props changed) vendor/llvm/dist/unittests/IR/CFGBuilder.h (contents, props changed) Deleted: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeServerHandler.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PDBTypeServerHandler.h vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBTypeServerHandler.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerTraceState.cpp vendor/llvm/dist/test/CodeGen/Hexagon/vect/vect-loadv4i16.ll vendor/llvm/dist/test/CodeGen/SystemZ/vec-intrinsics.ll vendor/llvm/dist/test/MC/Mips/mt/invalid-wrong-error.s vendor/llvm/dist/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s vendor/llvm/dist/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s vendor/llvm/dist/test/MC/Mips/mt/mftr-mttr-aliases.s vendor/llvm/dist/test/MC/Mips/mt/mftr-mttr-reserved-valid.s vendor/llvm/dist/test/Transforms/InstCombine/and-not-or.ll vendor/llvm/dist/test/Transforms/LoopInterchange/interchange.ll vendor/llvm/dist/unittests/DebugInfo/PDB/TypeServerHandlerTest.cpp Modified: vendor/llvm/dist/RELEASE_TESTERS.TXT vendor/llvm/dist/docs/AliasAnalysis.rst vendor/llvm/dist/docs/CodingStandards.rst vendor/llvm/dist/docs/CommandGuide/lit.rst vendor/llvm/dist/include/llvm/Analysis/DominanceFrontier.h vendor/llvm/dist/include/llvm/Analysis/DominanceFrontierImpl.h vendor/llvm/dist/include/llvm/Analysis/IteratedDominanceFrontier.h vendor/llvm/dist/include/llvm/Analysis/LazyCallGraph.h vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h vendor/llvm/dist/include/llvm/Analysis/PostDominators.h vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h vendor/llvm/dist/include/llvm/CodeGen/MachineDominanceFrontier.h vendor/llvm/dist/include/llvm/CodeGen/MachineDominators.h vendor/llvm/dist/include/llvm/CodeGen/MachinePostDominators.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/Formatters.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFVerifier.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/GenericError.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/Formatters.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/InfoStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/RawTypes.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/TpiHashing.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/PDBExtras.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h vendor/llvm/dist/include/llvm/ExecutionEngine/RTDyldMemoryManager.h vendor/llvm/dist/include/llvm/IR/CallingConv.h vendor/llvm/dist/include/llvm/IR/Constants.h vendor/llvm/dist/include/llvm/IR/DIBuilder.h vendor/llvm/dist/include/llvm/IR/DebugInfoMetadata.h vendor/llvm/dist/include/llvm/IR/Dominators.h vendor/llvm/dist/include/llvm/IR/IntrinsicsHexagon.td vendor/llvm/dist/include/llvm/IR/IntrinsicsSystemZ.td vendor/llvm/dist/include/llvm/MC/LaneBitmask.h vendor/llvm/dist/include/llvm/MC/MCFixup.h vendor/llvm/dist/include/llvm/MC/MCInstrDesc.h vendor/llvm/dist/include/llvm/Object/COFFImportFile.h vendor/llvm/dist/include/llvm/Object/COFFModuleDefinition.h vendor/llvm/dist/include/llvm/ObjectYAML/CodeViewYAMLTypes.h vendor/llvm/dist/include/llvm/Support/AArch64TargetParser.def vendor/llvm/dist/include/llvm/Support/BinaryItemStream.h vendor/llvm/dist/include/llvm/Support/Format.h vendor/llvm/dist/include/llvm/Support/GenericDomTree.h vendor/llvm/dist/include/llvm/Support/GenericDomTreeConstruction.h vendor/llvm/dist/include/llvm/Support/TargetParser.h vendor/llvm/dist/include/llvm/Support/YAMLTraits.h vendor/llvm/dist/include/llvm/Target/GlobalISel/SelectionDAGCompat.td vendor/llvm/dist/include/llvm/Target/TargetLowering.h vendor/llvm/dist/lib/Analysis/CGSCCPassManager.cpp vendor/llvm/dist/lib/Analysis/DominanceFrontier.cpp vendor/llvm/dist/lib/Analysis/InstCount.cpp vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist/lib/Analysis/IteratedDominanceFrontier.cpp vendor/llvm/dist/lib/Analysis/LazyCallGraph.cpp vendor/llvm/dist/lib/Analysis/LoopInfo.cpp vendor/llvm/dist/lib/Analysis/MemorySSA.cpp vendor/llvm/dist/lib/Analysis/PostDominators.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp vendor/llvm/dist/lib/AsmParser/LLLexer.cpp vendor/llvm/dist/lib/AsmParser/LLParser.cpp vendor/llvm/dist/lib/AsmParser/LLToken.h vendor/llvm/dist/lib/Bitcode/Reader/MetadataLoader.cpp vendor/llvm/dist/lib/Bitcode/Writer/BitcodeWriter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp vendor/llvm/dist/lib/CodeGen/CodeGenPrepare.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/LegalizerHelper.cpp vendor/llvm/dist/lib/CodeGen/MachineCombiner.cpp vendor/llvm/dist/lib/CodeGen/MachineDominanceFrontier.cpp vendor/llvm/dist/lib/CodeGen/MachineDominators.cpp vendor/llvm/dist/lib/CodeGen/MachinePostDominators.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp vendor/llvm/dist/lib/CodeGen/XRayInstrumentation.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CVTypeVisitor.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/Formatters.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/SymbolDumper.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeStreamMerger.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFVerifier.cpp vendor/llvm/dist/lib/DebugInfo/PDB/CMakeLists.txt vendor/llvm/dist/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp vendor/llvm/dist/lib/DebugInfo/PDB/GenericError.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/InfoStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/InfoStreamBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/NativeExeSymbol.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/TpiHashing.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/TpiStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/PDBExtras.cpp vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h vendor/llvm/dist/lib/Fuzzer/CMakeLists.txt vendor/llvm/dist/lib/Fuzzer/FuzzerCorpus.h vendor/llvm/dist/lib/Fuzzer/FuzzerDriver.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerFlags.def vendor/llvm/dist/lib/Fuzzer/FuzzerInternal.h vendor/llvm/dist/lib/Fuzzer/FuzzerLoop.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerMerge.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerMutate.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerMutate.h vendor/llvm/dist/lib/Fuzzer/FuzzerTracePC.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerTracePC.h vendor/llvm/dist/lib/Fuzzer/FuzzerUtil.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerUtil.h vendor/llvm/dist/lib/Fuzzer/afl/afl_driver.cpp vendor/llvm/dist/lib/Fuzzer/test/CMakeLists.txt vendor/llvm/dist/lib/Fuzzer/test/FuzzerUnittest.cpp vendor/llvm/dist/lib/Fuzzer/test/fuzzer-flags.test vendor/llvm/dist/lib/Fuzzer/test/fuzzer-traces-hooks.test vendor/llvm/dist/lib/Fuzzer/test/reduce_inputs.test vendor/llvm/dist/lib/IR/AsmWriter.cpp vendor/llvm/dist/lib/IR/Constants.cpp vendor/llvm/dist/lib/IR/Core.cpp vendor/llvm/dist/lib/IR/DIBuilder.cpp vendor/llvm/dist/lib/IR/DebugInfoMetadata.cpp vendor/llvm/dist/lib/IR/Dominators.cpp vendor/llvm/dist/lib/IR/LLVMContextImpl.h vendor/llvm/dist/lib/IR/LegacyPassManager.cpp vendor/llvm/dist/lib/IR/Module.cpp vendor/llvm/dist/lib/Object/ArchiveWriter.cpp vendor/llvm/dist/lib/Object/COFFImportFile.cpp vendor/llvm/dist/lib/Object/COFFModuleDefinition.cpp vendor/llvm/dist/lib/Object/COFFObjectFile.cpp vendor/llvm/dist/lib/ObjectYAML/CodeViewYAMLTypes.cpp vendor/llvm/dist/lib/Option/OptTable.cpp vendor/llvm/dist/lib/Support/ErrorHandling.cpp vendor/llvm/dist/lib/Support/Host.cpp vendor/llvm/dist/lib/Support/Path.cpp vendor/llvm/dist/lib/Support/TargetParser.cpp vendor/llvm/dist/lib/Support/YAMLTraits.cpp vendor/llvm/dist/lib/Support/raw_ostream.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64.h vendor/llvm/dist/lib/Target/AArch64/AArch64.td vendor/llvm/dist/lib/Target/AArch64/AArch64CallingConvention.td vendor/llvm/dist/lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64FastISel.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64FrameLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.h vendor/llvm/dist/lib/Target/AArch64/AArch64InstrAtomics.td vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.h vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.td vendor/llvm/dist/lib/Target/AArch64/AArch64LegalizerInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64RegisterInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64Subtarget.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64Subtarget.h vendor/llvm/dist/lib/Target/AArch64/AArch64TargetMachine.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64TargetMachine.h vendor/llvm/dist/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp vendor/llvm/dist/lib/Target/AArch64/CMakeLists.txt vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFObjectWriter.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h vendor/llvm/dist/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp vendor/llvm/dist/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp vendor/llvm/dist/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h vendor/llvm/dist/lib/Target/AMDGPU/SIFoldOperands.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIFrameLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.h vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.h vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.td vendor/llvm/dist/lib/Target/AMDGPU/SIInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIMachineFunctionInfo.h vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.td vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/VOP2Instructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOP3Instructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOP3PInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOPCInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOPInstructions.td vendor/llvm/dist/lib/Target/ARM/ARM.td vendor/llvm/dist/lib/Target/ARM/ARMBaseRegisterInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMFastISel.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/ARM/ARMInstructionSelector.cpp vendor/llvm/dist/lib/Target/ARM/ARMLegalizerInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMMCInstLower.cpp vendor/llvm/dist/lib/Target/ARM/ARMRegisterBankInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetMachine.h vendor/llvm/dist/lib/Target/BPF/BPFISelLowering.cpp vendor/llvm/dist/lib/Target/BPF/BPFInstrInfo.td vendor/llvm/dist/lib/Target/Hexagon/HexagonBitSimplify.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonDepInstrInfo.td vendor/llvm/dist/lib/Target/Hexagon/HexagonEarlyIfConv.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonExpandCondsets.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonFrameLowering.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonGenInsert.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonGenPredicate.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelLowering.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelLowering.h vendor/llvm/dist/lib/Target/Hexagon/HexagonIntrinsics.td vendor/llvm/dist/lib/Target/Hexagon/HexagonOptAddrMode.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonPatterns.td vendor/llvm/dist/lib/Target/Hexagon/HexagonTargetObjectFile.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonTargetObjectFile.h vendor/llvm/dist/lib/Target/Mips/AsmParser/MipsAsmParser.cpp vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp vendor/llvm/dist/lib/Target/Mips/Mips.td vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.cpp vendor/llvm/dist/lib/Target/Mips/MipsInstrFPU.td vendor/llvm/dist/lib/Target/Mips/MipsMTInstrFormats.td vendor/llvm/dist/lib/Target/Mips/MipsMTInstrInfo.td vendor/llvm/dist/lib/Target/Mips/MipsSEISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/Mips/MipsSEISelDAGToDAG.h vendor/llvm/dist/lib/Target/Mips/MipsSEISelLowering.cpp vendor/llvm/dist/lib/Target/Mips/MipsSchedule.td vendor/llvm/dist/lib/Target/Mips/MipsSubtarget.h vendor/llvm/dist/lib/Target/Mips/MipsTargetStreamer.h vendor/llvm/dist/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.h vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.td vendor/llvm/dist/lib/Target/PowerPC/PPCInstrVSX.td vendor/llvm/dist/lib/Target/PowerPC/PPCRegisterInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCTargetMachine.h vendor/llvm/dist/lib/Target/Sparc/Sparc.td vendor/llvm/dist/lib/Target/Sparc/SparcISelLowering.cpp vendor/llvm/dist/lib/Target/Sparc/SparcInstrInfo.td vendor/llvm/dist/lib/Target/Sparc/SparcSubtarget.cpp vendor/llvm/dist/lib/Target/Sparc/SparcSubtarget.h vendor/llvm/dist/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp vendor/llvm/dist/lib/Target/SystemZ/LLVMBuild.txt vendor/llvm/dist/lib/Target/SystemZ/SystemZFeatures.td vendor/llvm/dist/lib/Target/SystemZ/SystemZISelLowering.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZISelLowering.h vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrFP.td vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrFormats.td vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrInfo.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrInfo.td vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrSystem.td vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrVector.td vendor/llvm/dist/lib/Target/SystemZ/SystemZOperators.td vendor/llvm/dist/lib/Target/SystemZ/SystemZPatterns.td vendor/llvm/dist/lib/Target/SystemZ/SystemZProcessors.td vendor/llvm/dist/lib/Target/SystemZ/SystemZRegisterInfo.td vendor/llvm/dist/lib/Target/SystemZ/SystemZSchedule.td vendor/llvm/dist/lib/Target/SystemZ/SystemZScheduleZ196.td vendor/llvm/dist/lib/Target/SystemZ/SystemZScheduleZEC12.td vendor/llvm/dist/lib/Target/SystemZ/SystemZShortenInst.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZSubtarget.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZSubtarget.h vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetMachine.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetTransformInfo.h vendor/llvm/dist/lib/Target/X86/CMakeLists.txt vendor/llvm/dist/lib/Target/X86/X86.h vendor/llvm/dist/lib/Target/X86/X86.td vendor/llvm/dist/lib/Target/X86/X86CallingConv.td vendor/llvm/dist/lib/Target/X86/X86FastISel.cpp vendor/llvm/dist/lib/Target/X86/X86FixupBWInsts.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td vendor/llvm/dist/lib/Target/X86/X86RegisterInfo.cpp vendor/llvm/dist/lib/Target/X86/X86Schedule.td vendor/llvm/dist/lib/Target/X86/X86ScheduleBtVer2.td vendor/llvm/dist/lib/Target/X86/X86Subtarget.h vendor/llvm/dist/lib/Target/X86/X86TargetMachine.cpp vendor/llvm/dist/lib/Target/X86/X86TargetMachine.h vendor/llvm/dist/lib/ToolDrivers/CMakeLists.txt vendor/llvm/dist/lib/ToolDrivers/LLVMBuild.txt vendor/llvm/dist/lib/Transforms/IPO/GlobalOpt.cpp vendor/llvm/dist/lib/Transforms/IPO/Inliner.cpp vendor/llvm/dist/lib/Transforms/IPO/SampleProfile.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstructionCombining.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/AddressSanitizer.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/MemorySanitizer.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/SanitizerCoverage.cpp vendor/llvm/dist/lib/Transforms/Scalar/EarlyCSE.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp vendor/llvm/dist/lib/Transforms/Scalar/JumpThreading.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopInterchange.cpp vendor/llvm/dist/lib/Transforms/Scalar/TailRecursionElimination.cpp vendor/llvm/dist/lib/Transforms/Utils/LoopUnrollRuntime.cpp vendor/llvm/dist/lib/Transforms/Vectorize/LoopVectorize.cpp vendor/llvm/dist/lib/Transforms/Vectorize/SLPVectorizer.cpp vendor/llvm/dist/runtimes/CMakeLists.txt vendor/llvm/dist/test/Analysis/CostModel/SystemZ/fp-arith.ll vendor/llvm/dist/test/Assembler/diimportedentity.ll vendor/llvm/dist/test/Bitcode/DIGlobalVariableExpression.ll vendor/llvm/dist/test/Bitcode/compatibility-3.6.ll vendor/llvm/dist/test/Bitcode/compatibility-3.7.ll vendor/llvm/dist/test/Bitcode/compatibility-3.8.ll vendor/llvm/dist/test/Bitcode/compatibility-3.9.ll vendor/llvm/dist/test/Bitcode/compatibility-4.0.ll vendor/llvm/dist/test/Bitcode/compatibility.ll vendor/llvm/dist/test/CMakeLists.txt vendor/llvm/dist/test/CodeGen/AArch64/arm64-abi-varargs.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-abi_align.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-alloca-frame-pointer-offset.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-extern-weak.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-inline-asm.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-platform-reg.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-vext.ll vendor/llvm/dist/test/CodeGen/AArch64/atomic-ops-lse.ll vendor/llvm/dist/test/CodeGen/AArch64/dag-combine-invaraints.ll vendor/llvm/dist/test/CodeGen/AArch64/extern-weak.ll vendor/llvm/dist/test/CodeGen/AArch64/preferred-function-alignment.ll vendor/llvm/dist/test/CodeGen/AArch64/swifterror.ll vendor/llvm/dist/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll vendor/llvm/dist/test/CodeGen/AMDGPU/attr-amdgpu-flat-work-group-size.ll vendor/llvm/dist/test/CodeGen/AMDGPU/attr-amdgpu-waves-per-eu.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fcanonicalize-elimination.ll vendor/llvm/dist/test/CodeGen/AMDGPU/function-args.ll vendor/llvm/dist/test/CodeGen/AMDGPU/hsa.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.kernarg.segment.ptr.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.ps.live.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.s.waitcnt.ll vendor/llvm/dist/test/CodeGen/AMDGPU/mubuf-offset-private.ll vendor/llvm/dist/test/CodeGen/AMDGPU/parallelandifcollapse.ll vendor/llvm/dist/test/CodeGen/AMDGPU/parallelorifcollapse.ll vendor/llvm/dist/test/CodeGen/AMDGPU/private-access-no-objects.ll vendor/llvm/dist/test/CodeGen/AMDGPU/rename-independent-subregs-mac-operands.mir vendor/llvm/dist/test/CodeGen/AMDGPU/scratch-simple.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sdwa-peephole-instr.mir vendor/llvm/dist/test/CodeGen/AMDGPU/sdwa-vop2-64bit.mir vendor/llvm/dist/test/CodeGen/AMDGPU/trap.ll vendor/llvm/dist/test/CodeGen/AMDGPU/vccz-corrupt-bug-workaround.mir vendor/llvm/dist/test/CodeGen/AMDGPU/vgpr-spill-emergency-stack-slot-compute.ll vendor/llvm/dist/test/CodeGen/AMDGPU/vgpr-spill-emergency-stack-slot.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-instruction-select.mir vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-isel-divmod.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-isel.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-legalize-divmod.mir vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-regbankselect.mir vendor/llvm/dist/test/CodeGen/ARM/atomic-op.ll vendor/llvm/dist/test/CodeGen/AVR/branch-relaxation.ll vendor/llvm/dist/test/CodeGen/BPF/setcc.ll vendor/llvm/dist/test/CodeGen/Generic/2003-07-29-BadConstSbyte.ll vendor/llvm/dist/test/CodeGen/Generic/2011-07-07-ScheduleDAGCrash.ll vendor/llvm/dist/test/CodeGen/Generic/print-mul-exp.ll vendor/llvm/dist/test/CodeGen/Generic/print-mul.ll vendor/llvm/dist/test/CodeGen/Generic/print-shift.ll vendor/llvm/dist/test/CodeGen/Generic/v-split.ll vendor/llvm/dist/test/CodeGen/Generic/vector-redux.ll vendor/llvm/dist/test/CodeGen/Generic/vector.ll vendor/llvm/dist/test/CodeGen/Hexagon/intrinsics/system_user.ll vendor/llvm/dist/test/CodeGen/Hexagon/v6vec-vprint.ll vendor/llvm/dist/test/CodeGen/MIR/AArch64/target-memoperands.mir vendor/llvm/dist/test/CodeGen/MSP430/vararg.ll vendor/llvm/dist/test/CodeGen/Mips/2008-06-05-Carry.ll vendor/llvm/dist/test/CodeGen/Mips/dins.ll vendor/llvm/dist/test/CodeGen/Mips/dsp-patterns.ll vendor/llvm/dist/test/CodeGen/Mips/llcarry.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/add.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/sub.ll vendor/llvm/dist/test/CodeGen/Mips/madd-msub.ll vendor/llvm/dist/test/CodeGen/Mips/msa/f16-llvm-ir.ll vendor/llvm/dist/test/CodeGen/PowerPC/build-vector-tests.ll vendor/llvm/dist/test/CodeGen/PowerPC/ppc64-i128-abi.ll vendor/llvm/dist/test/CodeGen/PowerPC/swaps-le-6.ll vendor/llvm/dist/test/CodeGen/PowerPC/vsx-p9.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-add-01.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-cmp-01.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-div-01.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-mul-01.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-mul-06.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-mul-08.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-sqrt-01.ll vendor/llvm/dist/test/CodeGen/SystemZ/fp-sub-01.ll vendor/llvm/dist/test/CodeGen/Thumb/select.ll vendor/llvm/dist/test/CodeGen/WebAssembly/indirect-import.ll vendor/llvm/dist/test/CodeGen/WebAssembly/userstack.ll vendor/llvm/dist/test/CodeGen/X86/2008-01-08-SchedulerCrash.ll vendor/llvm/dist/test/CodeGen/X86/2009-06-03-Win64DisableRedZone.ll vendor/llvm/dist/test/CodeGen/X86/2011-10-19-widen_vselect.ll vendor/llvm/dist/test/CodeGen/X86/DynamicCalleeSavedRegisters.ll vendor/llvm/dist/test/CodeGen/X86/atomic-minmax-i6432.ll vendor/llvm/dist/test/CodeGen/X86/atomic128.ll vendor/llvm/dist/test/CodeGen/X86/avx-schedule.ll vendor/llvm/dist/test/CodeGen/X86/avx2-arith.ll vendor/llvm/dist/test/CodeGen/X86/avx2-schedule.ll vendor/llvm/dist/test/CodeGen/X86/avx2-vector-shifts.ll vendor/llvm/dist/test/CodeGen/X86/avx512-cvt.ll vendor/llvm/dist/test/CodeGen/X86/avx512-mask-op.ll vendor/llvm/dist/test/CodeGen/X86/avx512-shift.ll vendor/llvm/dist/test/CodeGen/X86/bool-ext-inc.ll vendor/llvm/dist/test/CodeGen/X86/clobber-fi0.ll vendor/llvm/dist/test/CodeGen/X86/combine-rotates.ll vendor/llvm/dist/test/CodeGen/X86/combine-shl.ll vendor/llvm/dist/test/CodeGen/X86/combine-srl.ll vendor/llvm/dist/test/CodeGen/X86/combine-udiv.ll vendor/llvm/dist/test/CodeGen/X86/combine-urem.ll vendor/llvm/dist/test/CodeGen/X86/fast-isel-x86-64.ll vendor/llvm/dist/test/CodeGen/X86/hipe-cc.ll vendor/llvm/dist/test/CodeGen/X86/hipe-cc64.ll vendor/llvm/dist/test/CodeGen/X86/legalize-shift-64.ll vendor/llvm/dist/test/CodeGen/X86/machine-outliner-debuginfo.ll vendor/llvm/dist/test/CodeGen/X86/machine-outliner.ll vendor/llvm/dist/test/CodeGen/X86/memcmp.ll vendor/llvm/dist/test/CodeGen/X86/pmul.ll vendor/llvm/dist/test/CodeGen/X86/regparm.ll vendor/llvm/dist/test/CodeGen/X86/sibcall-win64.ll vendor/llvm/dist/test/CodeGen/X86/sse-schedule.ll vendor/llvm/dist/test/CodeGen/X86/sse2-schedule.ll vendor/llvm/dist/test/CodeGen/X86/sse3-schedule.ll vendor/llvm/dist/test/CodeGen/X86/sse41-schedule.ll vendor/llvm/dist/test/CodeGen/X86/sse42-schedule.ll vendor/llvm/dist/test/CodeGen/X86/sse4a-schedule.ll vendor/llvm/dist/test/CodeGen/X86/ssse3-schedule.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-invoke.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-stack-usage.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-vector.ll vendor/llvm/dist/test/CodeGen/X86/vec_cmp_uint-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-idiv-sdiv-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-idiv-sdiv-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-idiv-udiv-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-idiv-udiv-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-idiv.ll vendor/llvm/dist/test/CodeGen/X86/vector-rotate-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-rotate-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-ashr-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-tzcnt-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-tzcnt-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-tzcnt-512.ll vendor/llvm/dist/test/CodeGen/X86/vselect-avx.ll vendor/llvm/dist/test/CodeGen/X86/widen_arith-2.ll vendor/llvm/dist/test/CodeGen/X86/widen_cast-4.ll vendor/llvm/dist/test/CodeGen/X86/win64-nosse-csrs.ll vendor/llvm/dist/test/CodeGen/X86/win64_nonvol.ll vendor/llvm/dist/test/CodeGen/X86/win64_params.ll vendor/llvm/dist/test/CodeGen/X86/win_chkstk.ll vendor/llvm/dist/test/CodeGen/X86/win_coreclr_chkstk.ll vendor/llvm/dist/test/CodeGen/X86/x86-64-ms_abi-vararg.ll vendor/llvm/dist/test/CodeGen/XCore/varargs.ll vendor/llvm/dist/test/DebugInfo/Generic/namespace.ll vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-headers.test vendor/llvm/dist/test/DebugInfo/X86/DIModule.ll vendor/llvm/dist/test/DebugInfo/X86/DIModuleContext.ll vendor/llvm/dist/test/DebugInfo/X86/fission-inline.ll vendor/llvm/dist/test/DebugInfo/X86/gnu-public-names.ll vendor/llvm/dist/test/DebugInfo/X86/lexical-block-file-inline.ll vendor/llvm/dist/test/DebugInfo/X86/pr19307.ll vendor/llvm/dist/test/FileCheck/regex-scope.txt vendor/llvm/dist/test/Instrumentation/AddressSanitizer/basic.ll vendor/llvm/dist/test/Instrumentation/EfficiencySanitizer/working_set_basic.ll vendor/llvm/dist/test/Instrumentation/EfficiencySanitizer/working_set_slow.ll vendor/llvm/dist/test/Instrumentation/MemorySanitizer/msan_basic.ll vendor/llvm/dist/test/Linker/pr26037.ll vendor/llvm/dist/test/MC/AMDGPU/gfx9_asm_all.s vendor/llvm/dist/test/MC/AMDGPU/vop3-errs.s vendor/llvm/dist/test/MC/ARM/virtexts-thumb.s vendor/llvm/dist/test/MC/Disassembler/AMDGPU/gfx9_dasm_all.txt vendor/llvm/dist/test/MC/Disassembler/Mips/mt/valid-r2-el.txt vendor/llvm/dist/test/MC/Disassembler/Mips/mt/valid-r2.txt vendor/llvm/dist/test/MC/Mips/mt/invalid.s vendor/llvm/dist/test/MC/Mips/mt/valid.s vendor/llvm/dist/test/MC/SystemZ/insn-bad-z13.s vendor/llvm/dist/test/MC/X86/pr22028.s vendor/llvm/dist/test/Object/no-section-table.test vendor/llvm/dist/test/Object/readobj-shared-object.test vendor/llvm/dist/test/Other/new-pass-manager.ll vendor/llvm/dist/test/ThinLTO/X86/debuginfo-cu-import.ll vendor/llvm/dist/test/Transforms/CodeGenPrepare/X86/memcmp.ll vendor/llvm/dist/test/Transforms/CodeGenPrepare/X86/sink-addrmode.ll vendor/llvm/dist/test/Transforms/GVN/PRE/phi-translate.ll vendor/llvm/dist/test/Transforms/InstCombine/2017-07-07-UMul-ZExt.ll vendor/llvm/dist/test/Transforms/InstCombine/and.ll vendor/llvm/dist/test/Transforms/InstCombine/and2.ll vendor/llvm/dist/test/Transforms/InstCombine/icmp-logical.ll vendor/llvm/dist/test/Transforms/InstCombine/or-xor.ll vendor/llvm/dist/test/Transforms/InstCombine/or.ll vendor/llvm/dist/test/Transforms/JumpThreading/select.ll vendor/llvm/dist/test/Transforms/LoopVectorize/X86/float-induction-x86.ll vendor/llvm/dist/test/Transforms/LoopVectorize/debugloc.ll vendor/llvm/dist/test/Transforms/LoopVectorize/first-order-recurrence.ll vendor/llvm/dist/test/Transforms/LoopVectorize/float-induction.ll vendor/llvm/dist/test/Transforms/LoopVectorize/if-conversion-nest.ll vendor/llvm/dist/test/Transforms/LoopVectorize/induction-step.ll vendor/llvm/dist/test/Transforms/LoopVectorize/induction.ll vendor/llvm/dist/test/Transforms/LoopVectorize/interleaved-accesses-pred-stores.ll vendor/llvm/dist/test/Transforms/LoopVectorize/interleaved-accesses.ll vendor/llvm/dist/test/Transforms/LoopVectorize/iv_outside_user.ll vendor/llvm/dist/test/Transforms/LoopVectorize/miniters.ll vendor/llvm/dist/test/Transforms/LoopVectorize/runtime-check-readonly.ll vendor/llvm/dist/test/Transforms/LoopVectorize/runtime-check.ll vendor/llvm/dist/test/tools/llvm-cov/showTabsHTML.cpp vendor/llvm/dist/test/tools/llvm-readobj/Inputs/dynamic-table-so.x86 vendor/llvm/dist/test/tools/llvm-readobj/Inputs/dynamic-table.c vendor/llvm/dist/test/tools/llvm-readobj/dynamic.test vendor/llvm/dist/test/tools/llvm-readobj/gnu-sections.test vendor/llvm/dist/tools/llvm-ar/CMakeLists.txt vendor/llvm/dist/tools/llvm-ar/llvm-ar.cpp vendor/llvm/dist/tools/llvm-objdump/llvm-objdump.cpp vendor/llvm/dist/tools/llvm-pdbutil/DumpOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbutil/MinimalSymbolDumper.cpp vendor/llvm/dist/tools/llvm-pdbutil/MinimalTypeDumper.cpp vendor/llvm/dist/tools/llvm-pdbutil/MinimalTypeDumper.h vendor/llvm/dist/tools/llvm-pdbutil/PdbYaml.cpp vendor/llvm/dist/tools/llvm-pdbutil/PdbYaml.h vendor/llvm/dist/tools/llvm-pdbutil/llvm-pdbutil.cpp vendor/llvm/dist/tools/llvm-readobj/CMakeLists.txt vendor/llvm/dist/tools/llvm-readobj/COFFDumper.cpp vendor/llvm/dist/tools/llvm-readobj/ELFDumper.cpp vendor/llvm/dist/tools/llvm-readobj/llvm-readobj.cpp vendor/llvm/dist/tools/opt-viewer/opt-diff.py vendor/llvm/dist/tools/opt-viewer/opt-stats.py vendor/llvm/dist/tools/opt-viewer/opt-viewer.py vendor/llvm/dist/tools/opt-viewer/optpmap.py vendor/llvm/dist/tools/opt-viewer/optrecord.py vendor/llvm/dist/unittests/Analysis/CGSCCPassManagerTest.cpp vendor/llvm/dist/unittests/Analysis/LazyCallGraphTest.cpp vendor/llvm/dist/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp vendor/llvm/dist/unittests/DebugInfo/PDB/CMakeLists.txt vendor/llvm/dist/unittests/IR/CMakeLists.txt vendor/llvm/dist/unittests/IR/DominatorTreeTest.cpp vendor/llvm/dist/unittests/IR/IRBuilderTest.cpp vendor/llvm/dist/unittests/IR/MetadataTest.cpp vendor/llvm/dist/unittests/Support/TargetParserTest.cpp vendor/llvm/dist/unittests/Support/YAMLIOTest.cpp vendor/llvm/dist/unittests/Support/raw_ostream_test.cpp vendor/llvm/dist/utils/TableGen/CodeGenRegisters.cpp vendor/llvm/dist/utils/lit/lit/LitConfig.py vendor/llvm/dist/utils/lit/lit/TestRunner.py vendor/llvm/dist/utils/lit/lit/main.py vendor/llvm/dist/utils/vim/syntax/llvm.vim Modified: vendor/llvm/dist/RELEASE_TESTERS.TXT ============================================================================== --- vendor/llvm/dist/RELEASE_TESTERS.TXT Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/RELEASE_TESTERS.TXT Wed Jul 19 07:02:10 2017 (r321184) @@ -41,14 +41,9 @@ E: hans@chromium.org T: x86 O: Windows -N: Renato Golin -E: renato.golin@linaro.org -T: ARM -O: Linux - N: Diana Picus E: diana.picus@linaro.org -T: AArch64 +T: ARM, AArch64 O: Linux N: Simon Dardis Modified: vendor/llvm/dist/docs/AliasAnalysis.rst ============================================================================== --- vendor/llvm/dist/docs/AliasAnalysis.rst Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/docs/AliasAnalysis.rst Wed Jul 19 07:02:10 2017 (r321184) @@ -132,7 +132,8 @@ The ``MayAlias`` response is used whenever the two poi same object. The ``PartialAlias`` response is used when the two memory objects are known to -be overlapping in some way, but do not start at the same address. +be overlapping in some way, regardless whether they start at the same address +or not. The ``MustAlias`` response may only be returned if the two memory objects are guaranteed to always start at exactly the same location. A ``MustAlias`` Modified: vendor/llvm/dist/docs/CodingStandards.rst ============================================================================== --- vendor/llvm/dist/docs/CodingStandards.rst Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/docs/CodingStandards.rst Wed Jul 19 07:02:10 2017 (r321184) @@ -34,10 +34,10 @@ There are some conventions that are not uniformly foll (e.g. the naming convention). This is because they are relatively new, and a lot of code was written before they were put in place. Our long term goal is for the entire codebase to follow the convention, but we explicitly *do not* -want patches that do large-scale reformating of existing code. On the other +want patches that do large-scale reformatting of existing code. On the other hand, it is reasonable to rename the methods of a class if you're about to -change it in some other way. Just do the reformating as a separate commit from -the functionality change. +change it in some other way. Just do the reformatting as a separate commit +from the functionality change. The ultimate goal of these guidelines is to increase the readability and maintainability of our common source base. If you have suggestions for topics to Modified: vendor/llvm/dist/docs/CommandGuide/lit.rst ============================================================================== --- vendor/llvm/dist/docs/CommandGuide/lit.rst Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/docs/CommandGuide/lit.rst Wed Jul 19 07:02:10 2017 (r321184) @@ -80,6 +80,13 @@ OUTPUT OPTIONS Show more information on test failures, for example the entire test output instead of just the test result. +.. option:: -vv, --echo-all-commands + + Echo all commands to stdout, as they are being executed. + This can be valuable for debugging test failures, as the last echoed command + will be the one which has failed. + This option implies ``--verbose``. + .. option:: -a, --show-all Show more information about all tests, for example the entire test Modified: vendor/llvm/dist/include/llvm/Analysis/DominanceFrontier.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/DominanceFrontier.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/DominanceFrontier.h Wed Jul 19 07:02:10 2017 (r321184) @@ -29,9 +29,9 @@ namespace llvm { /// DominanceFrontierBase - Common base class for computing forward and inverse /// dominance frontiers for a function. /// -template +template class DominanceFrontierBase { -public: + public: typedef std::set DomSetType; // Dom set for a bb typedef std::map DomSetMapType; // Dom set map @@ -40,10 +40,10 @@ class DominanceFrontierBase { (protected) DomSetMapType Frontiers; std::vector Roots; - const bool IsPostDominators; + static constexpr bool IsPostDominators = IsPostDom; -public: - DominanceFrontierBase(bool isPostDom) : IsPostDominators(isPostDom) {} + public: + DominanceFrontierBase() {} /// getRoots - Return the root blocks of the current CFG. This may include /// multiple blocks if we are computing post dominators. For forward @@ -96,7 +96,7 @@ class DominanceFrontierBase { (protected) /// compare - Return true if the other dominance frontier base matches /// this dominance frontier base. Otherwise return false. - bool compare(DominanceFrontierBase &Other) const; + bool compare(DominanceFrontierBase &Other) const; /// print - Convert to human readable form /// @@ -113,22 +113,21 @@ class DominanceFrontierBase { (protected) /// used to compute a forward dominator frontiers. /// template -class ForwardDominanceFrontierBase : public DominanceFrontierBase { -private: +class ForwardDominanceFrontierBase + : public DominanceFrontierBase { + private: typedef GraphTraits BlockTraits; public: - typedef DominatorTreeBase DomTreeT; - typedef DomTreeNodeBase DomTreeNodeT; - typedef typename DominanceFrontierBase::DomSetType DomSetType; + typedef DomTreeBase DomTreeT; + typedef DomTreeNodeBase DomTreeNodeT; + typedef typename DominanceFrontierBase::DomSetType DomSetType; - ForwardDominanceFrontierBase() : DominanceFrontierBase(false) {} - - void analyze(DomTreeT &DT) { - this->Roots = DT.getRoots(); - assert(this->Roots.size() == 1 && - "Only one entry block for forward domfronts!"); - calculate(DT, DT[this->Roots[0]]); + void analyze(DomTreeT &DT) { + this->Roots = DT.getRoots(); + assert(this->Roots.size() == 1 && + "Only one entry block for forward domfronts!"); + calculate(DT, DT[this->Roots[0]]); } const DomSetType &calculate(const DomTreeT &DT, const DomTreeNodeT *Node); @@ -136,15 +135,16 @@ class ForwardDominanceFrontierBase : public DominanceF class DominanceFrontier : public ForwardDominanceFrontierBase { public: - typedef DominatorTreeBase DomTreeT; - typedef DomTreeNodeBase DomTreeNodeT; - typedef DominanceFrontierBase::DomSetType DomSetType; - typedef DominanceFrontierBase::iterator iterator; - typedef DominanceFrontierBase::const_iterator const_iterator; + typedef DomTreeBase DomTreeT; + typedef DomTreeNodeBase DomTreeNodeT; + typedef DominanceFrontierBase::DomSetType DomSetType; + typedef DominanceFrontierBase::iterator iterator; + typedef DominanceFrontierBase::const_iterator + const_iterator; - /// Handle invalidation explicitly. - bool invalidate(Function &F, const PreservedAnalyses &PA, - FunctionAnalysisManager::Invalidator &); + /// Handle invalidation explicitly. + bool invalidate(Function &F, const PreservedAnalyses &PA, + FunctionAnalysisManager::Invalidator &); }; class DominanceFrontierWrapperPass : public FunctionPass { @@ -168,7 +168,8 @@ class DominanceFrontierWrapperPass : public FunctionPa void dump() const; }; -extern template class DominanceFrontierBase; +extern template class DominanceFrontierBase; +extern template class DominanceFrontierBase; extern template class ForwardDominanceFrontierBase; /// \brief Analysis pass which computes a \c DominanceFrontier. Modified: vendor/llvm/dist/include/llvm/Analysis/DominanceFrontierImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/DominanceFrontierImpl.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/DominanceFrontierImpl.h Wed Jul 19 07:02:10 2017 (r321184) @@ -39,33 +39,33 @@ class DFCalculateWorkObject { (public) const DomTreeNodeT *parentNode; }; -template -void DominanceFrontierBase::removeBlock(BlockT *BB) { +template +void DominanceFrontierBase::removeBlock(BlockT *BB) { assert(find(BB) != end() && "Block is not in DominanceFrontier!"); for (iterator I = begin(), E = end(); I != E; ++I) I->second.erase(BB); Frontiers.erase(BB); } -template -void DominanceFrontierBase::addToFrontier(iterator I, - BlockT *Node) { +template +void DominanceFrontierBase::addToFrontier(iterator I, + BlockT *Node) { assert(I != end() && "BB is not in DominanceFrontier!"); assert(I->second.count(Node) && "Node is not in DominanceFrontier of BB"); I->second.erase(Node); } -template -void DominanceFrontierBase::removeFromFrontier(iterator I, - BlockT *Node) { +template +void DominanceFrontierBase::removeFromFrontier( + iterator I, BlockT *Node) { assert(I != end() && "BB is not in DominanceFrontier!"); assert(I->second.count(Node) && "Node is not in DominanceFrontier of BB"); I->second.erase(Node); } -template -bool DominanceFrontierBase::compareDomSet(DomSetType &DS1, - const DomSetType &DS2) const { +template +bool DominanceFrontierBase::compareDomSet( + DomSetType &DS1, const DomSetType &DS2) const { std::set tmpSet; for (BlockT *BB : DS2) tmpSet.insert(BB); @@ -88,9 +88,9 @@ bool DominanceFrontierBase::compareDomSet(DomS return false; } -template -bool DominanceFrontierBase::compare( - DominanceFrontierBase &Other) const { +template +bool DominanceFrontierBase::compare( + DominanceFrontierBase &Other) const { DomSetMapType tmpFrontiers; for (typename DomSetMapType::const_iterator I = Other.begin(), E = Other.end(); @@ -118,8 +118,8 @@ bool DominanceFrontierBase::compare( return false; } -template -void DominanceFrontierBase::print(raw_ostream &OS) const { +template +void DominanceFrontierBase::print(raw_ostream &OS) const { for (const_iterator I = begin(), E = end(); I != E; ++I) { OS << " DomFrontier for BB "; if (I->first) @@ -142,8 +142,8 @@ void DominanceFrontierBase::print(raw_ostream } #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) -template -void DominanceFrontierBase::dump() const { +template +void DominanceFrontierBase::dump() const { print(dbgs()); } #endif Modified: vendor/llvm/dist/include/llvm/Analysis/IteratedDominanceFrontier.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/IteratedDominanceFrontier.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/IteratedDominanceFrontier.h Wed Jul 19 07:02:10 2017 (r321184) @@ -42,12 +42,12 @@ namespace llvm { /// By default, liveness is not used to prune the IDF computation. /// The template parameters should be either BasicBlock* or Inverse, depending on if you want the forward or reverse IDF. -template +template class IDFCalculator { + public: + IDFCalculator(DominatorTreeBase &DT) + : DT(DT), useLiveIn(false) {} -public: - IDFCalculator(DominatorTreeBase &DT) : DT(DT), useLiveIn(false) {} - /// \brief Give the IDF calculator the set of blocks in which the value is /// defined. This is equivalent to the set of starting blocks it should be /// calculating the IDF for (though later gets pruned based on liveness). @@ -84,12 +84,12 @@ class IDFCalculator { (public) void calculate(SmallVectorImpl &IDFBlocks); private: - DominatorTreeBase &DT; - bool useLiveIn; - const SmallPtrSetImpl *LiveInBlocks; - const SmallPtrSetImpl *DefBlocks; + DominatorTreeBase &DT; + bool useLiveIn; + const SmallPtrSetImpl *LiveInBlocks; + const SmallPtrSetImpl *DefBlocks; }; -typedef IDFCalculator ForwardIDFCalculator; -typedef IDFCalculator> ReverseIDFCalculator; +typedef IDFCalculator ForwardIDFCalculator; +typedef IDFCalculator, true> ReverseIDFCalculator; } #endif Modified: vendor/llvm/dist/include/llvm/Analysis/LazyCallGraph.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/LazyCallGraph.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/LazyCallGraph.h Wed Jul 19 07:02:10 2017 (r321184) @@ -43,6 +43,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/iterator.h" #include "llvm/ADT/iterator_range.h" +#include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Function.h" @@ -908,7 +909,7 @@ class LazyCallGraph { (public) /// This sets up the graph and computes all of the entry points of the graph. /// No function definitions are scanned until their nodes in the graph are /// requested during traversal. - LazyCallGraph(Module &M); + LazyCallGraph(Module &M, TargetLibraryInfo &TLI); LazyCallGraph(LazyCallGraph &&G); LazyCallGraph &operator=(LazyCallGraph &&RHS); @@ -966,6 +967,22 @@ class LazyCallGraph { (public) return insertInto(F, N); } + /// Get the sequence of known and defined library functions. + /// + /// These functions, because they are known to LLVM, can have calls + /// introduced out of thin air from arbitrary IR. + ArrayRef getLibFunctions() const { + return LibFunctions.getArrayRef(); + } + + /// Test whether a function is a known and defined library function tracked by + /// the call graph. + /// + /// Because these functions are known to LLVM they are specially modeled in + /// the call graph and even when all IR-level references have been removed + /// remain active and reachable. + bool isLibFunction(Function &F) const { return LibFunctions.count(&F); } + ///@{ /// \name Pre-SCC Mutation API /// @@ -1100,6 +1117,11 @@ class LazyCallGraph { (public) /// These are all of the RefSCCs which have no children. SmallVector LeafRefSCCs; + /// Defined functions that are also known library functions which the + /// optimizer can reason about and therefore might introduce calls to out of + /// thin air. + SmallSetVector LibFunctions; + /// Helper to insert a new function, with an already looked-up entry in /// the NodeMap. Node &insertInto(Function &F, Node *&MappedN); @@ -1216,8 +1238,8 @@ class LazyCallGraphAnalysis : public AnalysisInfoMixin /// /// This just builds the set of entry points to the call graph. The rest is /// built lazily as it is walked. - LazyCallGraph run(Module &M, ModuleAnalysisManager &) { - return LazyCallGraph(M); + LazyCallGraph run(Module &M, ModuleAnalysisManager &AM) { + return LazyCallGraph(M, AM.getResult(M)); } }; Modified: vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h Wed Jul 19 07:02:10 2017 (r321184) @@ -56,7 +56,8 @@ class Loop; class MDNode; class PHINode; class raw_ostream; -template class DominatorTreeBase; +template +class DominatorTreeBase; template class LoopInfoBase; template class LoopBase; @@ -663,12 +664,12 @@ class LoopInfoBase { (public) } /// Create the loop forest using a stable algorithm. - void analyze(const DominatorTreeBase &DomTree); + void analyze(const DominatorTreeBase &DomTree); // Debugging void print(raw_ostream &OS) const; - void verify(const DominatorTreeBase &DomTree) const; + void verify(const DominatorTreeBase &DomTree) const; }; // Implementation in LoopInfoImpl.h @@ -683,7 +684,7 @@ class LoopInfo : public LoopInfoBase LoopInfo(const LoopInfo &) = delete; public: LoopInfo() {} - explicit LoopInfo(const DominatorTreeBase &DomTree); + explicit LoopInfo(const DominatorTreeBase &DomTree); LoopInfo(LoopInfo &&Arg) : BaseT(std::move(static_cast(Arg))) {} LoopInfo &operator=(LoopInfo &&RHS) { Modified: vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h Wed Jul 19 07:02:10 2017 (r321184) @@ -340,10 +340,10 @@ void LoopBase::print(raw_ostream &OS, u /// Discover a subloop with the specified backedges such that: All blocks within /// this loop are mapped to this loop or a subloop. And all subloops within this /// loop have their parent loop set to this loop or a subloop. -template -static void discoverAndMapSubloop(LoopT *L, ArrayRef Backedges, - LoopInfoBase *LI, - const DominatorTreeBase &DomTree) { +template +static void discoverAndMapSubloop( + LoopT *L, ArrayRef Backedges, LoopInfoBase *LI, + const DomTreeBase &DomTree) { typedef GraphTraits > InvBlockTraits; unsigned NumBlocks = 0; @@ -462,10 +462,9 @@ void PopulateLoopsDFS::insertIntoLoop(B /// /// The Block vectors are inclusive, so step 3 requires loop-depth number of /// insertions per block. -template -void LoopInfoBase:: -analyze(const DominatorTreeBase &DomTree) { - +template +void LoopInfoBase::analyze( + const DomTreeBase &DomTree) { // Postorder traversal of the dominator tree. const DomTreeNodeBase *DomRoot = DomTree.getRootNode(); for (auto DomNode : post_order(DomRoot)) { @@ -607,7 +606,7 @@ static void compareLoops(const LoopT *L, const LoopT * template void LoopInfoBase::verify( - const DominatorTreeBase &DomTree) const { + const DomTreeBase &DomTree) const { DenseSet Loops; for (iterator I = begin(), E = end(); I != E; ++I) { assert(!(*I)->getParentLoop() && "Top-level loop has a parent!"); Modified: vendor/llvm/dist/include/llvm/Analysis/PostDominators.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/PostDominators.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/PostDominators.h Wed Jul 19 07:02:10 2017 (r321184) @@ -22,10 +22,8 @@ namespace llvm { /// PostDominatorTree Class - Concrete subclass of DominatorTree that is used to /// compute the post-dominator tree. /// -struct PostDominatorTree : public DominatorTreeBase { - typedef DominatorTreeBase Base; - - PostDominatorTree() : DominatorTreeBase(true) {} +struct PostDominatorTree : public PostDomTreeBase { + typedef PostDomTreeBase Base; /// Handle invalidation explicitly. bool invalidate(Function &F, const PreservedAnalyses &PA, Modified: vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Wed Jul 19 07:02:10 2017 (r321184) @@ -237,17 +237,15 @@ struct FoldingSetTrait : DefaultFolding }; /// This class represents an assumption that two SCEV expressions are equal, -/// and this can be checked at run-time. We assume that the left hand side is -/// a SCEVUnknown and the right hand side a constant. +/// and this can be checked at run-time. class SCEVEqualPredicate final : public SCEVPredicate { - /// We assume that LHS == RHS, where LHS is a SCEVUnknown and RHS a - /// constant. - const SCEVUnknown *LHS; - const SCEVConstant *RHS; + /// We assume that LHS == RHS. + const SCEV *LHS; + const SCEV *RHS; public: - SCEVEqualPredicate(const FoldingSetNodeIDRef ID, const SCEVUnknown *LHS, - const SCEVConstant *RHS); + SCEVEqualPredicate(const FoldingSetNodeIDRef ID, const SCEV *LHS, + const SCEV *RHS); /// Implementation of the SCEVPredicate interface bool implies(const SCEVPredicate *N) const override; @@ -256,10 +254,10 @@ class SCEVEqualPredicate final : public SCEVPredicate const SCEV *getExpr() const override; /// Returns the left hand side of the equality. - const SCEVUnknown *getLHS() const { return LHS; } + const SCEV *getLHS() const { return LHS; } /// Returns the right hand side of the equality. - const SCEVConstant *getRHS() const { return RHS; } + const SCEV *getRHS() const { return RHS; } /// Methods for support type inquiry through isa, cast, and dyn_cast: static bool classof(const SCEVPredicate *P) { @@ -1241,6 +1239,14 @@ class ScalarEvolution { (public) SmallVector NewOp(Operands.begin(), Operands.end()); return getAddRecExpr(NewOp, L, Flags); } + + /// Checks if \p SymbolicPHI can be rewritten as an AddRecExpr under some + /// Predicates. If successful return these ; + /// The function is intended to be called from PSCEV (the caller will decide + /// whether to actually add the predicates and carry out the rewrites). + Optional>> + createAddRecFromPHIWithCasts(const SCEVUnknown *SymbolicPHI); + /// Returns an expression for a GEP /// /// \p GEP The GEP. The indices contained in the GEP itself are ignored, @@ -1675,8 +1681,7 @@ class ScalarEvolution { (public) return F.getParent()->getDataLayout(); } - const SCEVPredicate *getEqualPredicate(const SCEVUnknown *LHS, - const SCEVConstant *RHS); + const SCEVPredicate *getEqualPredicate(const SCEV *LHS, const SCEV *RHS); const SCEVPredicate * getWrapPredicate(const SCEVAddRecExpr *AR, @@ -1692,6 +1697,19 @@ class ScalarEvolution { (public) SmallPtrSetImpl &Preds); private: + /// Similar to createAddRecFromPHI, but with the additional flexibility of + /// suggesting runtime overflow checks in case casts are encountered. + /// If successful, the analysis records that for this loop, \p SymbolicPHI, + /// which is the UnknownSCEV currently representing the PHI, can be rewritten + /// into an AddRec, assuming some predicates; The function then returns the + /// AddRec and the predicates as a pair, and caches this pair in + /// PredicatedSCEVRewrites. + /// If the analysis is not successful, a mapping from the \p SymbolicPHI to + /// itself (with no predicates) is recorded, and a nullptr with an empty + /// predicates vector is returned as a pair. + Optional>> + createAddRecFromPHIWithCastsImpl(const SCEVUnknown *SymbolicPHI); + /// Compute the backedge taken count knowing the interval difference, the /// stride and presence of the equality in the comparison. const SCEV *computeBECount(const SCEV *Delta, const SCEV *Stride, @@ -1722,6 +1740,12 @@ class ScalarEvolution { (public) FoldingSet UniquePreds; BumpPtrAllocator SCEVAllocator; + /// Cache tentative mappings from UnknownSCEVs in a Loop, to a SCEV expression + /// they can be rewritten into under certain predicates. + DenseMap, + std::pair>> + PredicatedSCEVRewrites; + /// The head of a linked list of all SCEVUnknown values that have been /// allocated. This is used by releaseMemory to locate them all and call /// their destructors. Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Wed Jul 19 07:02:10 2017 (r321184) @@ -155,6 +155,13 @@ class TargetTransformInfo { (public) int getGEPCost(Type *PointeeType, const Value *Ptr, ArrayRef Operands) const; + /// \brief Estimate the cost of a EXT operation when lowered. + /// + /// The contract for this function is the same as \c getOperationCost except + /// that it supports an interface that provides extra information specific to + /// the EXT operation. + int getExtCost(const Instruction *I, const Value *Src) const; + /// \brief Estimate the cost of a function call when lowered. /// /// The contract for this is the same as \c getOperationCost except that it @@ -849,6 +856,7 @@ class TargetTransformInfo::Concept { (public) virtual int getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) = 0; virtual int getGEPCost(Type *PointeeType, const Value *Ptr, ArrayRef Operands) = 0; + virtual int getExtCost(const Instruction *I, const Value *Src) = 0; virtual int getCallCost(FunctionType *FTy, int NumArgs) = 0; virtual int getCallCost(const Function *F, int NumArgs) = 0; virtual int getCallCost(const Function *F, @@ -1021,6 +1029,9 @@ class TargetTransformInfo::Model final : public Target int getGEPCost(Type *PointeeType, const Value *Ptr, ArrayRef Operands) override { return Impl.getGEPCost(PointeeType, Ptr, Operands); + } + int getExtCost(const Instruction *I, const Value *Src) override { + return Impl.getExtCost(I, Src); } int getCallCost(FunctionType *FTy, int NumArgs) override { return Impl.getCallCost(FTy, NumArgs); Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Wed Jul 19 07:02:10 2017 (r321184) @@ -120,6 +120,10 @@ class TargetTransformInfoImplBase { (public) return SI.getNumCases(); } + int getExtCost(const Instruction *I, const Value *Src) { + return TTI::TCC_Basic; + } + unsigned getCallCost(FunctionType *FTy, int NumArgs) { assert(FTy && "FunctionType must be provided to this routine."); @@ -728,6 +732,8 @@ class TargetTransformInfoImplCRTPBase : public TargetT // nop on most sane targets. if (isa(CI->getOperand(0))) return TTI::TCC_Free; + if (isa(CI) || isa(CI) || isa(CI)) + return static_cast(this)->getExtCost(CI, Operands.back()); } return static_cast(this)->getOperationCost( Modified: vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h Wed Jul 19 07:02:10 2017 (r321184) @@ -155,6 +155,18 @@ class BasicTTIImplBase : public TargetTransformInfoImp return BaseT::getGEPCost(PointeeType, Ptr, Operands); } + int getExtCost(const Instruction *I, const Value *Src) { + if (getTLI()->isExtFree(I)) + return TargetTransformInfo::TCC_Free; + + if (isa(I) || isa(I)) + if (const LoadInst *LI = dyn_cast(Src)) + if (getTLI()->isExtLoad(LI, I, DL)) + return TargetTransformInfo::TCC_Free; + + return TargetTransformInfo::TCC_Basic; + } + unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy, ArrayRef Arguments) { return BaseT::getIntrinsicCost(IID, RetTy, Arguments); Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineDominanceFrontier.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineDominanceFrontier.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineDominanceFrontier.h Wed Jul 19 07:02:10 2017 (r321184) @@ -23,27 +23,24 @@ class MachineDominanceFrontier : public MachineFunctio ForwardDominanceFrontierBase Base; public: - using DomTreeT = DominatorTreeBase; - using DomTreeNodeT = DomTreeNodeBase; - using DomSetType = DominanceFrontierBase::DomSetType; - using iterator = DominanceFrontierBase::iterator; - using const_iterator = - DominanceFrontierBase::const_iterator; + using DomTreeT = DomTreeBase; + using DomTreeNodeT = DomTreeNodeBase; + using DomSetType = DominanceFrontierBase::DomSetType; + using iterator = DominanceFrontierBase::iterator; + using const_iterator = + DominanceFrontierBase::const_iterator; - MachineDominanceFrontier(const MachineDominanceFrontier &) = delete; - MachineDominanceFrontier & - operator=(const MachineDominanceFrontier &) = delete; + MachineDominanceFrontier(const MachineDominanceFrontier &) = delete; + MachineDominanceFrontier &operator=(const MachineDominanceFrontier &) = delete; - static char ID; + static char ID; - MachineDominanceFrontier(); + MachineDominanceFrontier(); - DominanceFrontierBase &getBase() { - return Base; - } + DominanceFrontierBase &getBase() { return Base; } - inline const std::vector &getRoots() const { - return Base.getRoots(); + inline const std::vector &getRoots() const { + return Base.getRoots(); } MachineBasicBlock *getRoot() const { @@ -98,7 +95,7 @@ class MachineDominanceFrontier : public MachineFunctio return Base.compareDomSet(DS1, DS2); } - bool compare(DominanceFrontierBase &Other) const { + bool compare(DominanceFrontierBase &Other) const { return Base.compare(Other); } Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineDominators.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineDominators.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineDominators.h Wed Jul 19 07:02:10 2017 (r321184) @@ -28,13 +28,15 @@ namespace llvm { -template<> -inline void DominatorTreeBase::addRoot(MachineBasicBlock* MBB) { +template <> +inline void DominatorTreeBase::addRoot( + MachineBasicBlock *MBB) { this->Roots.push_back(MBB); } extern template class DomTreeNodeBase; -extern template class DominatorTreeBase; +extern template class DominatorTreeBase; // DomTree +extern template class DominatorTreeBase; // PostDomTree using MachineDomTreeNode = DomTreeNodeBase; @@ -65,7 +67,7 @@ class MachineDominatorTree : public MachineFunctionPas mutable SmallSet NewBBs; /// The DominatorTreeBase that is used to compute a normal dominator tree - std::unique_ptr> DT; + std::unique_ptr> DT; /// \brief Apply all the recorded critical edges to the DT. /// This updates the underlying DT information in a way that uses @@ -79,9 +81,8 @@ class MachineDominatorTree : public MachineFunctionPas MachineDominatorTree(); - DominatorTreeBase &getBase() { - if (!DT) - DT.reset(new DominatorTreeBase(false)); + DomTreeBase &getBase() { + if (!DT) DT.reset(new DomTreeBase()); applySplitCriticalEdges(); return *DT; } Modified: vendor/llvm/dist/include/llvm/CodeGen/MachinePostDominators.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachinePostDominators.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/CodeGen/MachinePostDominators.h Wed Jul 19 07:02:10 2017 (r321184) @@ -26,7 +26,7 @@ namespace llvm { /// struct MachinePostDominatorTree : public MachineFunctionPass { private: - DominatorTreeBase *DT; + PostDomTreeBase *DT; public: static char ID; Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h Wed Jul 19 07:02:10 2017 (r321184) @@ -17,7 +17,6 @@ namespace llvm { namespace codeview { class TypeCollection; -class TypeServerHandler; class TypeVisitorCallbacks; enum VisitorDataSource { @@ -31,11 +30,9 @@ enum VisitorDataSource { Error visitTypeRecord(CVType &Record, TypeIndex Index, TypeVisitorCallbacks &Callbacks, - VisitorDataSource Source = VDS_BytesPresent, - TypeServerHandler *TS = nullptr); + VisitorDataSource Source = VDS_BytesPresent); Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks, - VisitorDataSource Source = VDS_BytesPresent, - TypeServerHandler *TS = nullptr); + VisitorDataSource Source = VDS_BytesPresent); Error visitMemberRecord(CVMemberRecord Record, TypeVisitorCallbacks &Callbacks, VisitorDataSource Source = VDS_BytesPresent); @@ -46,12 +43,9 @@ Error visitMemberRecordStream(ArrayRef FieldL TypeVisitorCallbacks &Callbacks); Error visitTypeStream(const CVTypeArray &Types, TypeVisitorCallbacks &Callbacks, - VisitorDataSource Source = VDS_BytesPresent, - TypeServerHandler *TS = nullptr); -Error visitTypeStream(CVTypeRange Types, TypeVisitorCallbacks &Callbacks, - TypeServerHandler *TS = nullptr); -Error visitTypeStream(TypeCollection &Types, TypeVisitorCallbacks &Callbacks, - TypeServerHandler *TS = nullptr); + VisitorDataSource Source = VDS_BytesPresent); +Error visitTypeStream(CVTypeRange Types, TypeVisitorCallbacks &Callbacks); +Error visitTypeStream(TypeCollection &Types, TypeVisitorCallbacks &Callbacks); } // end namespace codeview } // end namespace llvm Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h Wed Jul 19 07:02:10 2017 (r321184) @@ -84,7 +84,7 @@ class CodeViewRecordIO { (public) Error mapEncodedInteger(uint64_t &Value); Error mapEncodedInteger(APSInt &Value); Error mapStringZ(StringRef &Value); - Error mapGuid(StringRef &Guid); + Error mapGuid(GUID &Guid); Error mapStringZVectorZ(std::vector &Value); Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/Formatters.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/Formatters.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/Formatters.h Wed Jul 19 07:02:10 2017 (r321184) @@ -12,6 +12,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" +#include "llvm/DebugInfo/CodeView/GUID.h" #include "llvm/DebugInfo/CodeView/TypeIndex.h" #include "llvm/Support/FormatAdapters.h" #include "llvm/Support/FormatVariadic.h" @@ -31,7 +32,7 @@ class GuidAdapter final : public FormatAdapter Guid); explicit GuidAdapter(StringRef Guid); - void format(raw_ostream &Stream, StringRef Style) override ; + void format(raw_ostream &Stream, StringRef Style) override; }; } // end namespace detail @@ -57,6 +58,13 @@ template <> struct format_provider struct format_provider { + static void format(const codeview::GUID &V, llvm::raw_ostream &Stream, + StringRef Style) { + Stream << V; } }; Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/GUID.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/GUID.h Wed Jul 19 07:02:10 2017 (r321184) @@ -0,0 +1,55 @@ +//===- GUID.h ---------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_DEBUGINFO_CODEVIEW_GUID_H +#define LLVM_DEBUGINFO_CODEVIEW_GUID_H + +#include +#include + +namespace llvm { +class raw_ostream; + +namespace codeview { + +/// This represents the 'GUID' type from windows.h. +struct GUID { + uint8_t Guid[16]; +}; + +inline bool operator==(const GUID &LHS, const GUID &RHS) { + return 0 == ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)); +} + +inline bool operator<(const GUID &LHS, const GUID &RHS) { + return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) < 0; +} + +inline bool operator<=(const GUID &LHS, const GUID &RHS) { + return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) <= 0; +} + +inline bool operator>(const GUID &LHS, const GUID &RHS) { + return !(LHS <= RHS); +} + +inline bool operator>=(const GUID &LHS, const GUID &RHS) { + return !(LHS < RHS); +} + +inline bool operator!=(const GUID &LHS, const GUID &RHS) { + return !(LHS == RHS); +} + +raw_ostream &operator<<(raw_ostream &OS, const GUID &Guid); + +} // namespace codeview +} // namespace llvm + +#endif Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecord.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecord.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecord.h Wed Jul 19 07:02:10 2017 (r321184) @@ -848,7 +848,7 @@ class BuildInfoSym : public SymbolRecord { (public) : SymbolRecord(SymbolRecordKind::BuildInfoSym), RecordOffset(RecordOffset) {} - uint32_t BuildId; + TypeIndex BuildId; uint32_t RecordOffset; }; Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeRecord.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeRecord.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeRecord.h Wed Jul 19 07:02:10 2017 (r321184) @@ -18,6 +18,7 @@ #include "llvm/ADT/iterator_range.h" #include "llvm/DebugInfo/CodeView/CVRecord.h" #include "llvm/DebugInfo/CodeView/CodeView.h" +#include "llvm/DebugInfo/CodeView/GUID.h" #include "llvm/DebugInfo/CodeView/TypeIndex.h" #include "llvm/Support/BinaryStreamArray.h" #include "llvm/Support/Endian.h" @@ -539,15 +540,17 @@ class TypeServer2Record : public TypeRecord { public: TypeServer2Record() = default; explicit TypeServer2Record(TypeRecordKind Kind) : TypeRecord(Kind) {} - TypeServer2Record(StringRef Guid, uint32_t Age, StringRef Name) - : TypeRecord(TypeRecordKind::TypeServer2), Guid(Guid), Age(Age), - Name(Name) {} + TypeServer2Record(StringRef GuidStr, uint32_t Age, StringRef Name) + : TypeRecord(TypeRecordKind::TypeServer2), Age(Age), Name(Name) { + assert(GuidStr.size() == 16 && "guid isn't 16 bytes"); + ::memcpy(Guid.Guid, GuidStr.data(), 16); + } - StringRef getGuid() const { return Guid; } + const GUID &getGuid() const { return Guid; } uint32_t getAge() const { return Age; } StringRef getName() const { return Name; } - StringRef Guid; + GUID Guid; uint32_t Age; StringRef Name; }; Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h Wed Jul 19 07:02:10 2017 (r321184) @@ -19,7 +19,6 @@ namespace llvm { namespace codeview { class TypeIndex; -class TypeServerHandler; class TypeTableBuilder; /// \brief Merge one set of type records into another. This method assumes @@ -31,16 +30,13 @@ class TypeTableBuilder; /// type stream, that contains the index of the corresponding type record /// in the destination stream. /// -/// \param Handler (optional) If non-null, an interface that gets invoked -/// to handle type server records. -/// /// \param Types The collection of types to merge in. /// /// \returns Error::success() if the operation succeeded, otherwise an /// appropriate error code. Error mergeTypeRecords(TypeTableBuilder &Dest, SmallVectorImpl &SourceToDest, - TypeServerHandler *Handler, const CVTypeArray &Types); + const CVTypeArray &Types); /// \brief Merge one set of id records into another. This method assumes /// that all records are id records, and there are no Type records present. @@ -65,7 +61,7 @@ Error mergeTypeRecords(TypeTableBuilder &Dest, /// appropriate error code. Error mergeIdRecords(TypeTableBuilder &Dest, ArrayRef Types, SmallVectorImpl &SourceToDest, - const CVTypeArray &Ids); + const CVTypeArray &Ids); /// \brief Merge a unified set of type and id records, splitting them into /// separate output streams. @@ -78,9 +74,6 @@ Error mergeIdRecords(TypeTableBuilder &Dest, ArrayRef< /// id stream, that contains the index of the corresponding id record /// in the destination stream. /// -/// \param Handler (optional) If non-null, an interface that gets invoked -/// to handle type server records. -/// /// \param IdsAndTypes The collection of id records to merge in. /// /// \returns Error::success() if the operation succeeded, otherwise an @@ -88,8 +81,7 @@ Error mergeIdRecords(TypeTableBuilder &Dest, ArrayRef< Error mergeTypeAndIdRecords(TypeTableBuilder &DestIds, TypeTableBuilder &DestTypes, SmallVectorImpl &SourceToDest, - TypeServerHandler *Handler, - const CVTypeArray &IdsAndTypes); + const CVTypeArray &IdsAndTypes); } // end namespace codeview } // end namespace llvm Modified: vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h Wed Jul 19 03:19:44 2017 (r321183) +++ vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h Wed Jul 19 07:02:10 2017 (r321184) @@ -238,6 +238,34 @@ class DWARFUnit { (public) uint8_t getUnitType() const { return UnitType; } + static bool isValidUnitType(uint8_t UnitType) { + return UnitType == dwarf::DW_UT_compile || UnitType == dwarf::DW_UT_type || + UnitType == dwarf::DW_UT_partial || + UnitType == dwarf::DW_UT_skeleton || + UnitType == dwarf::DW_UT_split_compile || + UnitType == dwarf::DW_UT_split_type; + } + + /// \brief Return the number of bytes for the header of a unit of + /// UnitType type. + /// + /// This function must be called with a valid unit type which in + /// DWARF5 is defined as one of the following six types. + static uint32_t getDWARF5HeaderSize(uint8_t UnitType) { + switch (UnitType) { + case dwarf::DW_UT_compile: + case dwarf::DW_UT_partial: + return 12; + case dwarf::DW_UT_skeleton: + case dwarf::DW_UT_split_compile: + return 20; + case dwarf::DW_UT_type: + case dwarf::DW_UT_split_type: + return 24; + } + llvm_unreachable("Invalid UnitType."); + } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Wed Jul 19 07:02:20 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 17FC1DAAB59; Wed, 19 Jul 2017 07:02:20 +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 C39A66E195; Wed, 19 Jul 2017 07:02:19 +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 v6J72Ihl090728; Wed, 19 Jul 2017 07:02:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72IPk090727; Wed, 19 Jul 2017 07:02:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72IPk090727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321185 - vendor/llvm/llvm-trunk-r308421 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm/llvm-trunk-r308421 X-SVN-Commit-Revision: 321185 X-SVN-Commit-Repository: base 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, 19 Jul 2017 07:02:20 -0000 Author: dim Date: Wed Jul 19 07:02:18 2017 New Revision: 321185 URL: https://svnweb.freebsd.org/changeset/base/321185 Log: Tag llvm trunk r308421. Added: vendor/llvm/llvm-trunk-r308421/ - copied from r321184, vendor/llvm/dist/ From owner-svn-src-vendor@freebsd.org Wed Jul 19 07:02:34 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 80F2BDAABB7; Wed, 19 Jul 2017 07:02:34 +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 130526E297; Wed, 19 Jul 2017 07:02:34 +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 v6J72XZ0090805; Wed, 19 Jul 2017 07:02:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72UMS090778; Wed, 19 Jul 2017 07:02:30 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72UMS090778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321186 - in vendor/clang/dist: . cmake/caches docs include/clang include/clang-c include/clang/AST include/clang/Analysis/Analyses include/clang/Basic include/clang/Config include/clan... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/clang/dist: . cmake/caches docs include/clang include/clang-c include/clang/AST include/clang/Analysis/Analyses include/clang/Basic include/clang/Config include/clang/Driver include/clang/Fr... X-SVN-Commit-Revision: 321186 X-SVN-Commit-Repository: base 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, 19 Jul 2017 07:02:34 -0000 Author: dim Date: Wed Jul 19 07:02:30 2017 New Revision: 321186 URL: https://svnweb.freebsd.org/changeset/base/321186 Log: Vendor import of clang trunk r308421: https://llvm.org/svn/llvm-project/cfe/trunk@308421 Added: vendor/clang/dist/include/clang/Tooling/Refactoring/RecursiveSymbolVisitor.h (contents, props changed) vendor/clang/dist/test/CodeGen/aarch64-varargs-ms.c (contents, props changed) vendor/clang/dist/test/CodeGen/builtins-systemz-vector2-error.c (contents, props changed) vendor/clang/dist/test/CodeGen/builtins-systemz-vector2.c (contents, props changed) vendor/clang/dist/test/CodeGen/builtins-systemz-zvector2-error.c (contents, props changed) vendor/clang/dist/test/CodeGen/builtins-systemz-zvector2.c (contents, props changed) vendor/clang/dist/test/CodeGen/coff-aarch64-type-sizes.c (contents, props changed) vendor/clang/dist/test/CodeGen/ms_abi_aarch64.c (contents, props changed) vendor/clang/dist/test/CodeGen/zvector2.c (contents, props changed) vendor/clang/dist/test/Index/Core/no-templated-canonical-decl.cpp (contents, props changed) vendor/clang/dist/test/Modules/Inputs/DebugObjCImport.h (contents, props changed) vendor/clang/dist/test/Modules/debug-info-moduleimport-in-module.m vendor/clang/dist/test/OpenMP/taskgroup_task_reduction_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/taskloop_reduction_codegen.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/taskloop_simd_reduction_codegen.cpp (contents, props changed) vendor/clang/dist/test/Sema/varargs-aarch64.c (contents, props changed) vendor/clang/dist/test/Sema/zvector2.c (contents, props changed) vendor/clang/dist/test/SemaObjC/attr-ns_returns_retained.m vendor/clang/dist/unittests/Tooling/DiagnosticsYamlTest.cpp (contents, props changed) Modified: vendor/clang/dist/CMakeLists.txt vendor/clang/dist/cmake/caches/Fuchsia-stage2.cmake vendor/clang/dist/cmake/caches/Fuchsia.cmake vendor/clang/dist/docs/LanguageExtensions.rst vendor/clang/dist/docs/ReleaseNotes.rst vendor/clang/dist/include/clang-c/Index.h vendor/clang/dist/include/clang/AST/ASTContext.h vendor/clang/dist/include/clang/AST/DeclObjC.h vendor/clang/dist/include/clang/AST/OpenMPClause.h vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h vendor/clang/dist/include/clang/AST/StmtOpenMP.h vendor/clang/dist/include/clang/AST/Type.h vendor/clang/dist/include/clang/Analysis/Analyses/Dominators.h vendor/clang/dist/include/clang/Basic/Attr.td vendor/clang/dist/include/clang/Basic/AttrDocs.td vendor/clang/dist/include/clang/Basic/Builtins.def vendor/clang/dist/include/clang/Basic/BuiltinsHexagon.def vendor/clang/dist/include/clang/Basic/BuiltinsSystemZ.def vendor/clang/dist/include/clang/Basic/BuiltinsX86.def vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td vendor/clang/dist/include/clang/Basic/IdentifierTable.h vendor/clang/dist/include/clang/Basic/LangOptions.def vendor/clang/dist/include/clang/Basic/OpenMPKinds.def vendor/clang/dist/include/clang/Basic/Specifiers.h vendor/clang/dist/include/clang/Basic/TargetInfo.h vendor/clang/dist/include/clang/Config/config.h.cmake vendor/clang/dist/include/clang/Driver/Options.td vendor/clang/dist/include/clang/Frontend/LangStandard.h vendor/clang/dist/include/clang/Frontend/LangStandards.def vendor/clang/dist/include/clang/Index/IndexingAction.h vendor/clang/dist/include/clang/Lex/MacroInfo.h vendor/clang/dist/include/clang/Lex/Preprocessor.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/Tooling/DiagnosticsYaml.h vendor/clang/dist/include/clang/Tooling/Refactoring/Rename/USRFinder.h vendor/clang/dist/include/clang/module.modulemap vendor/clang/dist/lib/AST/ASTContext.cpp vendor/clang/dist/lib/AST/ASTDumper.cpp vendor/clang/dist/lib/AST/DeclObjC.cpp vendor/clang/dist/lib/AST/ItaniumMangle.cpp vendor/clang/dist/lib/AST/MicrosoftMangle.cpp vendor/clang/dist/lib/AST/ODRHash.cpp vendor/clang/dist/lib/AST/OpenMPClause.cpp vendor/clang/dist/lib/AST/StmtOpenMP.cpp vendor/clang/dist/lib/AST/StmtPrinter.cpp vendor/clang/dist/lib/AST/StmtProfile.cpp vendor/clang/dist/lib/AST/Type.cpp vendor/clang/dist/lib/AST/TypePrinter.cpp vendor/clang/dist/lib/Analysis/PrintfFormatString.cpp vendor/clang/dist/lib/Basic/CMakeLists.txt vendor/clang/dist/lib/Basic/DiagnosticIDs.cpp vendor/clang/dist/lib/Basic/OpenMPKinds.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGCall.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.h vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/MacroPPCallbacks.cpp vendor/clang/dist/lib/CodeGen/ObjectFilePCHContainerOperations.cpp vendor/clang/dist/lib/CodeGen/TargetInfo.cpp vendor/clang/dist/lib/Driver/Driver.cpp vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist/lib/Driver/ToolChains/Darwin.cpp vendor/clang/dist/lib/Driver/ToolChains/Fuchsia.cpp vendor/clang/dist/lib/Driver/ToolChains/Gnu.cpp vendor/clang/dist/lib/Driver/ToolChains/Solaris.cpp vendor/clang/dist/lib/Driver/ToolChains/Solaris.h vendor/clang/dist/lib/Format/TokenAnnotator.cpp vendor/clang/dist/lib/Format/UnwrappedLineParser.cpp vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/lib/Frontend/InitPreprocessor.cpp vendor/clang/dist/lib/Frontend/PrintPreprocessedOutput.cpp vendor/clang/dist/lib/Frontend/Rewrite/FrontendActions.cpp vendor/clang/dist/lib/Frontend/Rewrite/RewriteModernObjC.cpp vendor/clang/dist/lib/Frontend/Rewrite/RewriteObjC.cpp vendor/clang/dist/lib/FrontendTool/ExecuteCompilerInvocation.cpp vendor/clang/dist/lib/Headers/vecintrin.h vendor/clang/dist/lib/Index/IndexingAction.cpp vendor/clang/dist/lib/Index/IndexingContext.cpp vendor/clang/dist/lib/Lex/MacroArgs.cpp vendor/clang/dist/lib/Lex/MacroInfo.cpp vendor/clang/dist/lib/Lex/PPDirectives.cpp vendor/clang/dist/lib/Lex/PPExpressions.cpp vendor/clang/dist/lib/Lex/PPMacroExpansion.cpp vendor/clang/dist/lib/Lex/Preprocessor.cpp vendor/clang/dist/lib/Lex/TokenLexer.cpp vendor/clang/dist/lib/Parse/ParseObjc.cpp vendor/clang/dist/lib/Parse/ParseOpenMP.cpp vendor/clang/dist/lib/Sema/DeclSpec.cpp vendor/clang/dist/lib/Sema/Sema.cpp vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaCodeComplete.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/SemaObjCProperty.cpp vendor/clang/dist/lib/Sema/SemaOpenMP.cpp vendor/clang/dist/lib/Sema/SemaType.cpp vendor/clang/dist/lib/Sema/TreeTransform.h vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTReaderStmt.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/lib/Serialization/ASTWriterStmt.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp vendor/clang/dist/lib/Tooling/Refactoring/Rename/USRFinder.cpp vendor/clang/dist/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp vendor/clang/dist/lib/Tooling/Tooling.cpp vendor/clang/dist/test/Analysis/localization-aggressive.m vendor/clang/dist/test/Analysis/retain-release-inline.m vendor/clang/dist/test/Analysis/retain-release.m vendor/clang/dist/test/CodeGen/aarch64-type-sizes.c vendor/clang/dist/test/CodeGen/builtins-hexagon.c vendor/clang/dist/test/CodeGen/builtins-systemz-zvector-error.c vendor/clang/dist/test/CodeGen/builtins-systemz-zvector.c vendor/clang/dist/test/CodeGen/debug-info-imported-entity.cpp vendor/clang/dist/test/CodeGen/ms_abi.c vendor/clang/dist/test/CodeGen/systemz-abi-vector.c vendor/clang/dist/test/CodeGen/systemz-abi.c vendor/clang/dist/test/CodeGen/target-data.c vendor/clang/dist/test/CodeGen/ubsan-pointer-overflow.m vendor/clang/dist/test/CodeGenCXX/amdgcn-automatic-variable.cpp vendor/clang/dist/test/CodeGenCXX/debug-info-anon-namespace.cpp vendor/clang/dist/test/CodeGenCXX/debug-info-namespace.cpp vendor/clang/dist/test/CodeGenCXX/implicit-exception-spec.cpp vendor/clang/dist/test/CodeGenObjC/arc-property.m vendor/clang/dist/test/CodeGenObjC/attr-callconv.m vendor/clang/dist/test/CodeGenOpenCL/kernel-arg-info.cl vendor/clang/dist/test/Driver/autocomplete.c vendor/clang/dist/test/Driver/constructors.c vendor/clang/dist/test/Driver/darwin-version.c vendor/clang/dist/test/Driver/emulated-tls.cpp vendor/clang/dist/test/Driver/fuchsia.c vendor/clang/dist/test/Driver/fuchsia.cpp vendor/clang/dist/test/Driver/lto-unit.c vendor/clang/dist/test/Driver/pic.c vendor/clang/dist/test/Driver/std.cpp vendor/clang/dist/test/Driver/systemz-march.c vendor/clang/dist/test/Driver/unknown-std.cpp vendor/clang/dist/test/FixIt/format.m vendor/clang/dist/test/Index/Core/index-source.m vendor/clang/dist/test/Index/complete-available.m vendor/clang/dist/test/Misc/ast-dump-decl.c vendor/clang/dist/test/Misc/ast-dump-decl.cpp vendor/clang/dist/test/Modules/DebugInfoTransitiveImport.m vendor/clang/dist/test/Modules/ExtDebugInfo.cpp vendor/clang/dist/test/Modules/Inputs/module.map vendor/clang/dist/test/Modules/ModuleDebugInfo.m vendor/clang/dist/test/Modules/debug-info-moduleimport.m vendor/clang/dist/test/Modules/odr_hash.cpp vendor/clang/dist/test/OpenMP/distribute_parallel_for_if_codegen.cpp vendor/clang/dist/test/OpenMP/for_reduction_codegen.cpp vendor/clang/dist/test/OpenMP/for_reduction_codegen_UDR.cpp vendor/clang/dist/test/OpenMP/parallel_if_codegen.cpp vendor/clang/dist/test/OpenMP/taskgroup_ast_print.cpp vendor/clang/dist/test/OpenMP/taskgroup_messages.cpp vendor/clang/dist/test/OpenMP/taskloop_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_firstprivate_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_lastprivate_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_private_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_simd_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_simd_firstprivate_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_simd_lastprivate_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_simd_private_codegen.cpp vendor/clang/dist/test/Parser/MicrosoftExtensions.cpp vendor/clang/dist/test/Preprocessor/aarch64-target-features.c vendor/clang/dist/test/Preprocessor/cxx_oper_keyword.cpp vendor/clang/dist/test/Preprocessor/init.c vendor/clang/dist/test/Preprocessor/predefined-arch-macros.c vendor/clang/dist/test/Sema/tls.c vendor/clang/dist/test/Sema/varargs-x86-32.c vendor/clang/dist/test/SemaCXX/attr-x86-no_caller_saved_registers.cpp vendor/clang/dist/test/SemaCXX/cxx1z-noexcept-function-type.cpp vendor/clang/dist/test/SemaObjC/arc-property-decl-attrs.m vendor/clang/dist/test/SemaObjC/property-ambiguous-synthesis.m vendor/clang/dist/test/SemaObjC/warn-deprecated-implementations.m vendor/clang/dist/tools/clang-fuzzer/CMakeLists.txt vendor/clang/dist/tools/clang-fuzzer/ClangFuzzer.cpp vendor/clang/dist/tools/libclang/ARCMigrate.cpp vendor/clang/dist/tools/libclang/CIndex.cpp vendor/clang/dist/tools/libclang/CXType.cpp vendor/clang/dist/tools/scan-build-py/libscanbuild/analyze.py vendor/clang/dist/unittests/ASTMatchers/Dynamic/ParserTest.cpp vendor/clang/dist/unittests/Format/FormatTest.cpp vendor/clang/dist/unittests/Format/FormatTestJS.cpp vendor/clang/dist/unittests/Format/SortImportsTestJS.cpp vendor/clang/dist/unittests/Lex/LexerTest.cpp vendor/clang/dist/unittests/Tooling/CMakeLists.txt vendor/clang/dist/utils/bash-autocomplete.sh vendor/clang/dist/www/analyzer/alpha_checks.html vendor/clang/dist/www/analyzer/available_checks.html vendor/clang/dist/www/analyzer/implicit_checks.html vendor/clang/dist/www/cxx_status.html Modified: vendor/clang/dist/CMakeLists.txt ============================================================================== --- vendor/clang/dist/CMakeLists.txt Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/CMakeLists.txt Wed Jul 19 07:02:30 2017 (r321186) @@ -389,11 +389,7 @@ if(CLANG_ANALYZER_BUILD_Z3) endif() if(CLANG_ENABLE_ARCMT) - add_definitions(-DCLANG_ENABLE_ARCMT) - add_definitions(-DCLANG_ENABLE_OBJC_REWRITER) -endif() -if(CLANG_ENABLE_STATIC_ANALYZER) - add_definitions(-DCLANG_ENABLE_STATIC_ANALYZER) + set(CLANG_ENABLE_OBJC_REWRITER ON) endif() # Clang version information Modified: vendor/clang/dist/cmake/caches/Fuchsia-stage2.cmake ============================================================================== --- vendor/clang/dist/cmake/caches/Fuchsia-stage2.cmake Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/cmake/caches/Fuchsia-stage2.cmake Wed Jul 19 07:02:30 2017 (r321186) @@ -7,7 +7,6 @@ set(PACKAGE_VENDOR Fuchsia CACHE STRING "") set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "") set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "") -set(LLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD OFF CACHE BOOL "") set(LLVM_ENABLE_ZLIB ON CACHE BOOL "") set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "") set(LLVM_EXTERNALIZE_DEBUGINFO ON CACHE BOOL "") @@ -27,12 +26,28 @@ set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -gline-tables-only -DNDEBUG" CACHE STRING "") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -gline-tables-only -DNDEBUG" CACHE STRING "") -set(LLVM_BUILTIN_TARGETS "x86_64-fuchsia-none;aarch64-fuchsia-none" CACHE STRING "") -set(BUILTINS_x86_64-fuchsia-none_CMAKE_SYSROOT ${FUCHSIA_SYSROOT} CACHE STRING "") -set(BUILTINS_x86_64-fuchsia-none_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "") -set(BUILTINS_aarch64-fuchsia-none_CMAKE_SYSROOT ${FUCHSIA_SYSROOT} CACHE STRING "") -set(BUILTINS_aarch64-fuchsia-none_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "") +set(LLVM_BUILTIN_TARGETS "x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "") +foreach(target x86_64;aarch64) + set(BUILTINS_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "") + set(BUILTINS_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "") +endforeach() +if(NOT APPLE) + list(APPEND LLVM_BUILTIN_TARGETS "default") +endif() +set(LLVM_RUNTIME_TARGETS "default;x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "") +foreach(target x86_64;aarch64) + set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "") + set(RUNTIMES_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "") + set(RUNTIMES_${target}-fuchsia_UNIX 1 CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia_LLVM_ENABLE_LIBCXX ON CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "") +endforeach() + # Setup toolchain. set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "") set(LLVM_TOOLCHAIN_TOOLS @@ -47,6 +62,7 @@ set(LLVM_TOOLCHAIN_TOOLS llvm-objdump llvm-profdata llvm-ranlib + llvm-readelf llvm-readobj llvm-size llvm-symbolizer @@ -61,8 +77,9 @@ set(LLVM_DISTRIBUTION_COMPONENTS LTO clang-format clang-headers - builtins-x86_64-fuchsia-none - builtins-aarch64-fuchsia-none + clang-tidy + clangd + builtins runtimes ${LLVM_TOOLCHAIN_TOOLS} CACHE STRING "") Modified: vendor/clang/dist/cmake/caches/Fuchsia.cmake ============================================================================== --- vendor/clang/dist/cmake/caches/Fuchsia.cmake Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/cmake/caches/Fuchsia.cmake Wed Jul 19 07:02:30 2017 (r321186) @@ -38,9 +38,11 @@ set(CLANG_BOOTSTRAP_TARGETS install-distribution clang CACHE STRING "") -if(FUCHSIA_SYSROOT) - set(EXTRA_ARGS -DFUCHSIA_SYSROOT=${FUCHSIA_SYSROOT}) -endif() +foreach(target x86_64;aarch64) + if(FUCHSIA_${target}_SYSROOT) + list(APPEND EXTRA_ARGS -DFUCHSIA_${target}_SYSROOT=${FUCHSIA_${target}_SYSROOT}) + endif() +endforeach() # Setup the bootstrap build. set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "") Modified: vendor/clang/dist/docs/LanguageExtensions.rst ============================================================================== --- vendor/clang/dist/docs/LanguageExtensions.rst Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/docs/LanguageExtensions.rst Wed Jul 19 07:02:30 2017 (r321186) @@ -1271,7 +1271,88 @@ Further examples of these attributes are available in Query for these features with ``__has_attribute(ns_consumed)``, ``__has_attribute(ns_returns_retained)``, etc. +Objective-C @available +---------------------- +It is possible to use the newest SDK but still build a program that can run on +older versions of macOS and iOS by passing ``-mmacosx-version-min=`` / +``-miphoneos-version-min=``. + +Before LLVM 5.0, when calling a function that exists only in the OS that's +newer than the target OS (as determined by the minimum deployment version), +programmers had to carefully check if the function exists at runtime, using +null checks for weakly-linked C functions, ``+class`` for Objective-C classes, +and ``-respondsToSelector:`` or ``+instancesRespondToSelector:`` for +Objective-C methods. If such a check was missed, the program would compile +fine, run fine on newer systems, but crash on older systems. + +As of LLVM 5.0, ``-Wunguarded-availability`` uses the `availability attributes +`_ together +with the new ``@available()`` keyword to assist with this issue. +When a method that's introduced in the OS newer than the target OS is called, a +-Wunguarded-availability warning is emitted if that call is not guarded: + +.. code-block:: objc + + void my_fun(NSSomeClass* var) { + // If fancyNewMethod was added in e.g. macOS 10.12, but the code is + // built with -mmacosx-version-min=10.11, then this unconditional call + // will emit a -Wunguarded-availability warning: + [var fancyNewMethod]; + } + +To fix the warning and to avoid the crash on macOS 10.11, wrap it in +``if(@available())``: + +.. code-block:: objc + + void my_fun(NSSomeClass* var) { + if (@available(macOS 10.12, *)) { + [var fancyNewMethod]; + } else { + // Put fallback behavior for old macOS versions (and for non-mac + // platforms) here. + } + } + +The ``*`` is required and means that platforms not explicitly listed will take +the true branch, and the compiler will emit ``-Wunguarded-availability`` +warnings for unlisted platforms based on those platform's deployment target. +More than one platform can be listed in ``@available()``: + +.. code-block:: objc + + void my_fun(NSSomeClass* var) { + if (@available(macOS 10.12, iOS 10, *)) { + [var fancyNewMethod]; + } + } + +If the caller of ``my_fun()`` already checks that ``my_fun()`` is only called +on 10.12, then add an `availability attribute +`_ to it, +which will also suppress the warning and require that calls to my_fun() are +checked: + +.. code-block:: objc + + API_AVAILABLE(macos(10.12)) void my_fun(NSSomeClass* var) { + [var fancyNewMethod]; // Now ok. + } + +``@available()`` is only available in Objective-C code. To use the feature +in C and C++ code, use the ``__builtin_available()`` spelling instead. + +If existing code uses null checks or ``-respondsToSelector:``, it should +be changed to use ``@available()`` (or ``__builtin_available``) instead. + +``-Wunguarded-availability`` is disabled by default, but +``-Wunguarded-availability-new``, which only emits this warning for APIs +that have been introduced in macOS >= 10.13, iOS >= 11, watchOS >= 4 and +tvOS >= 11, is enabled by default. + +.. _langext-overloading: + Objective-C++ ABI: protocol-qualifier mangling of parameters ------------------------------------------------------------ @@ -1286,8 +1367,6 @@ parameters of protocol-qualified type. Query the presence of this new mangling with ``__has_feature(objc_protocol_qualifier_mangling)``. - -.. _langext-overloading: Initializer lists for complex numbers in C ========================================== Modified: vendor/clang/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist/docs/ReleaseNotes.rst Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/docs/ReleaseNotes.rst Wed Jul 19 07:02:30 2017 (r321186) @@ -82,7 +82,9 @@ Clang now supports the ... Attribute Changes in Clang -------------------------- -- ... +- The ``overloadable`` attribute now allows at most one function with a given + name to lack the ``overloadable`` attribute. This unmarked function will not + have its name mangled. Windows Support --------------- Modified: vendor/clang/dist/include/clang-c/Index.h ============================================================================== --- vendor/clang/dist/include/clang-c/Index.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang-c/Index.h Wed Jul 19 07:02:30 2017 (r321186) @@ -3205,7 +3205,7 @@ enum CXCallingConv { CXCallingConv_AAPCS_VFP = 7, CXCallingConv_X86RegCall = 8, CXCallingConv_IntelOclBicc = 9, - CXCallingConv_X86_64Win64 = 10, + CXCallingConv_Win64 = 10, CXCallingConv_X86_64SysV = 11, CXCallingConv_X86VectorCall = 12, CXCallingConv_Swift = 13, Modified: vendor/clang/dist/include/clang/AST/ASTContext.h ============================================================================== --- vendor/clang/dist/include/clang/AST/ASTContext.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/AST/ASTContext.h Wed Jul 19 07:02:30 2017 (r321186) @@ -1441,6 +1441,10 @@ class ASTContext : public RefCountedBase { /// The sizeof operator requires this (C99 6.5.3.4p4). CanQualType getSizeType() const; + /// \brief Return the unique signed counterpart of + /// the integer type corresponding to size_t. + CanQualType getSignedSizeType() const; + /// \brief Return the unique type for "intmax_t" (C99 7.18.1.5), defined in /// . CanQualType getIntMaxType() const; Modified: vendor/clang/dist/include/clang/AST/DeclObjC.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclObjC.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/AST/DeclObjC.h Wed Jul 19 07:02:30 2017 (r321186) @@ -1039,10 +1039,9 @@ class ObjCContainerDecl : public NamedDecl, public Dec typedef llvm::DenseMap, ObjCPropertyDecl*> PropertyMap; - - typedef llvm::DenseMap - ProtocolPropertyMap; - + + typedef llvm::SmallDenseSet ProtocolPropertySet; + typedef llvm::SmallVector PropertyDeclOrder; /// This routine collects list of properties to be implemented in the class. @@ -2159,7 +2158,8 @@ class ObjCProtocolDecl : public ObjCContainerDecl, (pu PropertyDeclOrder &PO) const override; void collectInheritedProtocolProperties(const ObjCPropertyDecl *Property, - ProtocolPropertyMap &PM) const; + ProtocolPropertySet &PS, + PropertyDeclOrder &PO) const; static bool classof(const Decl *D) { return classofKind(D->getKind()); } static bool classofKind(Kind K) { return K == ObjCProtocol; } Modified: vendor/clang/dist/include/clang/AST/OpenMPClause.h ============================================================================== --- vendor/clang/dist/include/clang/AST/OpenMPClause.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/AST/OpenMPClause.h Wed Jul 19 07:02:30 2017 (r321186) @@ -1890,6 +1890,217 @@ class OMPReductionClause final (public) } }; +/// This represents clause 'task_reduction' in the '#pragma omp taskgroup' +/// directives. +/// +/// \code +/// #pragma omp taskgroup task_reduction(+:a,b) +/// \endcode +/// In this example directive '#pragma omp taskgroup' has clause +/// 'task_reduction' with operator '+' and the variables 'a' and 'b'. +/// +class OMPTaskReductionClause final + : public OMPVarListClause, + public OMPClauseWithPostUpdate, + private llvm::TrailingObjects { + friend TrailingObjects; + friend OMPVarListClause; + friend class OMPClauseReader; + /// Location of ':'. + SourceLocation ColonLoc; + /// Nested name specifier for C++. + NestedNameSpecifierLoc QualifierLoc; + /// Name of custom operator. + DeclarationNameInfo NameInfo; + + /// Build clause with number of variables \a N. + /// + /// \param StartLoc Starting location of the clause. + /// \param LParenLoc Location of '('. + /// \param EndLoc Ending location of the clause. + /// \param ColonLoc Location of ':'. + /// \param N Number of the variables in the clause. + /// \param QualifierLoc The nested-name qualifier with location information + /// \param NameInfo The full name info for reduction identifier. + /// + OMPTaskReductionClause(SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation ColonLoc, SourceLocation EndLoc, + unsigned N, NestedNameSpecifierLoc QualifierLoc, + const DeclarationNameInfo &NameInfo) + : OMPVarListClause(OMPC_task_reduction, StartLoc, + LParenLoc, EndLoc, N), + OMPClauseWithPostUpdate(this), ColonLoc(ColonLoc), + QualifierLoc(QualifierLoc), NameInfo(NameInfo) {} + + /// Build an empty clause. + /// + /// \param N Number of variables. + /// + explicit OMPTaskReductionClause(unsigned N) + : OMPVarListClause( + OMPC_task_reduction, SourceLocation(), SourceLocation(), + SourceLocation(), N), + OMPClauseWithPostUpdate(this), ColonLoc(), QualifierLoc(), NameInfo() {} + + /// Sets location of ':' symbol in clause. + void setColonLoc(SourceLocation CL) { ColonLoc = CL; } + /// Sets the name info for specified reduction identifier. + void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; } + /// Sets the nested name specifier. + void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; } + + /// Set list of helper expressions, required for proper codegen of the clause. + /// These expressions represent private copy of the reduction variable. + void setPrivates(ArrayRef Privates); + + /// Get the list of helper privates. + MutableArrayRef getPrivates() { + return MutableArrayRef(varlist_end(), varlist_size()); + } + ArrayRef getPrivates() const { + return llvm::makeArrayRef(varlist_end(), varlist_size()); + } + + /// Set list of helper expressions, required for proper codegen of the clause. + /// These expressions represent LHS expression in the final reduction + /// expression performed by the reduction clause. + void setLHSExprs(ArrayRef LHSExprs); + + /// Get the list of helper LHS expressions. + MutableArrayRef getLHSExprs() { + return MutableArrayRef(getPrivates().end(), varlist_size()); + } + ArrayRef getLHSExprs() const { + return llvm::makeArrayRef(getPrivates().end(), varlist_size()); + } + + /// Set list of helper expressions, required for proper codegen of the clause. + /// These expressions represent RHS expression in the final reduction + /// expression performed by the reduction clause. Also, variables in these + /// expressions are used for proper initialization of reduction copies. + void setRHSExprs(ArrayRef RHSExprs); + + /// Get the list of helper destination expressions. + MutableArrayRef getRHSExprs() { + return MutableArrayRef(getLHSExprs().end(), varlist_size()); + } + ArrayRef getRHSExprs() const { + return llvm::makeArrayRef(getLHSExprs().end(), varlist_size()); + } + + /// Set list of helper reduction expressions, required for proper + /// codegen of the clause. These expressions are binary expressions or + /// operator/custom reduction call that calculates new value from source + /// helper expressions to destination helper expressions. + void setReductionOps(ArrayRef ReductionOps); + + /// Get the list of helper reduction expressions. + MutableArrayRef getReductionOps() { + return MutableArrayRef(getRHSExprs().end(), varlist_size()); + } + ArrayRef getReductionOps() const { + return llvm::makeArrayRef(getRHSExprs().end(), varlist_size()); + } + +public: + /// Creates clause with a list of variables \a VL. + /// + /// \param StartLoc Starting location of the clause. + /// \param LParenLoc Location of '('. + /// \param ColonLoc Location of ':'. + /// \param EndLoc Ending location of the clause. + /// \param VL The variables in the clause. + /// \param QualifierLoc The nested-name qualifier with location information + /// \param NameInfo The full name info for reduction identifier. + /// \param Privates List of helper expressions for proper generation of + /// private copies. + /// \param LHSExprs List of helper expressions for proper generation of + /// assignment operation required for copyprivate clause. This list represents + /// LHSs of the reduction expressions. + /// \param RHSExprs List of helper expressions for proper generation of + /// assignment operation required for copyprivate clause. This list represents + /// RHSs of the reduction expressions. + /// Also, variables in these expressions are used for proper initialization of + /// reduction copies. + /// \param ReductionOps List of helper expressions that represents reduction + /// expressions: + /// \code + /// LHSExprs binop RHSExprs; + /// operator binop(LHSExpr, RHSExpr); + /// (LHSExpr, RHSExpr); + /// \endcode + /// Required for proper codegen of final reduction operation performed by the + /// reduction clause. + /// \param PreInit Statement that must be executed before entering the OpenMP + /// region with this clause. + /// \param PostUpdate Expression that must be executed after exit from the + /// OpenMP region with this clause. + /// + static OMPTaskReductionClause * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef VL, + NestedNameSpecifierLoc QualifierLoc, + const DeclarationNameInfo &NameInfo, ArrayRef Privates, + ArrayRef LHSExprs, ArrayRef RHSExprs, + ArrayRef ReductionOps, Stmt *PreInit, Expr *PostUpdate); + + /// Creates an empty clause with the place for \a N variables. + /// + /// \param C AST context. + /// \param N The number of variables. + /// + static OMPTaskReductionClause *CreateEmpty(const ASTContext &C, unsigned N); + + /// Gets location of ':' symbol in clause. + SourceLocation getColonLoc() const { return ColonLoc; } + /// Gets the name info for specified reduction identifier. + const DeclarationNameInfo &getNameInfo() const { return NameInfo; } + /// Gets the nested name specifier. + NestedNameSpecifierLoc getQualifierLoc() const { return QualifierLoc; } + + typedef MutableArrayRef::iterator helper_expr_iterator; + typedef ArrayRef::iterator helper_expr_const_iterator; + typedef llvm::iterator_range helper_expr_range; + typedef llvm::iterator_range + helper_expr_const_range; + + helper_expr_const_range privates() const { + return helper_expr_const_range(getPrivates().begin(), getPrivates().end()); + } + helper_expr_range privates() { + return helper_expr_range(getPrivates().begin(), getPrivates().end()); + } + helper_expr_const_range lhs_exprs() const { + return helper_expr_const_range(getLHSExprs().begin(), getLHSExprs().end()); + } + helper_expr_range lhs_exprs() { + return helper_expr_range(getLHSExprs().begin(), getLHSExprs().end()); + } + helper_expr_const_range rhs_exprs() const { + return helper_expr_const_range(getRHSExprs().begin(), getRHSExprs().end()); + } + helper_expr_range rhs_exprs() { + return helper_expr_range(getRHSExprs().begin(), getRHSExprs().end()); + } + helper_expr_const_range reduction_ops() const { + return helper_expr_const_range(getReductionOps().begin(), + getReductionOps().end()); + } + helper_expr_range reduction_ops() { + return helper_expr_range(getReductionOps().begin(), + getReductionOps().end()); + } + + child_range children() { + return child_range(reinterpret_cast(varlist_begin()), + reinterpret_cast(varlist_end())); + } + + static bool classof(const OMPClause *T) { + return T->getClauseKind() == OMPC_task_reduction; + } +}; + /// \brief This represents clause 'linear' in the '#pragma omp ...' /// directives. /// Modified: vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h ============================================================================== --- vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h Wed Jul 19 07:02:30 2017 (r321186) @@ -3017,6 +3017,28 @@ RecursiveASTVisitor::VisitOMPReductionClause( } template +bool RecursiveASTVisitor::VisitOMPTaskReductionClause( + OMPTaskReductionClause *C) { + TRY_TO(TraverseNestedNameSpecifierLoc(C->getQualifierLoc())); + TRY_TO(TraverseDeclarationNameInfo(C->getNameInfo())); + TRY_TO(VisitOMPClauseList(C)); + TRY_TO(VisitOMPClauseWithPostUpdate(C)); + for (auto *E : C->privates()) { + TRY_TO(TraverseStmt(E)); + } + for (auto *E : C->lhs_exprs()) { + TRY_TO(TraverseStmt(E)); + } + for (auto *E : C->rhs_exprs()) { + TRY_TO(TraverseStmt(E)); + } + for (auto *E : C->reduction_ops()) { + TRY_TO(TraverseStmt(E)); + } + return true; +} + +template bool RecursiveASTVisitor::VisitOMPFlushClause(OMPFlushClause *C) { TRY_TO(VisitOMPClauseList(C)); return true; Modified: vendor/clang/dist/include/clang/AST/StmtOpenMP.h ============================================================================== --- vendor/clang/dist/include/clang/AST/StmtOpenMP.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/AST/StmtOpenMP.h Wed Jul 19 07:02:30 2017 (r321186) @@ -1895,7 +1895,7 @@ class OMPTaskwaitDirective : public OMPExecutableDirec } }; -/// \brief This represents '#pragma omp taskgroup' directive. +/// This represents '#pragma omp taskgroup' directive. /// /// \code /// #pragma omp taskgroup @@ -1903,39 +1903,45 @@ class OMPTaskwaitDirective : public OMPExecutableDirec /// class OMPTaskgroupDirective : public OMPExecutableDirective { friend class ASTStmtReader; - /// \brief Build directive with the given start and end location. + /// Build directive with the given start and end location. /// /// \param StartLoc Starting location of the directive kind. /// \param EndLoc Ending location of the directive. + /// \param NumClauses Number of clauses. /// - OMPTaskgroupDirective(SourceLocation StartLoc, SourceLocation EndLoc) + OMPTaskgroupDirective(SourceLocation StartLoc, SourceLocation EndLoc, + unsigned NumClauses) : OMPExecutableDirective(this, OMPTaskgroupDirectiveClass, OMPD_taskgroup, - StartLoc, EndLoc, 0, 1) {} + StartLoc, EndLoc, NumClauses, 1) {} - /// \brief Build an empty directive. + /// Build an empty directive. + /// \param NumClauses Number of clauses. /// - explicit OMPTaskgroupDirective() + explicit OMPTaskgroupDirective(unsigned NumClauses) : OMPExecutableDirective(this, OMPTaskgroupDirectiveClass, OMPD_taskgroup, - SourceLocation(), SourceLocation(), 0, 1) {} + SourceLocation(), SourceLocation(), NumClauses, + 1) {} public: - /// \brief Creates directive. + /// Creates directive. /// /// \param C AST context. /// \param StartLoc Starting location of the directive kind. /// \param EndLoc Ending Location of the directive. + /// \param Clauses List of clauses. /// \param AssociatedStmt Statement, associated with the directive. /// - static OMPTaskgroupDirective *Create(const ASTContext &C, - SourceLocation StartLoc, - SourceLocation EndLoc, - Stmt *AssociatedStmt); + static OMPTaskgroupDirective * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, + ArrayRef Clauses, Stmt *AssociatedStmt); - /// \brief Creates an empty directive. + /// Creates an empty directive. /// /// \param C AST context. + /// \param NumClauses Number of clauses. /// - static OMPTaskgroupDirective *CreateEmpty(const ASTContext &C, EmptyShell); + static OMPTaskgroupDirective *CreateEmpty(const ASTContext &C, + unsigned NumClauses, EmptyShell); static bool classof(const Stmt *T) { return T->getStmtClass() == OMPTaskgroupDirectiveClass; Modified: vendor/clang/dist/include/clang/AST/Type.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Type.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/AST/Type.h Wed Jul 19 07:02:30 2017 (r321186) @@ -3878,6 +3878,7 @@ class AttributedType : public Type, public llvm::Foldi attr_sptr, attr_uptr, attr_nonnull, + attr_ns_returns_retained, attr_nullable, attr_null_unspecified, attr_objc_kindof, Modified: vendor/clang/dist/include/clang/Analysis/Analyses/Dominators.h ============================================================================== --- vendor/clang/dist/include/clang/Analysis/Analyses/Dominators.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Analysis/Analyses/Dominators.h Wed Jul 19 07:02:30 2017 (r321186) @@ -38,15 +38,15 @@ typedef llvm::DomTreeNodeBase DomTreeNode; class DominatorTree : public ManagedAnalysis { virtual void anchor(); public: - llvm::DominatorTreeBase* DT; + llvm::DomTreeBase* DT; DominatorTree() { - DT = new llvm::DominatorTreeBase(false); + DT = new llvm::DomTreeBase(); } ~DominatorTree() override { delete DT; } - llvm::DominatorTreeBase& getBase() { return *DT; } + llvm::DomTreeBase& getBase() { return *DT; } /// \brief This method returns the root CFGBlock of the dominators tree. /// Modified: vendor/clang/dist/include/clang/Basic/Attr.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/Attr.td Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/Attr.td Wed Jul 19 07:02:30 2017 (r321186) @@ -1802,11 +1802,18 @@ def Target : InheritableAttr { let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [TargetDocs]; let AdditionalMembers = [{ - typedef std::pair, StringRef> ParsedTargetAttr; + struct ParsedTargetAttr { + std::vector Features; + StringRef Architecture; + bool DuplicateArchitecture = false; + }; ParsedTargetAttr parse() const { + return parse(getFeaturesStr()); + } + static ParsedTargetAttr parse(StringRef Features) { ParsedTargetAttr Ret; SmallVector AttrFeatures; - getFeaturesStr().split(AttrFeatures, ","); + Features.split(AttrFeatures, ","); // Grab the various features and prepend a "+" to turn on the feature to // the backend and add them to our existing set of features. @@ -1823,12 +1830,15 @@ def Target : InheritableAttr { continue; // While we're here iterating check for a different target cpu. - if (Feature.startswith("arch=")) - Ret.second = Feature.split("=").second.trim(); - else if (Feature.startswith("no-")) - Ret.first.push_back("-" + Feature.split("-").second.str()); + if (Feature.startswith("arch=")) { + if (!Ret.Architecture.empty()) + Ret.DuplicateArchitecture = true; + else + Ret.Architecture = Feature.split("=").second.trim(); + } else if (Feature.startswith("no-")) + Ret.Features.push_back("-" + Feature.split("-").second.str()); else - Ret.first.push_back("+" + Feature.str()); + Ret.Features.push_back("+" + Feature.str()); } return Ret; } Modified: vendor/clang/dist/include/clang/Basic/AttrDocs.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/AttrDocs.td Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/AttrDocs.td Wed Jul 19 07:02:30 2017 (r321186) @@ -910,13 +910,13 @@ the function declaration for a hypothetical function ` void f(void) __attribute__((availability(macos,introduced=10.4,deprecated=10.6,obsoleted=10.7))); -The availability attribute states that ``f`` was introduced in Mac OS X 10.4, -deprecated in Mac OS X 10.6, and obsoleted in Mac OS X 10.7. This information +The availability attribute states that ``f`` was introduced in macOS 10.4, +deprecated in macOS 10.6, and obsoleted in macOS 10.7. This information is used by Clang to determine when it is safe to use ``f``: for example, if -Clang is instructed to compile code for Mac OS X 10.5, a call to ``f()`` -succeeds. If Clang is instructed to compile code for Mac OS X 10.6, the call +Clang is instructed to compile code for macOS 10.5, a call to ``f()`` +succeeds. If Clang is instructed to compile code for macOS 10.6, the call succeeds but Clang emits a warning specifying that the function is deprecated. -Finally, if Clang is instructed to compile code for Mac OS X 10.7, the call +Finally, if Clang is instructed to compile code for macOS 10.7, the call fails because ``f()`` is no longer available. The availability attribute is a comma-separated list starting with the @@ -961,7 +961,7 @@ are: command-line arguments. ``macos`` - Apple's Mac OS X operating system. The minimum deployment target is + Apple's macOS operating system. The minimum deployment target is specified by the ``-mmacosx-version-min=*version*`` command-line argument. ``macosx`` is supported for backward-compatibility reasons, but it is deprecated. @@ -1015,6 +1015,19 @@ When one method overrides another, the overriding meth - (id)method __attribute__((availability(macos,introduced=10.3))); // okay: method moved into base class later - (id)method __attribute__((availability(macos,introduced=10.5))); // error: this method was available via the base class in 10.4 @end + +Starting with the macOS 10.12 SDK, the ``API_AVAILABLE`` macro from +```` can simplify the spelling: + +.. code-block:: objc + + @interface A + - (id)method API_AVAILABLE(macos(10.11))); + - (id)otherMethod API_AVAILABLE(macos(10.11), ios(11.0)); + @end + +Also see the documentation for `@available +`_ }]; } Modified: vendor/clang/dist/include/clang/Basic/Builtins.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/Builtins.def Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/Builtins.def Wed Jul 19 07:02:30 2017 (r321186) @@ -1413,6 +1413,11 @@ BUILTIN(__builtin_os_log_format, "v*v*cC*.", "p:0:nt") // Builtins for XRay BUILTIN(__xray_customevent, "vcC*z", "") +// Win64-compatible va_list functions +BUILTIN(__builtin_ms_va_start, "vc*&.", "nt") +BUILTIN(__builtin_ms_va_end, "vc*&", "n") +BUILTIN(__builtin_ms_va_copy, "vc*&c*&", "n") + #undef BUILTIN #undef LIBBUILTIN #undef LANGBUILTIN Modified: vendor/clang/dist/include/clang/Basic/BuiltinsHexagon.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/BuiltinsHexagon.def Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/BuiltinsHexagon.def Wed Jul 19 07:02:30 2017 (r321186) @@ -882,6 +882,12 @@ BUILTIN(__builtin_HEXAGON_S2_ct0p,"iLLi","") BUILTIN(__builtin_HEXAGON_S2_ct1p,"iLLi","") BUILTIN(__builtin_HEXAGON_S2_interleave,"LLiLLi","") BUILTIN(__builtin_HEXAGON_S2_deinterleave,"LLiLLi","") +BUILTIN(__builtin_HEXAGON_Y2_dccleana,"vv*","") +BUILTIN(__builtin_HEXAGON_Y2_dccleaninva,"vv*","") +BUILTIN(__builtin_HEXAGON_Y2_dcinva,"vv*","") +BUILTIN(__builtin_HEXAGON_Y2_dczeroa,"vv*","") +BUILTIN(__builtin_HEXAGON_Y4_l2fetch,"vv*Ui","") +BUILTIN(__builtin_HEXAGON_Y5_l2fetch,"vv*LLUi","") BUILTIN(__builtin_HEXAGON_S6_rol_i_r,"iii","v:60:") BUILTIN(__builtin_HEXAGON_S6_rol_i_p,"LLiLLii","v:60:") Modified: vendor/clang/dist/include/clang/Basic/BuiltinsSystemZ.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/BuiltinsSystemZ.def Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/BuiltinsSystemZ.def Wed Jul 19 07:02:30 2017 (r321186) @@ -253,5 +253,29 @@ TARGET_BUILTIN(__builtin_s390_vfmsdb, "V2dV2dV2dV2d", TARGET_BUILTIN(__builtin_s390_vfsqdb, "V2dV2d", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vftcidb, "V2SLLiV2dIii*", "nc", "vector") +// Vector-enhancements facility 1 intrinsics. +TARGET_BUILTIN(__builtin_s390_vlrl, "V16ScUivC*", "", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vstrl, "vV16ScUiv*", "", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vbperm, "V2ULLiV16UcV16Uc", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vmslg, "V16UcV2ULLiV2ULLiV16UcIi", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfmaxdb, "V2dV2dV2dIi", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfmindb, "V2dV2dV2dIi", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfnmadb, "V2dV2dV2dV2d", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfnmsdb, "V2dV2dV2dV2d", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfcesbs, "V4SiV4fV4fi*", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfchsbs, "V4SiV4fV4fi*", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfchesbs, "V4SiV4fV4fi*", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfisb, "V4fV4fIiIi", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfmaxsb, "V4fV4fV4fIi", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfminsb, "V4fV4fV4fIi", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vflnsb, "V4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vflpsb, "V4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfmasb, "V4fV4fV4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfmssb, "V4fV4fV4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfnmasb, "V4fV4fV4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfnmssb, "V4fV4fV4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vfsqsb, "V4fV4f", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vftcisb, "V4SiV4fIii*", "nc", "vector-enhancements-1") + #undef BUILTIN #undef TARGET_BUILTIN Modified: vendor/clang/dist/include/clang/Basic/BuiltinsX86.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/BuiltinsX86.def Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/BuiltinsX86.def Wed Jul 19 07:02:30 2017 (r321186) @@ -34,11 +34,6 @@ // can use it? BUILTIN(__builtin_cpu_supports, "bcC*", "nc") -// Win64-compatible va_list functions -BUILTIN(__builtin_ms_va_start, "vc*&.", "nt") -BUILTIN(__builtin_ms_va_end, "vc*&", "n") -BUILTIN(__builtin_ms_va_copy, "vc*&c*&", "n") - // Undefined Values // TARGET_BUILTIN(__builtin_ia32_undef128, "V2d", "nc", "") Modified: vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Wed Jul 19 07:02:30 2017 (r321186) @@ -152,6 +152,8 @@ def GNUFoldingConstant : DiagGroup<"gnu-folding-consta def FormatExtraArgs : DiagGroup<"format-extra-args">; def FormatZeroLength : DiagGroup<"format-zero-length">; def CXX1zCompatMangling : DiagGroup<"c++1z-compat-mangling">; +// Name of this warning in GCC. +def NoexceptType : DiagGroup<"noexcept-type", [CXX1zCompatMangling]>; // Warnings for C++1y code which is not compatible with prior C++ standards. def CXXPre14Compat : DiagGroup<"c++98-c++11-compat">; Modified: vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h Wed Jul 19 07:02:30 2017 (r321186) @@ -18,6 +18,7 @@ #include "clang/Basic/LLVM.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/StringRef.h" +#include namespace clang { class DiagnosticsEngine; @@ -262,6 +263,13 @@ class DiagnosticIDs : public RefCountedBase getDiagnosticFlags(); /// \brief Get the set of all diagnostic IDs in the group with the given name. /// Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Wed Jul 19 07:02:30 2017 (r321186) @@ -808,8 +808,10 @@ def warn_property_types_are_incompatible : Warning< "property type %0 is incompatible with type %1 inherited from %2">, InGroup>; def warn_protocol_property_mismatch : Warning< - "property of type %0 was selected for synthesis">, + "property %select{of type %1|with attribute '%1'|without attribute '%1'|with " + "getter %1|with setter %1}0 was selected for synthesis">, InGroup>; +def err_protocol_property_mismatch: Error; def err_undef_interface : Error<"cannot find interface declaration for %0">; def err_category_forward_interface : Error< "cannot define %select{category|class extension}0 for undefined class %1">; @@ -1088,7 +1090,9 @@ def err_category_property : Error< def note_property_declare : Note< "property declared here">; def note_protocol_property_declare : Note< - "it could also be property of type %0 declared here">; + "it could also be property " + "%select{of type %1|without attribute '%1'|with attribute '%1'|with getter " + "%1|with setter %1}0 declared here">; def note_property_synthesize : Note< "property synthesized here">; def err_synthesize_category_decl : Error< @@ -4575,8 +4579,11 @@ def warn_deprecated_fwdclass_message : Warning< "%0 may be deprecated because the receiver type is unknown">, InGroup; def warn_deprecated_def : Warning< - "Implementing deprecated %select{method|class|category}0">, - InGroup, DefaultIgnore; + "implementing deprecated %select{method|class|category}0">, + InGroup, DefaultIgnore; +def warn_unavailable_def : Warning< + "implementing unavailable method">, + InGroup, DefaultIgnore; def err_unavailable : Error<"%0 is unavailable">; def err_property_method_unavailable : Error<"property access is using %0 method which is unavailable">; @@ -8106,10 +8113,10 @@ def err_systemz_invalid_tabort_code : Error< "invalid transaction abort code">; def err_64_bit_builtin_32_bit_tgt : Error< "this builtin is only available on 64-bit targets">; +def err_builtin_x64_aarch64_only : Error< + "this builtin is only available on x86-64 and aarch64 targets">; def err_ppc_builtin_only_on_pwr7 : Error< "this builtin is only valid on POWER7 or later CPUs">; -def err_x86_builtin_64_only : Error< - "this builtin is only available on x86-64 targets">; def err_x86_builtin_invalid_rounding : Error< "invalid rounding argument">; def err_x86_builtin_invalid_scale : Error< @@ -8648,11 +8655,11 @@ def err_omp_unknown_reduction_identifier : Error< def err_omp_not_resolved_reduction_identifier : Error< "unable to resolve declare reduction construct for type %0">; def err_omp_reduction_ref_type_arg : Error< - "argument of OpenMP clause 'reduction' must reference the same object in all threads">; + "argument of OpenMP clause '%0' must reference the same object in all threads">; def err_omp_clause_not_arithmetic_type_arg : Error< - "arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of %select{scalar|arithmetic}0 type">; + "arguments of OpenMP clause '%0' for 'min' or 'max' must be of %select{scalar|arithmetic}1 type">; def err_omp_clause_floating_type_arg : Error< - "arguments of OpenMP clause 'reduction' with bitwise operators cannot be of floating type">; + "arguments of OpenMP clause '%0' with bitwise operators cannot be of floating type">; def err_omp_once_referenced : Error< "variable can appear only once in OpenMP '%0' clause">; def err_omp_once_referenced_in_target_update : Error< Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Wed Jul 19 07:02:30 2017 (r321186) @@ -147,18 +147,29 @@ def err_module_odr_violation_mismatch_decl_diff : Erro "%select{non-|}5mutable field %4|" "field %4 with %select{no|an}5 initalizer|" "field %4 with an initializer|" - "method %4|" - "method %4 is %select{not deleted|deleted}5|" - "method %4 is %select{|pure }5%select{not virtual|virtual}6|" - "method %4 is %select{not static|static}5|" - "method %4 is %select{not volatile|volatile}5|" - "method %4 is %select{not const|const}5|" - "method %4 is %select{not inline|inline}5|" - "method %4 that has %5 parameter%s5|" - "method %4 with %ordinal5 parameter of type %6%select{| decayed from %8}7|" - "method %4 with %ordinal5 parameter named %6|" - "method %4 with %ordinal5 parameter with%select{out|}6 a default argument|" - "method %4 with %ordinal5 parameter with a default argument|" + "%select{method %5|constructor|destructor}4|" + "%select{method %5|constructor|destructor}4 " + "is %select{not deleted|deleted}6|" + "%select{method %5|constructor|destructor}4 " + "is %select{|pure }6%select{not virtual|virtual}7|" + "%select{method %5|constructor|destructor}4 " + "is %select{not static|static}6|" + "%select{method %5|constructor|destructor}4 " + "is %select{not volatile|volatile}6|" + "%select{method %5|constructor|destructor}4 " + "is %select{not const|const}6|" + "%select{method %5|constructor|destructor}4 " + "is %select{not inline|inline}6|" + "%select{method %5|constructor|destructor}4 " + "that has %6 parameter%s6|" + "%select{method %5|constructor|destructor}4 " + "with %ordinal6 parameter of type %7%select{| decayed from %9}8|" + "%select{method %5|constructor|destructor}4 " + "with %ordinal6 parameter named %7|" + "%select{method %5|constructor|destructor}4 " + "with %ordinal6 parameter with%select{out|}7 a default argument|" + "%select{method %5|constructor|destructor}4 " + "with %ordinal6 parameter with a default argument|" "%select{typedef|type alias}4 name %5|" "%select{typedef|type alias}4 %5 with underlying type %6|" "data member with name %4|" @@ -183,18 +194,29 @@ def note_module_odr_violation_mismatch_decl_diff : Not "%select{non-|}3mutable field %2|" "field %2 with %select{no|an}3 initializer|" "field %2 with a different initializer|" - "method %2|" - "method %2 is %select{not deleted|deleted}3|" - "method %2 is %select{|pure }3%select{not virtual|virtual}4|" - "method %2 is %select{not static|static}3|" - "method %2 is %select{not volatile|volatile}3|" - "method %2 is %select{not const|const}3|" - "method %2 is %select{not inline|inline}3|" - "method %2 that has %3 parameter%s3|" - "method %2 with %ordinal3 parameter of type %4%select{| decayed from %6}5|" - "method %2 with %ordinal3 parameter named %4|" - "method %2 with %ordinal3 parameter with%select{out|}4 a default argument|" - "method %2 with %ordinal3 parameter with a different default argument|" + "%select{method %3|constructor|destructor}2|" + "%select{method %3|constructor|destructor}2 " + "is %select{not deleted|deleted}4|" + "%select{method %3|constructor|destructor}2 " + "is %select{|pure }4%select{not virtual|virtual}5|" + "%select{method %3|constructor|destructor}2 " + "is %select{not static|static}4|" + "%select{method %3|constructor|destructor}2 " + "is %select{not volatile|volatile}4|" + "%select{method %3|constructor|destructor}2 " + "is %select{not const|const}4|" + "%select{method %3|constructor|destructor}2 " + "is %select{not inline|inline}4|" + "%select{method %3|constructor|destructor}2 " + "that has %4 parameter%s4|" + "%select{method %3|constructor|destructor}2 " + "with %ordinal4 parameter of type %5%select{| decayed from %7}6|" + "%select{method %3|constructor|destructor}2 " + "with %ordinal4 parameter named %5|" + "%select{method %3|constructor|destructor}2 " + "with %ordinal4 parameter with%select{out|}5 a default argument|" + "%select{method %3|constructor|destructor}2 " + "with %ordinal4 parameter with a different default argument|" "%select{typedef|type alias}2 name %3|" "%select{typedef|type alias}2 %3 with different underlying type %4|" "data member with name %2|" Modified: vendor/clang/dist/include/clang/Basic/IdentifierTable.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/IdentifierTable.h Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/IdentifierTable.h Wed Jul 19 07:02:30 2017 (r321186) @@ -272,10 +272,6 @@ class IdentifierInfo { (public) /// this identifier is a C++ alternate representation of an operator. void setIsCPlusPlusOperatorKeyword(bool Val = true) { IsCPPOperatorKeyword = Val; - if (Val) - NeedsHandleIdentifier = true; - else - RecomputeNeedsHandleIdentifier(); } bool isCPlusPlusOperatorKeyword() const { return IsCPPOperatorKeyword; } @@ -381,10 +377,9 @@ class IdentifierInfo { (public) /// This method is very tied to the definition of HandleIdentifier. Any /// change to it should be reflected here. void RecomputeNeedsHandleIdentifier() { - NeedsHandleIdentifier = - (isPoisoned() | hasMacroDefinition() | isCPlusPlusOperatorKeyword() | - isExtensionToken() | isFutureCompatKeyword() || isOutOfDate() || - isModulesImport()); + NeedsHandleIdentifier = isPoisoned() || hasMacroDefinition() || + isExtensionToken() || isFutureCompatKeyword() || + isOutOfDate() || isModulesImport(); } }; Modified: vendor/clang/dist/include/clang/Basic/LangOptions.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/LangOptions.def Wed Jul 19 07:02:18 2017 (r321185) +++ vendor/clang/dist/include/clang/Basic/LangOptions.def Wed Jul 19 07:02:30 2017 (r321186) @@ -90,6 +90,7 @@ LANGOPT(CPlusPlus , 1, 0, "C++") LANGOPT(CPlusPlus11 , 1, 0, "C++11") LANGOPT(CPlusPlus14 , 1, 0, "C++14") *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Wed Jul 19 07:02:38 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 87826DAABD9; Wed, 19 Jul 2017 07:02:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AF476E2E2; Wed, 19 Jul 2017 07:02:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6J72bTx090851; Wed, 19 Jul 2017 07:02:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72bDE090850; Wed, 19 Jul 2017 07:02:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72bDE090850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321187 - vendor/clang/clang-trunk-r308421 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/clang/clang-trunk-r308421 X-SVN-Commit-Revision: 321187 X-SVN-Commit-Repository: base 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, 19 Jul 2017 07:02:38 -0000 Author: dim Date: Wed Jul 19 07:02:37 2017 New Revision: 321187 URL: https://svnweb.freebsd.org/changeset/base/321187 Log: Tag clang trunk r308421. Added: vendor/clang/clang-trunk-r308421/ - copied from r321186, vendor/clang/dist/ From owner-svn-src-vendor@freebsd.org Wed Jul 19 07:02:43 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 B45FCDAAC25; Wed, 19 Jul 2017 07:02:43 +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 5C1746E353; Wed, 19 Jul 2017 07:02:43 +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 v6J72g80090925; Wed, 19 Jul 2017 07:02:42 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72eeO090898; Wed, 19 Jul 2017 07:02:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72eeO090898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321188 - in vendor/compiler-rt/dist: . lib/asan lib/asan/tests lib/builtins lib/lsan lib/msan lib/sanitizer_common lib/sanitizer_common/tests lib/scudo lib/tsan/rtl lib/tsan/tests/unit... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/compiler-rt/dist: . lib/asan lib/asan/tests lib/builtins lib/lsan lib/msan lib/sanitizer_common lib/sanitizer_common/tests lib/scudo lib/tsan/rtl lib/tsan/tests/unit lib/ubsan test/asan/Test... X-SVN-Commit-Revision: 321188 X-SVN-Commit-Repository: base 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, 19 Jul 2017 07:02:43 -0000 Author: dim Date: Wed Jul 19 07:02:40 2017 New Revision: 321188 URL: https://svnweb.freebsd.org/changeset/base/321188 Log: Vendor import of compiler-rt trunk r308421: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308421 Added: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_checks.h (contents, props changed) Modified: vendor/compiler-rt/dist/CMakeLists.txt vendor/compiler-rt/dist/lib/asan/asan_allocator.cc vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc vendor/compiler-rt/dist/lib/builtins/cpu_model.c vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc vendor/compiler-rt/dist/lib/lsan/lsan_common.cc vendor/compiler-rt/dist/lib/lsan/lsan_common.h vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc vendor/compiler-rt/dist/lib/msan/msan.h vendor/compiler-rt/dist/lib/msan/msan_allocator.cc vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_errno.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_bitvector_test.cc vendor/compiler-rt/dist/lib/scudo/scudo_allocator.cpp vendor/compiler-rt/dist/lib/scudo/scudo_allocator_combined.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_clock.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_clock.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_defs.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_mman.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_linux.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_clock_test.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc vendor/compiler-rt/dist/test/asan/TestCases/allocator_returns_null.cc vendor/compiler-rt/dist/test/lsan/TestCases/allocator_returns_null.cc vendor/compiler-rt/dist/test/msan/allocator_returns_null.cc vendor/compiler-rt/dist/test/scudo/memalign.cpp vendor/compiler-rt/dist/test/tsan/Linux/check_memcpy.cc vendor/compiler-rt/dist/test/ubsan/TestCases/Pointer/unsigned-index-expression.cpp Modified: vendor/compiler-rt/dist/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/CMakeLists.txt Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/CMakeLists.txt Wed Jul 19 07:02:40 2017 (r321188) @@ -172,10 +172,16 @@ endif() append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 SANITIZER_COMMON_CFLAGS) -# Build with optimization, unless we're in debug mode. If we're using MSVC, +# If we're using MSVC, # always respect the optimization flags set by CMAKE_BUILD_TYPE instead. -if(NOT COMPILER_RT_DEBUG AND NOT MSVC) - list(APPEND SANITIZER_COMMON_CFLAGS -O3) +if (NOT MSVC) + + # Build with optimization, unless we're in debug mode. + if(COMPILER_RT_DEBUG) + list(APPEND SANITIZER_COMMON_CFLAGS -O0) + else() + list(APPEND SANITIZER_COMMON_CFLAGS -O3) + endif() endif() # Determine if we should restrict stack frame sizes. Modified: vendor/compiler-rt/dist/lib/asan/asan_allocator.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_allocator.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/asan/asan_allocator.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -21,7 +21,9 @@ #include "asan_report.h" #include "asan_stack.h" #include "asan_thread.h" +#include "sanitizer_common/sanitizer_allocator_checks.h" #include "sanitizer_common/sanitizer_allocator_interface.h" +#include "sanitizer_common/sanitizer_errno.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_list.h" @@ -799,11 +801,6 @@ void PrintInternalAllocatorStats() { instance.PrintStats(); } -void *asan_memalign(uptr alignment, uptr size, BufferedStackTrace *stack, - AllocType alloc_type) { - return instance.Allocate(size, alignment, stack, alloc_type, true); -} - void asan_free(void *ptr, BufferedStackTrace *stack, AllocType alloc_type) { instance.Deallocate(ptr, 0, stack, alloc_type); } @@ -814,16 +811,16 @@ void asan_sized_free(void *ptr, uptr size, BufferedSta } void *asan_malloc(uptr size, BufferedStackTrace *stack) { - return instance.Allocate(size, 8, stack, FROM_MALLOC, true); + return SetErrnoOnNull(instance.Allocate(size, 8, stack, FROM_MALLOC, true)); } void *asan_calloc(uptr nmemb, uptr size, BufferedStackTrace *stack) { - return instance.Calloc(nmemb, size, stack); + return SetErrnoOnNull(instance.Calloc(nmemb, size, stack)); } void *asan_realloc(void *p, uptr size, BufferedStackTrace *stack) { if (!p) - return instance.Allocate(size, 8, stack, FROM_MALLOC, true); + return SetErrnoOnNull(instance.Allocate(size, 8, stack, FROM_MALLOC, true)); if (size == 0) { if (flags()->allocator_frees_and_returns_null_on_realloc_zero) { instance.Deallocate(p, 0, stack, FROM_MALLOC); @@ -832,26 +829,41 @@ void *asan_realloc(void *p, uptr size, BufferedStackTr // Allocate a size of 1 if we shouldn't free() on Realloc to 0 size = 1; } - return instance.Reallocate(p, size, stack); + return SetErrnoOnNull(instance.Reallocate(p, size, stack)); } void *asan_valloc(uptr size, BufferedStackTrace *stack) { - return instance.Allocate(size, GetPageSizeCached(), stack, FROM_MALLOC, true); + return SetErrnoOnNull( + instance.Allocate(size, GetPageSizeCached(), stack, FROM_MALLOC, true)); } void *asan_pvalloc(uptr size, BufferedStackTrace *stack) { uptr PageSize = GetPageSizeCached(); - size = RoundUpTo(size, PageSize); - if (size == 0) { - // pvalloc(0) should allocate one page. - size = PageSize; + // pvalloc(0) should allocate one page. + size = size ? RoundUpTo(size, PageSize) : PageSize; + return SetErrnoOnNull( + instance.Allocate(size, PageSize, stack, FROM_MALLOC, true)); +} + +void *asan_memalign(uptr alignment, uptr size, BufferedStackTrace *stack, + AllocType alloc_type) { + if (UNLIKELY(!IsPowerOfTwo(alignment))) { + errno = errno_EINVAL; + return AsanAllocator::FailureHandler::OnBadRequest(); } - return instance.Allocate(size, PageSize, stack, FROM_MALLOC, true); + return SetErrnoOnNull( + instance.Allocate(size, alignment, stack, alloc_type, true)); } int asan_posix_memalign(void **memptr, uptr alignment, uptr size, BufferedStackTrace *stack) { + if (UNLIKELY(!CheckPosixMemalignAlignment(alignment))) { + AsanAllocator::FailureHandler::OnBadRequest(); + return errno_EINVAL; + } void *ptr = instance.Allocate(size, alignment, stack, FROM_MALLOC, true); + if (UNLIKELY(!ptr)) + return errno_ENOMEM; CHECK(IsAligned((uptr)ptr, alignment)); *memptr = ptr; return 0; Modified: vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -178,6 +178,10 @@ void SetThreadName(const char *name) { } int OnExit() { + if (CAN_SANITIZE_LEAKS && common_flags()->detect_leaks && + __lsan::HasReportedLeaks()) { + return common_flags()->exitcode; + } // FIXME: ask frontend whether we need to return failure. return 0; } Modified: vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -12,6 +12,8 @@ //===----------------------------------------------------------------------===// #include "asan_test_utils.h" +#include + NOINLINE void *malloc_fff(size_t size) { void *res = malloc/**/(size); break_optimization(0); return res;} NOINLINE void *malloc_eee(size_t size) { @@ -74,9 +76,11 @@ TEST(AddressSanitizer, VariousMallocsTest) { delete c; #if SANITIZER_TEST_HAS_POSIX_MEMALIGN - int *pm; - int pm_res = posix_memalign((void**)&pm, kPageSize, kPageSize); + void *pm = 0; + // Valid allocation. + int pm_res = posix_memalign(&pm, kPageSize, kPageSize); EXPECT_EQ(0, pm_res); + EXPECT_NE(nullptr, pm); free(pm); #endif // SANITIZER_TEST_HAS_POSIX_MEMALIGN Modified: vendor/compiler-rt/dist/lib/builtins/cpu_model.c ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/cpu_model.c Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/builtins/cpu_model.c Wed Jul 19 07:02:40 2017 (r321188) @@ -190,8 +190,8 @@ static bool getX86CpuIDAndInfo(unsigned value, unsigne static bool getX86CpuIDAndInfoEx(unsigned value, unsigned subleaf, unsigned *rEAX, unsigned *rEBX, unsigned *rECX, unsigned *rEDX) { -#if defined(__x86_64__) || defined(_M_X64) #if defined(__GNUC__) || defined(__clang__) +#if defined(__x86_64__) // gcc doesn't know cpuid would clobber ebx/rbx. Preserve it manually. // FIXME: should we save this for Clang? __asm__("movq\t%%rbx, %%rsi\n\t" @@ -200,43 +200,24 @@ static bool getX86CpuIDAndInfoEx(unsigned value, unsig : "=a"(*rEAX), "=S"(*rEBX), "=c"(*rECX), "=d"(*rEDX) : "a"(value), "c"(subleaf)); return false; -#elif defined(_MSC_VER) - int registers[4]; - __cpuidex(registers, value, subleaf); - *rEAX = registers[0]; - *rEBX = registers[1]; - *rECX = registers[2]; - *rEDX = registers[3]; - return false; -#else - return true; -#endif -#elif defined(__i386__) || defined(_M_IX86) -#if defined(__GNUC__) || defined(__clang__) +#elif defined(__i386__) __asm__("movl\t%%ebx, %%esi\n\t" "cpuid\n\t" "xchgl\t%%ebx, %%esi\n\t" : "=a"(*rEAX), "=S"(*rEBX), "=c"(*rECX), "=d"(*rEDX) : "a"(value), "c"(subleaf)); return false; -#elif defined(_MSC_VER) - __asm { - mov eax,value - mov ecx,subleaf - cpuid - mov esi,rEAX - mov dword ptr [esi],eax - mov esi,rEBX - mov dword ptr [esi],ebx - mov esi,rECX - mov dword ptr [esi],ecx - mov esi,rEDX - mov dword ptr [esi],edx - } - return false; #else return true; #endif +#elif defined(_MSC_VER) + int registers[4]; + __cpuidex(registers, value, subleaf); + *rEAX = registers[0]; + *rEBX = registers[1]; + *rECX = registers[2]; + *rEDX = registers[3]; + return false; #else return true; #endif Modified: vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -15,7 +15,9 @@ #include "lsan_allocator.h" #include "sanitizer_common/sanitizer_allocator.h" +#include "sanitizer_common/sanitizer_allocator_checks.h" #include "sanitizer_common/sanitizer_allocator_interface.h" +#include "sanitizer_common/sanitizer_errno.h" #include "sanitizer_common/sanitizer_internal_defs.h" #include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_stacktrace.h" @@ -86,6 +88,13 @@ void *Allocate(const StackTrace &stack, uptr size, upt return p; } +static void *Calloc(uptr nmemb, uptr size, const StackTrace &stack) { + if (UNLIKELY(CheckForCallocOverflow(size, nmemb))) + return Allocator::FailureHandler::OnBadRequest(); + size *= nmemb; + return Allocate(stack, size, 1, true); +} + void Deallocate(void *p) { if (&__sanitizer_free_hook) __sanitizer_free_hook(p); RunFreeHooks(p); @@ -118,11 +127,15 @@ uptr GetMallocUsableSize(const void *p) { } void *lsan_memalign(uptr alignment, uptr size, const StackTrace &stack) { - return Allocate(stack, size, alignment, kAlwaysClearMemory); + if (UNLIKELY(!IsPowerOfTwo(alignment))) { + errno = errno_EINVAL; + return Allocator::FailureHandler::OnBadRequest(); + } + return SetErrnoOnNull(Allocate(stack, size, alignment, kAlwaysClearMemory)); } void *lsan_malloc(uptr size, const StackTrace &stack) { - return Allocate(stack, size, 1, kAlwaysClearMemory); + return SetErrnoOnNull(Allocate(stack, size, 1, kAlwaysClearMemory)); } void lsan_free(void *p) { @@ -130,20 +143,16 @@ void lsan_free(void *p) { } void *lsan_realloc(void *p, uptr size, const StackTrace &stack) { - return Reallocate(stack, p, size, 1); + return SetErrnoOnNull(Reallocate(stack, p, size, 1)); } void *lsan_calloc(uptr nmemb, uptr size, const StackTrace &stack) { - if (CheckForCallocOverflow(size, nmemb)) - return Allocator::FailureHandler::OnBadRequest(); - size *= nmemb; - return Allocate(stack, size, 1, true); + return SetErrnoOnNull(Calloc(nmemb, size, stack)); } void *lsan_valloc(uptr size, const StackTrace &stack) { - if (size == 0) - size = GetPageSizeCached(); - return Allocate(stack, size, GetPageSizeCached(), kAlwaysClearMemory); + return SetErrnoOnNull( + Allocate(stack, size, GetPageSizeCached(), kAlwaysClearMemory)); } uptr lsan_mz_size(const void *p) { Modified: vendor/compiler-rt/dist/lib/lsan/lsan_common.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_common.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/lsan/lsan_common.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -576,18 +576,16 @@ static bool CheckForLeaks() { return false; } +static bool has_reported_leaks = false; +bool HasReportedLeaks() { return has_reported_leaks; } + void DoLeakCheck() { BlockingMutexLock l(&global_mutex); static bool already_done; if (already_done) return; already_done = true; - bool have_leaks = CheckForLeaks(); - if (!have_leaks) { - return; - } - if (common_flags()->exitcode) { - Die(); - } + has_reported_leaks = CheckForLeaks(); + if (has_reported_leaks) HandleLeaks(); } static int DoRecoverableLeakCheck() { Modified: vendor/compiler-rt/dist/lib/lsan/lsan_common.h ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_common.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/lsan/lsan_common.h Wed Jul 19 07:02:40 2017 (r321188) @@ -226,6 +226,12 @@ IgnoreObjectResult IgnoreObjectLocked(const void *p); // Return the linker module, if valid for the platform. LoadedModule *GetLinker(); +// Return true if LSan has finished leak checking and reported leaks. +bool HasReportedLeaks(); + +// Run platform-specific leak handlers. +void HandleLeaks(); + // Wrapper for chunk metadata operations. class LsanMetadata { public: Modified: vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -100,6 +100,13 @@ struct DoStopTheWorldParam { void *argument; }; +// While calling Die() here is undefined behavior and can potentially +// cause race conditions, it isn't possible to intercept exit on linux, +// so we have no choice but to call Die() from the atexit handler. +void HandleLeaks() { + if (common_flags()->exitcode) Die(); +} + static int DoStopTheWorldCallback(struct dl_phdr_info *info, size_t size, void *data) { DoStopTheWorldParam *param = reinterpret_cast(data); Modified: vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -164,6 +164,11 @@ void ProcessPlatformSpecificAllocations(Frontier *fron } } +// On darwin, we can intercept _exit gracefully, and return a failing exit code +// if required at that point. Calling Die() here is undefined behavior and +// causes rare race conditions. +void HandleLeaks() {} + void DoStopTheWorld(StopTheWorldCallback callback, void *argument) { StopTheWorld(callback, argument); } Modified: vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -352,6 +352,11 @@ INTERCEPTOR(int, pthread_join, void *th, void **ret) { return res; } +INTERCEPTOR(void, _exit, int status) { + if (status == 0 && HasReportedLeaks()) status = common_flags()->exitcode; + REAL(_exit)(status); +} + namespace __lsan { void InitializeInterceptors() { @@ -371,6 +376,7 @@ void InitializeInterceptors() { LSAN_MAYBE_INTERCEPT_MALLOPT; INTERCEPT_FUNCTION(pthread_create); INTERCEPT_FUNCTION(pthread_join); + INTERCEPT_FUNCTION(_exit); if (pthread_key_create(&g_thread_finalize_key, &thread_finalize)) { Report("LeakSanitizer: failed to create thread key.\n"); Modified: vendor/compiler-rt/dist/lib/msan/msan.h ============================================================================== --- vendor/compiler-rt/dist/lib/msan/msan.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/msan/msan.h Wed Jul 19 07:02:40 2017 (r321188) @@ -280,10 +280,18 @@ void InitializeInterceptors(); void MsanAllocatorInit(); void MsanAllocatorThreadFinish(); -void *MsanCalloc(StackTrace *stack, uptr nmemb, uptr size); -void *MsanReallocate(StackTrace *stack, void *oldp, uptr size, - uptr alignment, bool zeroise); void MsanDeallocate(StackTrace *stack, void *ptr); + +void *msan_malloc(uptr size, StackTrace *stack); +void *msan_calloc(uptr nmemb, uptr size, StackTrace *stack); +void *msan_realloc(void *ptr, uptr size, StackTrace *stack); +void *msan_valloc(uptr size, StackTrace *stack); +void *msan_pvalloc(uptr size, StackTrace *stack); +void *msan_aligned_alloc(uptr alignment, uptr size, StackTrace *stack); +void *msan_memalign(uptr alignment, uptr size, StackTrace *stack); +int msan_posix_memalign(void **memptr, uptr alignment, uptr size, + StackTrace *stack); + void InstallTrapHandler(); void InstallAtExitHandler(); Modified: vendor/compiler-rt/dist/lib/msan/msan_allocator.cc ============================================================================== --- vendor/compiler-rt/dist/lib/msan/msan_allocator.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/msan/msan_allocator.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -13,7 +13,9 @@ //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_allocator.h" +#include "sanitizer_common/sanitizer_allocator_checks.h" #include "sanitizer_common/sanitizer_allocator_interface.h" +#include "sanitizer_common/sanitizer_errno.h" #include "msan.h" #include "msan_allocator.h" #include "msan_origin.h" @@ -194,20 +196,8 @@ void MsanDeallocate(StackTrace *stack, void *p) { } } -void *MsanCalloc(StackTrace *stack, uptr nmemb, uptr size) { - if (CheckForCallocOverflow(size, nmemb)) - return Allocator::FailureHandler::OnBadRequest(); - return MsanReallocate(stack, nullptr, nmemb * size, sizeof(u64), true); -} - void *MsanReallocate(StackTrace *stack, void *old_p, uptr new_size, - uptr alignment, bool zeroise) { - if (!old_p) - return MsanAllocate(stack, new_size, alignment, zeroise); - if (!new_size) { - MsanDeallocate(stack, old_p); - return nullptr; - } + uptr alignment) { Metadata *meta = reinterpret_cast(allocator.GetMetaData(old_p)); uptr old_size = meta->requested_size; uptr actually_allocated_size = allocator.GetActuallyAllocatedSize(old_p); @@ -215,10 +205,7 @@ void *MsanReallocate(StackTrace *stack, void *old_p, u // We are not reallocating here. meta->requested_size = new_size; if (new_size > old_size) { - if (zeroise) { - __msan_clear_and_unpoison((char *)old_p + old_size, - new_size - old_size); - } else if (flags()->poison_in_malloc) { + if (flags()->poison_in_malloc) { stack->tag = StackTrace::TAG_ALLOC; PoisonMemory((char *)old_p + old_size, new_size - old_size, stack); } @@ -226,8 +213,7 @@ void *MsanReallocate(StackTrace *stack, void *old_p, u return old_p; } uptr memcpy_size = Min(new_size, old_size); - void *new_p = MsanAllocate(stack, new_size, alignment, zeroise); - // Printf("realloc: old_size %zd new_size %zd\n", old_size, new_size); + void *new_p = MsanAllocate(stack, new_size, alignment, false /*zeroise*/); if (new_p) { CopyMemory(new_p, old_p, memcpy_size, stack); MsanDeallocate(stack, old_p); @@ -241,6 +227,67 @@ static uptr AllocationSize(const void *p) { if (beg != p) return 0; Metadata *b = (Metadata *)allocator.GetMetaData(p); return b->requested_size; +} + +void *msan_malloc(uptr size, StackTrace *stack) { + return SetErrnoOnNull(MsanAllocate(stack, size, sizeof(u64), false)); +} + +void *msan_calloc(uptr nmemb, uptr size, StackTrace *stack) { + if (UNLIKELY(CheckForCallocOverflow(size, nmemb))) + return SetErrnoOnNull(Allocator::FailureHandler::OnBadRequest()); + return SetErrnoOnNull(MsanAllocate(stack, nmemb * size, sizeof(u64), true)); +} + +void *msan_realloc(void *ptr, uptr size, StackTrace *stack) { + if (!ptr) + return SetErrnoOnNull(MsanAllocate(stack, size, sizeof(u64), false)); + if (size == 0) { + MsanDeallocate(stack, ptr); + return nullptr; + } + return SetErrnoOnNull(MsanReallocate(stack, ptr, size, sizeof(u64))); +} + +void *msan_valloc(uptr size, StackTrace *stack) { + return SetErrnoOnNull(MsanAllocate(stack, size, GetPageSizeCached(), false)); +} + +void *msan_pvalloc(uptr size, StackTrace *stack) { + uptr PageSize = GetPageSizeCached(); + // pvalloc(0) should allocate one page. + size = size == 0 ? PageSize : RoundUpTo(size, PageSize); + return SetErrnoOnNull(MsanAllocate(stack, size, PageSize, false)); +} + +void *msan_aligned_alloc(uptr alignment, uptr size, StackTrace *stack) { + if (UNLIKELY(!CheckAlignedAllocAlignmentAndSize(alignment, size))) { + errno = errno_EINVAL; + return Allocator::FailureHandler::OnBadRequest(); + } + return SetErrnoOnNull(MsanAllocate(stack, size, alignment, false)); +} + +void *msan_memalign(uptr alignment, uptr size, StackTrace *stack) { + if (UNLIKELY(!IsPowerOfTwo(alignment))) { + errno = errno_EINVAL; + return Allocator::FailureHandler::OnBadRequest(); + } + return SetErrnoOnNull(MsanAllocate(stack, size, alignment, false)); +} + +int msan_posix_memalign(void **memptr, uptr alignment, uptr size, + StackTrace *stack) { + if (UNLIKELY(!CheckPosixMemalignAlignment(alignment))) { + Allocator::FailureHandler::OnBadRequest(); + return errno_EINVAL; + } + void *ptr = MsanAllocate(stack, size, alignment, false); + if (UNLIKELY(!ptr)) + return errno_ENOMEM; + CHECK(IsAligned((uptr)ptr, alignment)); + *memptr = ptr; + return 0; } } // namespace __msan Modified: vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc ============================================================================== --- vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -161,58 +161,45 @@ INTERCEPTOR(void *, bcopy, const void *src, void *dest INTERCEPTOR(int, posix_memalign, void **memptr, SIZE_T alignment, SIZE_T size) { GET_MALLOC_STACK_TRACE; - CHECK_EQ(alignment & (alignment - 1), 0); CHECK_NE(memptr, 0); - *memptr = MsanReallocate(&stack, nullptr, size, alignment, false); - CHECK_NE(*memptr, 0); - __msan_unpoison(memptr, sizeof(*memptr)); - return 0; + int res = msan_posix_memalign(memptr, alignment, size, &stack); + if (!res) + __msan_unpoison(memptr, sizeof(*memptr)); + return res; } #if !SANITIZER_FREEBSD -INTERCEPTOR(void *, memalign, SIZE_T boundary, SIZE_T size) { +INTERCEPTOR(void *, memalign, SIZE_T alignment, SIZE_T size) { GET_MALLOC_STACK_TRACE; - CHECK_EQ(boundary & (boundary - 1), 0); - void *ptr = MsanReallocate(&stack, nullptr, size, boundary, false); - return ptr; + return msan_memalign(alignment, size, &stack); } #define MSAN_MAYBE_INTERCEPT_MEMALIGN INTERCEPT_FUNCTION(memalign) #else #define MSAN_MAYBE_INTERCEPT_MEMALIGN #endif -INTERCEPTOR(void *, aligned_alloc, SIZE_T boundary, SIZE_T size) { +INTERCEPTOR(void *, aligned_alloc, SIZE_T alignment, SIZE_T size) { GET_MALLOC_STACK_TRACE; - CHECK_EQ(boundary & (boundary - 1), 0); - void *ptr = MsanReallocate(&stack, nullptr, size, boundary, false); - return ptr; + return msan_aligned_alloc(alignment, size, &stack); } -INTERCEPTOR(void *, __libc_memalign, SIZE_T boundary, SIZE_T size) { +INTERCEPTOR(void *, __libc_memalign, SIZE_T alignment, SIZE_T size) { GET_MALLOC_STACK_TRACE; - CHECK_EQ(boundary & (boundary - 1), 0); - void *ptr = MsanReallocate(&stack, nullptr, size, boundary, false); - DTLS_on_libc_memalign(ptr, size); + void *ptr = msan_memalign(alignment, size, &stack); + if (ptr) + DTLS_on_libc_memalign(ptr, size); return ptr; } INTERCEPTOR(void *, valloc, SIZE_T size) { GET_MALLOC_STACK_TRACE; - void *ptr = MsanReallocate(&stack, nullptr, size, GetPageSizeCached(), false); - return ptr; + return msan_valloc(size, &stack); } #if !SANITIZER_FREEBSD INTERCEPTOR(void *, pvalloc, SIZE_T size) { GET_MALLOC_STACK_TRACE; - uptr PageSize = GetPageSizeCached(); - size = RoundUpTo(size, PageSize); - if (size == 0) { - // pvalloc(0) should allocate one page. - size = PageSize; - } - void *ptr = MsanReallocate(&stack, nullptr, size, PageSize, false); - return ptr; + return msan_pvalloc(size, &stack); } #define MSAN_MAYBE_INTERCEPT_PVALLOC INTERCEPT_FUNCTION(pvalloc) #else @@ -853,7 +840,7 @@ INTERCEPTOR(void *, calloc, SIZE_T nmemb, SIZE_T size) if (UNLIKELY(!msan_inited)) // Hack: dlsym calls calloc before REAL(calloc) is retrieved from dlsym. return AllocateFromLocalPool(nmemb * size); - return MsanCalloc(&stack, nmemb, size); + return msan_calloc(nmemb, size, &stack); } INTERCEPTOR(void *, realloc, void *ptr, SIZE_T size) { @@ -866,12 +853,12 @@ INTERCEPTOR(void *, realloc, void *ptr, SIZE_T size) { new_ptr = AllocateFromLocalPool(copy_size); } else { copy_size = size; - new_ptr = MsanReallocate(&stack, nullptr, copy_size, sizeof(u64), false); + new_ptr = msan_malloc(copy_size, &stack); } internal_memcpy(new_ptr, ptr, copy_size); return new_ptr; } - return MsanReallocate(&stack, ptr, size, sizeof(u64), false); + return msan_realloc(ptr, size, &stack); } INTERCEPTOR(void *, malloc, SIZE_T size) { @@ -879,7 +866,7 @@ INTERCEPTOR(void *, malloc, SIZE_T size) { if (UNLIKELY(!msan_inited)) // Hack: dlsym calls malloc before REAL(malloc) is retrieved from dlsym. return AllocateFromLocalPool(size); - return MsanReallocate(&stack, nullptr, size, sizeof(u64), false); + return msan_malloc(size, &stack); } void __msan_allocated_memory(const void *data, uptr size) { Modified: vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc ============================================================================== --- vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -31,7 +31,7 @@ namespace std { // TODO(alekseys): throw std::bad_alloc instead of dying on OOM. #define OPERATOR_NEW_BODY(nothrow) \ GET_MALLOC_STACK_TRACE; \ - void *res = MsanReallocate(&stack, 0, size, sizeof(u64), false);\ + void *res = msan_malloc(size, &stack);\ if (!nothrow && UNLIKELY(!res)) DieOnFailure::OnOOM();\ return res Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -14,6 +14,7 @@ #include "sanitizer_allocator.h" +#include "sanitizer_allocator_checks.h" #include "sanitizer_allocator_internal.h" #include "sanitizer_atomic.h" #include "sanitizer_common.h" @@ -160,7 +161,7 @@ void *InternalRealloc(void *addr, uptr size, InternalA } void *InternalCalloc(uptr count, uptr size, InternalAllocatorCache *cache) { - if (CheckForCallocOverflow(count, size)) + if (UNLIKELY(CheckForCallocOverflow(count, size))) return InternalAllocator::FailureHandler::OnBadRequest(); void *p = InternalAlloc(count * size, cache); if (p) internal_memset(p, 0, count * size); @@ -200,12 +201,6 @@ void *LowLevelAllocator::Allocate(uptr size) { void SetLowLevelAllocateCallback(LowLevelAllocateCallback callback) { low_level_alloc_callback = callback; -} - -bool CheckForCallocOverflow(uptr size, uptr n) { - if (!size) return false; - uptr max = (uptr)-1L; - return (max / size) < n; } static atomic_uint8_t allocator_out_of_memory = {0}; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.h Wed Jul 19 07:02:40 2017 (r321188) @@ -56,11 +56,6 @@ struct NoOpMapUnmapCallback { // Callback type for iterating over chunks. typedef void (*ForEachChunkCallback)(uptr chunk, void *arg); -// Returns true if calloc(size, n) call overflows on size*n calculation. -// The caller should "return POLICY::OnBadRequest();" where POLICY is the -// current allocator failure handling policy. -bool CheckForCallocOverflow(uptr size, uptr n); - #include "sanitizer_allocator_size_class_map.h" #include "sanitizer_allocator_stats.h" #include "sanitizer_allocator_primary64.h" Added: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_checks.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_checks.h Wed Jul 19 07:02:40 2017 (r321188) @@ -0,0 +1,64 @@ +//===-- sanitizer_allocator_checks.h ----------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Various checks shared between ThreadSanitizer, MemorySanitizer, etc. memory +// allocators. +// +//===----------------------------------------------------------------------===// + +#ifndef SANITIZER_ALLOCATOR_CHECKS_H +#define SANITIZER_ALLOCATOR_CHECKS_H + +#include "sanitizer_errno.h" +#include "sanitizer_internal_defs.h" +#include "sanitizer_common.h" +#include "sanitizer_platform.h" + +namespace __sanitizer { + +// A common errno setting logic shared by almost all sanitizer allocator APIs. +INLINE void *SetErrnoOnNull(void *ptr) { + if (UNLIKELY(!ptr)) + errno = errno_ENOMEM; + return ptr; +} + +// In case of the check failure, the caller of the following Check... functions +// should "return POLICY::OnBadRequest();" where POLICY is the current allocator +// failure handling policy. + +// Checks aligned_alloc() parameters, verifies that the alignment is a power of +// two and that the size is a multiple of alignment for POSIX implementation, +// and a bit relaxed requirement for non-POSIX ones, that the size is a multiple +// of alignment. +INLINE bool CheckAlignedAllocAlignmentAndSize(uptr alignment, uptr size) { +#if SANITIZER_POSIX + return IsPowerOfTwo(alignment) && (size & (alignment - 1)) == 0; +#else + return size % alignment == 0; +#endif +} + +// Checks posix_memalign() parameters, verifies that alignment is a power of two +// and a multiple of sizeof(void *). +INLINE bool CheckPosixMemalignAlignment(uptr alignment) { + return IsPowerOfTwo(alignment) && (alignment % sizeof(void *)) == 0; // NOLINT +} + +// Returns true if calloc(size, n) call overflows on size*n calculation. +INLINE bool CheckForCallocOverflow(uptr size, uptr n) { + if (!size) + return false; + uptr max = (uptr)-1L; + return (max / size) < n; +} + +} // namespace __sanitizer + +#endif // SANITIZER_ALLOCATOR_CHECKS_H Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_errno.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_errno.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_errno.h Wed Jul 19 07:02:40 2017 (r321188) @@ -26,6 +26,8 @@ # define __errno_location __error #elif SANITIZER_ANDROID # define __errno_location __errno +#elif SANITIZER_WINDOWS +# define __errno_location _errno #endif extern "C" int *__errno_location(); Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -629,8 +629,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, } #endif -uptr internal_sigaltstack(const struct sigaltstack *ss, - struct sigaltstack *oss) { +uptr internal_sigaltstack(const void *ss, void *oss) { return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss); } Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h Wed Jul 19 07:02:40 2017 (r321188) @@ -21,7 +21,6 @@ #include "sanitizer_platform_limits_posix.h" struct link_map; // Opaque type returned by dlopen(). -struct sigaltstack; namespace __sanitizer { // Dirent structure for getdents(). Note that this structure is different from @@ -30,8 +29,7 @@ struct linux_dirent; // Syscall wrappers. uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count); -uptr internal_sigaltstack(const struct sigaltstack* ss, - struct sigaltstack* oss); +uptr internal_sigaltstack(const void* ss, void* oss); uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset); Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc Wed Jul 19 07:02:40 2017 (r321188) @@ -805,14 +805,35 @@ char **GetArgv() { // fields only available in 10.12+. Declare the struct manually to be able to // build against older SDKs. struct __sanitizer_task_vm_info { - uptr _unused[(SANITIZER_WORDSIZE == 32) ? 20 : 19]; - uptr min_address; - uptr max_address; + mach_vm_size_t virtual_size; + integer_t region_count; + integer_t page_size; + mach_vm_size_t resident_size; + mach_vm_size_t resident_size_peak; + mach_vm_size_t device; + mach_vm_size_t device_peak; + mach_vm_size_t internal; + mach_vm_size_t internal_peak; + mach_vm_size_t external; + mach_vm_size_t external_peak; + mach_vm_size_t reusable; + mach_vm_size_t reusable_peak; + mach_vm_size_t purgeable_volatile_pmap; + mach_vm_size_t purgeable_volatile_resident; + mach_vm_size_t purgeable_volatile_virtual; + mach_vm_size_t compressed; + mach_vm_size_t compressed_peak; + mach_vm_size_t compressed_lifetime; + mach_vm_size_t phys_footprint; + mach_vm_address_t min_address; + mach_vm_address_t max_address; }; +#define __SANITIZER_TASK_VM_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(__sanitizer_task_vm_info) / sizeof(natural_t))) uptr GetTaskInfoMaxAddress() { - __sanitizer_task_vm_info vm_info = {{0}, 0, 0}; - mach_msg_type_number_t count = sizeof(vm_info) / sizeof(int); + __sanitizer_task_vm_info vm_info = {}; + mach_msg_type_number_t count = __SANITIZER_TASK_VM_INFO_COUNT; int err = task_info(mach_task_self(), TASK_VM_INFO, (int *)&vm_info, &count); if (err == 0) { return vm_info.max_address - 1; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h Wed Jul 19 07:02:40 2017 (r321188) @@ -13,7 +13,7 @@ #ifndef SANITIZER_PLATFORM_H #define SANITIZER_PLATFORM_H -#if !defined(__linux__) && !defined(__FreeBSD__) && \ +#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \ !defined(__APPLE__) && !defined(_WIN32) # error "This operating system is not supported" #endif @@ -30,6 +30,12 @@ # define SANITIZER_FREEBSD 0 #endif +#if defined(__NetBSD__) +# define SANITIZER_NETBSD 1 +#else +# define SANITIZER_NETBSD 0 +#endif + #if defined(__APPLE__) # define SANITIZER_MAC 1 # include @@ -79,7 +85,8 @@ # define SANITIZER_ANDROID 0 #endif -#define SANITIZER_POSIX (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC) +#define SANITIZER_POSIX \ + (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC || SANITIZER_NETBSD) #if __LP64__ || defined(_WIN64) # define SANITIZER_WORDSIZE 64 Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h Wed Jul 19 07:02:37 2017 (r321187) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h Wed Jul 19 07:02:40 2017 (r321188) @@ -49,6 +49,12 @@ # define SI_FREEBSD 0 #endif +#if SANITIZER_NETBSD +# define SI_NETBSD 1 +#else +# define SI_NETBSD 0 +#endif + #if SANITIZER_LINUX # define SI_LINUX 1 #else @@ -109,9 +115,9 @@ // memmem on Darwin doesn't exist on 10.6 // FIXME: enable memmem on Windows. #define SANITIZER_INTERCEPT_MEMMEM \ - SI_NOT_WINDOWS && !SI_MAC_DEPLOYMENT_BELOW_10_7 + (SI_NOT_WINDOWS && !SI_MAC_DEPLOYMENT_BELOW_10_7) #define SANITIZER_INTERCEPT_MEMCHR 1 -#define SANITIZER_INTERCEPT_MEMRCHR SI_FREEBSD || SI_LINUX +#define SANITIZER_INTERCEPT_MEMRCHR (SI_FREEBSD || SI_LINUX || SI_NETBSD) #define SANITIZER_INTERCEPT_READ SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PREAD SI_NOT_WINDOWS @@ -127,7 +133,8 @@ #define SANITIZER_INTERCEPT_READV SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_WRITEV SI_NOT_WINDOWS -#define SANITIZER_INTERCEPT_PREADV SI_FREEBSD || SI_LINUX_NOT_ANDROID +#define SANITIZER_INTERCEPT_PREADV \ + (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_PWRITEV SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PREADV64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_PWRITEV64 SI_LINUX_NOT_ANDROID @@ -142,7 +149,7 @@ #ifndef SANITIZER_INTERCEPT_PRINTF # define SANITIZER_INTERCEPT_PRINTF SI_NOT_WINDOWS -# define SANITIZER_INTERCEPT_PRINTF_L SI_FREEBSD +# define SANITIZER_INTERCEPT_PRINTF_L (SI_FREEBSD || SI_NETBSD) # define SANITIZER_INTERCEPT_ISOC99_PRINTF SI_LINUX_NOT_ANDROID #endif @@ -151,13 +158,14 @@ #define SANITIZER_INTERCEPT_GETPWNAM_AND_FRIENDS SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETPWNAM_R_AND_FRIENDS \ - SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_GETPWENT \ - SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_FGETPWENT SI_LINUX_NOT_ANDROID -#define SANITIZER_INTERCEPT_GETPWENT_R SI_FREEBSD || SI_LINUX_NOT_ANDROID -#define SANITIZER_INTERCEPT_SETPWENT SI_MAC || SI_LINUX_NOT_ANDROID -#define SANITIZER_INTERCEPT_CLOCK_GETTIME SI_FREEBSD || SI_LINUX +#define SANITIZER_INTERCEPT_GETPWENT_R \ + (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID) +#define SANITIZER_INTERCEPT_SETPWENT (SI_MAC || SI_LINUX_NOT_ANDROID) +#define SANITIZER_INTERCEPT_CLOCK_GETTIME (SI_FREEBSD || SI_NETBSD || SI_LINUX) #define SANITIZER_INTERCEPT_GETITIMER SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_TIME SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GLOB SI_LINUX_NOT_ANDROID @@ -168,10 +176,11 @@ #define SANITIZER_INTERCEPT_GETNAMEINFO SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETSOCKNAME SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_GETHOSTBYNAME SI_NOT_WINDOWS -#define SANITIZER_INTERCEPT_GETHOSTBYNAME_R SI_FREEBSD || SI_LINUX -#define SANITIZER_INTERCEPT_GETHOSTBYNAME2_R SI_FREEBSD || SI_LINUX_NOT_ANDROID -#define SANITIZER_INTERCEPT_GETHOSTBYADDR_R SI_FREEBSD || SI_LINUX_NOT_ANDROID -#define SANITIZER_INTERCEPT_GETHOSTENT_R SI_FREEBSD || SI_LINUX_NOT_ANDROID +#define SANITIZER_INTERCEPT_GETHOSTBYNAME_R (SI_FREEBSD || SI_LINUX) +#define SANITIZER_INTERCEPT_GETHOSTBYNAME2_R \ + (SI_FREEBSD || SI_LINUX_NOT_ANDROID) +#define SANITIZER_INTERCEPT_GETHOSTBYADDR_R (SI_FREEBSD || SI_LINUX_NOT_ANDROID) +#define SANITIZER_INTERCEPT_GETHOSTENT_R (SI_FREEBSD || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_GETSOCKOPT SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_ACCEPT SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_ACCEPT4 SI_LINUX_NOT_ANDROID @@ -197,63 +206,67 @@ #define SANITIZER_INTERCEPT_GET_CURRENT_DIR_NAME SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_STRTOIMAX SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_MBSTOWCS SI_NOT_WINDOWS -#define SANITIZER_INTERCEPT_MBSNRTOWCS SI_MAC || SI_LINUX_NOT_ANDROID +#define SANITIZER_INTERCEPT_MBSNRTOWCS (SI_MAC || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_WCSTOMBS SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_WCSNRTOMBS \ - SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_WCRTOMB \ - SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_TCGETATTR SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_REALPATH SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_CANONICALIZE_FILE_NAME SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_CONFSTR \ - SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_SCHED_GETAFFINITY SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SCHED_GETPARAM SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_STRERROR SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_STRERROR_R SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_XPG_STRERROR_R SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SCANDIR \ - SI_FREEBSD || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_SCANDIR64 SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_GETGROUPS SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_POLL SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_PPOLL SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_WORDEXP \ - SI_FREEBSD || (SI_MAC && !SI_IOS) || SI_LINUX_NOT_ANDROID + (SI_FREEBSD || SI_NETBSD || (SI_MAC && !SI_IOS) || SI_LINUX_NOT_ANDROID) #define SANITIZER_INTERCEPT_SIGWAIT SI_NOT_WINDOWS #define SANITIZER_INTERCEPT_SIGWAITINFO SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SIGTIMEDWAIT SI_LINUX_NOT_ANDROID #define SANITIZER_INTERCEPT_SIGSETOPS \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Wed Jul 19 07:02:51 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 9798EDAAC85; Wed, 19 Jul 2017 07:02:51 +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 478BE6E436; Wed, 19 Jul 2017 07:02: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 v6J72o1d091031; Wed, 19 Jul 2017 07:02:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72nmu091019; Wed, 19 Jul 2017 07:02:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72nmu091019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321190 - in vendor/libc++/dist: docs/DesignDocs include lib test/support www X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/libc++/dist: docs/DesignDocs include lib test/support www X-SVN-Commit-Revision: 321190 X-SVN-Commit-Repository: base 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, 19 Jul 2017 07:02:51 -0000 Author: dim Date: Wed Jul 19 07:02:49 2017 New Revision: 321190 URL: https://svnweb.freebsd.org/changeset/base/321190 Log: Vendor import of libc++ trunk r308421: https://llvm.org/svn/llvm-project/libcxx/trunk@308421 Added: vendor/libc++/dist/www/cxx2a_status.html (contents, props changed) Modified: vendor/libc++/dist/docs/DesignDocs/VisibilityMacros.rst vendor/libc++/dist/include/__config vendor/libc++/dist/include/algorithm vendor/libc++/dist/include/string vendor/libc++/dist/include/vector vendor/libc++/dist/lib/CMakeLists.txt vendor/libc++/dist/test/support/test_macros.h vendor/libc++/dist/www/cxx1z_status.html vendor/libc++/dist/www/index.html vendor/libc++/dist/www/upcoming_meeting.html Modified: vendor/libc++/dist/docs/DesignDocs/VisibilityMacros.rst ============================================================================== --- vendor/libc++/dist/docs/DesignDocs/VisibilityMacros.rst Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/docs/DesignDocs/VisibilityMacros.rst Wed Jul 19 07:02:49 2017 (r321190) @@ -90,20 +90,21 @@ Visibility Macros The macro has an empty definition with GCC. **Windows Behavior**: `extern template` and `dllexport` are fundamentally - incompatible *on a template class* on Windows; the former suppresses + incompatible *on a class template* on Windows; the former suppresses instantiation, while the latter forces it. Specifying both on the same - declaration makes the template class be instantiated, which is not desirable + declaration makes the class template be instantiated, which is not desirable inside headers. This macro therefore expands to `dllimport` outside of libc++ but nothing inside of it (rather than expanding to `dllexport`); instead, the explicit instantiations themselves are marked as exported. Note that this - applies *only* to extern template *classes*. Extern template *functions* obey + applies *only* to extern *class* templates. Extern *function* templates obey regular import/export semantics, and applying `dllexport` directly to the - extern template declaration is the correct thing to do for them. + extern template declaration (i.e. using `_LIBCPP_FUNC_VIS`) is the correct + thing to do for them. **_LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS** Mark the member functions, typeinfo, and vtable of an explicit instantiation of a class template as being exported by the libc++ library. This attribute - must be specified on all template class explicit instantiations. + must be specified on all class template explicit instantiations. It is only necessary to mark the explicit instantiation itself (as opposed to the extern template declaration) as exported on Windows, as discussed above. Modified: vendor/libc++/dist/include/__config ============================================================================== --- vendor/libc++/dist/include/__config Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/include/__config Wed Jul 19 07:02:49 2017 (r321190) @@ -229,8 +229,9 @@ # define _LIBCPP_SHORT_WCHAR 1 // Both MinGW and native MSVC provide a "MSVC"-like enviroment # define _LIBCPP_MSVCRT_LIKE -// If mingw not explicitly detected, assume using MS C runtime only. -# ifndef __MINGW32__ +// If mingw not explicitly detected, assume using MS C runtime only if +// a MS compatibility version is specified. +# if defined(_MSC_VER) && !defined(__MINGW32__) # define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library # endif # if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__)) @@ -625,7 +626,6 @@ namespace std { #define _LIBCPP_HIDDEN #define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS #define _LIBCPP_TEMPLATE_VIS -#define _LIBCPP_FUNC_VIS_ONLY #define _LIBCPP_ENUM_VIS #if defined(_LIBCPP_COMPILER_MSVC) @@ -684,10 +684,6 @@ namespace std { # endif #endif -#ifndef _LIBCPP_FUNC_VIS_ONLY -# define _LIBCPP_FUNC_VIS_ONLY _LIBCPP_FUNC_VIS -#endif - #ifndef _LIBCPP_EXTERN_VIS # define _LIBCPP_EXTERN_VIS #endif @@ -925,8 +921,10 @@ template struct __static_assert_check {}; # define _LIBCPP_STD_VER 11 # elif __cplusplus <= 201402L # define _LIBCPP_STD_VER 14 +# elif __cplusplus <= 201703L +# define _LIBCPP_STD_VER 17 # else -# define _LIBCPP_STD_VER 16 // current year, or date of c++17 ratification +# define _LIBCPP_STD_VER 18 // current year, or date of c++2a ratification # endif #endif // _LIBCPP_STD_VER Modified: vendor/libc++/dist/include/algorithm ============================================================================== --- vendor/libc++/dist/include/algorithm Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/include/algorithm Wed Jul 19 07:02:49 2017 (r321190) @@ -4234,10 +4234,6 @@ sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __la _VSTD::sort<_Tp*, _Comp_ref>(__first.base(), __last.base(), __comp); } -#ifdef _LIBCPP_MSVC -#pragma warning( push ) -#pragma warning( disable: 4231) -#endif // _LIBCPP_MSVC _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, char*>(char*, char*, __less&)) _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&)) _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, signed char*>(signed char*, signed char*, __less&)) @@ -4271,9 +4267,6 @@ _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insert _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, long double*>(long double*, long double*, __less&)) _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS unsigned __sort5<__less&, long double*>(long double*, long double*, long double*, long double*, long double*, __less&)) -#ifdef _LIBCPP_MSVC -#pragma warning( pop ) -#endif // _LIBCPP_MSVC // lower_bound Modified: vendor/libc++/dist/include/string ============================================================================== --- vendor/libc++/dist/include/string Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/include/string Wed Jul 19 07:02:49 2017 (r321190) @@ -578,14 +578,7 @@ __basic_string_common<__b>::__throw_out_of_range() con _VSTD::__throw_out_of_range("basic_string"); } -#ifdef _LIBCPP_MSVC -#pragma warning( push ) -#pragma warning( disable: 4231 ) -#endif // _LIBCPP_MSVC _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __basic_string_common) -#ifdef _LIBCPP_MSVC -#pragma warning( pop ) -#endif // _LIBCPP_MSVC #ifdef _LIBCPP_NO_EXCEPTIONS template @@ -4006,7 +3999,7 @@ basic_string<_CharT, _Traits, _Allocator>::__subscript _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string) _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string) -_LIBCPP_EXTERN_TEMPLATE(string operator+, allocator >(char const*, string const&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS string operator+, allocator >(char const*, string const&)) #if _LIBCPP_STD_VER > 11 // Literal suffixes for basic_string [basic.string.literals] Modified: vendor/libc++/dist/include/vector ============================================================================== --- vendor/libc++/dist/include/vector Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/include/vector Wed Jul 19 07:02:49 2017 (r321190) @@ -310,14 +310,7 @@ __vector_base_common<__b>::__throw_out_of_range() cons _VSTD::__throw_out_of_range("vector"); } -#ifdef _LIBCPP_MSVC -#pragma warning( push ) -#pragma warning( disable: 4231 ) -#endif // _LIBCPP_MSVC _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __vector_base_common) -#ifdef _LIBCPP_MSVC -#pragma warning( pop ) -#endif // _LIBCPP_MSVC template class __vector_base Modified: vendor/libc++/dist/lib/CMakeLists.txt ============================================================================== --- vendor/libc++/dist/lib/CMakeLists.txt Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/lib/CMakeLists.txt Wed Jul 19 07:02:49 2017 (r321190) @@ -258,7 +258,7 @@ if (LIBCXX_ENABLE_STATIC) set(MERGE_ARCHIVES_SEARCH_PATHS "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}") endif() if ((TARGET ${LIBCXX_CXX_ABI_LIBRARY}) OR - (${LIBCXX_CXX_ABI_LIBRARY} STREQUAL "cxxabi(_static|_shared)?" AND HAVE_LIBCXXABI)) + (${LIBCXX_CXX_ABI_LIBRARY} MATCHES "cxxabi(_static|_shared)?" AND HAVE_LIBCXXABI)) set(MERGE_ARCHIVES_ABI_TARGET "$") else() set(MERGE_ARCHIVES_ABI_TARGET Modified: vendor/libc++/dist/test/support/test_macros.h ============================================================================== --- vendor/libc++/dist/test/support/test_macros.h Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/test/support/test_macros.h Wed Jul 19 07:02:49 2017 (r321190) @@ -81,8 +81,11 @@ # define TEST_STD_VER 11 #elif __cplusplus <= 201402L # define TEST_STD_VER 14 +#elif __cplusplus <= 201703L +# define TEST_STD_VER 17 #else -# define TEST_STD_VER 16 // current year; greater than current standard +# define TEST_STD_VER 99 // greater than current standard +// This is deliberately different than _LIBCPP_STD_VER to discourage matching them up. #endif #endif Modified: vendor/libc++/dist/www/cxx1z_status.html ============================================================================== --- vendor/libc++/dist/www/cxx1z_status.html Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/www/cxx1z_status.html Wed Jul 19 07:02:49 2017 (r321190) @@ -161,6 +161,9 @@ P0607R0LWGInline Variables for the Standard LibraryKona P0618R0LWGDeprecating <codecvt>Kona P0623R0LWGFinal C++17 Parallel Algorithms FixesKona + + P0682R1LWGRepairing elementary string conversionsToronto + P0739R0LWGSome improvements to class template argument deduction integration into the standard libraryToronto @@ -483,6 +486,11 @@ 2911An is_aggregate type trait is neededKonaComplete 2921packaged_task and type-erased allocatorsKona 2934optional<const T> doesn't compare with TKonaComplete + + 2901Variants cannot properly support allocatorsTorontoComplete + 2955to_chars / from_chars depend on std::stringTorontoResolved by P0682R1 + 2956filesystem::canonical() still defined in terms of absolute(p, base)TorontoComplete + Added: vendor/libc++/dist/www/cxx2a_status.html ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/www/cxx2a_status.html Wed Jul 19 07:02:49 2017 (r321190) @@ -0,0 +1,90 @@ + + + + + + libc++ C++2a Status + + + + + + + +
+ +

libc++ C++2a Status

+ + +

In July 2017, the C++ standard committee created a draft for the next version of the C++ standard, known here as "C++2a" (probably to be C++20).

+

This page shows the status of libc++; the status of clang's support of the language features is here.

+ +

The groups that have contributed papers: +

    +
  • LWG - Library working group
  • +
  • CWG - Core Language Working group
  • +
  • SG1 - Study group #1 (Concurrency working group)
  • +
+

+ +

Paper Status

+ + + + + + + +
Paper #GroupPaper NameMeetingStatusFirst released version
P0463R1LWGEndian just EndianToronto
P0674R1LWGExtending make_shared to Support ArraysToronto
+ +

[ Note: "Nothing to do" means that no library changes were needed to implement this change -- end note]

+ +

Library Working group Issues Status

+ + + + + + + + + + + + + + + + + + + +
Issue #Issue NameMeetingStatus
2070allocate_shared should use allocator_traits<A>::constructTorontoResolved by P0674R1
2444Inconsistent complexity for std::sort_heapToronto
2593Moved-from state of AllocatorsToronto
2597std::log misspecified for complex numbersToronto
2783stack::emplace() and queue::emplace() should return decltype(auto)Toronto
2932Constraints on parallel algorithm implementations are underspecifiedToronto
2937Is equivalent("existing_thing", "not_existing_thing") an errorTorontoComplete
2940result_of specification also needs a little cleanupToronto
2942LWG 2873's resolution missed weak_ptr::owner_beforeToronto
2954Specialization of the convenience variable templates should be prohibitedToronto
2961Bad postcondition for set_default_resourceToronto
2966Incomplete resolution of US 74TorontoNothing to do
2974Diagnose out of bounds tuple_element/variant_alternativeTorontoComplete
+ +

Last Updated: 16-Jul-2017

+
+ + Modified: vendor/libc++/dist/www/index.html ============================================================================== --- vendor/libc++/dist/www/index.html Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/www/index.html Wed Jul 19 07:02:49 2017 (r321190) @@ -138,6 +138,8 @@ C++14 can be found here.

A list of features and changes for the next C++ standard, known here as "C++1z" (probably to be C++17) can be found here.

+

A list of features and changes for the C++ standard beyond C++17, known here as + "C++2a" (probably to be C++20) can be found here.

Implementation of the post-c++14 Technical Specifications is in progress. A list of features and the current status of these features can be found here.

Modified: vendor/libc++/dist/www/upcoming_meeting.html ============================================================================== --- vendor/libc++/dist/www/upcoming_meeting.html Wed Jul 19 07:02:46 2017 (r321189) +++ vendor/libc++/dist/www/upcoming_meeting.html Wed Jul 19 07:02:49 2017 (r321190) @@ -73,7 +73,11 @@ 2974Diagnose out of bounds tuple_element/variant_alternativeToronto
Priority 1 Bugs
- 2665remove_filename() post condition is incorrectKonaWe do this already + 2665remove_filename() post condition is incorrectTorontoWe do this already + +
Immediate Issues in Toronto
+ 2901Variants cannot properly support allocatorsTorontoWe do this already + 2956filesystem::canonical() still defined in terms of absolute(p, base)Toronto From owner-svn-src-vendor@freebsd.org Wed Jul 19 07:02:55 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 3F4B6DAACA4; Wed, 19 Jul 2017 07:02:55 +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 E67766E488; Wed, 19 Jul 2017 07:02:54 +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 v6J72sns091077; Wed, 19 Jul 2017 07:02:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72s5q091076; Wed, 19 Jul 2017 07:02:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72s5q091076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321191 - vendor/libc++/libc++-trunk-r308421 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/libc++/libc++-trunk-r308421 X-SVN-Commit-Revision: 321191 X-SVN-Commit-Repository: base 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, 19 Jul 2017 07:02:55 -0000 Author: dim Date: Wed Jul 19 07:02:53 2017 New Revision: 321191 URL: https://svnweb.freebsd.org/changeset/base/321191 Log: Tag libc++ trunk r308421. Added: vendor/libc++/libc++-trunk-r308421/ - copied from r321190, vendor/libc++/dist/ From owner-svn-src-vendor@freebsd.org Wed Jul 19 07:02: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 95FD6DAAC5A; Wed, 19 Jul 2017 07:02: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 4A0766E3C8; Wed, 19 Jul 2017 07:02: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 v6J72kVZ090971; Wed, 19 Jul 2017 07:02:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72kGZ090970; Wed, 19 Jul 2017 07:02:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72kGZ090970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321189 - vendor/compiler-rt/compiler-rt-trunk-r308421 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/compiler-rt/compiler-rt-trunk-r308421 X-SVN-Commit-Revision: 321189 X-SVN-Commit-Repository: base 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, 19 Jul 2017 07:02:47 -0000 Author: dim Date: Wed Jul 19 07:02:46 2017 New Revision: 321189 URL: https://svnweb.freebsd.org/changeset/base/321189 Log: Tag compiler-rt trunk r308421. Added: vendor/compiler-rt/compiler-rt-trunk-r308421/ - copied from r321188, vendor/compiler-rt/dist/ From owner-svn-src-vendor@freebsd.org Wed Jul 19 07:03:01 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 7C9B5DAAD1E; Wed, 19 Jul 2017 07:03:01 +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 26F426E54E; Wed, 19 Jul 2017 07:03: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 v6J7300l091151; Wed, 19 Jul 2017 07:03:00 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J72waQ091126; Wed, 19 Jul 2017 07:02:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190702.v6J72waQ091126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321192 - in vendor/lld/dist: COFF ELF ELF/Arch docs test/COFF test/COFF/Inputs test/ELF test/ELF/Inputs test/ELF/invalid test/ELF/linkerscript test/ELF/lto X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lld/dist: COFF ELF ELF/Arch docs test/COFF test/COFF/Inputs test/ELF test/ELF/Inputs test/ELF/invalid test/ELF/linkerscript test/ELF/lto X-SVN-Commit-Revision: 321192 X-SVN-Commit-Repository: base 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, 19 Jul 2017 07:03:01 -0000 Author: dim Date: Wed Jul 19 07:02:58 2017 New Revision: 321192 URL: https://svnweb.freebsd.org/changeset/base/321192 Log: Vendor import of lld trunk r308421: https://llvm.org/svn/llvm-project/lld/trunk@308421 Added: vendor/lld/dist/test/COFF/Inputs/default.def vendor/lld/dist/test/COFF/Inputs/extension.def vendor/lld/dist/test/COFF/Inputs/named.def vendor/lld/dist/test/COFF/Inputs/object.s (contents, props changed) vendor/lld/dist/test/COFF/Inputs/pdb-type-server-simple-a.yaml vendor/lld/dist/test/COFF/Inputs/pdb-type-server-simple-b.yaml vendor/lld/dist/test/COFF/Inputs/pdb-type-server-simple-ts.yaml vendor/lld/dist/test/COFF/implib-name.test vendor/lld/dist/test/COFF/pdb-type-server-missing.yaml vendor/lld/dist/test/COFF/pdb-type-server-simple.test vendor/lld/dist/test/COFF/reloc-discarded-dwarf.s (contents, props changed) vendor/lld/dist/test/COFF/reloc-oob.yaml vendor/lld/dist/test/ELF/Inputs/gdb-index.s (contents, props changed) vendor/lld/dist/test/ELF/filter.s (contents, props changed) vendor/lld/dist/test/ELF/linkerscript/exidx-crash.s (contents, props changed) vendor/lld/dist/test/ELF/linkerscript/got-write-offset.s (contents, props changed) vendor/lld/dist/test/ELF/map-gc-sections.s (contents, props changed) vendor/lld/dist/test/ELF/version-script-twice.s (contents, props changed) Deleted: vendor/lld/dist/test/ELF/Inputs/gdb-index-a.elf vendor/lld/dist/test/ELF/Inputs/gdb-index-b.elf vendor/lld/dist/test/ELF/Inputs/symver-archive1.s vendor/lld/dist/test/ELF/Inputs/symver-archive2.s vendor/lld/dist/test/ELF/symver-archive.s Modified: vendor/lld/dist/COFF/Chunks.cpp vendor/lld/dist/COFF/Chunks.h vendor/lld/dist/COFF/Config.h vendor/lld/dist/COFF/Driver.cpp vendor/lld/dist/COFF/PDB.cpp vendor/lld/dist/ELF/Arch/ARM.cpp vendor/lld/dist/ELF/Arch/MipsArchTree.cpp vendor/lld/dist/ELF/Config.h vendor/lld/dist/ELF/Driver.cpp vendor/lld/dist/ELF/EhFrame.h vendor/lld/dist/ELF/Filesystem.h vendor/lld/dist/ELF/GdbIndex.h vendor/lld/dist/ELF/ICF.h vendor/lld/dist/ELF/InputFiles.h vendor/lld/dist/ELF/LTO.h vendor/lld/dist/ELF/LinkerScript.cpp vendor/lld/dist/ELF/MapFile.cpp vendor/lld/dist/ELF/MapFile.h vendor/lld/dist/ELF/Memory.h vendor/lld/dist/ELF/Options.td vendor/lld/dist/ELF/OutputSections.cpp vendor/lld/dist/ELF/OutputSections.h vendor/lld/dist/ELF/Relocations.cpp vendor/lld/dist/ELF/Relocations.h vendor/lld/dist/ELF/ScriptParser.cpp vendor/lld/dist/ELF/Strings.cpp vendor/lld/dist/ELF/Strings.h 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/Threads.h vendor/lld/dist/ELF/Thunks.cpp vendor/lld/dist/ELF/Thunks.h vendor/lld/dist/ELF/Writer.cpp vendor/lld/dist/ELF/Writer.h vendor/lld/dist/docs/windows_support.rst vendor/lld/dist/test/COFF/common.test vendor/lld/dist/test/COFF/conflict.test vendor/lld/dist/test/COFF/constant.test vendor/lld/dist/test/COFF/def-export-stdcall.s vendor/lld/dist/test/COFF/delayimports32.test vendor/lld/dist/test/COFF/entry-mangled.test vendor/lld/dist/test/COFF/entrylib.ll vendor/lld/dist/test/COFF/imports.test vendor/lld/dist/test/COFF/include-lto.ll vendor/lld/dist/test/COFF/msvclto-archive.ll vendor/lld/dist/test/COFF/msvclto-order.ll vendor/lld/dist/test/COFF/msvclto.ll vendor/lld/dist/test/COFF/pdb-comdat.test vendor/lld/dist/test/COFF/pdb-lib.s vendor/lld/dist/test/COFF/pdb-symbol-types.yaml vendor/lld/dist/test/COFF/savetemps.ll vendor/lld/dist/test/COFF/thinlto-archives.ll vendor/lld/dist/test/COFF/thinlto-mangled.ll vendor/lld/dist/test/COFF/thinlto.ll vendor/lld/dist/test/ELF/Inputs/ctors_dtors_priority1.s vendor/lld/dist/test/ELF/Inputs/ctors_dtors_priority2.s vendor/lld/dist/test/ELF/Inputs/ctors_dtors_priority3.s vendor/lld/dist/test/ELF/allow-shlib-undefined.s vendor/lld/dist/test/ELF/as-needed-no-reloc.s vendor/lld/dist/test/ELF/as-needed.s vendor/lld/dist/test/ELF/auxiliary.s vendor/lld/dist/test/ELF/compressed-debug-input.s vendor/lld/dist/test/ELF/ctors_dtors_priority.s vendor/lld/dist/test/ELF/debug-gnu-pubnames.s vendor/lld/dist/test/ELF/dynamic-reloc.s vendor/lld/dist/test/ELF/gc-sections-shared.s vendor/lld/dist/test/ELF/gdb-index-empty.s vendor/lld/dist/test/ELF/gdb-index-gc-sections.s vendor/lld/dist/test/ELF/gdb-index.s vendor/lld/dist/test/ELF/i386-reloc-large-addend.s vendor/lld/dist/test/ELF/i386-reloc-range.s vendor/lld/dist/test/ELF/invalid/tls-symbol.s vendor/lld/dist/test/ELF/linkerscript/output-too-large.s vendor/lld/dist/test/ELF/lto/available-externally.ll vendor/lld/dist/test/ELF/lto/comdat2.ll vendor/lld/dist/test/ELF/lto/common2.ll vendor/lld/dist/test/ELF/lto/common3.ll vendor/lld/dist/test/ELF/lto/discard-value-names.ll vendor/lld/dist/test/ELF/lto/opt-level.ll vendor/lld/dist/test/ELF/lto/opt-remarks.ll vendor/lld/dist/test/ELF/lto/relax-relocs.ll vendor/lld/dist/test/ELF/lto/thin-archivecollision.ll vendor/lld/dist/test/ELF/lto/thinlto.ll vendor/lld/dist/test/ELF/lto/type-merge2.ll vendor/lld/dist/test/ELF/lto/unnamed-addr-comdat.ll vendor/lld/dist/test/ELF/lto/unnamed-addr-drop.ll vendor/lld/dist/test/ELF/lto/unnamed-addr.ll vendor/lld/dist/test/ELF/many-alloc-sections.s vendor/lld/dist/test/ELF/many-sections.s vendor/lld/dist/test/ELF/merge-section-types.s vendor/lld/dist/test/ELF/new-dtags.test vendor/lld/dist/test/ELF/no-obj.s vendor/lld/dist/test/ELF/no-soname.s vendor/lld/dist/test/ELF/no-symtab.s vendor/lld/dist/test/ELF/no-undefined.s vendor/lld/dist/test/ELF/pie-weak.s vendor/lld/dist/test/ELF/progname.s vendor/lld/dist/test/ELF/relative-dynamic-reloc-pie.s vendor/lld/dist/test/ELF/relative-dynamic-reloc.s vendor/lld/dist/test/ELF/relocatable-compressed-input.s vendor/lld/dist/test/ELF/relocatable-reloc.s vendor/lld/dist/test/ELF/relocatable-section-symbol.s vendor/lld/dist/test/ELF/relocatable-sections.s vendor/lld/dist/test/ELF/relocatable-tls.s vendor/lld/dist/test/ELF/relocation-shared.s vendor/lld/dist/test/ELF/shared-be.s vendor/lld/dist/test/ELF/shared.s vendor/lld/dist/test/ELF/soname.s vendor/lld/dist/test/ELF/soname2.s Modified: vendor/lld/dist/COFF/Chunks.cpp ============================================================================== --- vendor/lld/dist/COFF/Chunks.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/COFF/Chunks.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -210,7 +210,15 @@ void SectionChunk::writeTo(uint8_t *Buf) const { memcpy(Buf + OutputSectionOff, A.data(), A.size()); // Apply relocations. + size_t InputSize = getSize(); for (const coff_relocation &Rel : Relocs) { + // Check for an invalid relocation offset. This check isn't perfect, because + // we don't have the relocation size, which is only known after checking the + // machine and relocation type. As a result, a relocation may overwrite the + // beginning of the following input section. + if (Rel.VirtualAddress >= InputSize) + fatal("relocation points beyond the end of its parent section"); + uint8_t *Off = Buf + OutputSectionOff + Rel.VirtualAddress; // Get the output section of the symbol for this relocation. The output @@ -227,7 +235,7 @@ void SectionChunk::writeTo(uint8_t *Buf) const { // sections are not GC roots and can end up with these kinds of relocations. // Skip these relocations. if (!OS && !isa(Sym) && !isa(Sym)) { - if (isCodeView()) + if (isCodeView() || isDWARF()) continue; fatal("relocation against symbol in discarded section: " + Sym->getName()); Modified: vendor/lld/dist/COFF/Chunks.h ============================================================================== --- vendor/lld/dist/COFF/Chunks.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/COFF/Chunks.h Wed Jul 19 07:02:58 2017 (r321192) @@ -112,7 +112,7 @@ class Chunk { (protected) }; // A chunk corresponding a section of an input file. -class SectionChunk : public Chunk { +class SectionChunk final : public Chunk { // Identical COMDAT Folding feature accesses section internal data. friend class ICF; @@ -187,6 +187,9 @@ class SectionChunk : public Chunk { (public) bool isCodeView() const { return SectionName == ".debug" || SectionName.startswith(".debug$"); } + + // True if this is a DWARF debug info chunk. + bool isDWARF() const { return SectionName.startswith(".debug_"); } // Allow iteration over the bodies of this chunk's relocated symbols. llvm::iterator_range symbols() const { Modified: vendor/lld/dist/COFF/Config.h ============================================================================== --- vendor/lld/dist/COFF/Config.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/COFF/Config.h Wed Jul 19 07:02:58 2017 (r321192) @@ -82,6 +82,7 @@ struct Configuration { SymbolBody *Entry = nullptr; bool NoEntry = false; std::string OutputFile; + std::string ImportName; bool ColorDiagnostics; bool DoGC = true; bool DoICF = true; Modified: vendor/lld/dist/COFF/Driver.cpp ============================================================================== --- vendor/lld/dist/COFF/Driver.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/COFF/Driver.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -429,7 +429,32 @@ static std::string getImplibPath() { return Out.str(); } -static void createImportLibrary() { +// +// The import name is caculated as the following: +// +// | LIBRARY w/ ext | LIBRARY w/o ext | no LIBRARY +// -----+----------------+---------------------+------------------ +// LINK | {value} | {value}.{.dll/.exe} | {output name} +// LIB | {value} | {value}.dll | {output name}.dll +// +static std::string getImportName(bool AsLib) { + SmallString<128> Out; + + if (Config->ImportName.empty()) { + Out.assign(sys::path::filename(Config->OutputFile)); + if (AsLib) + sys::path::replace_extension(Out, ".dll"); + } else { + Out.assign(Config->ImportName); + if (!sys::path::has_extension(Out)) + sys::path::replace_extension(Out, + (Config->DLL || AsLib) ? ".dll" : ".exe"); + } + + return Out.str(); +} + +static void createImportLibrary(bool AsLib) { std::vector Exports; for (Export &E1 : Config->Exports) { COFFShortExport E2; @@ -444,9 +469,8 @@ static void createImportLibrary() { Exports.push_back(E2); } - std::string DLLName = sys::path::filename(Config->OutputFile); - std::string Path = getImplibPath(); - writeImportLibrary(DLLName, Path, Exports, Config->Machine); + writeImportLibrary(getImportName(AsLib), getImplibPath(), Exports, + Config->Machine); } static void parseModuleDefs(StringRef Path) { @@ -457,6 +481,7 @@ static void parseModuleDefs(StringRef Path) { if (Config->OutputFile.empty()) Config->OutputFile = Saver.save(M.OutputFile); + Config->ImportName = Saver.save(M.ImportName); if (M.ImageBase) Config->ImageBase = M.ImageBase; if (M.StackReserve) @@ -992,7 +1017,7 @@ void LinkerDriver::link(ArrayRef ArgsArr // Handle generation of import library from a def file. if (!Args.hasArgNoClaim(OPT_INPUT)) { fixupExports(); - createImportLibrary(); + createImportLibrary(/*AsLib=*/true); exit(0); } @@ -1117,7 +1142,7 @@ void LinkerDriver::link(ArrayRef ArgsArr // need to create a .lib file. if (!Config->Exports.empty() || Config->DLL) { fixupExports(); - createImportLibrary(); + createImportLibrary(/*AsLib=*/false); assignExportOrdinals(); } Modified: vendor/lld/dist/COFF/PDB.cpp ============================================================================== --- vendor/lld/dist/COFF/PDB.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/COFF/PDB.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -14,28 +14,29 @@ #include "SymbolTable.h" #include "Symbols.h" #include "llvm/DebugInfo/CodeView/CVDebugRecord.h" -#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h" #include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h" -#include "llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h" #include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h" #include "llvm/DebugInfo/CodeView/SymbolSerializer.h" +#include "llvm/DebugInfo/CodeView/TypeDeserializer.h" #include "llvm/DebugInfo/CodeView/TypeDumpVisitor.h" #include "llvm/DebugInfo/CodeView/TypeIndexDiscovery.h" #include "llvm/DebugInfo/CodeView/TypeStreamMerger.h" #include "llvm/DebugInfo/CodeView/TypeTableBuilder.h" #include "llvm/DebugInfo/MSF/MSFBuilder.h" #include "llvm/DebugInfo/MSF/MSFCommon.h" +#include "llvm/DebugInfo/PDB/GenericError.h" #include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h" #include "llvm/DebugInfo/PDB/Native/DbiStream.h" #include "llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h" #include "llvm/DebugInfo/PDB/Native/InfoStream.h" #include "llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h" +#include "llvm/DebugInfo/PDB/Native/NativeSession.h" #include "llvm/DebugInfo/PDB/Native/PDBFile.h" #include "llvm/DebugInfo/PDB/Native/PDBFileBuilder.h" #include "llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h" -#include "llvm/DebugInfo/PDB/Native/PDBTypeServerHandler.h" #include "llvm/DebugInfo/PDB/Native/TpiStream.h" #include "llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h" +#include "llvm/DebugInfo/PDB/PDB.h" #include "llvm/Object/COFF.h" #include "llvm/Support/BinaryByteStream.h" #include "llvm/Support/Endian.h" @@ -53,8 +54,81 @@ using llvm::object::coff_section; static ExitOnError ExitOnErr; +namespace { +/// Map from type index and item index in a type server PDB to the +/// corresponding index in the destination PDB. +struct CVIndexMap { + SmallVector TPIMap; + SmallVector IPIMap; + bool IsTypeServerMap = false; +}; + +class PDBLinker { +public: + PDBLinker(SymbolTable *Symtab) + : Alloc(), Symtab(Symtab), Builder(Alloc), TypeTable(Alloc), + IDTable(Alloc) {} + + /// Emit the basic PDB structure: initial streams, headers, etc. + void initialize(const llvm::codeview::DebugInfo *DI); + + /// Link CodeView from each object file in the symbol table into the PDB. + void addObjectsToPDB(); + + /// Link CodeView from a single object file into the PDB. + void addObjectFile(ObjectFile *File); + + /// Produce a mapping from the type and item indices used in the object + /// file to those in the destination PDB. + /// + /// If the object file uses a type server PDB (compiled with /Zi), merge TPI + /// and IPI from the type server PDB and return a map for it. Each unique type + /// server PDB is merged at most once, so this may return an existing index + /// mapping. + /// + /// If the object does not use a type server PDB (compiled with /Z7), we merge + /// all the type and item records from the .debug$S stream and fill in the + /// caller-provided ObjectIndexMap. + const CVIndexMap &mergeDebugT(ObjectFile *File, CVIndexMap &ObjectIndexMap); + + const CVIndexMap &maybeMergeTypeServerPDB(ObjectFile *File, + TypeServer2Record &TS); + + /// Add the section map and section contributions to the PDB. + void addSections(ArrayRef SectionTable); + + /// Write the PDB to disk. + void commit(); + +private: + BumpPtrAllocator Alloc; + + SymbolTable *Symtab; + + pdb::PDBFileBuilder Builder; + + /// Type records that will go into the PDB TPI stream. + TypeTableBuilder TypeTable; + + /// Item records that will go into the PDB IPI stream. + TypeTableBuilder IDTable; + + /// PDBs use a single global string table for filenames in the file checksum + /// table. + DebugStringTableSubsection PDBStrTab; + + llvm::SmallString<128> NativePath; + + std::vector SectionMap; + + /// Type index mappings of type server PDBs that we've loaded so far. + std::map TypeServerIndexMappings; +}; +} + // Returns a list of all SectionChunks. -static void addSectionContribs(SymbolTable *Symtab, pdb::DbiStreamBuilder &DbiBuilder) { +static void addSectionContribs(SymbolTable *Symtab, + pdb::DbiStreamBuilder &DbiBuilder) { for (Chunk *C : Symtab->getChunks()) if (auto *SC = dyn_cast(C)) DbiBuilder.addSectionContrib(SC->File->ModuleDBI, SC->Header); @@ -96,26 +170,117 @@ static void addTypeInfo(pdb::TpiStreamBuilder &TpiBuil }); } -static void mergeDebugT(ObjectFile *File, - TypeTableBuilder &IDTable, - TypeTableBuilder &TypeTable, - SmallVectorImpl &TypeIndexMap, - pdb::PDBTypeServerHandler &Handler) { +static Optional +maybeReadTypeServerRecord(CVTypeArray &Types) { + auto I = Types.begin(); + if (I == Types.end()) + return None; + const CVType &Type = *I; + if (Type.kind() != LF_TYPESERVER2) + return None; + TypeServer2Record TS; + if (auto EC = TypeDeserializer::deserializeAs(const_cast(Type), TS)) + fatal(EC, "error reading type server record"); + return std::move(TS); +} + +const CVIndexMap &PDBLinker::mergeDebugT(ObjectFile *File, + CVIndexMap &ObjectIndexMap) { ArrayRef Data = getDebugSection(File, ".debug$T"); if (Data.empty()) - return; + return ObjectIndexMap; BinaryByteStream Stream(Data, support::little); CVTypeArray Types; BinaryStreamReader Reader(Stream); - Handler.addSearchPath(sys::path::parent_path(File->getName())); if (auto EC = Reader.readArray(Types, Reader.getLength())) fatal(EC, "Reader::readArray failed"); + + // Look through type servers. If we've already seen this type server, don't + // merge any type information. + if (Optional TS = maybeReadTypeServerRecord(Types)) + return maybeMergeTypeServerPDB(File, *TS); + + // This is a /Z7 object. Fill in the temporary, caller-provided + // ObjectIndexMap. if (auto Err = mergeTypeAndIdRecords(IDTable, TypeTable, - TypeIndexMap, &Handler, Types)) - fatal(Err, "codeview::mergeTypeStreams failed"); + ObjectIndexMap.TPIMap, Types)) + fatal(Err, "codeview::mergeTypeAndIdRecords failed"); + return ObjectIndexMap; } +static Expected> +tryToLoadPDB(const GUID &GuidFromObj, StringRef TSPath) { + std::unique_ptr ThisSession; + if (auto EC = + pdb::loadDataForPDB(pdb::PDB_ReaderType::Native, TSPath, ThisSession)) + return std::move(EC); + + std::unique_ptr NS( + static_cast(ThisSession.release())); + pdb::PDBFile &File = NS->getPDBFile(); + auto ExpectedInfo = File.getPDBInfoStream(); + // All PDB Files should have an Info stream. + if (!ExpectedInfo) + return ExpectedInfo.takeError(); + + // Just because a file with a matching name was found and it was an actual + // PDB file doesn't mean it matches. For it to match the InfoStream's GUID + // must match the GUID specified in the TypeServer2 record. + if (ExpectedInfo->getGuid() != GuidFromObj) + return make_error( + pdb::generic_error_code::type_server_not_found, TSPath); + + return std::move(NS); +} + +const CVIndexMap &PDBLinker::maybeMergeTypeServerPDB(ObjectFile *File, + TypeServer2Record &TS) { + // First, check if we already loaded a PDB with this GUID. Return the type + // index mapping if we have it. + auto Insertion = TypeServerIndexMappings.insert({TS.getGuid(), CVIndexMap()}); + CVIndexMap &IndexMap = Insertion.first->second; + if (!Insertion.second) + return IndexMap; + + // Mark this map as a type server map. + IndexMap.IsTypeServerMap = true; + + // Check for a PDB at: + // 1. The given file path + // 2. Next to the object file or archive file + auto ExpectedSession = tryToLoadPDB(TS.getGuid(), TS.getName()); + if (!ExpectedSession) { + consumeError(ExpectedSession.takeError()); + StringRef LocalPath = + !File->ParentName.empty() ? File->ParentName : File->getName(); + SmallString<128> Path = sys::path::parent_path(LocalPath); + sys::path::append( + Path, sys::path::filename(TS.getName(), sys::path::Style::windows)); + ExpectedSession = tryToLoadPDB(TS.getGuid(), Path); + } + if (auto E = ExpectedSession.takeError()) + fatal(E, "Type server PDB was not found"); + + // Merge TPI first, because the IPI stream will reference type indices. + auto ExpectedTpi = (*ExpectedSession)->getPDBFile().getPDBTpiStream(); + if (auto E = ExpectedTpi.takeError()) + fatal(E, "Type server does not have TPI stream"); + if (auto Err = mergeTypeRecords(TypeTable, IndexMap.TPIMap, + ExpectedTpi->typeArray())) + fatal(Err, "codeview::mergeTypeRecords failed"); + + // Merge IPI. + auto ExpectedIpi = (*ExpectedSession)->getPDBFile().getPDBIpiStream(); + if (auto E = ExpectedIpi.takeError()) + fatal(E, "Type server does not have TPI stream"); + if (auto Err = mergeIdRecords(IDTable, IndexMap.TPIMap, IndexMap.IPIMap, + ExpectedIpi->typeArray())) + fatal(Err, "codeview::mergeIdRecords failed"); + + return IndexMap; +} + static bool remapTypeIndex(TypeIndex &TI, ArrayRef TypeIndexMap) { if (TI.isSimple()) return true; @@ -127,16 +292,22 @@ static bool remapTypeIndex(TypeIndex &TI, ArrayRef Contents, - ArrayRef TypeIndexMap, + const CVIndexMap &IndexMap, ArrayRef TypeRefs) { for (const TiReference &Ref : TypeRefs) { unsigned ByteSize = Ref.Count * sizeof(TypeIndex); if (Contents.size() < Ref.Offset + ByteSize) fatal("symbol record too short"); + + // This can be an item index or a type index. Choose the appropriate map. + ArrayRef TypeOrItemMap = IndexMap.TPIMap; + if (Ref.Kind == TiRefKind::IndexRef && IndexMap.IsTypeServerMap) + TypeOrItemMap = IndexMap.IPIMap; + MutableArrayRef TIs( reinterpret_cast(Contents.data() + Ref.Offset), Ref.Count); for (TypeIndex &TI : TIs) { - if (!remapTypeIndex(TI, TypeIndexMap)) { + if (!remapTypeIndex(TI, TypeOrItemMap)) { TI = TypeIndex(SimpleTypeKind::NotTranslated); log("ignoring symbol record in " + File->getName() + " with bad type index 0x" + utohexstr(TI.getIndex())); @@ -241,7 +412,7 @@ static void scopeStackClose(SmallVectorImpl TypeIndexMap, + const CVIndexMap &IndexMap, BinaryStreamRef SymData) { // FIXME: Improve error recovery by warning and skipping records when // possible. @@ -264,7 +435,7 @@ static void mergeSymbolRecords(BumpPtrAllocator &Alloc // Re-map all the type index references. MutableArrayRef Contents = NewData.drop_front(sizeof(RecordPrefix)); - remapTypesInSymbolRecord(File, Contents, TypeIndexMap, TypeRefs); + remapTypesInSymbolRecord(File, Contents, IndexMap, TypeRefs); // Fill in "Parent" and "End" fields by maintaining a stack of scopes. CVSymbol NewSym(Sym.kind(), NewData); @@ -289,110 +460,105 @@ static ArrayRef relocateDebugChunk(BumpPtrAll ".debug$S"); } -// Add all object files to the PDB. Merge .debug$T sections into IpiData and -// TpiData. -static void addObjectsToPDB(BumpPtrAllocator &Alloc, SymbolTable *Symtab, - pdb::PDBFileBuilder &Builder, - TypeTableBuilder &TypeTable, - TypeTableBuilder &IDTable) { - // Follow type servers. If the same type server is encountered more than - // once for this instance of `PDBTypeServerHandler` (for example if many - // object files reference the same TypeServer), the types from the - // TypeServer will only be visited once. - pdb::PDBTypeServerHandler Handler; +void PDBLinker::addObjectFile(ObjectFile *File) { + // Add a module descriptor for every object file. We need to put an absolute + // path to the object into the PDB. If this is a plain object, we make its + // path absolute. If it's an object in an archive, we make the archive path + // absolute. + bool InArchive = !File->ParentName.empty(); + SmallString<128> Path = InArchive ? File->ParentName : File->getName(); + sys::fs::make_absolute(Path); + sys::path::native(Path, sys::path::Style::windows); + StringRef Name = InArchive ? File->getName() : StringRef(Path); - // PDBs use a single global string table for filenames in the file checksum - // table. - auto PDBStrTab = std::make_shared(); + File->ModuleDBI = &ExitOnErr(Builder.getDbiBuilder().addModuleInfo(Name)); + File->ModuleDBI->setObjFileName(Path); - // Visit all .debug$T sections to add them to Builder. - for (ObjectFile *File : Symtab->ObjectFiles) { - // Add a module descriptor for every object file. We need to put an absolute - // path to the object into the PDB. If this is a plain object, we make its - // path absolute. If it's an object in an archive, we make the archive path - // absolute. - bool InArchive = !File->ParentName.empty(); - SmallString<128> Path = InArchive ? File->ParentName : File->getName(); - sys::fs::make_absolute(Path); - sys::path::native(Path, llvm::sys::path::Style::windows); - StringRef Name = InArchive ? File->getName() : StringRef(Path); + // Before we can process symbol substreams from .debug$S, we need to process + // type information, file checksums, and the string table. Add type info to + // the PDB first, so that we can get the map from object file type and item + // indices to PDB type and item indices. + CVIndexMap ObjectIndexMap; + const CVIndexMap &IndexMap = mergeDebugT(File, ObjectIndexMap); - File->ModuleDBI = &ExitOnErr(Builder.getDbiBuilder().addModuleInfo(Name)); - File->ModuleDBI->setObjFileName(Path); + // Now do all live .debug$S sections. + for (SectionChunk *DebugChunk : File->getDebugChunks()) { + if (!DebugChunk->isLive() || DebugChunk->getSectionName() != ".debug$S") + continue; - // Before we can process symbol substreams from .debug$S, we need to process - // type information, file checksums, and the string table. Add type info to - // the PDB first, so that we can get the map from object file type and item - // indices to PDB type and item indices. - SmallVector TypeIndexMap; - mergeDebugT(File, IDTable, TypeTable, TypeIndexMap, Handler); + ArrayRef RelocatedDebugContents = + relocateDebugChunk(Alloc, DebugChunk); + if (RelocatedDebugContents.empty()) + continue; - // Now do all line info. - for (SectionChunk *DebugChunk : File->getDebugChunks()) { - if (!DebugChunk->isLive() || DebugChunk->getSectionName() != ".debug$S") - continue; + DebugSubsectionArray Subsections; + BinaryStreamReader Reader(RelocatedDebugContents, support::little); + ExitOnErr(Reader.readArray(Subsections, RelocatedDebugContents.size())); - ArrayRef RelocatedDebugContents = - relocateDebugChunk(Alloc, DebugChunk); - if (RelocatedDebugContents.empty()) - continue; - - DebugSubsectionArray Subsections; - BinaryStreamReader Reader(RelocatedDebugContents, support::little); - ExitOnErr(Reader.readArray(Subsections, RelocatedDebugContents.size())); - - DebugStringTableSubsectionRef CVStrTab; - DebugChecksumsSubsectionRef Checksums; - for (const DebugSubsectionRecord &SS : Subsections) { - switch (SS.kind()) { - case DebugSubsectionKind::StringTable: - ExitOnErr(CVStrTab.initialize(SS.getRecordData())); - break; - case DebugSubsectionKind::FileChecksums: - ExitOnErr(Checksums.initialize(SS.getRecordData())); - break; - case DebugSubsectionKind::Lines: - // We can add the relocated line table directly to the PDB without - // modification because the file checksum offsets will stay the same. - File->ModuleDBI->addDebugSubsection(SS); - break; - case DebugSubsectionKind::Symbols: - mergeSymbolRecords(Alloc, File, TypeIndexMap, SS.getRecordData()); - break; - default: - // FIXME: Process the rest of the subsections. - break; - } + DebugStringTableSubsectionRef CVStrTab; + DebugChecksumsSubsectionRef Checksums; + for (const DebugSubsectionRecord &SS : Subsections) { + switch (SS.kind()) { + case DebugSubsectionKind::StringTable: + ExitOnErr(CVStrTab.initialize(SS.getRecordData())); + break; + case DebugSubsectionKind::FileChecksums: + ExitOnErr(Checksums.initialize(SS.getRecordData())); + break; + case DebugSubsectionKind::Lines: + // We can add the relocated line table directly to the PDB without + // modification because the file checksum offsets will stay the same. + File->ModuleDBI->addDebugSubsection(SS); + break; + case DebugSubsectionKind::Symbols: + mergeSymbolRecords(Alloc, File, IndexMap, SS.getRecordData()); + break; + default: + // FIXME: Process the rest of the subsections. + break; } + } - if (Checksums.valid()) { - // Make a new file checksum table that refers to offsets in the PDB-wide - // string table. Generally the string table subsection appears after the - // checksum table, so we have to do this after looping over all the - // subsections. - if (!CVStrTab.valid()) - fatal(".debug$S sections must have both a string table subsection " - "and a checksum subsection table or neither"); - auto NewChecksums = - make_unique(*PDBStrTab); - for (FileChecksumEntry &FC : Checksums) { - StringRef FileName = ExitOnErr(CVStrTab.getString(FC.FileNameOffset)); - ExitOnErr(Builder.getDbiBuilder().addModuleSourceFile( - *File->ModuleDBI, FileName)); - NewChecksums->addChecksum(FileName, FC.Kind, FC.Checksum); - } - File->ModuleDBI->addDebugSubsection(std::move(NewChecksums)); + if (Checksums.valid()) { + // Make a new file checksum table that refers to offsets in the PDB-wide + // string table. Generally the string table subsection appears after the + // checksum table, so we have to do this after looping over all the + // subsections. + if (!CVStrTab.valid()) + fatal(".debug$S sections must have both a string table subsection " + "and a checksum subsection table or neither"); + auto NewChecksums = make_unique(PDBStrTab); + for (FileChecksumEntry &FC : Checksums) { + StringRef FileName = ExitOnErr(CVStrTab.getString(FC.FileNameOffset)); + ExitOnErr(Builder.getDbiBuilder().addModuleSourceFile(*File->ModuleDBI, + FileName)); + NewChecksums->addChecksum(FileName, FC.Kind, FC.Checksum); } + File->ModuleDBI->addDebugSubsection(std::move(NewChecksums)); } } +} - Builder.getStringTableBuilder().setStrings(*PDBStrTab); +// Add all object files to the PDB. Merge .debug$T sections into IpiData and +// TpiData. +void PDBLinker::addObjectsToPDB() { + for (ObjectFile *File : Symtab->ObjectFiles) + addObjectFile(File); + Builder.getStringTableBuilder().setStrings(PDBStrTab); + // Construct TPI stream contents. addTypeInfo(Builder.getTpiBuilder(), TypeTable); // Construct IPI stream contents. addTypeInfo(Builder.getIpiBuilder(), IDTable); + + // Add public and symbol records stream. + + // For now we don't actually write any thing useful to the publics stream, but + // the act of "getting" it also creates it lazily so that we write an empty + // stream. + (void)Builder.getPublicsBuilder(); } static void addLinkerModuleSymbols(StringRef Path, @@ -423,7 +589,7 @@ static void addLinkerModuleSymbols(StringRef Path, std::string ArgStr = llvm::join(Args, " "); EBS.Fields.push_back("cwd"); SmallString<64> cwd; - llvm::sys::fs::current_path(cwd); + sys::fs::current_path(cwd); EBS.Fields.push_back(cwd); EBS.Fields.push_back("exe"); EBS.Fields.push_back(Config->Argv[0]); @@ -442,8 +608,14 @@ static void addLinkerModuleSymbols(StringRef Path, // Creates a PDB file. void coff::createPDB(SymbolTable *Symtab, ArrayRef SectionTable, const llvm::codeview::DebugInfo *DI) { - BumpPtrAllocator Alloc; - pdb::PDBFileBuilder Builder(Alloc); + PDBLinker PDB(Symtab); + PDB.initialize(DI); + PDB.addObjectsToPDB(); + PDB.addSections(SectionTable); + PDB.commit(); +} + +void PDBLinker::initialize(const llvm::codeview::DebugInfo *DI) { ExitOnErr(Builder.initialize(4096)); // 4096 is blocksize // Create streams in MSF for predefined streams, namely @@ -455,12 +627,7 @@ void coff::createPDB(SymbolTable *Symtab, ArrayRefPDB70.Age : 0); - llvm::SmallString<128> NativePath(Config->PDBPath.begin(), - Config->PDBPath.end()); - llvm::sys::fs::make_absolute(NativePath); - llvm::sys::path::native(NativePath, llvm::sys::path::Style::windows); - - pdb::PDB_UniqueId uuid{}; + GUID uuid{}; if (DI) memcpy(&uuid, &DI->PDB70.Signature, sizeof(uuid)); InfoBuilder.setGuid(uuid); @@ -471,32 +638,25 @@ void coff::createPDB(SymbolTable *Symtab, ArrayRef SectionTable) { // Add Section Contributions. + pdb::DbiStreamBuilder &DbiBuilder = Builder.getDbiBuilder(); addSectionContribs(Symtab, DbiBuilder); // Add Section Map stream. ArrayRef Sections = { (const object::coff_section *)SectionTable.data(), SectionTable.size() / sizeof(object::coff_section)}; - std::vector SectionMap = - pdb::DbiStreamBuilder::createSectionMap(Sections); + SectionMap = pdb::DbiStreamBuilder::createSectionMap(Sections); DbiBuilder.setSectionMap(SectionMap); + // It's not entirely clear what this is, but the * Linker * module uses it. + NativePath = Config->PDBPath; + sys::fs::make_absolute(NativePath); + sys::path::native(NativePath, sys::path::Style::windows); + uint32_t PdbFilePathNI = DbiBuilder.addECName(NativePath); auto &LinkerModule = ExitOnErr(DbiBuilder.addModuleInfo("* Linker *")); LinkerModule.setPdbFilePathNI(PdbFilePathNI); addLinkerModuleSymbols(NativePath, LinkerModule, Alloc); @@ -504,7 +664,9 @@ void coff::createPDB(SymbolTable *Symtab, ArrayRefPDBPath)); } Modified: vendor/lld/dist/ELF/Arch/ARM.cpp ============================================================================== --- vendor/lld/dist/ELF/Arch/ARM.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Arch/ARM.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -40,6 +40,8 @@ class ARM final : public TargetInfo { (public) void addPltHeaderSymbols(InputSectionBase *ISD) const override; bool needsThunk(RelExpr Expr, uint32_t RelocType, const InputFile *File, const SymbolBody &S) const override; + bool inBranchRange(uint32_t RelocType, uint64_t Src, + uint64_t Dst) const override; void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override; }; } // namespace @@ -216,6 +218,49 @@ bool ARM::needsThunk(RelExpr Expr, uint32_t RelocType, break; } return false; +} + +bool ARM::inBranchRange(uint32_t RelocType, uint64_t Src, uint64_t Dst) const { + uint64_t Range; + uint64_t InstrSize; + + switch (RelocType) { + case R_ARM_PC24: + case R_ARM_PLT32: + case R_ARM_JUMP24: + case R_ARM_CALL: + Range = 0x2000000; + InstrSize = 4; + break; + case R_ARM_THM_JUMP19: + Range = 0x100000; + InstrSize = 2; + break; + case R_ARM_THM_JUMP24: + case R_ARM_THM_CALL: + Range = 0x1000000; + InstrSize = 2; + break; + default: + return true; + } + // PC at Src is 2 instructions ahead, immediate of branch is signed + if (Src > Dst) + Range -= 2 * InstrSize; + else + Range += InstrSize; + + if ((Dst & 0x1) == 0) + // Destination is ARM, if ARM caller then Src is already 4-byte aligned. + // If Thumb Caller (BLX) the Src address has bottom 2 bits cleared to ensure + // destination will be 4 byte aligned. + Src &= ~0x3; + else + // Bit 0 == 1 denotes Thumb state, it is not part of the range + Dst &= ~0x1; + + uint64_t Distance = (Src > Dst) ? Src - Dst : Dst - Src; + return Distance <= Range; } void ARM::relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const { Modified: vendor/lld/dist/ELF/Arch/MipsArchTree.cpp ============================================================================== --- vendor/lld/dist/ELF/Arch/MipsArchTree.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Arch/MipsArchTree.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -37,7 +37,7 @@ struct FileFlags { StringRef Filename; uint32_t Flags; }; -} +} // namespace static StringRef getAbiName(uint32_t Flags) { switch (Flags) { @@ -337,8 +337,8 @@ uint8_t elf::getMipsFpAbiFlag(uint8_t OldFlag, uint8_t return NewFlag; if (compareMipsFpAbi(OldFlag, NewFlag) < 0) error("target floating point ABI '" + getMipsFpAbiName(OldFlag) + - "' is incompatible with '" + getMipsFpAbiName(NewFlag) + "': " + - FileName); + "' is incompatible with '" + getMipsFpAbiName(NewFlag) + + "': " + FileName); return OldFlag; } Modified: vendor/lld/dist/ELF/Config.h ============================================================================== --- vendor/lld/dist/ELF/Config.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Config.h Wed Jul 19 07:02:58 2017 (r321192) @@ -99,6 +99,7 @@ struct Configuration { std::vector VersionDefinitions; std::vector Argv; std::vector AuxiliaryList; + std::vector FilterList; std::vector SearchPaths; std::vector SymbolOrderingFile; std::vector Undefined; Modified: vendor/lld/dist/ELF/Driver.cpp ============================================================================== --- vendor/lld/dist/ELF/Driver.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Driver.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -259,6 +259,9 @@ static void checkOptions(opt::InputArgList &Args) { if (Config->Pie && Config->Shared) error("-shared and -pie may not be used together"); + if (!Config->Shared && !Config->FilterList.empty()) + error("-F may not be used without -shared"); + if (!Config->Shared && !Config->AuxiliaryList.empty()) error("-f may not be used without -shared"); @@ -631,6 +634,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args getArg(Args, OPT_export_dynamic, OPT_no_export_dynamic, false); Config->FatalWarnings = getArg(Args, OPT_fatal_warnings, OPT_no_fatal_warnings, false); + Config->FilterList = getArgs(Args, OPT_filter); Config->Fini = Args.getLastArgValue(OPT_fini, "_fini"); Config->GcSections = getArg(Args, OPT_gc_sections, OPT_no_gc_sections, false); Config->GdbIndex = Args.hasArg(OPT_gdb_index); Modified: vendor/lld/dist/ELF/EhFrame.h ============================================================================== --- vendor/lld/dist/ELF/EhFrame.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/EhFrame.h Wed Jul 19 07:02:58 2017 (r321192) @@ -19,7 +19,7 @@ struct EhSectionPiece; template size_t readEhRecordSize(InputSectionBase *S, size_t Off); template uint8_t getFdeEncoding(EhSectionPiece *P); -} -} +} // namespace elf +} // namespace lld #endif Modified: vendor/lld/dist/ELF/Filesystem.h ============================================================================== --- vendor/lld/dist/ELF/Filesystem.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Filesystem.h Wed Jul 19 07:02:58 2017 (r321192) @@ -16,7 +16,7 @@ namespace lld { namespace elf { void unlinkAsync(StringRef Path); std::error_code tryCreateFile(StringRef Path); -} -} +} // namespace elf +} // namespace lld #endif Modified: vendor/lld/dist/ELF/GdbIndex.h ============================================================================== --- vendor/lld/dist/ELF/GdbIndex.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/GdbIndex.h Wed Jul 19 07:02:58 2017 (r321192) @@ -11,8 +11,8 @@ #define LLD_ELF_GDB_INDEX_H #include "InputFiles.h" -#include "llvm/Object/ELF.h" #include "llvm/DebugInfo/DWARF/DWARFContext.h" +#include "llvm/Object/ELF.h" namespace lld { namespace elf { Modified: vendor/lld/dist/ELF/ICF.h ============================================================================== --- vendor/lld/dist/ELF/ICF.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/ICF.h Wed Jul 19 07:02:58 2017 (r321192) @@ -14,6 +14,6 @@ namespace lld { namespace elf { template void doIcf(); } -} +} // namespace lld #endif Modified: vendor/lld/dist/ELF/InputFiles.h ============================================================================== --- vendor/lld/dist/ELF/InputFiles.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/InputFiles.h Wed Jul 19 07:02:58 2017 (r321192) @@ -11,8 +11,8 @@ #define LLD_ELF_INPUT_FILES_H #include "Config.h" -#include "InputSection.h" #include "Error.h" +#include "InputSection.h" #include "Symbols.h" #include "lld/Core/LLVM.h" @@ -34,7 +34,7 @@ struct DILineInfo; namespace lto { class InputFile; } -} +} // namespace llvm namespace lld { namespace elf { Modified: vendor/lld/dist/ELF/LTO.h ============================================================================== --- vendor/lld/dist/ELF/LTO.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/LTO.h Wed Jul 19 07:02:58 2017 (r321192) @@ -30,7 +30,7 @@ namespace llvm { namespace lto { class LTO; } -} +} // namespace llvm namespace lld { namespace elf { @@ -51,7 +51,7 @@ class BitcodeCompiler { (private) std::vector> Buff; std::vector> Files; }; -} -} +} // namespace elf +} // namespace lld #endif Modified: vendor/lld/dist/ELF/LinkerScript.cpp ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/LinkerScript.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -229,6 +229,19 @@ bool LinkerScript::shouldKeep(InputSectionBase *S) { return false; } +// If an input string is in the form of "foo.N" where N is a number, +// return N. Otherwise, returns 65536, which is one greater than the +// lowest priority. +static int getPriority(StringRef S) { + size_t Pos = S.rfind('.'); + if (Pos == StringRef::npos) + return 65536; + int V; + if (!to_integer(S.substr(Pos + 1), V, 10)) + return 65536; + return V; +} + // A helper function for the SORT() command. static std::function getComparator(SortSectionPolicy K) { @@ -449,7 +462,7 @@ void LinkerScript::fabricateDefaultCommands() { // The Sections with -T
have been sorted in order of ascending // address. We must lower StartAddr if the lowest -T
as // calls to setDot() must be monotonically increasing. - for (auto& KV : Config->SectionStartMap) + for (auto &KV : Config->SectionStartMap) StartAddr = std::min(StartAddr, KV.second); Commands.push_back(make( @@ -739,7 +752,7 @@ void LinkerScript::adjustSectionsAfterSorting() { Cmd->MemRegion = findMemoryRegion(Cmd); // Handle align (e.g. ".foo : ALIGN(16) { ... }"). if (Cmd->AlignExpr) - Cmd->Sec->updateAlignment(Cmd->AlignExpr().getValue()); + Cmd->Sec->updateAlignment(Cmd->AlignExpr().getValue()); } } @@ -1071,7 +1084,7 @@ template void OutputSectionCommand::final } if ((Sec->Flags & SHF_LINK_ORDER)) { - std::sort(Sections.begin(), Sections.end(), compareByFilePosition); + std::stable_sort(Sections.begin(), Sections.end(), compareByFilePosition); for (int I = 0, N = Sections.size(); I < N; ++I) *ScriptSections[I] = Sections[I]; Modified: vendor/lld/dist/ELF/MapFile.cpp ============================================================================== --- vendor/lld/dist/ELF/MapFile.cpp Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/MapFile.cpp Wed Jul 19 07:02:58 2017 (r321192) @@ -55,7 +55,7 @@ template std::vector ge for (SymbolBody *B : File->getSymbols()) if (B->File == File && !B->isSection()) if (auto *Sym = dyn_cast(B)) - if (Sym->Section) + if (Sym->Section && Sym->Section->Live) V.push_back(Sym); return V; } Modified: vendor/lld/dist/ELF/MapFile.h ============================================================================== --- vendor/lld/dist/ELF/MapFile.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/MapFile.h Wed Jul 19 07:02:58 2017 (r321192) @@ -17,7 +17,7 @@ namespace elf { struct OutputSectionCommand; template void writeMapFile(llvm::ArrayRef Script); -} -} +} // namespace elf +} // namespace lld #endif Modified: vendor/lld/dist/ELF/Memory.h ============================================================================== --- vendor/lld/dist/ELF/Memory.h Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Memory.h Wed Jul 19 07:02:58 2017 (r321192) @@ -61,7 +61,7 @@ inline void freeArena() { Alloc->reset(); BAlloc.Reset(); } -} -} +} // namespace elf +} // namespace lld #endif Modified: vendor/lld/dist/ELF/Options.td ============================================================================== --- vendor/lld/dist/ELF/Options.td Wed Jul 19 07:02:53 2017 (r321191) +++ vendor/lld/dist/ELF/Options.td Wed Jul 19 07:02:58 2017 (r321192) @@ -104,6 +104,8 @@ def export_dynamic_symbol: S<"export-dynamic-symbol">, def fatal_warnings: F<"fatal-warnings">, HelpText<"Treat warnings as errors">; +def filter: J<"filter=">, HelpText<"Set DT_FILTER field to the specified name">; + def fini: S<"fini">, MetaVarName<"">, HelpText<"Specify a finalizer function">; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Wed Jul 19 07:03:05 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 757FDDAAD4D; Wed, 19 Jul 2017 07:03:05 +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 276616E5AE; Wed, 19 Jul 2017 07:03:05 +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 v6J734xc091198; Wed, 19 Jul 2017 07:03:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J7341T091197; Wed, 19 Jul 2017 07:03:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190703.v6J7341T091197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321193 - vendor/lld/lld-trunk-r308421 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lld/lld-trunk-r308421 X-SVN-Commit-Revision: 321193 X-SVN-Commit-Repository: base 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, 19 Jul 2017 07:03:05 -0000 Author: dim Date: Wed Jul 19 07:03:04 2017 New Revision: 321193 URL: https://svnweb.freebsd.org/changeset/base/321193 Log: Tag lld trunk r308421. Added: vendor/lld/lld-trunk-r308421/ - copied from r321192, vendor/lld/dist/ From owner-svn-src-vendor@freebsd.org Wed Jul 19 07:03:13 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 8F6E9DAADFB; Wed, 19 Jul 2017 07:03:13 +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 354EB6E6A2; Wed, 19 Jul 2017 07:03:13 +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 v6J73C1c091291; Wed, 19 Jul 2017 07:03:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J738eZ091248; Wed, 19 Jul 2017 07:03:08 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190703.v6J738eZ091248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321194 - in vendor/lldb/dist: cmake/modules include/lldb include/lldb/Host include/lldb/Host/common include/lldb/Interpreter include/lldb/Utility packages/Python/lldbsuite/test/express... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lldb/dist: cmake/modules include/lldb include/lldb/Host include/lldb/Host/common include/lldb/Interpreter include/lldb/Utility packages/Python/lldbsuite/test/expression_command/unwind_expres... X-SVN-Commit-Revision: 321194 X-SVN-Commit-Repository: base 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, 19 Jul 2017 07:03:13 -0000 Author: dim Date: Wed Jul 19 07:03:07 2017 New Revision: 321194 URL: https://svnweb.freebsd.org/changeset/base/321194 Log: Vendor import of lldb trunk r308421: https://llvm.org/svn/llvm-project/lldb/trunk@308421 Deleted: vendor/lldb/dist/tools/debugserver/source/MacOSX/i386/CMakeLists.txt vendor/lldb/dist/tools/debugserver/source/MacOSX/x86_64/CMakeLists.txt Modified: vendor/lldb/dist/cmake/modules/LLDBConfig.cmake vendor/lldb/dist/cmake/modules/LLDBStandalone.cmake vendor/lldb/dist/include/lldb/Host/MainLoop.h vendor/lldb/dist/include/lldb/Host/PosixApi.h vendor/lldb/dist/include/lldb/Host/SocketAddress.h vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h vendor/lldb/dist/include/lldb/Host/common/NativeThreadProtocol.h vendor/lldb/dist/include/lldb/Interpreter/CommandInterpreter.h vendor/lldb/dist/include/lldb/Utility/DataExtractor.h vendor/lldb/dist/include/lldb/lldb-private-forward.h vendor/lldb/dist/include/lldb/lldb-types.h vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py vendor/lldb/dist/source/Host/CMakeLists.txt vendor/lldb/dist/source/Host/common/File.cpp vendor/lldb/dist/source/Host/common/Host.cpp vendor/lldb/dist/source/Host/common/MainLoop.cpp vendor/lldb/dist/source/Host/common/NativeRegisterContext.cpp vendor/lldb/dist/source/Host/common/NativeThreadProtocol.cpp vendor/lldb/dist/source/Host/common/Socket.cpp vendor/lldb/dist/source/Host/common/SocketAddress.cpp vendor/lldb/dist/source/Host/common/TCPSocket.cpp vendor/lldb/dist/source/Host/linux/Host.cpp vendor/lldb/dist/source/Host/linux/HostInfoLinux.cpp vendor/lldb/dist/source/Host/posix/ConnectionFileDescriptorPosix.cpp vendor/lldb/dist/source/Host/posix/FileSystem.cpp vendor/lldb/dist/source/Host/posix/HostProcessPosix.cpp vendor/lldb/dist/source/Host/posix/LockFilePosix.cpp vendor/lldb/dist/source/Host/posix/ProcessLauncherPosixFork.cpp vendor/lldb/dist/source/Interpreter/CommandInterpreter.cpp vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h vendor/lldb/dist/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.h vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.h vendor/lldb/dist/source/Plugins/Process/Linux/ProcessorTrace.h vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp vendor/lldb/dist/source/Target/Target.cpp vendor/lldb/dist/test/CMakeLists.txt vendor/lldb/dist/tools/debugserver/CMakeLists.txt vendor/lldb/dist/tools/debugserver/source/CMakeLists.txt vendor/lldb/dist/tools/debugserver/source/MacOSX/CMakeLists.txt vendor/lldb/dist/tools/debugserver/source/MacOSX/DarwinLog/CMakeLists.txt vendor/lldb/dist/tools/debugserver/source/RNBSocket.cpp vendor/lldb/dist/tools/driver/Driver.cpp vendor/lldb/dist/tools/lldb-mi/MICmnLLDBDebugger.cpp vendor/lldb/dist/tools/lldb-mi/MIDriver.cpp vendor/lldb/dist/tools/lldb-mi/MIDriverMain.cpp vendor/lldb/dist/tools/lldb-server/lldb-gdbserver.cpp vendor/lldb/dist/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp vendor/lldb/dist/unittests/debugserver/RNBSocketTest.cpp Modified: vendor/lldb/dist/cmake/modules/LLDBConfig.cmake ============================================================================== --- vendor/lldb/dist/cmake/modules/LLDBConfig.cmake Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/cmake/modules/LLDBConfig.cmake Wed Jul 19 07:03:07 2017 (r321194) @@ -10,17 +10,22 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_S set(LLDB_LINKER_SUPPORTS_GROUPS ON) endif() +set(LLDB_DEFAULT_DISABLE_PYTHON 0) +set(LLDB_DEFAULT_DISABLE_CURSES 0) + if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - set(LLDB_DEFAULT_DISABLE_PYTHON 0) set(LLDB_DEFAULT_DISABLE_CURSES 1) elseif (CMAKE_SYSTEM_NAME MATCHES "Android" ) set(LLDB_DEFAULT_DISABLE_PYTHON 1) set(LLDB_DEFAULT_DISABLE_CURSES 1) -else() - set(LLDB_DEFAULT_DISABLE_PYTHON 0) - set(LLDB_DEFAULT_DISABLE_CURSES 0) +elseif(IOS) + set(LLDB_DEFAULT_DISABLE_PYTHON 1) endif() +if(IOS) + add_definitions(-DNO_XPC_SERVICES) +endif() + set(LLDB_DISABLE_PYTHON ${LLDB_DEFAULT_DISABLE_PYTHON} CACHE BOOL "Disables the Python scripting integration.") set(LLDB_DISABLE_CURSES ${LLDB_DEFAULT_DISABLE_CURSES} CACHE BOOL @@ -298,13 +303,15 @@ if (NOT LIBXML2_FOUND AND NOT (CMAKE_SYSTEM_NAME MATCH endif() # Find libraries or frameworks that may be needed -if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - find_library(CARBON_LIBRARY Carbon) +if (APPLE) + if(NOT IOS) + find_library(CARBON_LIBRARY Carbon) + find_library(CORE_SERVICES_LIBRARY CoreServices) + find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks") + endif() find_library(FOUNDATION_LIBRARY Foundation) find_library(CORE_FOUNDATION_LIBRARY CoreFoundation) - find_library(CORE_SERVICES_LIBRARY CoreServices) find_library(SECURITY_LIBRARY Security) - find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks") set(LLDB_FRAMEWORK_INSTALL_DIR Library/Frameworks CACHE STRING "Output directory for LLDB.framework") set(LLDB_FRAMEWORK_VERSION A CACHE STRING "LLDB.framework version (default is A)") @@ -312,10 +319,13 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin") LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Resources) add_definitions( -DLIBXML2_DEFINED ) - list(APPEND system_libs xml2 ${CURSES_LIBRARIES}) - list(APPEND system_libs ${CARBON_LIBRARY} ${FOUNDATION_LIBRARY} - ${CORE_FOUNDATION_LIBRARY} ${CORE_SERVICES_LIBRARY} ${SECURITY_LIBRARY} - ${DEBUG_SYMBOLS_LIBRARY}) + list(APPEND system_libs xml2 + ${CURSES_LIBRARIES} + ${FOUNDATION_LIBRARY} + ${CORE_FOUNDATION_LIBRARY} + ${CORE_SERVICES_LIBRARY} + ${SECURITY_LIBRARY} + ${DEBUG_SYMBOLS_LIBRARY}) else() if (LIBXML2_FOUND) Modified: vendor/lldb/dist/cmake/modules/LLDBStandalone.cmake ============================================================================== --- vendor/lldb/dist/cmake/modules/LLDBStandalone.cmake Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/cmake/modules/LLDBStandalone.cmake Wed Jul 19 07:03:07 2017 (r321194) @@ -2,7 +2,6 @@ # standalone project, using LLVM as an external library: if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) project(lldb) - cmake_minimum_required(VERSION 2.8.12.2) if (POLICY CMP0022) cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required Modified: vendor/lldb/dist/include/lldb/Host/MainLoop.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/MainLoop.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Host/MainLoop.h Wed Jul 19 07:03:07 2017 (r321194) @@ -12,8 +12,8 @@ #include "lldb/Host/Config.h" #include "lldb/Host/MainLoopBase.h" - #include "llvm/ADT/DenseMap.h" +#include #if !HAVE_PPOLL && !HAVE_SYS_EVENT_H #define SIGNAL_POLLING_UNSUPPORTED 1 Modified: vendor/lldb/dist/include/lldb/Host/PosixApi.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/PosixApi.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Host/PosixApi.h Wed Jul 19 07:03:07 2017 (r321194) @@ -16,6 +16,8 @@ #if defined(_WIN32) #include "lldb/Host/windows/PosixApi.h" +#else +#include #endif #endif Modified: vendor/lldb/dist/include/lldb/Host/SocketAddress.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/SocketAddress.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Host/SocketAddress.h Wed Jul 19 07:03:07 2017 (r321194) @@ -152,6 +152,11 @@ class SocketAddress { (public) bool IsAnyAddr() const; //------------------------------------------------------------------ + // Returns true if the socket is INADDR_LOOPBACK + //------------------------------------------------------------------ + bool IsLocalhost() const; + + //------------------------------------------------------------------ // Direct access to all of the sockaddr structures //------------------------------------------------------------------ struct sockaddr &sockaddr() { Modified: vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h Wed Jul 19 07:03:07 2017 (r321194) @@ -33,8 +33,7 @@ class ResumeActionList; //------------------------------------------------------------------ // NativeProcessProtocol //------------------------------------------------------------------ -class NativeProcessProtocol - : public std::enable_shared_from_this { +class NativeProcessProtocol { friend class SoftwareBreakpoint; public: @@ -268,7 +267,7 @@ class NativeProcessProtocol (public) /// A NativeProcessProtocol shared pointer if the operation succeeded or /// an error object if it failed. //------------------------------------------------------------------ - virtual llvm::Expected + virtual llvm::Expected> Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate, MainLoop &mainloop) const = 0; @@ -292,7 +291,7 @@ class NativeProcessProtocol (public) /// A NativeProcessProtocol shared pointer if the operation succeeded or /// an error object if it failed. //------------------------------------------------------------------ - virtual llvm::Expected + virtual llvm::Expected> Attach(lldb::pid_t pid, NativeDelegate &native_delegate, MainLoop &mainloop) const = 0; }; Modified: vendor/lldb/dist/include/lldb/Host/common/NativeThreadProtocol.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/common/NativeThreadProtocol.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Host/common/NativeThreadProtocol.h Wed Jul 19 07:03:07 2017 (r321194) @@ -23,7 +23,7 @@ namespace lldb_private { class NativeThreadProtocol : public std::enable_shared_from_this { public: - NativeThreadProtocol(NativeProcessProtocol *process, lldb::tid_t tid); + NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid); virtual ~NativeThreadProtocol() {} @@ -46,7 +46,7 @@ class NativeThreadProtocol (public) lldb::tid_t GetID() const { return m_tid; } - NativeProcessProtocolSP GetProcess(); + NativeProcessProtocol &GetProcess() { return m_process; } // --------------------------------------------------------------------- // Thread-specific watchpoints @@ -64,7 +64,7 @@ class NativeThreadProtocol (public) virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr) = 0; protected: - NativeProcessProtocolWP m_process_wp; + NativeProcessProtocol &m_process; lldb::tid_t m_tid; }; } Modified: vendor/lldb/dist/include/lldb/Interpreter/CommandInterpreter.h ============================================================================== --- vendor/lldb/dist/include/lldb/Interpreter/CommandInterpreter.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Interpreter/CommandInterpreter.h Wed Jul 19 07:03:07 2017 (r321194) @@ -539,7 +539,7 @@ class CommandInterpreter : public Broadcaster, (privat std::string m_repeat_command; // Stores the command that will be executed for // an empty command string. lldb::ScriptInterpreterSP m_script_interpreter_sp; - std::mutex m_script_interpreter_mutex; + std::recursive_mutex m_script_interpreter_mutex; lldb::IOHandlerSP m_command_io_handler_sp; char m_comment_char; bool m_batch_command_mode; Modified: vendor/lldb/dist/include/lldb/Utility/DataExtractor.h ============================================================================== --- vendor/lldb/dist/include/lldb/Utility/DataExtractor.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/Utility/DataExtractor.h Wed Jul 19 07:03:07 2017 (r321194) @@ -15,6 +15,7 @@ #include "lldb/lldb-forward.h" // for DataBufferSP #include "lldb/lldb-types.h" +#include #include #include Modified: vendor/lldb/dist/include/lldb/lldb-private-forward.h ============================================================================== --- vendor/lldb/dist/include/lldb/lldb-private-forward.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/lldb-private-forward.h Wed Jul 19 07:03:07 2017 (r321194) @@ -30,10 +30,6 @@ class UnixSignals; // SP/WP decls. // --------------------------------------------------------------- typedef std::shared_ptr NativeBreakpointSP; -typedef std::shared_ptr - NativeProcessProtocolSP; -typedef std::weak_ptr - NativeProcessProtocolWP; typedef std::shared_ptr NativeRegisterContextSP; typedef std::shared_ptr Modified: vendor/lldb/dist/include/lldb/lldb-types.h ============================================================================== --- vendor/lldb/dist/include/lldb/lldb-types.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/include/lldb/lldb-types.h Wed Jul 19 07:03:07 2017 (r321194) @@ -13,16 +13,10 @@ #include "lldb/lldb-enumerations.h" #include "lldb/lldb-forward.h" -#include -#include #include //---------------------------------------------------------------------- // All host systems must define: -// lldb::condition_t The native condition type (or a substitute class) -// for conditions on the host system. -// lldb::mutex_t The native mutex type for mutex objects on the host -// system. // lldb::thread_t The native thread type for spawned threads on the // system // lldb::thread_arg_t The type of the one any only thread creation @@ -34,32 +28,22 @@ // #define LLDB_INVALID_PROCESS_ID ... // #define LLDB_INVALID_THREAD_ID ... // #define LLDB_INVALID_HOST_THREAD ... -// #define IS_VALID_LLDB_HOST_THREAD ... //---------------------------------------------------------------------- // TODO: Add a bunch of ifdefs to determine the host system and what // things should be defined. Currently MacOSX is being assumed by default // since that is what lldb was first developed for. -#ifndef _MSC_VER -#include -#include -#endif - #ifdef _WIN32 #include namespace lldb { -typedef void *mutex_t; -typedef void *condition_t; typedef void *rwlock_t; typedef void *process_t; // Process type is HANDLE typedef void *thread_t; // Host thread type typedef void *file_t; // Host file type -typedef void *pipe_t; // Host pipe type typedef unsigned int __w64 socket_t; // Host socket type -typedef uint32_t thread_key_t; typedef void *thread_arg_t; // Host thread argument type typedef unsigned thread_result_t; // Host thread result type typedef thread_result_t (*thread_func_t)(void *); // Host thread function type @@ -73,15 +57,11 @@ namespace lldb { //---------------------------------------------------------------------- // MacOSX Types //---------------------------------------------------------------------- -typedef ::pthread_mutex_t mutex_t; -typedef pthread_cond_t condition_t; typedef pthread_rwlock_t rwlock_t; typedef uint64_t process_t; // Process type is just a pid. typedef pthread_t thread_t; // Host thread type typedef int file_t; // Host file type -typedef int pipe_t; // Host pipe type typedef int socket_t; // Host socket type -typedef pthread_key_t thread_key_t; typedef void *thread_arg_t; // Host thread argument type typedef void *thread_result_t; // Host thread result type typedef void *(*thread_func_t)(void *); // Host thread function type @@ -100,10 +80,6 @@ typedef bool (*ExpressionCancelCallback)(ExpressionEva #define LLDB_INVALID_PROCESS ((lldb::process_t)-1) #define LLDB_INVALID_HOST_THREAD ((lldb::thread_t)NULL) -#define IS_VALID_LLDB_HOST_THREAD(t) ((t) != LLDB_INVALID_HOST_THREAD) - -#define LLDB_INVALID_HOST_TIME \ - { 0, 0 } namespace lldb { typedef uint64_t addr_t; Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py Wed Jul 19 07:03:07 2017 (r321194) @@ -23,32 +23,8 @@ class UnwindFromExpressionTest(TestBase): def build_and_run_to_bkpt(self): self.build() - exe = os.path.join(os.getcwd(), "a.out") - - target = self.dbg.CreateTarget(exe) - self.assertTrue(target, VALID_TARGET) - - # Create the breakpoint. - breakpoint = target.BreakpointCreateBySourceRegex( - "// Set a breakpoint here to get started", self.main_spec) - self.assertTrue(breakpoint, VALID_BREAKPOINT) - - # Launch the process, and do not stop at the entry point. - process = target.LaunchSimple( - None, None, self.get_process_working_directory()) - - if not process: - self.fail("SBTarget.LaunchProcess() failed") - - if process.GetState() != lldb.eStateStopped: - self.fail("Process should be in the 'stopped' state, " - "instead the actual state is: '%s'" % - lldbutil.state_type_to_str(process.GetState())) - - self.thread = lldbutil.get_one_thread_stopped_at_breakpoint( - process, breakpoint) - self.assertIsNotNone( - self.thread, "Expected one thread to be stopped at the breakpoint") + (target, process, self.thread, bkpt) = lldbutil.run_to_source_breakpoint(self, + "// Set a breakpoint here to get started", self.main_spec) # Next set a breakpoint in this function, set up Expression options to stop on # breakpoint hits, and call the function. Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py Wed Jul 19 07:03:07 2017 (r321194) @@ -30,46 +30,13 @@ class BadAddressBreakpointTestCase(TestBase): def address_breakpoints(self): """Test that breakpoints set on a bad address say they are bad.""" - exe = os.path.join(os.getcwd(), "a.out") - # Create a target by the debugger. - target = self.dbg.CreateTarget(exe) - self.assertTrue(target, VALID_TARGET) + (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self, + "Set a breakpoint here", lldb.SBFileSpec("main.c")) - # Now create a breakpoint on main.c by name 'c'. - breakpoint = target.BreakpointCreateBySourceRegex( - "Set a breakpoint here", lldb.SBFileSpec("main.c")) - self.assertTrue(breakpoint and - breakpoint.GetNumLocations() == 1, - VALID_BREAKPOINT) - - # Get the breakpoint location from breakpoint after we verified that, - # indeed, it has one location. - location = breakpoint.GetLocationAtIndex(0) - self.assertTrue(location and - location.IsEnabled(), - VALID_BREAKPOINT_LOCATION) - - launch_info = lldb.SBLaunchInfo(None) - - error = lldb.SBError() - - process = target.Launch(launch_info, error) - self.assertTrue(process, PROCESS_IS_VALID) - - # Did we hit our breakpoint? - from lldbsuite.test.lldbutil import get_threads_stopped_at_breakpoint - threads = get_threads_stopped_at_breakpoint(process, breakpoint) - self.assertTrue( - len(threads) == 1, - "There should be a thread stopped at our breakpoint") - - # The hit count for the breakpoint should be 1. - self.assertTrue(breakpoint.GetHitCount() == 1) - # Now see if we can read from 0. If I can't do that, I don't have a good way to know # what an illegal address is... - error.Clear() + error = lldb.SBError() ptr = process.ReadPointerFromMemory(0x0, error) Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py Wed Jul 19 07:03:07 2017 (r321194) @@ -18,29 +18,9 @@ class ConsecutiveBreakpointsTestCase(TestBase): def prepare_test(self): self.build() - exe = os.path.join(os.getcwd(), "a.out") - # Create a target by the debugger. - self.target = self.dbg.CreateTarget(exe) - self.assertTrue(self.target, VALID_TARGET) - - breakpoint1 = self.target.BreakpointCreateBySourceRegex( - "Set breakpoint here", lldb.SBFileSpec("main.cpp")) - self.assertTrue( - breakpoint1 and breakpoint1.GetNumLocations() == 1, - VALID_BREAKPOINT) - - # Now launch the process, and do not stop at entry point. - self.process = self.target.LaunchSimple( - None, None, self.get_process_working_directory()) - self.assertIsNotNone(self.process, PROCESS_IS_VALID) - - # We should be stopped at the first breakpoint - self.thread = lldbutil.get_one_thread_stopped_at_breakpoint( - self.process, breakpoint1) - self.assertIsNotNone( - self.thread, - "Expected one thread to be stopped at breakpoint 1") + (self.target, self.process, self.thread, bkpt) = lldbutil.run_to_source_breakpoint( + self, "Set breakpoint here", lldb.SBFileSpec("main.cpp")) # Set breakpoint to the next instruction frame = self.thread.GetFrameAtIndex(0) Modified: vendor/lldb/dist/source/Host/CMakeLists.txt ============================================================================== --- vendor/lldb/dist/source/Host/CMakeLists.txt Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/CMakeLists.txt Wed Jul 19 07:03:07 2017 (r321194) @@ -103,6 +103,10 @@ else() macosx/cfcpp/CFCMutableSet.cpp macosx/cfcpp/CFCString.cpp ) + if(IOS) + set_property(SOURCE macosx/Host.mm APPEND PROPERTY + COMPILE_DEFINITIONS "NO_XPC_SERVICES=1") + endif() elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android") Modified: vendor/lldb/dist/source/Host/common/File.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/File.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/File.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -21,6 +21,7 @@ #include #include #include +#include #endif #include "llvm/Support/ConvertUTF.h" Modified: vendor/lldb/dist/source/Host/common/Host.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/Host.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/Host.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -46,6 +46,7 @@ #endif // C++ Includes +#include // Other libraries and framework includes // Project includes Modified: vendor/lldb/dist/source/Host/common/MainLoop.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/MainLoop.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/MainLoop.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -10,6 +10,7 @@ #include "llvm/Config/llvm-config.h" #include "lldb/Host/MainLoop.h" +#include "lldb/Host/PosixApi.h" #include "lldb/Utility/Status.h" #include #include Modified: vendor/lldb/dist/source/Host/common/NativeRegisterContext.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/NativeRegisterContext.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/NativeRegisterContext.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -345,17 +345,12 @@ Status NativeRegisterContext::ReadRegisterValueFromMem return error; } - NativeProcessProtocolSP process_sp(m_thread.GetProcess()); - if (!process_sp) { - error.SetErrorString("invalid process"); - return error; - } - + NativeProcessProtocol &process = m_thread.GetProcess(); uint8_t src[RegisterValue::kMaxRegisterByteSize]; // Read the memory size_t bytes_read; - error = process_sp->ReadMemory(src_addr, src, src_len, bytes_read); + error = process.ReadMemory(src_addr, src, src_len, bytes_read); if (error.Fail()) return error; @@ -374,7 +369,7 @@ Status NativeRegisterContext::ReadRegisterValueFromMem // order of the memory data doesn't match the process. For now we are assuming // they are the same. lldb::ByteOrder byte_order; - if (!process_sp->GetByteOrder(byte_order)) { + if (process.GetByteOrder(byte_order)) { error.SetErrorString("NativeProcessProtocol::GetByteOrder () failed"); return error; } @@ -392,41 +387,37 @@ Status NativeRegisterContext::WriteRegisterValueToMemo Status error; - NativeProcessProtocolSP process_sp(m_thread.GetProcess()); - if (process_sp) { + NativeProcessProtocol &process = m_thread.GetProcess(); - // TODO: we might need to add a parameter to this function in case the byte - // order of the memory data doesn't match the process. For now we are - // assuming - // they are the same. - lldb::ByteOrder byte_order; - if (!process_sp->GetByteOrder(byte_order)) - return Status("NativeProcessProtocol::GetByteOrder () failed"); + // TODO: we might need to add a parameter to this function in case the byte + // order of the memory data doesn't match the process. For now we are + // assuming + // they are the same. + lldb::ByteOrder byte_order; + if (!process.GetByteOrder(byte_order)) + return Status("NativeProcessProtocol::GetByteOrder () failed"); - const size_t bytes_copied = - reg_value.GetAsMemoryData(reg_info, dst, dst_len, byte_order, error); + const size_t bytes_copied = + reg_value.GetAsMemoryData(reg_info, dst, dst_len, byte_order, error); - if (error.Success()) { - if (bytes_copied == 0) { - error.SetErrorString("byte copy failed."); - } else { - size_t bytes_written; - error = - process_sp->WriteMemory(dst_addr, dst, bytes_copied, bytes_written); - if (error.Fail()) - return error; + if (error.Success()) { + if (bytes_copied == 0) { + error.SetErrorString("byte copy failed."); + } else { + size_t bytes_written; + error = process.WriteMemory(dst_addr, dst, bytes_copied, bytes_written); + if (error.Fail()) + return error; - if (bytes_written != bytes_copied) { - // This might happen if we read _some_ bytes but not all - error.SetErrorStringWithFormat("only wrote %" PRIu64 " of %" PRIu64 - " bytes", - static_cast(bytes_written), - static_cast(bytes_copied)); - } + if (bytes_written != bytes_copied) { + // This might happen if we read _some_ bytes but not all + error.SetErrorStringWithFormat("only wrote %" PRIu64 " of %" PRIu64 + " bytes", + static_cast(bytes_written), + static_cast(bytes_copied)); } } - } else - error.SetErrorString("invalid process"); + } return error; } Modified: vendor/lldb/dist/source/Host/common/NativeThreadProtocol.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/NativeThreadProtocol.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/NativeThreadProtocol.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -16,9 +16,9 @@ using namespace lldb; using namespace lldb_private; -NativeThreadProtocol::NativeThreadProtocol(NativeProcessProtocol *process, +NativeThreadProtocol::NativeThreadProtocol(NativeProcessProtocol &process, lldb::tid_t tid) - : m_process_wp(process->shared_from_this()), m_tid(tid) {} + : m_process(process), m_tid(tid) {} Status NativeThreadProtocol::ReadRegister(uint32_t reg, RegisterValue ®_value) { @@ -61,8 +61,4 @@ Status NativeThreadProtocol::RestoreAllRegisters(lldb: if (!register_context_sp) return Status("no register context"); return register_context_sp->ReadAllRegisterValues(data_sp); -} - -NativeProcessProtocolSP NativeThreadProtocol::GetProcess() { - return m_process_wp.lock(); } Modified: vendor/lldb/dist/source/Host/common/Socket.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/Socket.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/Socket.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -29,6 +29,7 @@ #include #include #include +#include #endif #ifdef __linux__ Modified: vendor/lldb/dist/source/Host/common/SocketAddress.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/SocketAddress.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/SocketAddress.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -317,6 +317,13 @@ bool SocketAddress::IsAnyAddr() const { : 0 == memcmp(&m_socket_addr.sa_ipv6.sin6_addr, &in6addr_any, 16); } +bool SocketAddress::IsLocalhost() const { + return (GetFamily() == AF_INET) + ? m_socket_addr.sa_ipv4.sin_addr.s_addr == htonl(INADDR_LOOPBACK) + : 0 == memcmp(&m_socket_addr.sa_ipv6.sin6_addr, &in6addr_loopback, + 16); +} + bool SocketAddress::operator==(const SocketAddress &rhs) const { if (GetFamily() != rhs.GetFamily()) return false; Modified: vendor/lldb/dist/source/Host/common/TCPSocket.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/TCPSocket.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/common/TCPSocket.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -34,6 +34,7 @@ #define CLOSE_SOCKET closesocket typedef const char *set_socket_option_arg_type; #else +#include #define CLOSE_SOCKET ::close typedef const void *set_socket_option_arg_type; #endif Modified: vendor/lldb/dist/source/Host/linux/Host.cpp ============================================================================== --- vendor/lldb/dist/source/Host/linux/Host.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/linux/Host.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -16,6 +16,7 @@ #include #include #include +#include // C++ Includes // Other libraries and framework includes Modified: vendor/lldb/dist/source/Host/linux/HostInfoLinux.cpp ============================================================================== --- vendor/lldb/dist/source/Host/linux/HostInfoLinux.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/linux/HostInfoLinux.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -16,6 +16,7 @@ #include #include #include +#include #include #include // std::once Modified: vendor/lldb/dist/source/Host/posix/ConnectionFileDescriptorPosix.cpp ============================================================================== --- vendor/lldb/dist/source/Host/posix/ConnectionFileDescriptorPosix.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/posix/ConnectionFileDescriptorPosix.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -30,6 +30,7 @@ #ifndef LLDB_DISABLE_POSIX #include +#include #endif // C++ Includes Modified: vendor/lldb/dist/source/Host/posix/FileSystem.cpp ============================================================================== --- vendor/lldb/dist/source/Host/posix/FileSystem.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/posix/FileSystem.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -15,6 +15,7 @@ #include #include #include +#include #ifdef __linux__ #include #include Modified: vendor/lldb/dist/source/Host/posix/HostProcessPosix.cpp ============================================================================== --- vendor/lldb/dist/source/Host/posix/HostProcessPosix.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/posix/HostProcessPosix.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -13,7 +13,9 @@ #include "llvm/ADT/STLExtras.h" +#include #include +#include using namespace lldb_private; Modified: vendor/lldb/dist/source/Host/posix/LockFilePosix.cpp ============================================================================== --- vendor/lldb/dist/source/Host/posix/LockFilePosix.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/posix/LockFilePosix.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -10,6 +10,7 @@ #include "lldb/Host/posix/LockFilePosix.h" #include +#include using namespace lldb; using namespace lldb_private; Modified: vendor/lldb/dist/source/Host/posix/ProcessLauncherPosixFork.cpp ============================================================================== --- vendor/lldb/dist/source/Host/posix/ProcessLauncherPosixFork.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Host/posix/ProcessLauncherPosixFork.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -19,8 +19,10 @@ #include #include #include +#include #include +#include #ifdef __ANDROID__ #include Modified: vendor/lldb/dist/source/Interpreter/CommandInterpreter.cpp ============================================================================== --- vendor/lldb/dist/source/Interpreter/CommandInterpreter.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Interpreter/CommandInterpreter.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -2475,7 +2475,7 @@ void CommandInterpreter::HandleCommandsFromFile( } ScriptInterpreter *CommandInterpreter::GetScriptInterpreter(bool can_create) { - std::lock_guard locker(m_script_interpreter_mutex); + std::lock_guard locker(m_script_interpreter_mutex); if (!m_script_interpreter_sp) { if (!can_create) return nullptr; Modified: vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -7,23 +7,11 @@ // //===----------------------------------------------------------------------===// -// C Includes -#include -#include -#include - -// C++ Includes -// Other libraries and framework includes +#include "AuxVector.h" #include "lldb/Target/Process.h" #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/Log.h" - -#if defined(__linux__) || defined(__FreeBSD__) -#include "Plugins/Process/elf-core/ProcessElfCore.h" -#endif - -#include "AuxVector.h" using namespace lldb; using namespace lldb_private; Modified: vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -451,16 +451,16 @@ void ClangModulesDeclVendorImpl::ForEachMacro( bool first_arg = true; - for (clang::MacroInfo::arg_iterator ai = macro_info->arg_begin(), - ae = macro_info->arg_end(); - ai != ae; ++ai) { + for (auto pi = macro_info->param_begin(), + pe = macro_info->param_end(); + pi != pe; ++pi) { if (!first_arg) { macro_expansion.append(", "); } else { first_arg = false; } - macro_expansion.append((*ai)->getName().str()); + macro_expansion.append((*pi)->getName().str()); } if (macro_info->isC99Varargs()) { Modified: vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -274,6 +274,28 @@ bool CPlusPlusNameParser::ConsumeAnonymousNamespace() return true; } +bool CPlusPlusNameParser::ConsumeLambda() { + Bookmark start_position = SetBookmark(); + if (!ConsumeToken(tok::l_brace)) { + return false; + } + constexpr llvm::StringLiteral g_lambda("lambda"); + if (HasMoreTokens() && Peek().is(tok::raw_identifier) && + Peek().getRawIdentifier() == g_lambda) { + // Put the matched brace back so we can use ConsumeBrackets + TakeBack(); + } else { + return false; + } + + if (!ConsumeBrackets(tok::l_brace, tok::r_brace)) { + return false; + } + + start_position.Remove(); + return true; +} + bool CPlusPlusNameParser::ConsumeBrackets(tok::TokenKind left, tok::TokenKind right) { Bookmark start_position = SetBookmark(); @@ -502,6 +524,15 @@ CPlusPlusNameParser::ParseFullNameImpl() { state = State::AfterTwoColons; break; } + case tok::l_brace: + if (state == State::Beginning || state == State::AfterTwoColons) { + if (ConsumeLambda()) { + state = State::AfterIdentifier; + break; + } + } + continue_parsing = false; + break; case tok::coloncolon: // Type nesting delimiter. if (state != State::Beginning && state != State::AfterIdentifier && state != State::AfterTemplate) { Modified: vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h ============================================================================== --- vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h Wed Jul 19 07:03:07 2017 (r321194) @@ -143,6 +143,9 @@ class CPlusPlusNameParser { (private) // Consumes '(anonymous namespace)' bool ConsumeAnonymousNamespace(); + // Consumes '{lambda ...}' + bool ConsumeLambda(); + // Consumes operator declaration like 'operator *' or 'operator delete []' bool ConsumeOperator(); Modified: vendor/lldb/dist/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -23,6 +23,7 @@ #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" +#include "lldb/Host/PosixApi.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Utility/FileSpec.h" Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -214,7 +214,7 @@ static Status EnsureFDFlags(int fd, int flags) { // Public Static Methods // ----------------------------------------------------------------------------- -llvm::Expected +llvm::Expected> NativeProcessLinux::Factory::Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate, MainLoop &mainloop) const { @@ -259,14 +259,13 @@ NativeProcessLinux::Factory::Launch(ProcessLaunchInfo return status.ToError(); } - std::shared_ptr process_sp(new NativeProcessLinux( + return std::unique_ptr(new NativeProcessLinux( pid, launch_info.GetPTY().ReleaseMasterFileDescriptor(), native_delegate, - arch, mainloop)); - process_sp->InitializeThreads({pid}); - return process_sp; + arch, mainloop, {pid})); } -llvm::Expected NativeProcessLinux::Factory::Attach( +llvm::Expected> +NativeProcessLinux::Factory::Attach( lldb::pid_t pid, NativeProcessProtocol::NativeDelegate &native_delegate, MainLoop &mainloop) const { Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS)); @@ -282,10 +281,8 @@ llvm::Expected NativeProcessL if (!tids_or) return tids_or.takeError(); - std::shared_ptr process_sp( - new NativeProcessLinux(pid, -1, native_delegate, arch, mainloop)); - process_sp->InitializeThreads(*tids_or); - return process_sp; + return std::unique_ptr(new NativeProcessLinux( + pid, -1, native_delegate, arch, mainloop, *tids_or)); } // ----------------------------------------------------------------------------- @@ -294,7 +291,8 @@ llvm::Expected NativeProcessL NativeProcessLinux::NativeProcessLinux(::pid_t pid, int terminal_fd, NativeDelegate &delegate, - const ArchSpec &arch, MainLoop &mainloop) + const ArchSpec &arch, MainLoop &mainloop, + llvm::ArrayRef<::pid_t> tids) : NativeProcessProtocol(pid, terminal_fd, delegate), m_arch(arch) { if (m_terminal_fd != -1) { Status status = EnsureFDFlags(m_terminal_fd, O_NONBLOCK); @@ -305,9 +303,7 @@ NativeProcessLinux::NativeProcessLinux(::pid_t pid, in m_sigchld_handle = mainloop.RegisterSignal( SIGCHLD, [this](MainLoopBase &) { SigchldHandler(); }, status); assert(m_sigchld_handle && status.Success()); -} -void NativeProcessLinux::InitializeThreads(llvm::ArrayRef<::pid_t> tids) { for (const auto &tid : tids) { NativeThreadLinuxSP thread_sp = AddThread(tid); assert(thread_sp && "AddThread() returned a nullptr thread"); @@ -2009,7 +2005,7 @@ NativeThreadLinuxSP NativeProcessLinux::AddThread(lldb if (m_threads.empty()) SetCurrentThreadID(thread_id); - auto thread_sp = std::make_shared(this, thread_id); + auto thread_sp = std::make_shared(*this, thread_id); m_threads.push_back(thread_sp); if (m_pt_proces_trace_id != LLDB_INVALID_UID) { Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.h ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.h Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.h Wed Jul 19 07:03:07 2017 (r321194) @@ -10,7 +10,7 @@ #ifndef liblldb_NativeProcessLinux_H_ #define liblldb_NativeProcessLinux_H_ -// C++ Includes +#include #include // Other libraries and framework includes @@ -42,11 +42,11 @@ class NativeProcessLinux : public NativeProcessProtoco public: class Factory : public NativeProcessProtocol::Factory { public: - llvm::Expected + llvm::Expected> Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate, MainLoop &mainloop) const override; - llvm::Expected + llvm::Expected> Attach(lldb::pid_t pid, NativeDelegate &native_delegate, MainLoop &mainloop) const override; }; @@ -160,14 +160,13 @@ class NativeProcessLinux : public NativeProcessProtoco // Private Instance Methods // --------------------------------------------------------------------- NativeProcessLinux(::pid_t pid, int terminal_fd, NativeDelegate &delegate, - const ArchSpec &arch, MainLoop &mainloop); + const ArchSpec &arch, MainLoop &mainloop, + llvm::ArrayRef<::pid_t> tids); // Returns a list of process threads that we have attached to. static llvm::Expected> Attach(::pid_t pid); static Status SetDefaultPtraceOpts(const lldb::pid_t); - - void InitializeThreads(llvm::ArrayRef<::pid_t> tids); void MonitorCallback(lldb::pid_t pid, bool exited, WaitStatus status); Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -30,11 +30,7 @@ lldb::ByteOrder NativeRegisterContextLinux::GetByteOrd // read. lldb::ByteOrder byte_order = lldb::eByteOrderInvalid; - NativeProcessProtocolSP process_sp(m_thread.GetProcess()); - if (!process_sp) - return byte_order; - - if (!process_sp->GetByteOrder(byte_order)) { + if (!m_thread.GetProcess().GetByteOrder(byte_order)) { // FIXME log here } Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -873,7 +873,7 @@ Status NativeRegisterContextLinux_arm64::DoReadRegiste PTRACE_GETREGSET, m_thread.GetID(), ®set, &ioVec, sizeof regs); if (error.Success()) { ArchSpec arch; - if (m_thread.GetProcess()->GetArchitecture(arch)) + if (m_thread.GetProcess().GetArchitecture(arch)) value.SetBytes((void *)(((unsigned char *)(®s)) + offset), 16, arch.GetByteOrder()); else @@ -890,7 +890,7 @@ Status NativeRegisterContextLinux_arm64::DoReadRegiste PTRACE_GETREGSET, m_thread.GetID(), ®set, &ioVec, sizeof regs); if (error.Success()) { ArchSpec arch; - if (m_thread.GetProcess()->GetArchitecture(arch)) + if (m_thread.GetProcess().GetArchitecture(arch)) value.SetBytes((void *)(((unsigned char *)(regs)) + offset), 8, arch.GetByteOrder()); else Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -953,7 +953,7 @@ NativeRegisterContextLinux_mips64::GetWatchpointHitAdd return LLDB_INVALID_ADDRESS; EmulatorBaton baton( - static_cast(m_thread.GetProcess().get()), this); + static_cast(&m_thread.GetProcess()), this); emulator_ap->SetBaton(&baton); emulator_ap->SetReadMemCallback(&ReadMemoryCallback); emulator_ap->SetReadRegCallback(&ReadRegisterCallback); @@ -1034,7 +1034,7 @@ Status NativeRegisterContextLinux_mips64::Read_SR_Conf PTRACE_GETREGS, m_thread.GetID(), NULL, ®s, sizeof regs); if (error.Success()) { lldb_private::ArchSpec arch; - if (m_thread.GetProcess()->GetArchitecture(arch)) { + if (m_thread.GetProcess().GetArchitecture(arch)) { void *target_address = ((uint8_t *)®s) + offset + 4 * (arch.GetMachine() == llvm::Triple::mips); value.SetUInt(*(uint32_t *)target_address, size); Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.cpp Wed Jul 19 07:03:04 2017 (r321193) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.cpp Wed Jul 19 07:03:07 2017 (r321194) @@ -85,7 +85,7 @@ void LogThreadStopInfo(Log &log, const ThreadStopInfo } } -NativeThreadLinux::NativeThreadLinux(NativeProcessLinux *process, +NativeThreadLinux::NativeThreadLinux(NativeProcessLinux &process, lldb::tid_t tid) : NativeThreadProtocol(process, tid), m_state(StateType::eStateInvalid), m_stop_info(), m_reg_context_sp(), m_stop_description() {} @@ -144,12 +144,8 @@ NativeRegisterContextSP NativeThreadLinux::GetRegister if (m_reg_context_sp) return m_reg_context_sp; - NativeProcessProtocolSP m_process_sp = m_process_wp.lock(); - if (!m_process_sp) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Wed Jul 19 07:03:17 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 7C5ADDAAE31; Wed, 19 Jul 2017 07:03:17 +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 2AC0C6E729; Wed, 19 Jul 2017 07:03:17 +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 v6J73GT4091340; Wed, 19 Jul 2017 07:03:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J73Gdd091339; Wed, 19 Jul 2017 07:03:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707190703.v6J73Gdd091339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 07:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321195 - vendor/lldb/lldb-trunk-r308421 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/lldb/lldb-trunk-r308421 X-SVN-Commit-Revision: 321195 X-SVN-Commit-Repository: base 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, 19 Jul 2017 07:03:17 -0000 Author: dim Date: Wed Jul 19 07:03:16 2017 New Revision: 321195 URL: https://svnweb.freebsd.org/changeset/base/321195 Log: Tag lldb trunk r308421. Added: vendor/lldb/lldb-trunk-r308421/ - copied from r321194, vendor/lldb/dist/