From owner-svn-src-vendor@freebsd.org Mon May 29 16:25:33 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 AC40CD77743; Mon, 29 May 2017 16:25:33 +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 5F76E809D6; Mon, 29 May 2017 16:25:33 +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 v4TGPWpj082972; Mon, 29 May 2017 16:25:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TGPWM7082971; Mon, 29 May 2017 16:25:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705291625.v4TGPWM7082971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 May 2017 16:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319141 - vendor/llvm/llvm-trunk-r304149 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 16:25:33 -0000 Author: dim Date: Mon May 29 16:25:32 2017 New Revision: 319141 URL: https://svnweb.freebsd.org/changeset/base/319141 Log: Tag llvm trunk r304149. Added: vendor/llvm/llvm-trunk-r304149/ - copied from r319140, vendor/llvm/dist/ From owner-svn-src-vendor@freebsd.org Mon May 29 16:25:29 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 55F86D7773B; Mon, 29 May 2017 16:25:29 +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 D7C2F809CC; Mon, 29 May 2017 16:25:28 +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 v4TGPS2j082925; Mon, 29 May 2017 16:25:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TGPQcb082909; Mon, 29 May 2017 16:25:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705291625.v4TGPQcb082909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 May 2017 16:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319140 - in vendor/llvm/dist: . docs examples/Kaleidoscope/BuildingAJIT/Chapter1 examples/Kaleidoscope/BuildingAJIT/Chapter2 examples/Kaleidoscope/BuildingAJIT/Chapter3 examples/Kaleid... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 16:25:29 -0000 Author: dim Date: Mon May 29 16:25:25 2017 New Revision: 319140 URL: https://svnweb.freebsd.org/changeset/base/319140 Log: Vendor import of llvm trunk r304149: https://llvm.org/svn/llvm-project/llvm/trunk@304149 Added: vendor/llvm/dist/docs/Benchmarking.rst vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/Localizer.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h (contents, props changed) vendor/llvm/dist/lib/CodeGen/AsmPrinter/DIEHashAttributes.def vendor/llvm/dist/lib/CodeGen/GlobalISel/Localizer.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp (contents, props changed) vendor/llvm/dist/lib/Target/Nios2/ vendor/llvm/dist/lib/Target/Nios2/CMakeLists.txt (contents, props changed) vendor/llvm/dist/lib/Target/Nios2/LLVMBuild.txt (contents, props changed) vendor/llvm/dist/lib/Target/Nios2/MCTargetDesc/ vendor/llvm/dist/lib/Target/Nios2/MCTargetDesc/CMakeLists.txt (contents, props changed) vendor/llvm/dist/lib/Target/Nios2/MCTargetDesc/LLVMBuild.txt (contents, props changed) vendor/llvm/dist/lib/Target/Nios2/MCTargetDesc/Nios2MCTargetDesc.cpp (contents, props changed) vendor/llvm/dist/lib/Target/Nios2/MCTargetDesc/Nios2MCTargetDesc.h (contents, props changed) vendor/llvm/dist/lib/Target/Nios2/Nios2.h (contents, props changed) vendor/llvm/dist/lib/Target/Nios2/Nios2.td vendor/llvm/dist/lib/Target/Nios2/Nios2InstrFormats.td vendor/llvm/dist/lib/Target/Nios2/Nios2InstrInfo.td vendor/llvm/dist/lib/Target/Nios2/Nios2RegisterInfo.td vendor/llvm/dist/lib/Target/Nios2/Nios2TargetMachine.cpp (contents, props changed) vendor/llvm/dist/lib/Target/Nios2/Nios2TargetMachine.h (contents, props changed) vendor/llvm/dist/lib/Target/Nios2/TargetInfo/ vendor/llvm/dist/lib/Target/Nios2/TargetInfo/CMakeLists.txt (contents, props changed) vendor/llvm/dist/lib/Target/Nios2/TargetInfo/LLVMBuild.txt (contents, props changed) vendor/llvm/dist/lib/Target/Nios2/TargetInfo/Nios2TargetInfo.cpp (contents, props changed) vendor/llvm/dist/lib/Transforms/Scalar/GVNSink.cpp (contents, props changed) vendor/llvm/dist/test/Analysis/Delinearization/constant_functions_multi_dim.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/localizer-in-O0-pipeline.mir vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/localizer.mir vendor/llvm/dist/test/CodeGen/AArch64/asm-print-comments.ll vendor/llvm/dist/test/CodeGen/AMDGPU/bfe-combine.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.s.getpc.ll vendor/llvm/dist/test/CodeGen/AMDGPU/shl-add-to-add-shl.ll vendor/llvm/dist/test/CodeGen/Nios2/ vendor/llvm/dist/test/CodeGen/Nios2/lit.local.cfg vendor/llvm/dist/test/CodeGen/Nios2/target_support.ll vendor/llvm/dist/test/CodeGen/PowerPC/atomics-constant.ll vendor/llvm/dist/test/CodeGen/PowerPC/livephysregs.mir vendor/llvm/dist/test/CodeGen/PowerPC/vec_sldwi.ll vendor/llvm/dist/test/CodeGen/Thumb/machine-cse-physreg.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-leaf-constant.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-memop-v256.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-memop-v512.mir vendor/llvm/dist/test/CodeGen/X86/avx512vpopcntdq-intrinsics.ll vendor/llvm/dist/test/DebugInfo/Inputs/split-dwarf-dwp.cpp (contents, props changed) vendor/llvm/dist/test/DebugInfo/Inputs/split-dwarf-dwp.o (contents, props changed) vendor/llvm/dist/test/DebugInfo/Inputs/split-dwarf-dwp.o.dwp (contents, props changed) vendor/llvm/dist/test/DebugInfo/MIR/X86/empty-inline.mir vendor/llvm/dist/test/DebugInfo/PDB/Inputs/merge-ids-1.yaml vendor/llvm/dist/test/DebugInfo/PDB/Inputs/merge-ids-2.yaml vendor/llvm/dist/test/DebugInfo/PDB/Inputs/merge-ids-and-types-1.yaml vendor/llvm/dist/test/DebugInfo/PDB/Inputs/merge-ids-and-types-2.yaml vendor/llvm/dist/test/DebugInfo/PDB/Inputs/merge-types-1.yaml vendor/llvm/dist/test/DebugInfo/PDB/Inputs/merge-types-2.yaml vendor/llvm/dist/test/DebugInfo/PDB/Inputs/source-names-1.yaml vendor/llvm/dist/test/DebugInfo/PDB/Inputs/source-names-2.yaml vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-merge-ids-and-types.test vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-mergeids.test vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-objfilename.yaml vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-source-names.test vendor/llvm/dist/test/DebugInfo/X86/gnu-public-names-gmlt.ll vendor/llvm/dist/test/DebugInfo/X86/split-dwarf-multiple-cu-hash.ll vendor/llvm/dist/test/DebugInfo/X86/split-dwarf-omit-empty.ll vendor/llvm/dist/test/DebugInfo/omit-empty.ll vendor/llvm/dist/test/ExecutionEngine/OrcMCJIT/pr32650.ll vendor/llvm/dist/test/Instrumentation/SanitizerCoverage/chains.ll vendor/llvm/dist/test/Instrumentation/SanitizerCoverage/postdominator_check.ll vendor/llvm/dist/test/LTO/Resolution/X86/linkonce.ll vendor/llvm/dist/test/LTO/Resolution/X86/type-checked-load.ll vendor/llvm/dist/test/MC/Disassembler/AMDGPU/sdwa_gfx9.txt (contents, props changed) vendor/llvm/dist/test/MC/WebAssembly/unnamed-data.ll vendor/llvm/dist/test/MC/X86/pr22004.s (contents, props changed) vendor/llvm/dist/test/MC/X86/x86-64-avx512vpopcntdq.s (contents, props changed) vendor/llvm/dist/test/Transforms/Coroutines/coro-debug.ll vendor/llvm/dist/test/Transforms/Coroutines/coro-materialize.ll vendor/llvm/dist/test/Transforms/EarlyCSE/const-speculation.ll vendor/llvm/dist/test/Transforms/GVN/PRE/phi-translate-2.ll vendor/llvm/dist/test/Transforms/GVNSink/ vendor/llvm/dist/test/Transforms/GVNSink/dither.ll vendor/llvm/dist/test/Transforms/GVNSink/indirect-call.ll vendor/llvm/dist/test/Transforms/GVNSink/sink-common-code.ll vendor/llvm/dist/test/Transforms/GVNSink/struct.ll vendor/llvm/dist/test/Transforms/Inline/prof-update-instr.ll vendor/llvm/dist/test/Transforms/Inline/prof-update-sample.ll vendor/llvm/dist/test/Transforms/InstCombine/icmp-xor-signbit.ll vendor/llvm/dist/test/Transforms/LoopIdiom/pr33114.ll vendor/llvm/dist/test/Transforms/LoopStrengthReduce/X86/lsr-expand-quadratic.ll vendor/llvm/dist/test/Transforms/LoopStrengthReduce/nonintegral.ll vendor/llvm/dist/test/Transforms/LoopVectorize/AArch64/no_vector_instructions.ll vendor/llvm/dist/test/Transforms/LoopVectorize/SystemZ/addressing.ll vendor/llvm/dist/test/Transforms/NewGVN/pr32836.ll vendor/llvm/dist/test/tools/gold/X86/relocation-model-pic.ll vendor/llvm/dist/test/tools/llvm-nm/X86/Inputs/example.lib (contents, props changed) vendor/llvm/dist/test/tools/llvm-nm/X86/importlibrary.test vendor/llvm/dist/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp (contents, props changed) vendor/llvm/dist/unittests/IR/BasicBlockTest.cpp (contents, props changed) vendor/llvm/dist/utils/TableGen/X86FoldTablesEmitter.cpp (contents, props changed) vendor/llvm/dist/utils/abtest.py (contents, props changed) Deleted: vendor/llvm/dist/lib/Target/AArch64/AArch64SchedFalkorWriteRes.td vendor/llvm/dist/test/Analysis/CostModel/AArch64/falkor.ll vendor/llvm/dist/test/CodeGen/MIR/ARM/PR32721_ifcvt_triangle_unanalyzable.mir vendor/llvm/dist/test/DebugInfo/PDB/Inputs/merge1.yaml vendor/llvm/dist/test/DebugInfo/PDB/Inputs/merge2.yaml vendor/llvm/dist/test/Transforms/Inline/prof-update.ll vendor/llvm/dist/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll vendor/llvm/dist/test/Transforms/InstCombine/2008-08-17-ICmpXorSignbit.ll vendor/llvm/dist/test/Transforms/LoopStrengthReduce/lsr-expand-quadratic.ll vendor/llvm/dist/utils/abtest/abtest.py vendor/llvm/dist/utils/abtest/mark_aarch64fns.py vendor/llvm/dist/utils/abtest/mark_armfns.py Modified: vendor/llvm/dist/CMakeLists.txt vendor/llvm/dist/docs/GettingStartedVS.rst vendor/llvm/dist/docs/LangRef.rst vendor/llvm/dist/docs/Vectorizers.rst vendor/llvm/dist/docs/index.rst vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter5/Server/server.cpp vendor/llvm/dist/examples/Kaleidoscope/include/KaleidoscopeJIT.h vendor/llvm/dist/include/llvm/ADT/Triple.h vendor/llvm/dist/include/llvm/Analysis/InstructionSimplify.h vendor/llvm/dist/include/llvm/Analysis/LoopPass.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/Analysis/ValueTracking.h vendor/llvm/dist/include/llvm/CodeGen/AsmPrinter.h vendor/llvm/dist/include/llvm/CodeGen/AtomicExpandUtils.h vendor/llvm/dist/include/llvm/CodeGen/DIE.h vendor/llvm/dist/include/llvm/CodeGen/FaultMaps.h vendor/llvm/dist/include/llvm/CodeGen/ISDOpcodes.h vendor/llvm/dist/include/llvm/CodeGen/LiveInterval.h vendor/llvm/dist/include/llvm/CodeGen/LiveIntervalAnalysis.h vendor/llvm/dist/include/llvm/CodeGen/LiveIntervalUnion.h vendor/llvm/dist/include/llvm/CodeGen/LivePhysRegs.h vendor/llvm/dist/include/llvm/CodeGen/LiveRangeEdit.h vendor/llvm/dist/include/llvm/CodeGen/LiveStackAnalysis.h vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h vendor/llvm/dist/include/llvm/CodeGen/MachineBlockFrequencyInfo.h vendor/llvm/dist/include/llvm/CodeGen/MachineDominanceFrontier.h vendor/llvm/dist/include/llvm/CodeGen/MachineDominators.h vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h vendor/llvm/dist/include/llvm/CodeGen/MachineRegisterInfo.h vendor/llvm/dist/include/llvm/CodeGen/MachineValueType.h vendor/llvm/dist/include/llvm/CodeGen/ScheduleDAG.h vendor/llvm/dist/include/llvm/CodeGen/ScheduleDAGInstrs.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAG.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDeserializer.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeSerializer.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeTableCollection.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFContext.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDie.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFFormValue.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h vendor/llvm/dist/include/llvm/DebugInfo/MSF/MappedBlockStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PDBTypeServerHandler.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/TpiStream.h vendor/llvm/dist/include/llvm/IR/Attributes.h vendor/llvm/dist/include/llvm/IR/BasicBlock.h vendor/llvm/dist/include/llvm/IR/IntrinsicInst.h vendor/llvm/dist/include/llvm/IR/Intrinsics.td vendor/llvm/dist/include/llvm/IR/IntrinsicsAMDGPU.td vendor/llvm/dist/include/llvm/IR/Metadata.h vendor/llvm/dist/include/llvm/IR/Module.h vendor/llvm/dist/include/llvm/InitializePasses.h vendor/llvm/dist/include/llvm/LTO/Config.h vendor/llvm/dist/include/llvm/Object/Binary.h vendor/llvm/dist/include/llvm/Object/COFF.h vendor/llvm/dist/include/llvm/Object/ELFObjectFile.h vendor/llvm/dist/include/llvm/Object/MachO.h vendor/llvm/dist/include/llvm/Object/ObjectFile.h vendor/llvm/dist/include/llvm/Object/RelocVisitor.h vendor/llvm/dist/include/llvm/Object/Wasm.h vendor/llvm/dist/include/llvm/Option/OptTable.h vendor/llvm/dist/include/llvm/ProfileData/InstrProf.h vendor/llvm/dist/include/llvm/TableGen/Record.h vendor/llvm/dist/include/llvm/Target/TargetLowering.h vendor/llvm/dist/include/llvm/Transforms/Scalar.h vendor/llvm/dist/include/llvm/Transforms/Scalar/GVN.h vendor/llvm/dist/include/llvm/Transforms/Utils/Local.h vendor/llvm/dist/lib/Analysis/ConstantFolding.cpp vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist/lib/Analysis/Lint.cpp vendor/llvm/dist/lib/Analysis/LoopPass.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolutionExpander.cpp vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp vendor/llvm/dist/lib/Analysis/ValueTracking.cpp vendor/llvm/dist/lib/Bitcode/Writer/BitcodeWriter.cpp vendor/llvm/dist/lib/Bitcode/Writer/ValueEnumerator.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DIEHash.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DIEHash.h vendor/llvm/dist/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.h vendor/llvm/dist/lib/CodeGen/AtomicExpandPass.cpp vendor/llvm/dist/lib/CodeGen/BasicTargetTransformInfo.cpp vendor/llvm/dist/lib/CodeGen/BranchCoalescing.cpp vendor/llvm/dist/lib/CodeGen/BranchFolding.cpp vendor/llvm/dist/lib/CodeGen/BranchFolding.h vendor/llvm/dist/lib/CodeGen/BranchRelaxation.cpp vendor/llvm/dist/lib/CodeGen/CodeGenPrepare.cpp vendor/llvm/dist/lib/CodeGen/DeadMachineInstructionElim.cpp vendor/llvm/dist/lib/CodeGen/DetectDeadLanes.cpp vendor/llvm/dist/lib/CodeGen/DwarfEHPrepare.cpp vendor/llvm/dist/lib/CodeGen/EarlyIfConversion.cpp vendor/llvm/dist/lib/CodeGen/ExpandISelPseudos.cpp vendor/llvm/dist/lib/CodeGen/ExpandPostRAPseudos.cpp vendor/llvm/dist/lib/CodeGen/FuncletLayout.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/CMakeLists.txt vendor/llvm/dist/lib/CodeGen/GlobalISel/GlobalISel.cpp vendor/llvm/dist/lib/CodeGen/GlobalMerge.cpp vendor/llvm/dist/lib/CodeGen/IfConversion.cpp vendor/llvm/dist/lib/CodeGen/ImplicitNullChecks.cpp vendor/llvm/dist/lib/CodeGen/InterleavedAccessPass.cpp vendor/llvm/dist/lib/CodeGen/LexicalScopes.cpp vendor/llvm/dist/lib/CodeGen/LiveDebugValues.cpp vendor/llvm/dist/lib/CodeGen/LiveDebugVariables.cpp vendor/llvm/dist/lib/CodeGen/LiveIntervalAnalysis.cpp vendor/llvm/dist/lib/CodeGen/LivePhysRegs.cpp vendor/llvm/dist/lib/CodeGen/LiveStackAnalysis.cpp vendor/llvm/dist/lib/CodeGen/LocalStackSlotAllocation.cpp vendor/llvm/dist/lib/CodeGen/LowerEmuTLS.cpp vendor/llvm/dist/lib/CodeGen/MachineBlockFrequencyInfo.cpp vendor/llvm/dist/lib/CodeGen/MachineBlockPlacement.cpp vendor/llvm/dist/lib/CodeGen/MachineCSE.cpp vendor/llvm/dist/lib/CodeGen/MachineCombiner.cpp vendor/llvm/dist/lib/CodeGen/MachineCopyPropagation.cpp vendor/llvm/dist/lib/CodeGen/MachineLICM.cpp vendor/llvm/dist/lib/CodeGen/MachineOutliner.cpp vendor/llvm/dist/lib/CodeGen/MachinePipeliner.cpp vendor/llvm/dist/lib/CodeGen/MachineScheduler.cpp vendor/llvm/dist/lib/CodeGen/MachineSink.cpp vendor/llvm/dist/lib/CodeGen/MachineTraceMetrics.cpp vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp vendor/llvm/dist/lib/CodeGen/OptimizePHIs.cpp vendor/llvm/dist/lib/CodeGen/PHIElimination.cpp vendor/llvm/dist/lib/CodeGen/PostRASchedulerList.cpp vendor/llvm/dist/lib/CodeGen/ProcessImplicitDefs.cpp vendor/llvm/dist/lib/CodeGen/PrologEpilogInserter.cpp vendor/llvm/dist/lib/CodeGen/RenameIndependentSubregs.cpp vendor/llvm/dist/lib/CodeGen/SafeStack.cpp vendor/llvm/dist/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp vendor/llvm/dist/lib/CodeGen/ScheduleDAGInstrs.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm/dist/lib/CodeGen/ShadowStackGCLowering.cpp vendor/llvm/dist/lib/CodeGen/ShrinkWrap.cpp vendor/llvm/dist/lib/CodeGen/SjLjEHPrepare.cpp vendor/llvm/dist/lib/CodeGen/SlotIndexes.cpp vendor/llvm/dist/lib/CodeGen/SpillPlacement.cpp vendor/llvm/dist/lib/CodeGen/StackColoring.cpp vendor/llvm/dist/lib/CodeGen/StackProtector.cpp vendor/llvm/dist/lib/CodeGen/StackSlotColoring.cpp vendor/llvm/dist/lib/CodeGen/TailDuplication.cpp vendor/llvm/dist/lib/CodeGen/TailDuplicator.cpp vendor/llvm/dist/lib/CodeGen/TwoAddressInstructionPass.cpp vendor/llvm/dist/lib/CodeGen/WinEHPrepare.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CMakeLists.txt vendor/llvm/dist/lib/DebugInfo/CodeView/CVTypeVisitor.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeSerializer.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeStreamMerger.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeTableCollection.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFContext.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFDie.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFFormValue.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFUnit.cpp vendor/llvm/dist/lib/DebugInfo/MSF/MappedBlockStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBTypeServerHandler.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/TpiStream.cpp vendor/llvm/dist/lib/Demangle/ItaniumDemangle.cpp vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerUtilPosix.cpp vendor/llvm/dist/lib/Fuzzer/test/fuzzer-segv.test vendor/llvm/dist/lib/IR/AttributeImpl.h vendor/llvm/dist/lib/IR/Attributes.cpp vendor/llvm/dist/lib/IR/BasicBlock.cpp vendor/llvm/dist/lib/IR/DebugLoc.cpp vendor/llvm/dist/lib/IR/Instructions.cpp vendor/llvm/dist/lib/IR/IntrinsicInst.cpp vendor/llvm/dist/lib/IR/Module.cpp vendor/llvm/dist/lib/IR/Verifier.cpp vendor/llvm/dist/lib/LTO/LTO.cpp vendor/llvm/dist/lib/LTO/LTOBackend.cpp vendor/llvm/dist/lib/Linker/IRMover.cpp vendor/llvm/dist/lib/MC/WasmObjectWriter.cpp vendor/llvm/dist/lib/Object/COFFObjectFile.cpp vendor/llvm/dist/lib/Object/MachOObjectFile.cpp vendor/llvm/dist/lib/Object/WasmObjectFile.cpp vendor/llvm/dist/lib/Option/OptTable.cpp vendor/llvm/dist/lib/Passes/PassBuilder.cpp vendor/llvm/dist/lib/ProfileData/InstrProf.cpp vendor/llvm/dist/lib/Support/APInt.cpp vendor/llvm/dist/lib/Support/BinaryStreamReader.cpp vendor/llvm/dist/lib/Support/ConvertUTF.cpp vendor/llvm/dist/lib/Support/DebugCounter.cpp vendor/llvm/dist/lib/Support/DynamicLibrary.cpp vendor/llvm/dist/lib/Support/GraphWriter.cpp vendor/llvm/dist/lib/Support/Host.cpp vendor/llvm/dist/lib/Support/Path.cpp vendor/llvm/dist/lib/Support/Triple.cpp vendor/llvm/dist/lib/Support/YAMLParser.cpp vendor/llvm/dist/lib/TableGen/Record.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64AsmPrinter.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64FrameLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp 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/AArch64MacroFusion.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64SchedFalkor.td vendor/llvm/dist/lib/Target/AArch64/AArch64SchedFalkorDetails.td vendor/llvm/dist/lib/Target/AArch64/AArch64Subtarget.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64TargetMachine.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.td vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUPromoteAlloca.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/GCNIterativeScheduler.cpp vendor/llvm/dist/lib/Target/AMDGPU/GCNMinRegStrategy.cpp vendor/llvm/dist/lib/Target/AMDGPU/GCNRegPressure.cpp vendor/llvm/dist/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCCodeEmitter.h vendor/llvm/dist/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp vendor/llvm/dist/lib/Target/AMDGPU/R600ISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/R600ISelLowering.h vendor/llvm/dist/lib/Target/AMDGPU/R600RegisterInfo.td vendor/llvm/dist/lib/Target/AMDGPU/SIDefines.h 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.td vendor/llvm/dist/lib/Target/AMDGPU/SOPInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h vendor/llvm/dist/lib/Target/AMDGPU/VOP1Instructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOP2Instructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOP3Instructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOPCInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOPInstructions.td vendor/llvm/dist/lib/Target/ARM/ARMCallLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMCallLowering.h vendor/llvm/dist/lib/Target/ARM/ARMExpandPseudoInsts.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.h vendor/llvm/dist/lib/Target/ARM/ARMInstrNEON.td vendor/llvm/dist/lib/Target/ARM/ARMSchedule.td vendor/llvm/dist/lib/Target/ARM/ARMScheduleA9.td vendor/llvm/dist/lib/Target/ARM/ARMScheduleR52.td vendor/llvm/dist/lib/Target/ARM/ARMScheduleSwift.td vendor/llvm/dist/lib/Target/ARM/ARMTargetMachine.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetMachine.h vendor/llvm/dist/lib/Target/ARM/ARMTargetObjectFile.cpp vendor/llvm/dist/lib/Target/ARM/Thumb1FrameLowering.cpp vendor/llvm/dist/lib/Target/AVR/AVRInstrInfo.td vendor/llvm/dist/lib/Target/BPF/BPFISelLowering.cpp vendor/llvm/dist/lib/Target/BPF/BPFISelLowering.h vendor/llvm/dist/lib/Target/Hexagon/HexagonFrameLowering.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrInfo.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonPseudo.td vendor/llvm/dist/lib/Target/Hexagon/HexagonRegisterInfo.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonRegisterInfo.h vendor/llvm/dist/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp vendor/llvm/dist/lib/Target/LLVMBuild.txt vendor/llvm/dist/lib/Target/MSP430/MSP430.td vendor/llvm/dist/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/MSP430/MSP430ISelLowering.cpp vendor/llvm/dist/lib/Target/MSP430/MSP430InstrInfo.td vendor/llvm/dist/lib/Target/MSP430/MSP430RegisterInfo.cpp vendor/llvm/dist/lib/Target/MSP430/MSP430Subtarget.cpp vendor/llvm/dist/lib/Target/MSP430/MSP430Subtarget.h vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.cpp vendor/llvm/dist/lib/Target/Mips/MipsSubtarget.cpp vendor/llvm/dist/lib/Target/Mips/MipsSubtarget.h vendor/llvm/dist/lib/Target/PowerPC/PPCExpandISEL.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.h vendor/llvm/dist/lib/Target/PowerPC/PPCInstr64Bit.td 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/SystemZ/SystemZExpandPseudo.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrInfo.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetTransformInfo.h vendor/llvm/dist/lib/Target/X86/AsmParser/X86AsmParser.cpp vendor/llvm/dist/lib/Target/X86/CMakeLists.txt vendor/llvm/dist/lib/Target/X86/X86.td vendor/llvm/dist/lib/Target/X86/X86FloatingPoint.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td vendor/llvm/dist/lib/Target/X86/X86InstrArithmetic.td vendor/llvm/dist/lib/Target/X86/X86InstrFMA.td vendor/llvm/dist/lib/Target/X86/X86InstrFormats.td vendor/llvm/dist/lib/Target/X86/X86InstrInfo.cpp vendor/llvm/dist/lib/Target/X86/X86InstrInfo.td vendor/llvm/dist/lib/Target/X86/X86InstrMMX.td vendor/llvm/dist/lib/Target/X86/X86InstrSSE.td vendor/llvm/dist/lib/Target/X86/X86InstrXOP.td vendor/llvm/dist/lib/Target/X86/X86InstructionSelector.cpp vendor/llvm/dist/lib/Target/X86/X86LegalizerInfo.cpp vendor/llvm/dist/lib/Target/X86/X86LegalizerInfo.h vendor/llvm/dist/lib/Target/X86/X86Subtarget.cpp vendor/llvm/dist/lib/Target/X86/X86Subtarget.h vendor/llvm/dist/lib/Transforms/Coroutines/CoroCleanup.cpp vendor/llvm/dist/lib/Transforms/Coroutines/CoroEarly.cpp vendor/llvm/dist/lib/Transforms/Coroutines/CoroElide.cpp vendor/llvm/dist/lib/Transforms/Coroutines/CoroFrame.cpp vendor/llvm/dist/lib/Transforms/Coroutines/CoroSplit.cpp vendor/llvm/dist/lib/Transforms/IPO/PartialInlining.cpp vendor/llvm/dist/lib/Transforms/IPO/PassManagerBuilder.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineAddSub.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCasts.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineInternal.h vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineShifts.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstructionCombining.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/PGOInstrumentation.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/SanitizerCoverage.cpp vendor/llvm/dist/lib/Transforms/Scalar/CMakeLists.txt vendor/llvm/dist/lib/Transforms/Scalar/ConstantHoisting.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/GuardWidening.cpp vendor/llvm/dist/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp vendor/llvm/dist/lib/Transforms/Scalar/JumpThreading.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopIdiomRecognize.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopUnswitch.cpp vendor/llvm/dist/lib/Transforms/Scalar/NewGVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/SCCP.cpp vendor/llvm/dist/lib/Transforms/Scalar/SROA.cpp vendor/llvm/dist/lib/Transforms/Scalar/Scalar.cpp vendor/llvm/dist/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp vendor/llvm/dist/lib/Transforms/Utils/CloneFunction.cpp vendor/llvm/dist/lib/Transforms/Utils/FunctionComparator.cpp vendor/llvm/dist/lib/Transforms/Utils/InlineFunction.cpp vendor/llvm/dist/lib/Transforms/Utils/Local.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyLibCalls.cpp vendor/llvm/dist/lib/Transforms/Vectorize/LoopVectorize.cpp vendor/llvm/dist/test/Analysis/IVUsers/quadradic-exit-value.ll vendor/llvm/dist/test/Analysis/ScalarEvolution/different-loops-recs.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll vendor/llvm/dist/test/CodeGen/AArch64/aarch64-stp-cluster.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-csldst-mmo.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-inline-asm.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-ldp-cluster.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-misched-basic-A53.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-misched-basic-A57.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-misched-forwarding-A53.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-misched-memdep-bug.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-misched-multimmo.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-vabs.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-vadd.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-vmul.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-vshift.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-vsub.ll vendor/llvm/dist/test/CodeGen/AArch64/cmpxchg-O0.ll vendor/llvm/dist/test/CodeGen/AArch64/fast-isel-cmpxchg.ll vendor/llvm/dist/test/CodeGen/AArch64/live-interval-analysis.mir vendor/llvm/dist/test/CodeGen/AArch64/misched-fusion-aes.ll vendor/llvm/dist/test/CodeGen/AArch64/optimize-imm.ll vendor/llvm/dist/test/CodeGen/AArch64/scheduledag-constreg.mir vendor/llvm/dist/test/CodeGen/AArch64/tailcall_misched_graph.ll vendor/llvm/dist/test/CodeGen/AMDGPU/GlobalISel/legalize-constant.mir vendor/llvm/dist/test/CodeGen/AMDGPU/extload-align.ll vendor/llvm/dist/test/CodeGen/AMDGPU/kernel-args.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-constant-i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-constant-i8.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-global-i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-global-i8.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-local-i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/load-local-i8.ll vendor/llvm/dist/test/CodeGen/AMDGPU/min.ll vendor/llvm/dist/test/CodeGen/AMDGPU/parallelandifcollapse.ll vendor/llvm/dist/test/CodeGen/AMDGPU/r600.bitcast.ll vendor/llvm/dist/test/CodeGen/AMDGPU/schedule-regpressure.mir vendor/llvm/dist/test/CodeGen/AMDGPU/setcc.ll vendor/llvm/dist/test/CodeGen/AMDGPU/shl.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sra.ll vendor/llvm/dist/test/CodeGen/AMDGPU/store-global.ll vendor/llvm/dist/test/CodeGen/AMDGPU/store-private.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sub.ll vendor/llvm/dist/test/CodeGen/AMDGPU/unknown-processor.ll vendor/llvm/dist/test/CodeGen/AMDGPU/vector-alloca.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll vendor/llvm/dist/test/CodeGen/ARM/arm-shrink-wrapping.ll vendor/llvm/dist/test/CodeGen/ARM/constantpool-promote-dbg.ll vendor/llvm/dist/test/CodeGen/ARM/constantpool-promote-ldrh.ll vendor/llvm/dist/test/CodeGen/ARM/constantpool-promote.ll vendor/llvm/dist/test/CodeGen/ARM/cortexr52-misched-basic.ll vendor/llvm/dist/test/CodeGen/ARM/fastisel-thumb-litpool.ll vendor/llvm/dist/test/CodeGen/ARM/memcpy-inline.ll vendor/llvm/dist/test/CodeGen/ARM/memset-inline.ll vendor/llvm/dist/test/CodeGen/ARM/misched-copy-arm.ll vendor/llvm/dist/test/CodeGen/ARM/misched-fp-basic.ll vendor/llvm/dist/test/CodeGen/ARM/misched-int-basic-thumb2.mir vendor/llvm/dist/test/CodeGen/ARM/misched-int-basic.mir vendor/llvm/dist/test/CodeGen/ARM/single-issue-r52.mir vendor/llvm/dist/test/CodeGen/ARM/vcombine.ll vendor/llvm/dist/test/CodeGen/ARM/vext.ll vendor/llvm/dist/test/CodeGen/Hexagon/post-ra-kill-update.mir vendor/llvm/dist/test/CodeGen/Lanai/lanai-misched-trivial-disjoint.ll vendor/llvm/dist/test/CodeGen/MSP430/hwmult16.ll vendor/llvm/dist/test/CodeGen/MSP430/hwmult32.ll vendor/llvm/dist/test/CodeGen/MSP430/hwmultf5.ll vendor/llvm/dist/test/CodeGen/MSP430/vararg.ll vendor/llvm/dist/test/CodeGen/PowerPC/build-vector-tests.ll vendor/llvm/dist/test/CodeGen/PowerPC/p8altivec-shuffles-pred.ll vendor/llvm/dist/test/CodeGen/PowerPC/p9-xxinsertw-xxextractuw.ll vendor/llvm/dist/test/CodeGen/PowerPC/ppc64-i128-abi.ll vendor/llvm/dist/test/CodeGen/PowerPC/pr25157-peephole.ll vendor/llvm/dist/test/CodeGen/PowerPC/pr27078.ll vendor/llvm/dist/test/CodeGen/PowerPC/swaps-le-6.ll vendor/llvm/dist/test/CodeGen/PowerPC/vsx-ldst-builtin-le.ll vendor/llvm/dist/test/CodeGen/PowerPC/vsx-ldst.ll vendor/llvm/dist/test/CodeGen/PowerPC/vsx-p9.ll vendor/llvm/dist/test/CodeGen/PowerPC/vsx_insert_extract_le.ll vendor/llvm/dist/test/CodeGen/PowerPC/vsx_shuffle_le.ll vendor/llvm/dist/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/memop-vec.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/regbankselect-AVX2.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/regbankselect-AVX512.mir vendor/llvm/dist/test/CodeGen/X86/avx-vzeroupper.ll vendor/llvm/dist/test/CodeGen/X86/avx512bw-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/fast-isel-select-cmp.ll vendor/llvm/dist/test/CodeGen/X86/fp-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/hoist-invariant-load.ll vendor/llvm/dist/test/CodeGen/X86/misched-copy.ll vendor/llvm/dist/test/CodeGen/X86/or-branch.ll vendor/llvm/dist/test/CodeGen/X86/pr27681.mir vendor/llvm/dist/test/CodeGen/X86/sandybridge-loads.ll vendor/llvm/dist/test/CodeGen/X86/sse42-intrinsics-fast-isel.ll vendor/llvm/dist/test/CodeGen/X86/stack-folding-fp-avx1.ll vendor/llvm/dist/test/CodeGen/X86/twoaddr-coalesce-2.ll vendor/llvm/dist/test/CodeGen/X86/vector-narrow-binop.ll vendor/llvm/dist/test/CodeGen/X86/vector-popcnt-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-popcnt-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-popcnt-512.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-512-v16.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-avx512.ll vendor/llvm/dist/test/CodeGen/X86/vector-sqrt.ll vendor/llvm/dist/test/CodeGen/X86/vector-trunc-math.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/wide-integer-cmp.ll vendor/llvm/dist/test/CodeGen/X86/widened-broadcast.ll vendor/llvm/dist/test/CodeGen/X86/x86-interleaved-access.ll vendor/llvm/dist/test/CodeGen/X86/x87.ll vendor/llvm/dist/test/CodeGen/XCore/epilogue_prologue.ll vendor/llvm/dist/test/DebugInfo/Generic/empty.ll vendor/llvm/dist/test/DebugInfo/Generic/nodebug.ll vendor/llvm/dist/test/DebugInfo/Generic/skeletoncu.ll vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-mergetypes.test vendor/llvm/dist/test/DebugInfo/X86/array.ll vendor/llvm/dist/test/DebugInfo/X86/dbg-value-frame-index.ll vendor/llvm/dist/test/DebugInfo/X86/debug-loc-offset.ll vendor/llvm/dist/test/DebugInfo/X86/debug-macro.ll vendor/llvm/dist/test/DebugInfo/X86/empty.ll vendor/llvm/dist/test/DebugInfo/X86/fission-hash.ll vendor/llvm/dist/test/DebugInfo/X86/gnu-public-names-empty.ll vendor/llvm/dist/test/DebugInfo/dwo.ll vendor/llvm/dist/test/DebugInfo/llvm-symbolizer.test vendor/llvm/dist/test/DebugInfo/skeletoncu.ll vendor/llvm/dist/test/ExecutionEngine/MCJIT/lit.local.cfg vendor/llvm/dist/test/ExecutionEngine/OrcMCJIT/lit.local.cfg vendor/llvm/dist/test/Feature/fp-intrinsics.ll vendor/llvm/dist/test/Linker/Inputs/module-flags-pic-2-b.ll vendor/llvm/dist/test/Linker/module-flags-pic-2-a.ll vendor/llvm/dist/test/MC/AMDGPU/vop_sdwa.s vendor/llvm/dist/test/MC/Disassembler/X86/avx-512.txt vendor/llvm/dist/test/Other/new-pm-defaults.ll vendor/llvm/dist/test/TableGen/GlobalISelEmitter.td vendor/llvm/dist/test/Transforms/Coroutines/coro-frame.ll vendor/llvm/dist/test/Transforms/GVN/PRE/pre-gep-load.ll vendor/llvm/dist/test/Transforms/GVN/PRE/pre-load.ll vendor/llvm/dist/test/Transforms/GlobalDCE/externally_available.ll vendor/llvm/dist/test/Transforms/InstCombine/alloca.ll vendor/llvm/dist/test/Transforms/InstCombine/bitcast-vec-canon.ll vendor/llvm/dist/test/Transforms/InstCombine/bitcast.ll vendor/llvm/dist/test/Transforms/InstCombine/ctpop.ll vendor/llvm/dist/test/Transforms/InstCombine/icmp.ll vendor/llvm/dist/test/Transforms/InstSimplify/call.ll vendor/llvm/dist/test/Transforms/InstSimplify/or.ll vendor/llvm/dist/test/Transforms/JumpThreading/assume.ll vendor/llvm/dist/test/Transforms/JumpThreading/fold-not-thread.ll vendor/llvm/dist/test/Transforms/JumpThreading/guards.ll vendor/llvm/dist/test/Transforms/LoopStrengthReduce/X86/incorrect-offset-scaling.ll vendor/llvm/dist/test/Transforms/LoopStrengthReduce/post-inc-icmpzero.ll vendor/llvm/dist/test/Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll vendor/llvm/dist/test/Transforms/NewGVN/pr32403.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/trivial-unswitch.ll vendor/llvm/dist/test/Verifier/fp-intrinsics.ll vendor/llvm/dist/test/Verifier/module-flags-1.ll vendor/llvm/dist/test/tools/llvm-profdata/memop-size-prof.proftext vendor/llvm/dist/tools/gold/gold-plugin.cpp vendor/llvm/dist/tools/llvm-nm/llvm-nm.cpp vendor/llvm/dist/tools/llvm-pdbdump/PrettyClassLayoutGraphicalDumper.cpp vendor/llvm/dist/tools/llvm-pdbdump/YAMLOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbdump/llvm-pdbdump.cpp vendor/llvm/dist/tools/llvm-pdbdump/llvm-pdbdump.h vendor/llvm/dist/tools/llvm-profdata/llvm-profdata.cpp vendor/llvm/dist/tools/llvm-readobj/COFFDumper.cpp vendor/llvm/dist/unittests/Analysis/ScalarEvolutionTest.cpp vendor/llvm/dist/unittests/DebugInfo/CodeView/CMakeLists.txt vendor/llvm/dist/unittests/DebugInfo/CodeView/ErrorChecking.h vendor/llvm/dist/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp vendor/llvm/dist/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp vendor/llvm/dist/unittests/IR/CMakeLists.txt vendor/llvm/dist/unittests/IR/DominatorTreeTest.cpp vendor/llvm/dist/unittests/Support/CrashRecoveryTest.cpp vendor/llvm/dist/utils/TableGen/CMakeLists.txt vendor/llvm/dist/utils/TableGen/GlobalISelEmitter.cpp vendor/llvm/dist/utils/TableGen/TableGen.cpp vendor/llvm/dist/utils/TableGen/TableGenBackends.h vendor/llvm/dist/utils/git-svn/git-llvm vendor/llvm/dist/utils/lit/lit/TestRunner.py vendor/llvm/dist/utils/release/merge-request.sh Modified: vendor/llvm/dist/CMakeLists.txt ============================================================================== --- vendor/llvm/dist/CMakeLists.txt Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/CMakeLists.txt Mon May 29 16:25:25 2017 (r319140) @@ -44,6 +44,13 @@ if (NOT PACKAGE_VERSION) "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}") endif() +if ((CMAKE_GENERATOR MATCHES "Visual Studio") AND (CMAKE_GENERATOR_TOOLSET STREQUAL "")) + message(WARNING "Visual Studio generators use the x86 host compiler by " + "default, even for 64-bit targets. This can result in linker " + "instability and out of memory errors. To use the 64-bit " + "host compiler, pass -Thost=x64 on the CMake command line.") +endif() + project(LLVM ${cmake_3_0_PROJ_VERSION} ${cmake_3_0_LANGUAGES} Added: vendor/llvm/dist/docs/Benchmarking.rst ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/docs/Benchmarking.rst Mon May 29 16:25:25 2017 (r319140) @@ -0,0 +1,87 @@ +================================== +Benchmarking tips +================================== + + +Introduction +============ + +For benchmarking a patch we want to reduce all possible sources of +noise as much as possible. How to do that is very OS dependent. + +Note that low noise is required, but not sufficient. It does not +exclude measurement bias. See +https://www.cis.upenn.edu/~cis501/papers/producing-wrong-data.pdf for +example. + +General +================================ + +* Use a high resolution timer, e.g. perf under linux. + +* Run the benchmark multiple times to be able to recognize noise. + +* Disable as many processes or services as possible on the target system. + +* Disable frequency scaling, turbo boost and address space + randomization (see OS specific section). + +* Static link if the OS supports it. That avoids any variation that + might be introduced by loading dynamic libraries. This can be done + by passing ``-DLLVM_BUILD_STATIC=ON`` to cmake. + +* Try to avoid storage. On some systems you can use tmpfs. Putting the + program, inputs and outputs on tmpfs avoids touching a real storage + system, which can have a pretty big variability. + + To mount it (on linux and freebsd at least):: + + mount -t tmpfs -o size=g none dir_to_mount + +Linux +===== + +* Disable address space randomization:: + + echo 0 > /proc/sys/kernel/randomize_va_space + +* Set scaling_governor to performance:: + + for i in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor + do + echo performance > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor + done + +* Use https://github.com/lpechacek/cpuset to reserve cpus for just the + program you are benchmarking. If using perf, leave at least 2 cores + so that perf runs in one and your program in another:: + + cset shield -c N1,N2 -k on + + This will move all threads out of N1 and N2. The ``-k on`` means + that even kernel threads are moved out. + +* Disable the SMT pair of the cpus you will use for the benchmark. The + pair of cpu N can be found in + ``/sys/devices/system/cpu/cpuN/topology/thread_siblings_list`` and + disabled with:: + + echo 0 > /sys/devices/system/cpu/cpuX/online + + +* Run the program with:: + + cset shield --exec -- perf stat -r 10 + + This will run the command after ``--`` in the isolated cpus. The + particular perf command runs the ```` 10 times and reports + statistics. + +With these in place you can expect perf variations of less than 0.1%. + +Linux Intel +----------- + +* Disable turbo mode:: + + echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo Modified: vendor/llvm/dist/docs/GettingStartedVS.rst ============================================================================== --- vendor/llvm/dist/docs/GettingStartedVS.rst Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/docs/GettingStartedVS.rst Mon May 29 16:25:25 2017 (r319140) @@ -100,6 +100,10 @@ Here's the short story for getting up an * CMake generates project files for all build types. To select a specific build type, use the Configuration manager from the VS IDE or the ``/property:Configuration`` command line option when using MSBuild. + * By default, the Visual Studio project files generated by CMake use the + 32-bit toolset. If you are developing on a 64-bit version of Windows and + want to use the 64-bit toolset, pass the ``-Thost=x64`` flag when + generating the Visual Studio solution. This requires CMake 3.8.0 or later. 6. Start Visual Studio Modified: vendor/llvm/dist/docs/LangRef.rst ============================================================================== --- vendor/llvm/dist/docs/LangRef.rst Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/docs/LangRef.rst Mon May 29 16:25:25 2017 (r319140) @@ -4415,12 +4415,6 @@ The current supported vocabulary is limi address space identifier. - ``DW_OP_stack_value`` marks a constant value. -DIExpression nodes that contain a ``DW_OP_stack_value`` operator are standalone -location descriptions that describe constant values. This form is used to -describe global constants that have been optimized away. All other expressions -are modifiers to another location: A debug intrinsic ties a location and a -DIExpression together. - DWARF specifies three kinds of simple location descriptions: Register, memory, and implicit location descriptions. Register and memory location descriptions describe the *location* of a source variable (in the sense that a debugger might @@ -12722,7 +12716,7 @@ Syntax: declare @llvm.experimental.constrained.fadd( , , metadata , - metadata ) + metadata ) Overview: """"""""" @@ -12759,7 +12753,7 @@ Syntax: declare @llvm.experimental.constrained.fsub( , , metadata , - metadata ) + metadata ) Overview: """"""""" @@ -12796,7 +12790,7 @@ Syntax: declare @llvm.experimental.constrained.fmul( , , metadata , - metadata ) + metadata ) Overview: """"""""" @@ -12833,7 +12827,7 @@ Syntax: declare @llvm.experimental.constrained.fdiv( , , metadata , - metadata ) + metadata ) Overview: """"""""" @@ -12870,7 +12864,7 @@ Syntax: declare @llvm.experimental.constrained.frem( , , metadata , - metadata ) + metadata ) Overview: """"""""" @@ -12899,6 +12893,461 @@ value operands and has the same type as same sign as the dividend. +Constrained libm-equivalent Intrinsics +-------------------------------------- + +In addition to the basic floating point operations for which constrained +intrinsics are described above, there are constrained versions of various +operations which provide equivalent behavior to a corresponding libm function. +These intrinsics allow the precise behavior of these operations with respect to +rounding mode and exception behavior to be controlled. + +As with the basic constrained floating point intrinsics, the rounding mode +and exception behavior arguments only control the behavior of the optimizer. +They do not change the runtime floating point environment. + + +'``llvm.experimental.constrained.sqrt``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare + @llvm.experimental.constrained.sqrt( , + metadata , + metadata ) + +Overview: +""""""""" + +The '``llvm.experimental.constrained.sqrt``' intrinsic returns the square root +of the specified value, returning the same value as the libm '``sqrt``' +functions would, but without setting ``errno``. + +Arguments: +"""""""""" + +The first argument and the return type are floating point numbers of the same +type. + +The second and third arguments specify the rounding mode and exception +behavior as described above. + +Semantics: +"""""""""" + +This function returns the nonnegative square root of the specified value. +If the value is less than negative zero, a floating point exception occurs +and the the return value is architecture specific. + + +'``llvm.experimental.constrained.pow``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare + @llvm.experimental.constrained.pow( , , + metadata , + metadata ) + +Overview: +""""""""" + +The '``llvm.experimental.constrained.pow``' intrinsic returns the first operand +raised to the (positive or negative) power specified by the second operand. + +Arguments: +"""""""""" + +The first two arguments and the return value are floating point numbers of the +same type. The second argument specifies the power to which the first argument +should be raised. + +The third and fourth arguments specify the rounding mode and exception +behavior as described above. + +Semantics: +"""""""""" + +This function returns the first value raised to the second power, +returning the same values as the libm ``pow`` functions would, and +handles error conditions in the same way. + + +'``llvm.experimental.constrained.powi``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare + @llvm.experimental.constrained.powi( , i32 , + metadata , + metadata ) + +Overview: +""""""""" + +The '``llvm.experimental.constrained.powi``' intrinsic returns the first operand +raised to the (positive or negative) power specified by the second operand. The +order of evaluation of multiplications is not defined. When a vector of floating +point type is used, the second argument remains a scalar integer value. + + +Arguments: +"""""""""" + +The first argument and the return value are floating point numbers of the same +type. The second argument is a 32-bit signed integer specifying the power to +which the first argument should be raised. + +The third and fourth arguments specify the rounding mode and exception +behavior as described above. + +Semantics: +"""""""""" + +This function returns the first value raised to the second power with an +unspecified sequence of rounding operations. + + +'``llvm.experimental.constrained.sin``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare + @llvm.experimental.constrained.sin( , + metadata , + metadata ) + +Overview: +""""""""" + +The '``llvm.experimental.constrained.sin``' intrinsic returns the sine of the +first operand. + +Arguments: +"""""""""" + +The first argument and the return type are floating point numbers of the same +type. + +The second and third arguments specify the rounding mode and exception +behavior as described above. + +Semantics: +"""""""""" + +This function returns the sine of the specified operand, returning the +same values as the libm ``sin`` functions would, and handles error +conditions in the same way. + + +'``llvm.experimental.constrained.cos``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare + @llvm.experimental.constrained.cos( , + metadata , + metadata ) + +Overview: +""""""""" + +The '``llvm.experimental.constrained.cos``' intrinsic returns the cosine of the +first operand. + +Arguments: +"""""""""" + +The first argument and the return type are floating point numbers of the same +type. + +The second and third arguments specify the rounding mode and exception +behavior as described above. + +Semantics: +"""""""""" + +This function returns the cosine of the specified operand, returning the +same values as the libm ``cos`` functions would, and handles error +conditions in the same way. + + +'``llvm.experimental.constrained.exp``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare + @llvm.experimental.constrained.exp( , + metadata , + metadata ) + +Overview: +""""""""" + +The '``llvm.experimental.constrained.exp``' intrinsic computes the base-e +exponential of the specified value. + +Arguments: +"""""""""" + +The first argument and the return value are floating point numbers of the same +type. + +The second and third arguments specify the rounding mode and exception +behavior as described above. + +Semantics: +"""""""""" + +This function returns the same values as the libm ``exp`` functions +would, and handles error conditions in the same way. + + +'``llvm.experimental.constrained.exp2``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare + @llvm.experimental.constrained.exp2( , + metadata , + metadata ) + +Overview: +""""""""" + +The '``llvm.experimental.constrained.exp2``' intrinsic computes the base-2 +exponential of the specified value. + + +Arguments: +"""""""""" + +The first argument and the return value are floating point numbers of the same +type. + +The second and third arguments specify the rounding mode and exception +behavior as described above. + +Semantics: +"""""""""" + +This function returns the same values as the libm ``exp2`` functions +would, and handles error conditions in the same way. + + +'``llvm.experimental.constrained.log``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare + @llvm.experimental.constrained.log( , + metadata , + metadata ) + +Overview: +""""""""" + +The '``llvm.experimental.constrained.log``' intrinsic computes the base-e +logarithm of the specified value. + +Arguments: +"""""""""" + +The first argument and the return value are floating point numbers of the same +type. + +The second and third arguments specify the rounding mode and exception +behavior as described above. + + +Semantics: +"""""""""" + +This function returns the same values as the libm ``log`` functions +would, and handles error conditions in the same way. + + +'``llvm.experimental.constrained.log10``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare + @llvm.experimental.constrained.log10( , + metadata , + metadata ) + +Overview: +""""""""" + +The '``llvm.experimental.constrained.log10``' intrinsic computes the base-10 +logarithm of the specified value. + +Arguments: +"""""""""" + +The first argument and the return value are floating point numbers of the same +type. + +The second and third arguments specify the rounding mode and exception +behavior as described above. + +Semantics: +"""""""""" + +This function returns the same values as the libm ``log10`` functions +would, and handles error conditions in the same way. + + +'``llvm.experimental.constrained.log2``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare + @llvm.experimental.constrained.log2( , + metadata , + metadata ) + +Overview: +""""""""" + +The '``llvm.experimental.constrained.log2``' intrinsic computes the base-2 +logarithm of the specified value. + +Arguments: +"""""""""" + +The first argument and the return value are floating point numbers of the same +type. + +The second and third arguments specify the rounding mode and exception +behavior as described above. + +Semantics: +"""""""""" + +This function returns the same values as the libm ``log2`` functions +would, and handles error conditions in the same way. + + +'``llvm.experimental.constrained.rint``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare + @llvm.experimental.constrained.rint( , + metadata , + metadata ) + +Overview: +""""""""" + +The '``llvm.experimental.constrained.rint``' intrinsic returns the first +operand rounded to the nearest integer. It may raise an inexact floating point +exception if the operand is not an integer. + +Arguments: +"""""""""" + +The first argument and the return value are floating point numbers of the same +type. + +The second and third arguments specify the rounding mode and exception +behavior as described above. + +Semantics: +"""""""""" + +This function returns the same values as the libm ``rint`` functions +would, and handles error conditions in the same way. The rounding mode is +described, not determined, by the rounding mode argument. The actual rounding +mode is determined by the runtime floating point environment. The rounding +mode argument is only intended as information to the compiler. + + +'``llvm.experimental.constrained.nearbyint``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +:: + + declare + @llvm.experimental.constrained.nearbyint( , + metadata , + metadata ) + +Overview: +""""""""" + +The '``llvm.experimental.constrained.nearbyint``' intrinsic returns the first +operand rounded to the nearest integer. It will not raise an inexact floating +point exception if the operand is not an integer. + + +Arguments: +"""""""""" + +The first argument and the return value are floating point numbers of the same +type. + +The second and third arguments specify the rounding mode and exception +behavior as described above. + +Semantics: +"""""""""" + +This function returns the same values as the libm ``nearbyint`` functions +would, and handles error conditions in the same way. The rounding mode is +described, not determined, by the rounding mode argument. The actual rounding +mode is determined by the runtime floating point environment. The rounding +mode argument is only intended as information to the compiler. + + General Intrinsics ------------------ Modified: vendor/llvm/dist/docs/Vectorizers.rst ============================================================================== --- vendor/llvm/dist/docs/Vectorizers.rst Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/docs/Vectorizers.rst Mon May 29 16:25:25 2017 (r319140) @@ -99,7 +99,9 @@ Optimization remarks are enabled using: indicates if vectorization was specified. ``-Rpass-analysis=loop-vectorize`` identifies the statements that caused -vectorization to fail. +vectorization to fail. If in addition ``-fsave-optimization-record`` is +provided, multiple causes of vectorization failure may be listed (this behavior +might change in the future). Consider the following loop: Modified: vendor/llvm/dist/docs/index.rst ============================================================================== --- vendor/llvm/dist/docs/index.rst Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/docs/index.rst Mon May 29 16:25:25 2017 (r319140) @@ -90,6 +90,7 @@ representation. CodeOfConduct CompileCudaWithLLVM ReportingGuide + Benchmarking :doc:`GettingStarted` Discusses how to get up and running quickly with the LLVM infrastructure. Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h Mon May 29 16:25:25 2017 (r319140) @@ -1,4 +1,4 @@ -//===----- KaleidoscopeJIT.h - A simple JIT for Kaleidoscope ----*- C++ -*-===// +//===- KaleidoscopeJIT.h - A simple JIT for Kaleidoscope --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -17,7 +17,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JITSymbol.h" -#include "llvm/ExecutionEngine/RuntimeDyld.h" +#include "llvm/ExecutionEngine/RTDyldMemoryManager.h" #include "llvm/ExecutionEngine/SectionMemoryManager.h" #include "llvm/ExecutionEngine/Orc/CompileUtils.h" #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h" @@ -44,7 +44,7 @@ private: IRCompileLayer CompileLayer; public: - typedef decltype(CompileLayer)::ModuleSetHandleT ModuleHandle; + using ModuleHandle = decltype(CompileLayer)::ModuleSetHandleT; KaleidoscopeJIT() : TM(EngineBuilder().selectTarget()), DL(TM->createDataLayout()), Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h Mon May 29 16:25:25 2017 (r319140) @@ -1,4 +1,4 @@ -//===----- KaleidoscopeJIT.h - A simple JIT for Kaleidoscope ----*- C++ -*-===// +//===- KaleidoscopeJIT.h - A simple JIT for Kaleidoscope --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -17,7 +17,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JITSymbol.h" -#include "llvm/ExecutionEngine/RuntimeDyld.h" +#include "llvm/ExecutionEngine/RTDyldMemoryManager.h" #include "llvm/ExecutionEngine/SectionMemoryManager.h" #include "llvm/ExecutionEngine/Orc/CompileUtils.h" #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h" @@ -47,13 +47,13 @@ private: RTDyldObjectLinkingLayer<> ObjectLayer; IRCompileLayer CompileLayer; - typedef std::function(std::unique_ptr)> - OptimizeFunction; + using OptimizeFunction = + std::function(std::unique_ptr)>; IRTransformLayer OptimizeLayer; public: - typedef decltype(OptimizeLayer)::ModuleSetHandleT ModuleHandle; + using ModuleHandle = decltype(OptimizeLayer)::ModuleSetHandleT; KaleidoscopeJIT() : TM(EngineBuilder().selectTarget()), DL(TM->createDataLayout()), Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h Mon May 29 16:25:25 2017 (r319140) @@ -1,4 +1,4 @@ -//===----- KaleidoscopeJIT.h - A simple JIT for Kaleidoscope ----*- C++ -*-===// +//===- KaleidoscopeJIT.h - A simple JIT for Kaleidoscope --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -17,6 +17,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JITSymbol.h" +#include "llvm/ExecutionEngine/RTDyldMemoryManager.h" #include "llvm/ExecutionEngine/RuntimeDyld.h" #include "llvm/ExecutionEngine/SectionMemoryManager.h" #include "llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h" @@ -49,8 +50,8 @@ private: RTDyldObjectLinkingLayer<> ObjectLayer; IRCompileLayer CompileLayer; - typedef std::function(std::unique_ptr)> - OptimizeFunction; + using OptimizeFunction = + std::function(std::unique_ptr)>; IRTransformLayer OptimizeLayer; @@ -58,7 +59,7 @@ private: CompileOnDemandLayer CODLayer; public: - typedef decltype(CODLayer)::ModuleSetHandleT ModuleHandle; + using ModuleHandle = decltype(CODLayer)::ModuleSetHandleT; KaleidoscopeJIT() : TM(EngineBuilder().selectTarget()), DL(TM->createDataLayout()), Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h Mon May 29 16:25:25 2017 (r319140) @@ -1,4 +1,4 @@ -//===----- KaleidoscopeJIT.h - A simple JIT for Kaleidoscope ----*- C++ -*-===// +//===- KaleidoscopeJIT.h - A simple JIT for Kaleidoscope --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -17,10 +17,10 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JITSymbol.h" -#include "llvm/ExecutionEngine/RuntimeDyld.h" +#include "llvm/ExecutionEngine/RTDyldMemoryManager.h" #include "llvm/ExecutionEngine/SectionMemoryManager.h" -#include "llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h" #include "llvm/ExecutionEngine/Orc/CompileUtils.h" +#include "llvm/ExecutionEngine/Orc/IndirectionUtils.h" #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h" #include "llvm/ExecutionEngine/Orc/IRTransformLayer.h" #include "llvm/ExecutionEngine/Orc/LambdaResolver.h" @@ -76,8 +76,8 @@ private: RTDyldObjectLinkingLayer<> ObjectLayer; IRCompileLayer CompileLayer; - typedef std::function(std::unique_ptr)> - OptimizeFunction; + using OptimizeFunction = + std::function(std::unique_ptr)>; IRTransformLayer OptimizeLayer; @@ -85,7 +85,7 @@ private: std::unique_ptr IndirectStubsMgr; public: - typedef decltype(OptimizeLayer)::ModuleSetHandleT ModuleHandle; + using ModuleHandle = decltype(OptimizeLayer)::ModuleSetHandleT; KaleidoscopeJIT() : TM(EngineBuilder().selectTarget()), @@ -106,7 +106,6 @@ public: TargetMachine &getTargetMachine() { return *TM; } ModuleHandle addModule(std::unique_ptr M) { - // Build our symbol resolver: // Lambda 1: Look back into the JIT itself to find symbols that are part of // the same "logical dylib". Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h Mon May 29 16:25:25 2017 (r319140) @@ -1,4 +1,4 @@ -//===----- KaleidoscopeJIT.h - A simple JIT for Kaleidoscope ----*- C++ -*-===// +//===- KaleidoscopeJIT.h - A simple JIT for Kaleidoscope --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -20,9 +20,8 @@ #include "llvm/ADT/Triple.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JITSymbol.h" -#include "llvm/ExecutionEngine/RuntimeDyld.h" -#include "llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h" #include "llvm/ExecutionEngine/Orc/CompileUtils.h" +#include "llvm/ExecutionEngine/Orc/IndirectionUtils.h" #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h" #include "llvm/ExecutionEngine/Orc/IRTransformLayer.h" #include "llvm/ExecutionEngine/Orc/LambdaResolver.h" @@ -73,7 +72,7 @@ namespace llvm { namespace orc { // Typedef the remote-client API. -typedef remote::OrcRemoteTargetClient MyRemote; +using MyRemote = remote::OrcRemoteTargetClient; class KaleidoscopeJIT { private: @@ -82,8 +81,8 @@ private: RTDyldObjectLinkingLayer<> ObjectLayer; IRCompileLayer CompileLayer; - typedef std::function(std::unique_ptr)> - OptimizeFunction; + using OptimizeFunction = + std::function(std::unique_ptr)>; IRTransformLayer OptimizeLayer; @@ -92,7 +91,7 @@ private: MyRemote &Remote; public: - typedef decltype(OptimizeLayer)::ModuleSetHandleT ModuleHandle; + using ModuleHandle = decltype(OptimizeLayer)::ModuleSetHandleT; KaleidoscopeJIT(MyRemote &Remote) : TM(EngineBuilder().selectTarget(Triple(Remote.getTargetTriple()), "", @@ -124,7 +123,6 @@ public: TargetMachine &getTargetMachine() { return *TM; } ModuleHandle addModule(std::unique_ptr M) { - // Build our symbol resolver: // Lambda 1: Look back into the JIT itself to find symbols that are part of // the same "logical dylib". Modified: vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter5/Server/server.cpp ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter5/Server/server.cpp Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/examples/Kaleidoscope/BuildingAJIT/Chapter5/Server/server.cpp Mon May 29 16:25:25 2017 (r319140) @@ -1,17 +1,19 @@ +#include "../RemoteJITUtils.h" +#include "llvm/ExecutionEngine/RTDyldMemoryManager.h" +#include "llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h" +#include "llvm/ExecutionEngine/Orc/OrcABISupport.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/DynamicLibrary.h" +#include "llvm/Support/Error.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/Support/TargetSelect.h" -#include "llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h" -#include "llvm/ExecutionEngine/Orc/OrcABISupport.h" - -#include "../RemoteJITUtils.h" - +#include +#include #include -#include +#include #include #include - using namespace llvm; using namespace llvm::orc; @@ -22,7 +24,7 @@ cl::opt Port("port", ExitOnError ExitOnErr; -typedef int (*MainFun)(int, const char*[]); +using MainFun = int (*)(int, const char*[]); template NativePtrT MakeNative(uint64_t P) { @@ -36,7 +38,6 @@ void printExprResult(double Val) { // --- LAZY COMPILE TEST --- int main(int argc, char* argv[]) { - if (argc == 0) ExitOnErr.setBanner("jit_server: "); else @@ -59,14 +60,14 @@ int main(int argc, char* argv[]) { int sockfd = socket(PF_INET, SOCK_STREAM, 0); sockaddr_in servAddr, clientAddr; socklen_t clientAddrLen = sizeof(clientAddr); - bzero(&servAddr, sizeof(servAddr)); + memset(&servAddr, 0, sizeof(servAddr)); servAddr.sin_family = PF_INET; servAddr.sin_family = INADDR_ANY; servAddr.sin_port = htons(Port); { // avoid "Address already in use" error. - int yes=1; + int yes = 1; if (setsockopt(sockfd,SOL_SOCKET,SO_REUSEADDR,&yes,sizeof(int)) == -1) { errs() << "Error calling setsockopt.\n"; return 1; @@ -98,7 +99,8 @@ int main(int argc, char* argv[]) { }; FDRPCChannel TCPChannel(newsockfd, newsockfd); - typedef remote::OrcRemoteTargetServer MyServerT; + + using MyServerT = remote::OrcRemoteTargetServer; MyServerT Server(TCPChannel, SymbolLookup, RegisterEHFrames, DeregisterEHFrames); Modified: vendor/llvm/dist/examples/Kaleidoscope/include/KaleidoscopeJIT.h ============================================================================== --- vendor/llvm/dist/examples/Kaleidoscope/include/KaleidoscopeJIT.h Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/examples/Kaleidoscope/include/KaleidoscopeJIT.h Mon May 29 16:25:25 2017 (r319140) @@ -1,4 +1,4 @@ -//===----- KaleidoscopeJIT.h - A simple JIT for Kaleidoscope ----*- C++ -*-===// +//===- KaleidoscopeJIT.h - A simple JIT for Kaleidoscope --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -19,7 +19,6 @@ #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JITSymbol.h" #include "llvm/ExecutionEngine/RTDyldMemoryManager.h" -#include "llvm/ExecutionEngine/RuntimeDyld.h" #include "llvm/ExecutionEngine/SectionMemoryManager.h" #include "llvm/ExecutionEngine/Orc/CompileUtils.h" #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h" @@ -40,9 +39,9 @@ namespace orc { class KaleidoscopeJIT { public: - typedef RTDyldObjectLinkingLayer<> ObjLayerT; - typedef IRCompileLayer CompileLayerT; - typedef CompileLayerT::ModuleSetHandleT ModuleHandleT; + using ObjLayerT = RTDyldObjectLinkingLayer<>; + using CompileLayerT = IRCompileLayer; + using ModuleHandleT = CompileLayerT::ModuleSetHandleT; KaleidoscopeJIT() : TM(EngineBuilder().selectTarget()), DL(TM->createDataLayout()), Modified: vendor/llvm/dist/include/llvm/ADT/Triple.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/Triple.h Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/include/llvm/ADT/Triple.h Mon May 29 16:25:25 2017 (r319140) @@ -59,6 +59,7 @@ public: mips64, // MIPS64: mips64 mips64el, // MIPS64EL: mips64el msp430, // MSP430: msp430 + nios2, // NIOSII: nios2 ppc, // PPC: powerpc ppc64, // PPC64: powerpc64, ppu ppc64le, // PPC64LE: powerpc64le Modified: vendor/llvm/dist/include/llvm/Analysis/InstructionSimplify.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/InstructionSimplify.h Mon May 29 15:24:45 2017 (r319139) +++ vendor/llvm/dist/include/llvm/Analysis/InstructionSimplify.h Mon May 29 16:25:25 2017 (r319140) @@ -70,174 +70,173 @@ struct SimplifyQuery { Copy.CxtI = I; return Copy; } - }; +}; - // NOTE: the explicit multiple argument versions of these functions are - // deprecated. - // Please use the SimplifyQuery versions in new code. +// NOTE: the explicit multiple argument versions of these functions are +// deprecated. +// Please use the SimplifyQuery versions in new code. - /// Given operands for an Add, fold the result or return null. - Value *SimplifyAddInst(Value *LHS, Value *RHS, bool isNSW, bool isNUW, +/// Given operands for an Add, fold the result or return null. +Value *SimplifyAddInst(Value *LHS, Value *RHS, bool isNSW, bool isNUW, const SimplifyQuery &Q); - /// Given operands for a Sub, fold the result or return null. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Mon May 29 16:25: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 7F83CD777DC; Mon, 29 May 2017 16:25: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 3322E80B49; Mon, 29 May 2017 16:25:55 +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 v4TGPsi3083101; Mon, 29 May 2017 16:25:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TGPs40083100; Mon, 29 May 2017 16:25:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705291625.v4TGPs40083100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 May 2017 16:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319143 - vendor/clang/clang-trunk-r304149 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 16:25:55 -0000 Author: dim Date: Mon May 29 16:25:53 2017 New Revision: 319143 URL: https://svnweb.freebsd.org/changeset/base/319143 Log: Tag clang trunk r304149. Added: vendor/clang/clang-trunk-r304149/ - copied from r319142, vendor/clang/dist/ From owner-svn-src-vendor@freebsd.org Mon May 29 16:25: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 6633CD777C8; Mon, 29 May 2017 16:25: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 104A880AFB; Mon, 29 May 2017 16:25:50 +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 v4TGPo3O083053; Mon, 29 May 2017 16:25:50 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TGPkiN083020; Mon, 29 May 2017 16:25:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705291625.v4TGPkiN083020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 May 2017 16:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319142 - in vendor/clang/dist: . bindings/python/clang cmake/caches docs include/clang-c include/clang/AST include/clang/Basic include/clang/Driver include/clang/Format include/clang/F... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 16:25:51 -0000 Author: dim Date: Mon May 29 16:25:46 2017 New Revision: 319142 URL: https://svnweb.freebsd.org/changeset/base/319142 Log: Vendor import of clang trunk r304149: https://llvm.org/svn/llvm-project/cfe/trunk@304149 Added: vendor/clang/dist/cmake/caches/BaremetalARM.cmake vendor/clang/dist/lib/Driver/ToolChains/BareMetal.cpp (contents, props changed) vendor/clang/dist/lib/Driver/ToolChains/BareMetal.h (contents, props changed) vendor/clang/dist/lib/Headers/avx512vpopcntdqintrin.h (contents, props changed) vendor/clang/dist/test/CodeGen/avx512vpopcntdqintrin.c (contents, props changed) vendor/clang/dist/test/CodeGen/union-tbaa1.c (contents, props changed) vendor/clang/dist/test/CodeGen/xray-imbue-arg1.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCXX/union-tbaa2.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCoroutines/Inputs/ vendor/clang/dist/test/CodeGenCoroutines/Inputs/coroutine.h (contents, props changed) vendor/clang/dist/test/CodeGenCoroutines/coro-gro.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCoroutines/coro-lambda.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCoroutines/coro-params.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCoroutines/coro-promise-dtor.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCoroutines/coro-ret-void.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCoroutines/coro-unhandled-exception.cpp (contents, props changed) vendor/clang/dist/test/Driver/Inputs/baremetal_arm/ vendor/clang/dist/test/Driver/Inputs/baremetal_arm/include/ vendor/clang/dist/test/Driver/Inputs/baremetal_arm/include/c++/ vendor/clang/dist/test/Driver/Inputs/baremetal_arm/include/c++/5.0.0/ vendor/clang/dist/test/Driver/Inputs/baremetal_arm/include/c++/5.0.0/.keep vendor/clang/dist/test/Driver/Inputs/baremetal_arm/include/c++/6.0.0/ vendor/clang/dist/test/Driver/Inputs/baremetal_arm/include/c++/6.0.0/.keep vendor/clang/dist/test/Driver/Inputs/baremetal_arm/include/c++/v1/ vendor/clang/dist/test/Driver/Inputs/baremetal_arm/include/c++/v1/.keep vendor/clang/dist/test/Driver/autocomplete.c (contents, props changed) vendor/clang/dist/test/Driver/baremetal.cpp (contents, props changed) vendor/clang/dist/test/Frontend/Inputs/SystemHeaderPrefix/line-directive-in-system.h (contents, props changed) vendor/clang/dist/test/Frontend/Inputs/SystemHeaderPrefix/noline.h (contents, props changed) vendor/clang/dist/test/Frontend/Inputs/line-directive.h (contents, props changed) vendor/clang/dist/test/Frontend/system-header-line-directive.c (contents, props changed) vendor/clang/dist/test/Misc/caret-diags-multiline.cpp (contents, props changed) vendor/clang/dist/test/Modules/Inputs/DependsOnModule.framework/Headers/coroutines.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/DependsOnModule.framework/Headers/not_coroutines.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/diagnose-missing-import/ vendor/clang/dist/test/Modules/Inputs/diagnose-missing-import/a.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/diagnose-missing-import/module.modulemap vendor/clang/dist/test/Modules/diagnose-missing-import.m vendor/clang/dist/test/Modules/requires-coroutines.mm vendor/clang/dist/test/SemaCXX/coroutine-seh.cpp (contents, props changed) vendor/clang/dist/test/SemaCXX/null-cast.cpp (contents, props changed) vendor/clang/dist/test/SemaObjC/diagnose_if.m vendor/clang/dist/utils/bash-autocomplete.sh (contents, props changed) Deleted: vendor/clang/dist/test/Driver/arm-darwin-builtin.c Modified: vendor/clang/dist/CMakeLists.txt vendor/clang/dist/bindings/python/clang/cindex.py vendor/clang/dist/docs/Modules.rst vendor/clang/dist/include/clang-c/Index.h vendor/clang/dist/include/clang/AST/Expr.h vendor/clang/dist/include/clang/AST/StmtCXX.h vendor/clang/dist/include/clang/Basic/Attr.td vendor/clang/dist/include/clang/Basic/BuiltinsAMDGPU.def vendor/clang/dist/include/clang/Basic/BuiltinsPPC.def vendor/clang/dist/include/clang/Basic/BuiltinsX86.def vendor/clang/dist/include/clang/Basic/DiagnosticOptions.def vendor/clang/dist/include/clang/Basic/DiagnosticOptions.h vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/SourceManager.h vendor/clang/dist/include/clang/Basic/SourceManagerInternals.h vendor/clang/dist/include/clang/Basic/TemplateKinds.h vendor/clang/dist/include/clang/Basic/XRayLists.h vendor/clang/dist/include/clang/Driver/CC1Options.td vendor/clang/dist/include/clang/Driver/Options.td vendor/clang/dist/include/clang/Format/Format.h vendor/clang/dist/include/clang/Frontend/ASTUnit.h vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def vendor/clang/dist/include/clang/Frontend/CompilerInvocation.h vendor/clang/dist/include/clang/Lex/ModuleMap.h vendor/clang/dist/include/clang/Sema/AttributeList.h vendor/clang/dist/include/clang/Sema/ParsedTemplate.h vendor/clang/dist/include/clang/Sema/ScopeInfo.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/Tooling/CompilationDatabase.h vendor/clang/dist/lib/AST/DeclBase.cpp vendor/clang/dist/lib/AST/ExprConstant.cpp vendor/clang/dist/lib/AST/MicrosoftMangle.cpp vendor/clang/dist/lib/AST/StmtCXX.cpp vendor/clang/dist/lib/Analysis/AnalysisDeclContext.cpp vendor/clang/dist/lib/Basic/Module.cpp vendor/clang/dist/lib/Basic/SourceManager.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/Basic/XRayLists.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/TargetInfo.cpp vendor/clang/dist/lib/Driver/CMakeLists.txt vendor/clang/dist/lib/Driver/Driver.cpp vendor/clang/dist/lib/Driver/ToolChains/Gnu.cpp vendor/clang/dist/lib/Driver/ToolChains/Linux.cpp vendor/clang/dist/lib/Driver/ToolChains/Myriad.cpp vendor/clang/dist/lib/Format/ContinuationIndenter.cpp vendor/clang/dist/lib/Format/Format.cpp vendor/clang/dist/lib/Format/TokenAnnotator.cpp vendor/clang/dist/lib/Frontend/ASTUnit.cpp vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/lib/Frontend/CreateInvocationFromCommandLine.cpp vendor/clang/dist/lib/Frontend/FrontendAction.cpp vendor/clang/dist/lib/Frontend/InitPreprocessor.cpp vendor/clang/dist/lib/Frontend/TextDiagnostic.cpp vendor/clang/dist/lib/Headers/CMakeLists.txt vendor/clang/dist/lib/Headers/altivec.h vendor/clang/dist/lib/Headers/immintrin.h vendor/clang/dist/lib/Index/IndexBody.cpp vendor/clang/dist/lib/Index/IndexingContext.cpp vendor/clang/dist/lib/Lex/LiteralSupport.cpp vendor/clang/dist/lib/Lex/ModuleMap.cpp vendor/clang/dist/lib/Lex/PPDirectives.cpp vendor/clang/dist/lib/Lex/PPMacroExpansion.cpp vendor/clang/dist/lib/Lex/Pragma.cpp vendor/clang/dist/lib/Parse/ParseExprCXX.cpp vendor/clang/dist/lib/Parse/ParseTemplate.cpp vendor/clang/dist/lib/Sema/AnalysisBasedWarnings.cpp vendor/clang/dist/lib/Sema/CoroutineStmtBuilder.h vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaCoroutine.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaLambda.cpp vendor/clang/dist/lib/Sema/SemaLookup.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiate.cpp vendor/clang/dist/lib/Sema/TreeTransform.h vendor/clang/dist/lib/Tooling/CommonOptionsParser.cpp vendor/clang/dist/lib/Tooling/CompilationDatabase.cpp vendor/clang/dist/lib/Tooling/Tooling.cpp vendor/clang/dist/test/CXX/class.access/p4.cpp vendor/clang/dist/test/CodeGen/64bit-swiftcall.c vendor/clang/dist/test/CodeGen/aarch64-neon-2velem.c vendor/clang/dist/test/CodeGen/aarch64-neon-3v.c vendor/clang/dist/test/CodeGen/aarch64-neon-across.c vendor/clang/dist/test/CodeGen/aarch64-neon-extract.c vendor/clang/dist/test/CodeGen/aarch64-neon-fcvt-intrinsics.c vendor/clang/dist/test/CodeGen/aarch64-neon-fma.c vendor/clang/dist/test/CodeGen/aarch64-neon-intrinsics.c vendor/clang/dist/test/CodeGen/aarch64-neon-ldst-one.c vendor/clang/dist/test/CodeGen/aarch64-neon-misc.c vendor/clang/dist/test/CodeGen/aarch64-neon-perm.c vendor/clang/dist/test/CodeGen/aarch64-neon-scalar-copy.c vendor/clang/dist/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c vendor/clang/dist/test/CodeGen/aarch64-neon-shifts.c vendor/clang/dist/test/CodeGen/aarch64-neon-tbl.c vendor/clang/dist/test/CodeGen/aarch64-neon-vcombine.c vendor/clang/dist/test/CodeGen/aarch64-neon-vget-hilo.c vendor/clang/dist/test/CodeGen/aarch64-neon-vget.c vendor/clang/dist/test/CodeGen/aarch64-poly128.c vendor/clang/dist/test/CodeGen/aarch64-poly64.c vendor/clang/dist/test/CodeGen/address-safety-attr-kasan.cpp vendor/clang/dist/test/CodeGen/address-safety-attr.cpp vendor/clang/dist/test/CodeGen/arm-crc32.c vendor/clang/dist/test/CodeGen/arm-neon-directed-rounding.c vendor/clang/dist/test/CodeGen/arm-neon-fma.c vendor/clang/dist/test/CodeGen/arm-neon-numeric-maxmin.c vendor/clang/dist/test/CodeGen/arm-neon-shifts.c vendor/clang/dist/test/CodeGen/arm-neon-vcvtX.c vendor/clang/dist/test/CodeGen/arm-neon-vget.c vendor/clang/dist/test/CodeGen/arm-swiftcall.c vendor/clang/dist/test/CodeGen/arm64-crc32.c vendor/clang/dist/test/CodeGen/arm64-lanes.c vendor/clang/dist/test/CodeGen/arm64_vcopy.c vendor/clang/dist/test/CodeGen/arm64_vdupq_n_f64.c vendor/clang/dist/test/CodeGen/attr-coldhot.c vendor/clang/dist/test/CodeGen/attr-naked.c vendor/clang/dist/test/CodeGen/attr-target-x86.c vendor/clang/dist/test/CodeGen/builtins-arm-exclusive.c vendor/clang/dist/test/CodeGen/builtins-arm.c vendor/clang/dist/test/CodeGen/builtins-arm64.c vendor/clang/dist/test/CodeGen/builtins-ppc-error.c vendor/clang/dist/test/CodeGen/builtins-ppc-vsx.c vendor/clang/dist/test/CodeGen/mips-varargs.c vendor/clang/dist/test/CodeGen/noduplicate-cxx11-test.cpp vendor/clang/dist/test/CodeGen/piclevels.c vendor/clang/dist/test/CodeGen/pragma-weak.c vendor/clang/dist/test/CodeGen/unwind-attr.c vendor/clang/dist/test/CodeGenCXX/apple-kext-indirect-virtual-dtor-call.cpp vendor/clang/dist/test/CodeGenCXX/apple-kext-no-staticinit-section.cpp vendor/clang/dist/test/CodeGenCXX/debug-info-global-ctor-dtor.cpp vendor/clang/dist/test/CodeGenCXX/optnone-templates.cpp vendor/clang/dist/test/CodeGenCXX/static-init-wasm.cpp vendor/clang/dist/test/CodeGenCXX/thunks.cpp vendor/clang/dist/test/CodeGenCoroutines/coro-alloc.cpp vendor/clang/dist/test/CodeGenCoroutines/coro-await.cpp vendor/clang/dist/test/CodeGenCoroutines/coro-builtins.c vendor/clang/dist/test/CodeGenCoroutines/coro-cleanup.cpp vendor/clang/dist/test/CodeGenCoroutines/coro-eh-cleanup.cpp vendor/clang/dist/test/CodeGenObjC/gnu-exceptions.m vendor/clang/dist/test/CodeGenOpenCL/amdgpu-alignment.cl vendor/clang/dist/test/CodeGenOpenCL/amdgpu-attrs.cl vendor/clang/dist/test/CodeGenOpenCL/amdgpu-debug-info-pointer-address-space.cl vendor/clang/dist/test/CodeGenOpenCL/amdgpu-debug-info-variable-expression.cl vendor/clang/dist/test/CodeGenOpenCL/amdgpu-nullptr.cl vendor/clang/dist/test/CodeGenOpenCL/builtins-amdgcn.cl vendor/clang/dist/test/CodeGenOpenCL/byval.cl vendor/clang/dist/test/CodeGenOpenCL/half.cl vendor/clang/dist/test/CodeGenOpenCL/size_t.cl vendor/clang/dist/test/Driver/aarch64-cpus.c vendor/clang/dist/test/Driver/amdgpu-features.c vendor/clang/dist/test/Driver/arm-default-build-attributes.s vendor/clang/dist/test/Driver/cl-outputs.c vendor/clang/dist/test/Driver/clang_f_opts.c vendor/clang/dist/test/Driver/cuda-external-tools.cu vendor/clang/dist/test/Driver/darwin-iphone-defaults.m vendor/clang/dist/test/Driver/debug-options.c vendor/clang/dist/test/Driver/gfortran.f90 vendor/clang/dist/test/Driver/split-debug.h vendor/clang/dist/test/Driver/unknown-arg.c vendor/clang/dist/test/Frontend/gnu-mcount.c vendor/clang/dist/test/Index/Core/index-instantiated-source.cpp vendor/clang/dist/test/Index/Core/index-source.m vendor/clang/dist/test/Index/index-attrs.c vendor/clang/dist/test/Index/index-attrs.cpp vendor/clang/dist/test/Index/index-module.m vendor/clang/dist/test/Index/opencl-types.cl vendor/clang/dist/test/Lexer/cxx-features.cpp vendor/clang/dist/test/Modules/Inputs/DependsOnModule.framework/module.map vendor/clang/dist/test/OpenMP/nvptx_target_codegen.cpp vendor/clang/dist/test/OpenMP/target_codegen.cpp vendor/clang/dist/test/OpenMP/target_codegen_registration.cpp vendor/clang/dist/test/OpenMP/target_parallel_codegen.cpp vendor/clang/dist/test/OpenMP/target_parallel_codegen_registration.cpp vendor/clang/dist/test/OpenMP/target_parallel_if_codegen.cpp vendor/clang/dist/test/OpenMP/target_parallel_num_threads_codegen.cpp vendor/clang/dist/test/OpenMP/target_teams_codegen.cpp vendor/clang/dist/test/OpenMP/target_teams_codegen_registration.cpp vendor/clang/dist/test/OpenMP/target_teams_num_teams_codegen.cpp vendor/clang/dist/test/OpenMP/target_teams_thread_limit_codegen.cpp vendor/clang/dist/test/Parser/objc-available.m vendor/clang/dist/test/Preprocessor/line-directive-output.c vendor/clang/dist/test/Sema/128bitfloat.cpp vendor/clang/dist/test/Sema/sizeof-struct-non-zero-as-member.cl vendor/clang/dist/test/SemaCXX/coreturn.cpp vendor/clang/dist/test/SemaCXX/coroutine-unhandled_exception-warning.cpp vendor/clang/dist/test/SemaCXX/coroutines.cpp vendor/clang/dist/test/SemaCXX/default-assignment-operator.cpp vendor/clang/dist/test/SemaCXX/deprecated.cpp vendor/clang/dist/test/SemaCXX/uninitialized.cpp vendor/clang/dist/test/SemaCXX/virtual-base-used.cpp vendor/clang/dist/test/SemaObjC/unguarded-availability.m vendor/clang/dist/test/SemaOpenCL/invalid-pipes-cl2.0.cl vendor/clang/dist/test/SemaOpenCL/vector_literals_invalid.cl vendor/clang/dist/tools/clang-format/git-clang-format vendor/clang/dist/tools/driver/driver.cpp vendor/clang/dist/tools/libclang/CXCompilationDatabase.cpp vendor/clang/dist/tools/libclang/CXType.cpp vendor/clang/dist/tools/scan-build/libexec/ccc-analyzer vendor/clang/dist/unittests/Driver/ToolChainTest.cpp vendor/clang/dist/unittests/Format/CleanupTest.cpp vendor/clang/dist/unittests/Format/FormatTest.cpp vendor/clang/dist/unittests/Format/FormatTestJS.cpp vendor/clang/dist/unittests/Format/FormatTestObjC.cpp vendor/clang/dist/unittests/Tooling/CompilationDatabaseTest.cpp vendor/clang/dist/utils/TableGen/ClangAttrEmitter.cpp vendor/clang/dist/www/cxx_status.html vendor/clang/dist/www/get_started.html Modified: vendor/clang/dist/CMakeLists.txt ============================================================================== --- vendor/clang/dist/CMakeLists.txt Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/CMakeLists.txt Mon May 29 16:25:46 2017 (r319142) @@ -359,6 +359,10 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) PATTERN "*.inc" PATTERN "*.h" ) + + install(PROGRAMS utils/bash-autocomplete.sh + DESTINATION share/clang + ) endif() add_definitions( -D_GNU_SOURCE ) Modified: vendor/clang/dist/bindings/python/clang/cindex.py ============================================================================== --- vendor/clang/dist/bindings/python/clang/cindex.py Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/bindings/python/clang/cindex.py Mon May 29 16:25:46 2017 (r319142) @@ -1963,6 +1963,47 @@ TypeKind.DEPENDENTSIZEDARRAY = TypeKind( TypeKind.MEMBERPOINTER = TypeKind(117) TypeKind.AUTO = TypeKind(118) TypeKind.ELABORATED = TypeKind(119) +TypeKind.PIPE = TypeKind(120) +TypeKind.OCLIMAGE1DRO = TypeKind(121) +TypeKind.OCLIMAGE1DARRAYRO = TypeKind(122) +TypeKind.OCLIMAGE1DBUFFERRO = TypeKind(123) +TypeKind.OCLIMAGE2DRO = TypeKind(124) +TypeKind.OCLIMAGE2DARRAYRO = TypeKind(125) +TypeKind.OCLIMAGE2DDEPTHRO = TypeKind(126) +TypeKind.OCLIMAGE2DARRAYDEPTHRO = TypeKind(127) +TypeKind.OCLIMAGE2DMSAARO = TypeKind(128) +TypeKind.OCLIMAGE2DARRAYMSAARO = TypeKind(129) +TypeKind.OCLIMAGE2DMSAADEPTHRO = TypeKind(130) +TypeKind.OCLIMAGE2DARRAYMSAADEPTHRO = TypeKind(131) +TypeKind.OCLIMAGE3DRO = TypeKind(132) +TypeKind.OCLIMAGE1DWO = TypeKind(133) +TypeKind.OCLIMAGE1DARRAYWO = TypeKind(134) +TypeKind.OCLIMAGE1DBUFFERWO = TypeKind(135) +TypeKind.OCLIMAGE2DWO = TypeKind(136) +TypeKind.OCLIMAGE2DARRAYWO = TypeKind(137) +TypeKind.OCLIMAGE2DDEPTHWO = TypeKind(138) +TypeKind.OCLIMAGE2DARRAYDEPTHWO = TypeKind(139) +TypeKind.OCLIMAGE2DMSAAWO = TypeKind(140) +TypeKind.OCLIMAGE2DARRAYMSAAWO = TypeKind(141) +TypeKind.OCLIMAGE2DMSAADEPTHWO = TypeKind(142) +TypeKind.OCLIMAGE2DARRAYMSAADEPTHWO = TypeKind(143) +TypeKind.OCLIMAGE3DWO = TypeKind(144) +TypeKind.OCLIMAGE1DRW = TypeKind(145) +TypeKind.OCLIMAGE1DARRAYRW = TypeKind(146) +TypeKind.OCLIMAGE1DBUFFERRW = TypeKind(147) +TypeKind.OCLIMAGE2DRW = TypeKind(148) +TypeKind.OCLIMAGE2DARRAYRW = TypeKind(149) +TypeKind.OCLIMAGE2DDEPTHRW = TypeKind(150) +TypeKind.OCLIMAGE2DARRAYDEPTHRW = TypeKind(151) +TypeKind.OCLIMAGE2DMSAARW = TypeKind(152) +TypeKind.OCLIMAGE2DARRAYMSAARW = TypeKind(153) +TypeKind.OCLIMAGE2DMSAADEPTHRW = TypeKind(154) +TypeKind.OCLIMAGE2DARRAYMSAADEPTHRW = TypeKind(155) +TypeKind.OCLIMAGE3DRW = TypeKind(156) +TypeKind.OCLSAMPLER = TypeKind(157) +TypeKind.OCLEVENT = TypeKind(158) +TypeKind.OCLQUEUE = TypeKind(159) +TypeKind.OCLRESERVEID = TypeKind(160) class RefQualifierKind(BaseEnumeration): """Describes a specific ref-qualifier of a type.""" Added: vendor/clang/dist/cmake/caches/BaremetalARM.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist/cmake/caches/BaremetalARM.cmake Mon May 29 16:25:46 2017 (r319142) @@ -0,0 +1,50 @@ +set(LLVM_TARGETS_TO_BUILD ARM;X86 CACHE STRING "") + +# Builtins +set(LLVM_BUILTIN_TARGETS "armv7m-none-eabi;armv6m-none-eabi;armv7em-none-eabi" CACHE STRING "Builtin Targets") + +set(BUILTINS_armv6m-none-eabi_CMAKE_SYSROOT ${BAREMETAL_ARMV6M_SYSROOT} CACHE STRING "armv6m-none-eabi Sysroot") +set(BUILTINS_armv6m-none-eabi_CMAKE_SYSTEM_NAME Generic CACHE STRING "armv6m-none-eabi System Name") +set(BUILTINS_armv6m-none-eabi_COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL "armv6m-none-eabi Baremetal build") +set(BUILTINS_armv6m-none-eabi_COMPILER_RT_OS_DIR "baremetal" CACHE STRING "armv6m-none-eabi os dir") + +set(BUILTINS_armv7m-none-eabi_CMAKE_SYSROOT ${BAREMETAL_ARMV7M_SYSROOT} CACHE STRING "armv7m-none-eabi Sysroot") +set(BUILTINS_armv7m-none-eabi_CMAKE_SYSTEM_NAME Generic CACHE STRING "armv7m-none-eabi System Name") +set(BUILTINS_armv7m-none-eabi_COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL "armv7m-none-eabi Baremetal build") +set(BUILTINS_armv7m-none-eabi_CMAKE_C_FLAGS "-mfpu=fp-armv8" CACHE STRING "armv7m-none-eabi C Flags") +set(BUILTINS_armv7m-none-eabi_CMAKE_ASM_FLAGS "-mfpu=fp-armv8" CACHE STRING "armv7m-none-eabi ASM Flags") +set(BUILTINS_armv7m-none-eabi_COMPILER_RT_OS_DIR "baremetal" CACHE STRING "armv7m-none-eabi os dir") + +set(BUILTINS_armv7em-none-eabi_CMAKE_SYSROOT ${BAREMETAL_ARMV7EM_SYSROOT} CACHE STRING "armv7em-none-eabi Sysroot") +set(BUILTINS_armv7em-none-eabi_CMAKE_SYSTEM_NAME Generic CACHE STRING "armv7em-none-eabi System Name") +set(BUILTINS_armv7em-none-eabi_COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL "armv7em-none-eabi Baremetal build") +set(BUILTINS_armv7em-none-eabi_CMAKE_C_FLAGS "-mfpu=fp-armv8" CACHE STRING "armv7em-none-eabi C Flags") +set(BUILTINS_armv7em-none-eabi_CMAKE_ASM_FLAGS "-mfpu=fp-armv8" CACHE STRING "armv7em-none-eabi ASM Flags") +set(BUILTINS_armv7em-none-eabi_COMPILER_RT_OS_DIR "baremetal" CACHE STRING "armv7em-none-eabi os dir") + +set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "") +set(LLVM_TOOLCHAIN_TOOLS + llc + llvm-ar + llvm-cxxfilt + llvm-dwarfdump + llvm-dsymutil + llvm-nm + llvm-objdump + llvm-ranlib + llvm-readobj + llvm-size + llvm-symbolizer + opt + CACHE STRING "") + +set(LLVM_DISTRIBUTION_COMPONENTS + clang + lld + clang-headers + builtins-armv6m-none-eabi + builtins-armv7m-none-eabi + builtins-armv7em-none-eabi + runtimes + ${LLVM_TOOLCHAIN_TOOLS} + CACHE STRING "") Modified: vendor/clang/dist/docs/Modules.rst ============================================================================== --- vendor/clang/dist/docs/Modules.rst Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/docs/Modules.rst Mon May 29 16:25:46 2017 (r319142) @@ -413,6 +413,9 @@ altivec blocks The "blocks" language feature is available. +coroutines + Support for the coroutines TS is available. + cplusplus C++ support is available. Modified: vendor/clang/dist/include/clang-c/Index.h ============================================================================== --- vendor/clang/dist/include/clang-c/Index.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang-c/Index.h Mon May 29 16:25:46 2017 (r319142) @@ -32,7 +32,7 @@ * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. */ #define CINDEX_VERSION_MAJOR 0 -#define CINDEX_VERSION_MINOR 39 +#define CINDEX_VERSION_MINOR 40 #define CINDEX_VERSION_ENCODE(major, minor) ( \ ((major) * 10000) \ @@ -3076,7 +3076,52 @@ enum CXTypeKind { * * E.g., struct S, or via a qualified name, e.g., N::M::type, or both. */ - CXType_Elaborated = 119 + CXType_Elaborated = 119, + + /* OpenCL PipeType. */ + CXType_Pipe = 120, + + /* OpenCL builtin types. */ + CXType_OCLImage1dRO = 121, + CXType_OCLImage1dArrayRO = 122, + CXType_OCLImage1dBufferRO = 123, + CXType_OCLImage2dRO = 124, + CXType_OCLImage2dArrayRO = 125, + CXType_OCLImage2dDepthRO = 126, + CXType_OCLImage2dArrayDepthRO = 127, + CXType_OCLImage2dMSAARO = 128, + CXType_OCLImage2dArrayMSAARO = 129, + CXType_OCLImage2dMSAADepthRO = 130, + CXType_OCLImage2dArrayMSAADepthRO = 131, + CXType_OCLImage3dRO = 132, + CXType_OCLImage1dWO = 133, + CXType_OCLImage1dArrayWO = 134, + CXType_OCLImage1dBufferWO = 135, + CXType_OCLImage2dWO = 136, + CXType_OCLImage2dArrayWO = 137, + CXType_OCLImage2dDepthWO = 138, + CXType_OCLImage2dArrayDepthWO = 139, + CXType_OCLImage2dMSAAWO = 140, + CXType_OCLImage2dArrayMSAAWO = 141, + CXType_OCLImage2dMSAADepthWO = 142, + CXType_OCLImage2dArrayMSAADepthWO = 143, + CXType_OCLImage3dWO = 144, + CXType_OCLImage1dRW = 145, + CXType_OCLImage1dArrayRW = 146, + CXType_OCLImage1dBufferRW = 147, + CXType_OCLImage2dRW = 148, + CXType_OCLImage2dArrayRW = 149, + CXType_OCLImage2dDepthRW = 150, + CXType_OCLImage2dArrayDepthRW = 151, + CXType_OCLImage2dMSAARW = 152, + CXType_OCLImage2dArrayMSAARW = 153, + CXType_OCLImage2dMSAADepthRW = 154, + CXType_OCLImage2dArrayMSAADepthRW = 155, + CXType_OCLImage3dRW = 156, + CXType_OCLSampler = 157, + CXType_OCLEvent = 158, + CXType_OCLQueue = 159, + CXType_OCLReserveID = 160 }; /** Modified: vendor/clang/dist/include/clang/AST/Expr.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Expr.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/AST/Expr.h Mon May 29 16:25:46 2017 (r319142) @@ -4284,6 +4284,9 @@ public: } Designator *getDesignator(unsigned Idx) { return &designators()[Idx]; } + const Designator *getDesignator(unsigned Idx) const { + return &designators()[Idx]; + } void setDesignators(const ASTContext &C, const Designator *Desigs, unsigned NumDesigs); Modified: vendor/clang/dist/include/clang/AST/StmtCXX.h ============================================================================== --- vendor/clang/dist/include/clang/AST/StmtCXX.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/AST/StmtCXX.h Mon May 29 16:25:46 2017 (r319142) @@ -308,7 +308,9 @@ class CoroutineBodyStmt final OnFallthrough, ///< Handler for control flow falling off the body. Allocate, ///< Coroutine frame memory allocation. Deallocate, ///< Coroutine frame memory deallocation. - ReturnValue, ///< Return value for thunk function. + ReturnValue, ///< Return value for thunk function: p.get_return_object(). + ResultDecl, ///< Declaration holding the result of get_return_object. + ReturnStmt, ///< Return statement for the thunk function. ReturnStmtOnAllocFailure, ///< Return statement if allocation failed. FirstParamMove ///< First offset for move construction of parameter copies. }; @@ -332,7 +334,9 @@ public: Stmt *OnFallthrough = nullptr; Expr *Allocate = nullptr; Expr *Deallocate = nullptr; - Stmt *ReturnValue = nullptr; + Expr *ReturnValue = nullptr; + Stmt *ResultDecl = nullptr; + Stmt *ReturnStmt = nullptr; Stmt *ReturnStmtOnAllocFailure = nullptr; ArrayRef ParamMoves; }; @@ -381,10 +385,11 @@ public: Expr *getDeallocate() const { return cast_or_null(getStoredStmts()[SubStmt::Deallocate]); } - Expr *getReturnValueInit() const { - return cast_or_null(getStoredStmts()[SubStmt::ReturnValue]); + return cast(getStoredStmts()[SubStmt::ReturnValue]); } + Stmt *getResultDecl() const { return getStoredStmts()[SubStmt::ResultDecl]; } + Stmt *getReturnStmt() const { return getStoredStmts()[SubStmt::ReturnStmt]; } Stmt *getReturnStmtOnAllocFailure() const { return getStoredStmts()[SubStmt::ReturnStmtOnAllocFailure]; } Modified: vendor/clang/dist/include/clang/Basic/Attr.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/Attr.td Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Basic/Attr.td Mon May 29 16:25:46 2017 (r319142) @@ -149,6 +149,9 @@ class ExprArgument : Argument; +class NamedArgument : Argument; class TypeArgument : Argument; class UnsignedArgument : Argument; class VariadicUnsignedArgument : Argument; @@ -1819,14 +1822,14 @@ def Unavailable : InheritableAttr { def DiagnoseIf : InheritableAttr { let Spellings = [GNU<"diagnose_if">]; - let Subjects = SubjectList<[Function]>; + let Subjects = SubjectList<[Function, ObjCMethod, ObjCProperty]>; let Args = [ExprArgument<"Cond">, StringArgument<"Message">, EnumArgument<"DiagnosticType", "DiagnosticType", ["error", "warning"], ["DT_Error", "DT_Warning"]>, BoolArgument<"ArgDependent", 0, /*fake*/ 1>, - FunctionArgument<"Parent", 0, /*fake*/ 1>]; + NamedArgument<"Parent", 0, /*fake*/ 1>]; let DuplicatesAllowedWhileMerging = 1; let LateParsed = 1; let AdditionalMembers = [{ Modified: vendor/clang/dist/include/clang/Basic/BuiltinsAMDGPU.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/BuiltinsAMDGPU.def Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Basic/BuiltinsAMDGPU.def Mon May 29 16:25:46 2017 (r319142) @@ -36,6 +36,7 @@ BUILTIN(__builtin_amdgcn_workitem_id_z, // Instruction builtins. //===----------------------------------------------------------------------===// BUILTIN(__builtin_amdgcn_s_getreg, "UiIi", "n") +BUILTIN(__builtin_amdgcn_s_getpc, "LUi", "n") BUILTIN(__builtin_amdgcn_s_waitcnt, "vIi", "n") BUILTIN(__builtin_amdgcn_s_sendmsg, "vIiUi", "n") BUILTIN(__builtin_amdgcn_s_sendmsghalt, "vIiUi", "n") Modified: vendor/clang/dist/include/clang/Basic/BuiltinsPPC.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/BuiltinsPPC.def Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Basic/BuiltinsPPC.def Mon May 29 16:25:46 2017 (r319142) @@ -420,6 +420,9 @@ BUILTIN(__builtin_vsx_xvtstdcsp, "V4UiV4 BUILTIN(__builtin_vsx_insertword, "V16UcV4UiV16UcIi", "") BUILTIN(__builtin_vsx_extractuword, "V2ULLiV16UcIi", "") +BUILTIN(__builtin_vsx_xxpermdi, "v.", "t") +BUILTIN(__builtin_vsx_xxsldwi, "v.", "t") + // HTM builtins BUILTIN(__builtin_tbegin, "UiUIi", "") BUILTIN(__builtin_tend, "UiUIi", "") Modified: vendor/clang/dist/include/clang/Basic/BuiltinsX86.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/BuiltinsX86.def Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Basic/BuiltinsX86.def Mon May 29 16:25:46 2017 (r319142) @@ -1107,6 +1107,9 @@ TARGET_BUILTIN(__builtin_ia32_vpconflict TARGET_BUILTIN(__builtin_ia32_vplzcntd_512_mask, "V16iV16iV16iUs", "", "avx512cd") TARGET_BUILTIN(__builtin_ia32_vplzcntq_512_mask, "V8LLiV8LLiV8LLiUc", "", "avx512cd") +TARGET_BUILTIN(__builtin_ia32_vpopcntd_512, "V16iV16i", "", "avx512vpopcntdq") +TARGET_BUILTIN(__builtin_ia32_vpopcntq_512, "V8LLiV8LLi", "", "avx512vpopcntdq") + TARGET_BUILTIN(__builtin_ia32_vpermi2varhi128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_vpermi2varhi256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_vpermt2varhi128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") Modified: vendor/clang/dist/include/clang/Basic/DiagnosticOptions.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticOptions.def Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Basic/DiagnosticOptions.def Mon May 29 16:25:46 2017 (r319142) @@ -87,6 +87,8 @@ VALUE_DIAGOPT(TemplateBacktraceLimit, 32 VALUE_DIAGOPT(ConstexprBacktraceLimit, 32, DefaultConstexprBacktraceLimit) /// Limit number of times to perform spell checking. VALUE_DIAGOPT(SpellCheckingLimit, 32, DefaultSpellCheckingLimit) +/// Limit number of lines shown in a snippet. +VALUE_DIAGOPT(SnippetLineLimit, 32, DefaultSnippetLineLimit) VALUE_DIAGOPT(TabStop, 32, DefaultTabStop) /// The distance between tab stops. /// Column limit for formatting message diagnostics, or 0 if unused. Modified: vendor/clang/dist/include/clang/Basic/DiagnosticOptions.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticOptions.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Basic/DiagnosticOptions.h Mon May 29 16:25:46 2017 (r319142) @@ -63,11 +63,15 @@ public: enum TextDiagnosticFormat { Clang, MSVC, Vi }; // Default values. - enum { DefaultTabStop = 8, MaxTabStop = 100, + enum { + DefaultTabStop = 8, + MaxTabStop = 100, DefaultMacroBacktraceLimit = 6, DefaultTemplateBacktraceLimit = 10, DefaultConstexprBacktraceLimit = 10, - DefaultSpellCheckingLimit = 50 }; + DefaultSpellCheckingLimit = 50, + DefaultSnippetLineLimit = 1, + }; // Define simple diagnostic options (with no accessors). #define DIAGOPT(Name, Bits, Default) unsigned Name : Bits; Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Mon May 29 16:25:46 2017 (r319142) @@ -537,10 +537,10 @@ def err_maybe_falloff_nonvoid_block : Er def err_falloff_nonvoid_block : Error< "control reaches end of non-void block">; def warn_maybe_falloff_nonvoid_coroutine : Warning< - "control may reach end of non-void coroutine">, + "control may reach end of coroutine; which is undefined behavior because the promise type %0 does not declare 'return_void()'">, InGroup; def warn_falloff_nonvoid_coroutine : Warning< - "control reaches end of non-void coroutine">, + "control reaches end of coroutine; which is undefined behavior because the promise type %0 does not declare 'return_void()'">, InGroup; def warn_suggest_noreturn_function : Warning< "%select{function|method}0 %1 could be declared with attribute 'noreturn'">, @@ -1554,11 +1554,9 @@ def note_ivar_decl : Note<"instance vari def note_bitfield_decl : Note<"bit-field is declared here">; def note_implicit_param_decl : Note<"%0 is an implicit parameter">; def note_member_synthesized_at : Note< - "implicit %select{default constructor|copy constructor|move constructor|copy " - "assignment operator|move assignment operator|destructor}0 for %1 first " - "required here">; -def note_inhctor_synthesized_at : Note< - "inherited constructor for %0 first required here">; + "in implicit %select{default constructor|copy constructor|move constructor|" + "copy assignment operator|move assignment operator|destructor}0 for %1 " + "first required here">; def err_missing_default_ctor : Error< "%select{constructor for %1 must explicitly initialize the|" "implicit default constructor for %1 must explicitly initialize the|" @@ -2769,6 +2767,7 @@ def warn_attribute_wrong_decl_type : War "|types and namespaces" "|Objective-C interfaces" "|methods and properties" + "|functions, methods, and properties" "|struct or union" "|struct, union or class" "|types" @@ -2883,6 +2882,10 @@ def warn_partial_message : Warning<"%0 i def warn_partial_fwdclass_message : Warning< "%0 may be partial because the receiver type is unknown">, InGroup, DefaultIgnore; +def warn_at_available_unchecked_use : Warning< + "%select{@available|__builtin_available}0 does not guard availability here; " + "use if (%select{@available|__builtin_available}0) instead">, + InGroup>; // Thread Safety Attributes def warn_invalid_capability_name : Warning< @@ -6298,6 +6301,8 @@ def warn_ambiguous_suitable_delete_funct InGroup>; def note_member_declared_here : Note< "member %0 declared here">; +def note_member_first_declared_here : Note< + "member %0 first declared here">; def err_decrement_bool : Error<"cannot decrement expression of type bool">; def warn_increment_bool : Warning< "incrementing expression of type bool is deprecated and " @@ -8009,10 +8014,13 @@ def err_block_on_nonlocal : Error< def err_block_on_vm : Error< "__block attribute not allowed on declaration with a variably modified type">; -def err_shufflevector_non_vector : Error< - "first two arguments to __builtin_shufflevector must be vectors">; -def err_shufflevector_incompatible_vector : Error< - "first two arguments to __builtin_shufflevector must have the same type">; +def err_vec_builtin_non_vector : Error< + "first two arguments to %0 must be vectors">; +def err_vec_builtin_incompatible_vector : Error< + "first two arguments to %0 must have the same type">; +def err_vsx_builtin_nonconstant_argument : Error< + "argument %0 to %1 must be a 2-bit unsigned literal (i.e. 0, 1, 2 or 3)">; + def err_shufflevector_nonconstant_argument : Error< "index for __builtin_shufflevector must be a constant integer">; def err_shufflevector_argument_too_large : Error< @@ -8899,8 +8907,6 @@ def note_equivalent_internal_linkage_dec def note_redefinition_modules_same_file : Note< "'%0' included multiple times, additional include site in header from module '%1'">; -def note_redefinition_modules_same_file_modulemap : Note< - "consider adding '%0' as part of '%1' definition">; def note_redefinition_include_same_file : Note< "'%0' included multiple times, additional include site here">; } @@ -8944,8 +8950,10 @@ def err_coroutine_promise_type_incomplet def err_coroutine_type_missing_specialization : Error< "this function cannot be a coroutine: missing definition of " "specialization %q0">; -def err_coroutine_promise_return_ill_formed : Error< - "%0 declares both 'return_value' and 'return_void'">; +def err_coroutine_promise_incompatible_return_functions : Error< + "the coroutine promise type %0 declares both 'return_value' and 'return_void'">; +def err_coroutine_promise_requires_return_function : Error< + "the coroutine promise type %0 must declare either 'return_value' or 'return_void'">; def note_coroutine_promise_implicit_await_transform_required_here : Note< "call to 'await_transform' implicitly required by 'co_await' here">; def note_coroutine_promise_suspend_implicitly_required : Note< @@ -8958,11 +8966,19 @@ def warn_coroutine_promise_unhandled_exc InGroup; def err_coroutine_promise_get_return_object_on_allocation_failure : Error< "%0: 'get_return_object_on_allocation_failure()' must be a static member function">; +def err_seh_in_a_coroutine_with_cxx_exceptions : Error< + "cannot use SEH '__try' in a coroutine when C++ exceptions are enabled">; def err_coroutine_promise_new_requires_nothrow : Error< "%0 is required to have a non-throwing noexcept specification when the promise " "type declares 'get_return_object_on_allocation_failure()'">; def note_coroutine_promise_call_implicitly_required : Note< "call to %0 implicitly required by coroutine function here">; +def err_await_suspend_invalid_return_type : Error< + "the return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)" +>; +def note_await_ready_no_bool_conversion : Note< + "the return type of 'await_ready' is required to be contextually convertible to 'bool'" +>; } let CategoryName = "Documentation Issue" in { Modified: vendor/clang/dist/include/clang/Basic/SourceManager.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/SourceManager.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Basic/SourceManager.h Mon May 29 16:25:46 2017 (r319142) @@ -1399,10 +1399,9 @@ public: /// specified by Loc. /// /// If FilenameID is -1, it is considered to be unspecified. - void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID); void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID, bool IsFileEntry, bool IsFileExit, - bool IsSystemHeader, bool IsExternCHeader); + SrcMgr::CharacteristicKind FileKind); /// \brief Determine if the source manager has a line table. bool hasLineTable() const { return LineTable != nullptr; } Modified: vendor/clang/dist/include/clang/Basic/SourceManagerInternals.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/SourceManagerInternals.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Basic/SourceManagerInternals.h Mon May 29 16:25:46 2017 (r319142) @@ -102,8 +102,6 @@ public: unsigned getNumFilenames() const { return FilenamesByID.size(); } void AddLineNote(FileID FID, unsigned Offset, - unsigned LineNo, int FilenameID); - void AddLineNote(FileID FID, unsigned Offset, unsigned LineNo, int FilenameID, unsigned EntryExit, SrcMgr::CharacteristicKind FileKind); Modified: vendor/clang/dist/include/clang/Basic/TemplateKinds.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/TemplateKinds.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Basic/TemplateKinds.h Mon May 29 16:25:46 2017 (r319142) @@ -26,13 +26,21 @@ enum TemplateNameKind { TNK_Function_template, /// The name refers to a template whose specialization produces a /// type. The template itself could be a class template, template - /// template parameter, or C++0x template alias. + /// template parameter, or template alias. TNK_Type_template, /// The name refers to a variable template whose specialization produces a /// variable. TNK_Var_template, - /// The name refers to a dependent template name. Whether the - /// template name is assumed to refer to a type template or a + /// The name refers to a dependent template name: + /// \code + /// template struct apply2 { + /// typedef typename MetaFun::template apply::type type; + /// }; + /// \endcode + /// + /// Here, "apply" is a dependent template name within the typename + /// specifier in the typedef. "apply" is a nested template, and + /// whether the template name is assumed to refer to a type template or a /// function template depends on the context in which the template /// name occurs. TNK_Dependent_template_name Modified: vendor/clang/dist/include/clang/Basic/XRayLists.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/XRayLists.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Basic/XRayLists.h Mon May 29 16:25:46 2017 (r319142) @@ -37,6 +37,7 @@ public: NONE, ALWAYS, NEVER, + ALWAYS_ARG1, }; ImbueAttribute shouldImbueFunction(StringRef FunctionName) const; Modified: vendor/clang/dist/include/clang/Driver/CC1Options.td ============================================================================== --- vendor/clang/dist/include/clang/Driver/CC1Options.td Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Driver/CC1Options.td Mon May 29 16:25:46 2017 (r319142) @@ -172,6 +172,8 @@ def disable_llvm_optzns : Flag<["-"], "d def disable_lifetimemarkers : Flag<["-"], "disable-lifetime-markers">, HelpText<"Disable lifetime-markers emission even when optimizations are " "enabled">; +def disable_O0_optnone : Flag<["-"], "disable-O0-optnone">, + HelpText<"Disable adding the optnone attribute to functions at O0">; def disable_red_zone : Flag<["-"], "disable-red-zone">, HelpText<"Do not emit code that uses the red zone.">; def dwarf_column_info : Flag<["-"], "dwarf-column-info">, @@ -359,6 +361,9 @@ def fconstexpr_backtrace_limit : Separat HelpText<"Set the maximum number of entries to print in a constexpr evaluation backtrace (0 = no limit).">; def fspell_checking_limit : Separate<["-"], "fspell-checking-limit">, MetaVarName<"">, HelpText<"Set the maximum number of times to perform spell checking on unrecognized identifiers (0 = no limit).">; +def fcaret_diagnostics_max_lines : + Separate<["-"], "fcaret-diagnostics-max-lines">, MetaVarName<"">, + HelpText<"Set the maximum number of source lines to show in a caret diagnostic">; def fmessage_length : Separate<["-"], "fmessage-length">, MetaVarName<"">, HelpText<"Format message diagnostics so that they fit within N columns or fewer, when possible.">; def verify : Flag<["-"], "verify">, Modified: vendor/clang/dist/include/clang/Driver/Options.td ============================================================================== --- vendor/clang/dist/include/clang/Driver/Options.td Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Driver/Options.td Mon May 29 16:25:46 2017 (r319142) @@ -469,6 +469,7 @@ def arch__errors__fatal : Flag<["-"], "a def arch : Separate<["-"], "arch">, Flags<[DriverOption]>; def arch__only : Separate<["-"], "arch_only">; def a : Joined<["-"], "a">; +def autocomplete : Joined<["--"], "autocomplete=">; def bind__at__load : Flag<["-"], "bind_at_load">; def bundle__loader : Separate<["-"], "bundle_loader">; def bundle : Flag<["-"], "bundle">; @@ -1740,6 +1741,7 @@ def mno_avx : Flag<["-"], "mno-avx">, Gr def mno_avx2 : Flag<["-"], "mno-avx2">, Group; def mno_avx512f : Flag<["-"], "mno-avx512f">, Group; def mno_avx512cd : Flag<["-"], "mno-avx512cd">, Group; +def mno_avx512vpopcntdq : Flag<["-"], "mno-avx512vpopcntdq">, Group; def mno_avx512er : Flag<["-"], "mno-avx512er">, Group; def mno_avx512pf : Flag<["-"], "mno-avx512pf">, Group; def mno_avx512dq : Flag<["-"], "mno-avx512dq">, Group; @@ -1940,6 +1942,7 @@ def mavx : Flag<["-"], "mavx">, Group, Group; def mavx512f : Flag<["-"], "mavx512f">, Group; def mavx512cd : Flag<["-"], "mavx512cd">, Group; +def mavx512vpopcntdq : Flag<["-"], "mavx512vpopcntdq">, Group; def mavx512er : Flag<["-"], "mavx512er">, Group; def mavx512pf : Flag<["-"], "mavx512pf">, Group; def mavx512dq : Flag<["-"], "mavx512dq">, Group; Modified: vendor/clang/dist/include/clang/Format/Format.h ============================================================================== --- vendor/clang/dist/include/clang/Format/Format.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Format/Format.h Mon May 29 16:25:46 2017 (r319142) @@ -710,16 +710,35 @@ struct FormatStyle { /// \endcode bool BreakBeforeTernaryOperators; - /// \brief Always break constructor initializers before commas and align - /// the commas with the colon. - /// \code - /// true: false: - /// SomeClass::Constructor() vs. SomeClass::Constructor() : a(a), - /// : a(a) b(b), - /// , b(b) c(c) {} - /// , c(c) {} - /// \endcode - bool BreakConstructorInitializersBeforeComma; + /// \brief Different ways to break initializers. + enum BreakConstructorInitializersStyle + { + /// Break constructor initializers before the colon and after the commas. + /// \code + /// Constructor() + /// : initializer1(), + /// initializer2() + /// \endcode + BCIS_BeforeColon, + /// Break constructor initializers before the colon and commas, and align + /// the commas with the colon. + /// \code + /// Constructor() + /// : initializer1() + /// , initializer2() + /// \endcode + BCIS_BeforeComma, + /// Break constructor initializers after the colon and commas. + /// \code + /// Constructor() : + /// initializer1(), + /// initializer2() + /// \endcode + BCIS_AfterColon + }; + + /// \brief The constructor initializers style to use.. + BreakConstructorInitializersStyle BreakConstructorInitializers; /// \brief Break after each annotation on a field in Java files. /// \code{.java} @@ -1390,8 +1409,7 @@ struct FormatStyle { BreakBeforeBinaryOperators == R.BreakBeforeBinaryOperators && BreakBeforeBraces == R.BreakBeforeBraces && BreakBeforeTernaryOperators == R.BreakBeforeTernaryOperators && - BreakConstructorInitializersBeforeComma == - R.BreakConstructorInitializersBeforeComma && + BreakConstructorInitializers == R.BreakConstructorInitializers && BreakAfterJavaFieldAnnotations == R.BreakAfterJavaFieldAnnotations && BreakStringLiterals == R.BreakStringLiterals && ColumnLimit == R.ColumnLimit && CommentPragmas == R.CommentPragmas && Modified: vendor/clang/dist/include/clang/Frontend/ASTUnit.h ============================================================================== --- vendor/clang/dist/include/clang/Frontend/ASTUnit.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Frontend/ASTUnit.h Mon May 29 16:25:46 2017 (r319142) @@ -59,6 +59,10 @@ class TargetInfo; class FrontendAction; class ASTDeserializationListener; +namespace vfs { +class FileSystem; +} + /// \brief Utility class for loading a ASTContext from an AST file. /// class ASTUnit : public ModuleLoader { @@ -420,7 +424,8 @@ private: explicit ASTUnit(bool MainFileIsAST); bool Parse(std::shared_ptr PCHContainerOps, - std::unique_ptr OverrideMainBuffer); + std::unique_ptr OverrideMainBuffer, + IntrusiveRefCntPtr VFS); struct ComputedPreamble { llvm::MemoryBuffer *Buffer; @@ -434,11 +439,13 @@ private: PreambleEndsAtStartOfLine(PreambleEndsAtStartOfLine) {} }; ComputedPreamble ComputePreamble(CompilerInvocation &Invocation, - unsigned MaxLines); + unsigned MaxLines, + IntrusiveRefCntPtr VFS); std::unique_ptr getMainBufferWithPrecompiledPreamble( std::shared_ptr PCHContainerOps, - const CompilerInvocation &PreambleInvocationIn, bool AllowRebuild = true, + const CompilerInvocation &PreambleInvocationIn, + IntrusiveRefCntPtr VFS, bool AllowRebuild = true, unsigned MaxLines = 0); void RealizeTopLevelDeclsFromPreamble(); @@ -731,11 +738,17 @@ private: /// of this translation unit should be precompiled, to improve the performance /// of reparsing. Set to zero to disable preambles. /// + /// \param VFS - A vfs::FileSystem to be used for all file accesses. Note that + /// preamble is saved to a temporary directory on a RealFileSystem, so in order + /// for it to be loaded correctly, VFS should have access to it(i.e., be an + /// overlay over RealFileSystem). + /// /// \returns \c true if a catastrophic failure occurred (which means that the /// \c ASTUnit itself is invalid), or \c false otherwise. bool LoadFromCompilerInvocation( std::shared_ptr PCHContainerOps, - unsigned PrecompilePreambleAfterNParses); + unsigned PrecompilePreambleAfterNParses, + IntrusiveRefCntPtr VFS); public: @@ -826,6 +839,11 @@ public: /// (e.g. because the PCH could not be loaded), this accepts the ASTUnit /// mainly to allow the caller to see the diagnostics. /// + /// \param VFS - A vfs::FileSystem to be used for all file accesses. Note that + /// preamble is saved to a temporary directory on a RealFileSystem, so in order + /// for it to be loaded correctly, VFS should have access to it(i.e., be an + /// overlay over RealFileSystem). RealFileSystem will be used if \p VFS is nullptr. + /// // FIXME: Move OnlyLocalDecls, UseBumpAllocator to setters on the ASTUnit, we // shouldn't need to specify them at construction time. static ASTUnit *LoadFromCommandLine( @@ -842,15 +860,23 @@ public: bool AllowPCHWithCompilerErrors = false, bool SkipFunctionBodies = false, bool UserFilesAreVolatile = false, bool ForSerialization = false, llvm::Optional ModuleFormat = llvm::None, - std::unique_ptr *ErrAST = nullptr); + std::unique_ptr *ErrAST = nullptr, + IntrusiveRefCntPtr VFS = nullptr); /// \brief Reparse the source files using the same command-line options that /// were originally used to produce this translation unit. /// + /// \param VFS - A vfs::FileSystem to be used for all file accesses. Note that + /// preamble is saved to a temporary directory on a RealFileSystem, so in order + /// for it to be loaded correctly, VFS should give an access to this(i.e. be an + /// overlay over RealFileSystem). FileMgr->getVirtualFileSystem() will be used if + /// \p VFS is nullptr. + /// /// \returns True if a failure occurred that causes the ASTUnit not to /// contain any translation-unit information, false otherwise. bool Reparse(std::shared_ptr PCHContainerOps, - ArrayRef RemappedFiles = None); + ArrayRef RemappedFiles = None, + IntrusiveRefCntPtr VFS = nullptr); /// \brief Perform code completion at the given file, line, and /// column within this translation unit. Modified: vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def ============================================================================== --- vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def Mon May 29 16:25:46 2017 (r319142) @@ -53,6 +53,7 @@ CODEGENOPT(DisableLLVMPasses , 1, 0) /// ///< the pristine IR generated by the ///< frontend. CODEGENOPT(DisableLifetimeMarkers, 1, 0) ///< Don't emit any lifetime markers +CODEGENOPT(DisableO0ImplyOptNone , 1, 0) ///< Don't annonate function with optnone at O0 CODEGENOPT(ExperimentalNewPassManager, 1, 0) ///< Enables the new, experimental ///< pass manager. CODEGENOPT(DisableRedZone , 1, 0) ///< Set when -mno-red-zone is enabled. Modified: vendor/clang/dist/include/clang/Frontend/CompilerInvocation.h ============================================================================== --- vendor/clang/dist/include/clang/Frontend/CompilerInvocation.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Frontend/CompilerInvocation.h Mon May 29 16:25:46 2017 (r319142) @@ -225,6 +225,11 @@ IntrusiveRefCntPtr createVFSFromCompilerInvocation(const CompilerInvocation &CI, DiagnosticsEngine &Diags); +IntrusiveRefCntPtr +createVFSFromCompilerInvocation(const CompilerInvocation &CI, + DiagnosticsEngine &Diags, + IntrusiveRefCntPtr BaseFS); + } // end namespace clang #endif Modified: vendor/clang/dist/include/clang/Lex/ModuleMap.h ============================================================================== --- vendor/clang/dist/include/clang/Lex/ModuleMap.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Lex/ModuleMap.h Mon May 29 16:25:46 2017 (r319142) @@ -257,6 +257,23 @@ private: /// resolved. Module *resolveModuleId(const ModuleId &Id, Module *Mod, bool Complain) const; + /// Resolve the given header directive to an actual header file. + /// + /// \param M The module in which we're resolving the header directive. + /// \param Header The header directive to resolve. + /// \param RelativePathName Filled in with the relative path name from the + /// module to the resolved header. + /// \return The resolved file, if any. + const FileEntry *resolveHeader(Module *M, + Module::UnresolvedHeaderDirective Header, + SmallVectorImpl &RelativePathName); + + /// Attempt to resolve the specified header directive as naming a builtin + /// header. + const FileEntry * + resolveAsBuiltinHeader(Module *M, Module::UnresolvedHeaderDirective Header, + SmallVectorImpl &BuiltinPathName); + /// \brief Looks up the modules that \p File corresponds to. /// /// If \p File represents a builtin header within Clang's builtin include Modified: vendor/clang/dist/include/clang/Sema/AttributeList.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/AttributeList.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Sema/AttributeList.h Mon May 29 16:25:46 2017 (r319142) @@ -915,6 +915,7 @@ enum AttributeDeclKind { ExpectedTypeOrNamespace, ExpectedObjectiveCInterface, ExpectedMethodOrProperty, + ExpectedFunctionOrMethodOrProperty, ExpectedStructOrUnion, ExpectedStructOrUnionOrClass, ExpectedType, Modified: vendor/clang/dist/include/clang/Sema/ParsedTemplate.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/ParsedTemplate.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Sema/ParsedTemplate.h Mon May 29 16:25:46 2017 (r319142) @@ -145,12 +145,15 @@ namespace clang { /// expressions, or template names, and the source locations for important /// tokens. All of the information about template arguments is allocated /// directly after this structure. - struct TemplateIdAnnotation { + struct TemplateIdAnnotation final + : private llvm::TrailingObjects { + friend TrailingObjects; /// \brief The nested-name-specifier that precedes the template name. CXXScopeSpec SS; - /// TemplateKWLoc - The location of the template keyword within the - /// source. + /// TemplateKWLoc - The location of the template keyword. + /// For e.g. typename T::template Y SourceLocation TemplateKWLoc; /// TemplateNameLoc - The location of the template name within the @@ -183,34 +186,56 @@ namespace clang { /// \brief Retrieves a pointer to the template arguments ParsedTemplateArgument *getTemplateArgs() { - return reinterpret_cast(this + 1); + return getTrailingObjects(); } /// \brief Creates a new TemplateIdAnnotation with NumArgs arguments and /// appends it to List. static TemplateIdAnnotation * - Allocate(unsigned NumArgs, SmallVectorImpl &List) { - TemplateIdAnnotation *TemplateId - = (TemplateIdAnnotation *)std::malloc(sizeof(TemplateIdAnnotation) + - sizeof(ParsedTemplateArgument) * NumArgs); - TemplateId->NumArgs = NumArgs; - - // Default-construct nested-name-specifier. - new (&TemplateId->SS) CXXScopeSpec(); - - // Default-construct parsed template arguments. - ParsedTemplateArgument *TemplateArgs = TemplateId->getTemplateArgs(); - for (unsigned I = 0; I != NumArgs; ++I) - new (TemplateArgs + I) ParsedTemplateArgument(); - - List.push_back(TemplateId); + Create(CXXScopeSpec SS, SourceLocation TemplateKWLoc, + SourceLocation TemplateNameLoc, IdentifierInfo *Name, + OverloadedOperatorKind OperatorKind, + ParsedTemplateTy OpaqueTemplateName, TemplateNameKind TemplateKind, + SourceLocation LAngleLoc, SourceLocation RAngleLoc, + ArrayRef TemplateArgs, + SmallVectorImpl &CleanupList) { + + TemplateIdAnnotation *TemplateId = new (std::malloc( + totalSizeToAlloc(TemplateArgs.size()))) + TemplateIdAnnotation(SS, TemplateKWLoc, TemplateNameLoc, Name, + OperatorKind, OpaqueTemplateName, TemplateKind, + LAngleLoc, RAngleLoc, TemplateArgs); + CleanupList.push_back(TemplateId); return TemplateId; } - - void Destroy() { - SS.~CXXScopeSpec(); + + void Destroy() { + std::for_each( + getTemplateArgs(), getTemplateArgs() + NumArgs, + [](ParsedTemplateArgument &A) { A.~ParsedTemplateArgument(); }); + this->~TemplateIdAnnotation(); free(this); } + private: + TemplateIdAnnotation(const TemplateIdAnnotation &) = delete; + + TemplateIdAnnotation(CXXScopeSpec SS, SourceLocation TemplateKWLoc, + SourceLocation TemplateNameLoc, IdentifierInfo *Name, + OverloadedOperatorKind OperatorKind, + ParsedTemplateTy OpaqueTemplateName, + TemplateNameKind TemplateKind, + SourceLocation LAngleLoc, SourceLocation RAngleLoc, + ArrayRef TemplateArgs) noexcept + : SS(SS), TemplateKWLoc(TemplateKWLoc), + TemplateNameLoc(TemplateNameLoc), Name(Name), Operator(OperatorKind), + Template(OpaqueTemplateName), Kind(TemplateKind), + LAngleLoc(LAngleLoc), RAngleLoc(RAngleLoc), + NumArgs(TemplateArgs.size()) { + + std::uninitialized_copy(TemplateArgs.begin(), TemplateArgs.end(), + getTemplateArgs()); + } + ~TemplateIdAnnotation() = default; }; /// Retrieves the range of the given template parameter lists. Modified: vendor/clang/dist/include/clang/Sema/ScopeInfo.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/ScopeInfo.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Sema/ScopeInfo.h Mon May 29 16:25:46 2017 (r319142) @@ -388,6 +388,8 @@ public: (HasBranchProtectedScope && HasBranchIntoScope)); } + bool isCoroutine() const { return !FirstCoroutineStmtLoc.isInvalid(); } + void setFirstCoroutineStmt(SourceLocation Loc, StringRef Keyword) { assert(FirstCoroutineStmtLoc.isInvalid() && "first coroutine statement location already set"); Modified: vendor/clang/dist/include/clang/Sema/Sema.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/Sema.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Sema/Sema.h Mon May 29 16:25:46 2017 (r319142) @@ -689,17 +689,37 @@ public: class SynthesizedFunctionScope { Sema &S; Sema::ContextRAII SavedContext; + bool PushedCodeSynthesisContext = false; public: SynthesizedFunctionScope(Sema &S, DeclContext *DC) - : S(S), SavedContext(S, DC) - { + : S(S), SavedContext(S, DC) { S.PushFunctionScope(); S.PushExpressionEvaluationContext( Sema::ExpressionEvaluationContext::PotentiallyEvaluated); + if (auto *FD = dyn_cast(DC)) + FD->setWillHaveBody(true); + else + assert(isa(DC)); + } + + void addContextNote(SourceLocation UseLoc) { + assert(!PushedCodeSynthesisContext); + + Sema::CodeSynthesisContext Ctx; + Ctx.Kind = Sema::CodeSynthesisContext::DefiningSynthesizedFunction; + Ctx.PointOfInstantiation = UseLoc; + Ctx.Entity = cast(S.CurContext); + S.pushCodeSynthesisContext(Ctx); + + PushedCodeSynthesisContext = true; } ~SynthesizedFunctionScope() { + if (PushedCodeSynthesisContext) + S.popCodeSynthesisContext(); + if (auto *FD = dyn_cast(S.CurContext)) + FD->setWillHaveBody(false); S.PopExpressionEvaluationContext(); S.PopFunctionScopeInfo(); } @@ -2727,7 +2747,7 @@ public: /// of a function. /// /// Returns true if any errors were emitted. - bool diagnoseArgIndependentDiagnoseIfAttrs(const FunctionDecl *Function, + bool diagnoseArgIndependentDiagnoseIfAttrs(const NamedDecl *ND, SourceLocation Loc); /// Returns whether the given function's address can be taken or not, @@ -6974,6 +6994,10 @@ public: /// We are declaring an implicit special member function. DeclaringSpecialMember, + + /// We are defining a synthesized function (such as a defaulted special + /// member). + DefiningSynthesizedFunction, } Kind; /// \brief Was the enclosing context a non-instantiation SFINAE context? @@ -10121,6 +10145,7 @@ private: bool SemaBuiltinVAStartARM(CallExpr *Call); bool SemaBuiltinUnorderedCompare(CallExpr *TheCall); bool SemaBuiltinFPClassification(CallExpr *TheCall, unsigned NumArgs); + bool SemaBuiltinVSX(CallExpr *TheCall); bool SemaBuiltinOSLogFormat(CallExpr *TheCall); public: Modified: vendor/clang/dist/include/clang/Tooling/CompilationDatabase.h ============================================================================== --- vendor/clang/dist/include/clang/Tooling/CompilationDatabase.h Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/include/clang/Tooling/CompilationDatabase.h Mon May 29 16:25:46 2017 (r319142) @@ -60,16 +60,6 @@ struct CompileCommand { /// The output file associated with the command. std::string Output; - - /// \brief An optional mapping from each file's path to its content for all - /// files needed for the compilation that are not available via the file - /// system. - /// - /// Note that a tool implementation is required to fall back to the file - /// system if a source file is not provided in the mapped sources, as - /// compilation databases will usually not provide all files in mapped sources - /// for performance reasons. - std::vector > MappedSources; }; /// \brief Interface for compilation databases. @@ -186,10 +176,11 @@ public: /// the number of arguments before "--", if "--" was found in the argument /// list. /// \param Argv Points to the command line arguments. + /// \param ErrorMsg Contains error text if the function returns null pointer. /// \param Directory The base directory used in the FixedCompilationDatabase. - static FixedCompilationDatabase *loadFromCommandLine(int &Argc, - const char *const *Argv, - Twine Directory = "."); + static std::unique_ptr loadFromCommandLine( + int &Argc, const char *const *Argv, std::string &ErrorMsg, + Twine Directory = "."); /// \brief Constructs a compilation data base from a specified directory /// and command line. Modified: vendor/clang/dist/lib/AST/DeclBase.cpp ============================================================================== --- vendor/clang/dist/lib/AST/DeclBase.cpp Mon May 29 16:25:32 2017 (r319141) +++ vendor/clang/dist/lib/AST/DeclBase.cpp Mon May 29 16:25:46 2017 (r319142) @@ -274,9 +274,17 @@ void Decl::setLexicalDeclContext(DeclCon } else { getMultipleDC()->LexicalDC = DC; } - Hidden = cast(DC)->Hidden; - if (Hidden && !isFromASTFile() && hasLocalOwningModuleStorage()) - setLocalOwningModule(cast(DC)->getOwningModule()); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Mon May 29 16:26:03 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 A7F16D77840; Mon, 29 May 2017 16:26:03 +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 58DDD80C14; Mon, 29 May 2017 16:26:03 +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 v4TGQ2TF083207; Mon, 29 May 2017 16:26:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TGPv8l083151; Mon, 29 May 2017 16:25:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705291625.v4TGPv8l083151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 May 2017 16:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319144 - in vendor/compiler-rt/dist: cmake lib/asan lib/asan/scripts lib/asan/tests lib/builtins lib/builtins/arm lib/lsan lib/sanitizer_common lib/sanitizer_common/tests lib/scudo lib... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 16:26:03 -0000 Author: dim Date: Mon May 29 16:25:57 2017 New Revision: 319144 URL: https://svnweb.freebsd.org/changeset/base/319144 Log: Vendor import of compiler-rt trunk r304149: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304149 Added: vendor/compiler-rt/dist/lib/builtins/bswapdi2.c (contents, props changed) vendor/compiler-rt/dist/lib/builtins/bswapsi2.c (contents, props changed) vendor/compiler-rt/dist/test/asan/TestCases/Linux/preinstalled_signal.cc (contents, props changed) vendor/compiler-rt/dist/test/lsan/TestCases/many_tls_keys.cc (contents, props changed) Modified: vendor/compiler-rt/dist/cmake/base-config-ix.cmake vendor/compiler-rt/dist/cmake/builtin-config-ix.cmake vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc vendor/compiler-rt/dist/lib/asan/asan_win.cc vendor/compiler-rt/dist/lib/asan/scripts/asan_device_setup vendor/compiler-rt/dist/lib/asan/tests/asan_interface_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_noinst_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt vendor/compiler-rt/dist/lib/builtins/README.txt vendor/compiler-rt/dist/lib/builtins/arm/aeabi_cdcmp.S vendor/compiler-rt/dist/lib/builtins/arm/aeabi_cfcmp.S vendor/compiler-rt/dist/lib/builtins/arm/eqdf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/eqsf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/gedf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/gesf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/gtdf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/gtsf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/ledf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/lesf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/ltdf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/ltsf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/nedf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/nesf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/unorddf2vfp.S vendor/compiler-rt/dist/lib/builtins/arm/unordsf2vfp.S vendor/compiler-rt/dist/lib/builtins/assembly.h vendor/compiler-rt/dist/lib/lsan/lsan_common.cc vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc vendor/compiler-rt/dist/lib/lsan/lsan_flags.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_primary32.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flag_parser.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_s390.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_flags_test.cc vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.cpp vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_linux.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_mac.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_thread.cc vendor/compiler-rt/dist/test/asan/TestCases/Linux/sanbox_read_proc_self_maps_test.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/allow_user_segv.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/current_allocated_bytes.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/wait.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/wait3.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/wait4.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/waitid.cc vendor/compiler-rt/dist/test/builtins/Unit/bswapdi2_test.c vendor/compiler-rt/dist/test/builtins/Unit/bswapsi2_test.c vendor/compiler-rt/dist/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc vendor/compiler-rt/dist/test/sanitizer_common/TestCases/Linux/signal_segv_handler.cc vendor/compiler-rt/dist/test/ubsan/TestCases/Integer/negate-overflow.cpp Modified: vendor/compiler-rt/dist/cmake/base-config-ix.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/base-config-ix.cmake Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/cmake/base-config-ix.cmake Mon May 29 16:25:57 2017 (r319144) @@ -63,7 +63,9 @@ else() set(COMPILER_RT_TEST_COMPILER_ID GNU) endif() -string(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_OS_DIR) +if(NOT DEFINED COMPILER_RT_OS_DIR) + string(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_OS_DIR) +endif() set(COMPILER_RT_LIBRARY_OUTPUT_DIR ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) set(COMPILER_RT_LIBRARY_INSTALL_DIR Modified: vendor/compiler-rt/dist/cmake/builtin-config-ix.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/builtin-config-ix.cmake Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/cmake/builtin-config-ix.cmake Mon May 29 16:25:57 2017 (r319144) @@ -24,7 +24,7 @@ int foo(int x, int y) { set(ARM64 aarch64) -set(ARM32 arm armhf armv6m) +set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k) set(X86 i386 i686) set(X86_64 x86_64) set(MIPS32 mips mipsel) Modified: vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc Mon May 29 16:25:57 2017 (r319144) @@ -357,28 +357,22 @@ DEFINE_REAL_PTHREAD_FUNCTIONS #if SANITIZER_ANDROID INTERCEPTOR(void*, bsd_signal, int signum, void *handler) { - if (!IsHandledDeadlySignal(signum) || - common_flags()->allow_user_segv_handler) { + if (GetHandleSignalMode(signum) != kHandleSignalExclusive) return REAL(bsd_signal)(signum, handler); - } return 0; } #endif INTERCEPTOR(void*, signal, int signum, void *handler) { - if (!IsHandledDeadlySignal(signum) || - common_flags()->allow_user_segv_handler) { + if (GetHandleSignalMode(signum) != kHandleSignalExclusive) return REAL(signal)(signum, handler); - } return nullptr; } INTERCEPTOR(int, sigaction, int signum, const struct sigaction *act, struct sigaction *oldact) { - if (!IsHandledDeadlySignal(signum) || - common_flags()->allow_user_segv_handler) { + if (GetHandleSignalMode(signum) != kHandleSignalExclusive) return REAL(sigaction)(signum, act, oldact); - } return 0; } Modified: vendor/compiler-rt/dist/lib/asan/asan_win.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_win.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/asan/asan_win.cc Mon May 29 16:25:57 2017 (r319144) @@ -80,7 +80,7 @@ static long WINAPI SEHHandler(EXCEPTION_ INTERCEPTOR_WINAPI(LPTOP_LEVEL_EXCEPTION_FILTER, SetUnhandledExceptionFilter, LPTOP_LEVEL_EXCEPTION_FILTER ExceptionFilter) { CHECK(REAL(SetUnhandledExceptionFilter)); - if (ExceptionFilter == &SEHHandler || common_flags()->allow_user_segv_handler) + if (ExceptionFilter == &SEHHandler) return REAL(SetUnhandledExceptionFilter)(ExceptionFilter); // We record the user provided exception handler to be called for all the // exceptions unhandled by asan. Modified: vendor/compiler-rt/dist/lib/asan/scripts/asan_device_setup ============================================================================== --- vendor/compiler-rt/dist/lib/asan/scripts/asan_device_setup Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/asan/scripts/asan_device_setup Mon May 29 16:25:57 2017 (r319144) @@ -327,11 +327,6 @@ exec $_to \$@ EOF } -# On Android-L not allowing user segv handler breaks some applications. -if [[ PRE_L -eq 0 ]]; then - ASAN_OPTIONS="$ASAN_OPTIONS,allow_user_segv_handler=1" -fi - if [[ x$extra_options != x ]] ; then ASAN_OPTIONS="$ASAN_OPTIONS,$extra_options" fi Modified: vendor/compiler-rt/dist/lib/asan/tests/asan_interface_test.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/tests/asan_interface_test.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/asan/tests/asan_interface_test.cc Mon May 29 16:25:57 2017 (r319144) @@ -102,9 +102,6 @@ TEST(AddressSanitizerInterface, GetHeapS } } -#ifndef __powerpc64__ -// FIXME: This has not reliably worked on powerpc since r279664. Re-enable -// this once the problem is tracked down and fixed. static const size_t kManyThreadsMallocSizes[] = {5, 1UL<<10, 1UL<<14, 357}; static const size_t kManyThreadsIterations = 250; static const size_t kManyThreadsNumThreads = @@ -138,7 +135,6 @@ TEST(AddressSanitizerInterface, ManyThre // so we can't check for equality here. EXPECT_LT(after_test, before_test + (1UL<<20)); } -#endif static void DoDoubleFree() { int *x = Ident(new int); Modified: vendor/compiler-rt/dist/lib/asan/tests/asan_noinst_test.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/tests/asan_noinst_test.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/asan/tests/asan_noinst_test.cc Mon May 29 16:25:57 2017 (r319144) @@ -97,9 +97,6 @@ TEST(AddressSanitizer, NoInstMallocTest) MallocStress(ASAN_LOW_MEMORY ? 300000 : 1000000); } -#ifndef __powerpc64__ -// FIXME: This has not reliably worked on powerpc since r279664. Re-enable -// this once the problem is tracked down and fixed. TEST(AddressSanitizer, ThreadedMallocStressTest) { const int kNumThreads = 4; const int kNumIterations = (ASAN_LOW_MEMORY) ? 10000 : 100000; @@ -112,7 +109,6 @@ TEST(AddressSanitizer, ThreadedMallocStr PTHREAD_JOIN(t[i], 0); } } -#endif static void PrintShadow(const char *tag, uptr ptr, size_t size) { fprintf(stderr, "%s shadow: %lx size % 3ld: ", tag, (long)ptr, (long)size); @@ -210,10 +206,6 @@ void *ThreadedOneSizeMallocStress(void * return NULL; } -#ifndef __powerpc64__ -// FIXME: This has not reliably worked on powerpc since r279664. Re-enable -// this once the problem is tracked down and fixed. - TEST(AddressSanitizer, ThreadedOneSizeMallocStressTest) { const int kNumThreads = 4; pthread_t t[kNumThreads]; @@ -224,7 +216,6 @@ TEST(AddressSanitizer, ThreadedOneSizeMa PTHREAD_JOIN(t[i], 0); } } -#endif TEST(AddressSanitizer, ShadowRegionIsPoisonedTest) { using __asan::kHighMemEnd; Modified: vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc Mon May 29 16:25:57 2017 (r319144) @@ -251,7 +251,8 @@ TEST(AddressSanitizer, BitFieldNegativeT namespace { const char kSEGVCrash[] = "AddressSanitizer: SEGV on unknown address"; -const char kOverriddenHandler[] = "ASan signal handler has been overridden\n"; +const char kOverriddenSigactionHandler[] = "Test sigaction handler\n"; +const char kOverriddenSignalHandler[] = "Test signal handler\n"; TEST(AddressSanitizer, WildAddressTest) { char *c = (char*)0x123; @@ -259,12 +260,12 @@ TEST(AddressSanitizer, WildAddressTest) } void my_sigaction_sighandler(int, siginfo_t*, void*) { - fprintf(stderr, kOverriddenHandler); + fprintf(stderr, kOverriddenSigactionHandler); exit(1); } void my_signal_sighandler(int signum) { - fprintf(stderr, kOverriddenHandler); + fprintf(stderr, kOverriddenSignalHandler); exit(1); } @@ -273,16 +274,20 @@ TEST(AddressSanitizer, SignalTest) { memset(&sigact, 0, sizeof(sigact)); sigact.sa_sigaction = my_sigaction_sighandler; sigact.sa_flags = SA_SIGINFO; - // ASan should silently ignore sigaction()... + char *c = (char *)0x123; + + EXPECT_DEATH(*c = 0, kSEGVCrash); + + // ASan should allow to set sigaction()... EXPECT_EQ(0, sigaction(SIGSEGV, &sigact, 0)); #ifdef __APPLE__ EXPECT_EQ(0, sigaction(SIGBUS, &sigact, 0)); #endif - char *c = (char*)0x123; - EXPECT_DEATH(*c = 0, kSEGVCrash); + EXPECT_DEATH(*c = 0, kOverriddenSigactionHandler); + // ... and signal(). - EXPECT_EQ(0, signal(SIGSEGV, my_signal_sighandler)); - EXPECT_DEATH(*c = 0, kSEGVCrash); + EXPECT_NE(SIG_ERR, signal(SIGSEGV, my_signal_sighandler)); + EXPECT_DEATH(*c = 0, kOverriddenSignalHandler); } } // namespace #endif Modified: vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt Mon May 29 16:25:57 2017 (r319144) @@ -42,6 +42,8 @@ set(GENERIC_SOURCES ashlti3.c ashrdi3.c ashrti3.c + bswapdi2.c + bswapsi2.c clear_cache.c clzdi2.c clzsi2.c @@ -163,8 +165,7 @@ set(GENERIC_SOURCES udivti3.c umoddi3.c umodsi3.c - umodti3.c - emutls.c) + umodti3.c) set(GENERIC_TF_SOURCES comparetf2.c @@ -193,6 +194,7 @@ option(COMPILER_RT_EXCLUDE_ATOMIC_BUILTI if(NOT COMPILER_RT_BAREMETAL_BUILD) set(GENERIC_SOURCES ${GENERIC_SOURCES} + emutls.c enable_execute_stack.c) endif() Modified: vendor/compiler-rt/dist/lib/builtins/README.txt ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/README.txt Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/README.txt Mon May 29 16:25:57 2017 (r319144) @@ -57,8 +57,8 @@ si_int __popcountsi2(si_int a); // bit si_int __popcountdi2(di_int a); // bit population si_int __popcountti2(ti_int a); // bit population -uint32_t __bswapsi2(uint32_t a); // a byteswapped, arm only -uint64_t __bswapdi2(uint64_t a); // a byteswapped, arm only +uint32_t __bswapsi2(uint32_t a); // a byteswapped +uint64_t __bswapdi2(uint64_t a); // a byteswapped // Integral arithmetic Modified: vendor/compiler-rt/dist/lib/builtins/arm/aeabi_cdcmp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/aeabi_cdcmp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/aeabi_cdcmp.S Mon May 29 16:25:57 2017 (r319144) @@ -48,7 +48,12 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_cdcmp // NaN has been ruled out, so __aeabi_cdcmple can't trap bne __aeabi_cdcmple +#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) + mov ip, #APSR_C + msr APSR_nzcvq, ip +#else msr CPSR_f, #APSR_C +#endif JMP(lr) #endif END_COMPILERRT_FUNCTION(__aeabi_cdcmpeq) @@ -95,17 +100,23 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_cdcmp lsls r0, r0, #31 pop {r0-r3, pc} #else + ITT(eq) moveq ip, #0 beq 1f ldm sp, {r0-r3} bl __aeabi_dcmpeq cmp r0, #1 + ITE(eq) moveq ip, #(APSR_C | APSR_Z) movne ip, #(APSR_C) 1: +#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) + msr APSR_nzcvq, ip +#else msr CPSR_f, ip +#endif pop {r0-r3} POP_PC() #endif Modified: vendor/compiler-rt/dist/lib/builtins/arm/aeabi_cfcmp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/aeabi_cfcmp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/aeabi_cfcmp.S Mon May 29 16:25:57 2017 (r319144) @@ -48,7 +48,12 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_cfcmp // NaN has been ruled out, so __aeabi_cfcmple can't trap bne __aeabi_cfcmple +#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) + mov ip, #APSR_C + msr APSR_nzcvq, ip +#else msr CPSR_f, #APSR_C +#endif JMP(lr) #endif END_COMPILERRT_FUNCTION(__aeabi_cfcmpeq) @@ -95,17 +100,23 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_cfcmp lsls r0, r0, #31 pop {r0-r3, pc} #else + ITT(eq) moveq ip, #0 beq 1f ldm sp, {r0-r3} bl __aeabi_fcmpeq cmp r0, #1 + ITE(eq) moveq ip, #(APSR_C | APSR_Z) movne ip, #(APSR_C) 1: +#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) + msr APSR_nzcvq, ip +#else msr CPSR_f, ip +#endif pop {r0-r3} POP_PC() #endif Modified: vendor/compiler-rt/dist/lib/builtins/arm/eqdf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/eqdf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/eqdf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__eqdf2vfp) vcmp.f64 d6, d7 #endif vmrs apsr_nzcv, fpscr + ITE(eq) moveq r0, #1 // set result register to 1 if equal movne r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/arm/eqsf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/eqsf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/eqsf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2vfp) vcmp.f32 s14, s15 #endif vmrs apsr_nzcv, fpscr + ITE(eq) moveq r0, #1 // set result register to 1 if equal movne r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/arm/gedf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/gedf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/gedf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__gedf2vfp) vcmp.f64 d6, d7 #endif vmrs apsr_nzcv, fpscr + ITE(ge) movge r0, #1 // set result register to 1 if greater than or equal movlt r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/arm/gesf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/gesf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/gesf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__gesf2vfp) vcmp.f32 s14, s15 #endif vmrs apsr_nzcv, fpscr + ITE(ge) movge r0, #1 // set result register to 1 if greater than or equal movlt r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/arm/gtdf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/gtdf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/gtdf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__gtdf2vfp) vcmp.f64 d6, d7 #endif vmrs apsr_nzcv, fpscr + ITE(gt) movgt r0, #1 // set result register to 1 if equal movle r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/arm/gtsf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/gtsf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/gtsf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__gtsf2vfp) vcmp.f32 s14, s15 #endif vmrs apsr_nzcv, fpscr + ITE(gt) movgt r0, #1 // set result register to 1 if equal movle r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/arm/ledf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/ledf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/ledf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__ledf2vfp) vcmp.f64 d6, d7 #endif vmrs apsr_nzcv, fpscr + ITE(ls) movls r0, #1 // set result register to 1 if equal movhi r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/arm/lesf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/lesf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/lesf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__lesf2vfp) vcmp.f32 s14, s15 #endif vmrs apsr_nzcv, fpscr + ITE(ls) movls r0, #1 // set result register to 1 if equal movhi r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/arm/ltdf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/ltdf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/ltdf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__ltdf2vfp) vcmp.f64 d6, d7 #endif vmrs apsr_nzcv, fpscr + ITE(mi) movmi r0, #1 // set result register to 1 if equal movpl r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/arm/ltsf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/ltsf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/ltsf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__ltsf2vfp) vcmp.f32 s14, s15 #endif vmrs apsr_nzcv, fpscr + ITE(mi) movmi r0, #1 // set result register to 1 if equal movpl r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/arm/nedf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/nedf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/nedf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__nedf2vfp) vcmp.f64 d6, d7 #endif vmrs apsr_nzcv, fpscr + ITE(ne) movne r0, #1 // set result register to 0 if unequal moveq r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/arm/nesf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/nesf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/nesf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__nesf2vfp) vcmp.f32 s14, s15 #endif vmrs apsr_nzcv, fpscr + ITE(ne) movne r0, #1 // set result register to 1 if unequal moveq r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/arm/unorddf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/unorddf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/unorddf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__unorddf2vfp vcmp.f64 d6, d7 #endif vmrs apsr_nzcv, fpscr + ITE(vs) movvs r0, #1 // set result register to 1 if "overflow" (any NaNs) movvc r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/arm/unordsf2vfp.S ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/arm/unordsf2vfp.S Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/arm/unordsf2vfp.S Mon May 29 16:25:57 2017 (r319144) @@ -27,6 +27,7 @@ DEFINE_COMPILERRT_FUNCTION(__unordsf2vfp vcmp.f32 s14, s15 #endif vmrs apsr_nzcv, fpscr + ITE(vs) movvs r0, #1 // set result register to 1 if "overflow" (any NaNs) movvc r0, #0 bx lr Modified: vendor/compiler-rt/dist/lib/builtins/assembly.h ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/assembly.h Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/builtins/assembly.h Mon May 29 16:25:57 2017 (r319144) @@ -96,9 +96,11 @@ #if __ARM_ARCH_ISA_THUMB == 2 #define IT(cond) it cond #define ITT(cond) itt cond +#define ITE(cond) ite cond #else #define IT(cond) #define ITT(cond) +#define ITE(cond) #endif #if __ARM_ARCH_ISA_THUMB == 2 Added: vendor/compiler-rt/dist/lib/builtins/bswapdi2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/lib/builtins/bswapdi2.c Mon May 29 16:25:57 2017 (r319144) @@ -0,0 +1,27 @@ +/* ===-- bswapdi2.c - Implement __bswapdi2 ---------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + * + * This file implements __bswapdi2 for the compiler_rt library. + * + * ===----------------------------------------------------------------------=== + */ + +#include "int_lib.h" + +COMPILER_RT_ABI uint64_t __bswapdi2(uint64_t u) { + return ( + (((u)&0xff00000000000000ULL) >> 56) | + (((u)&0x00ff000000000000ULL) >> 40) | + (((u)&0x0000ff0000000000ULL) >> 24) | + (((u)&0x000000ff00000000ULL) >> 8) | + (((u)&0x00000000ff000000ULL) << 8) | + (((u)&0x0000000000ff0000ULL) << 24) | + (((u)&0x000000000000ff00ULL) << 40) | + (((u)&0x00000000000000ffULL) << 56)); +} Added: vendor/compiler-rt/dist/lib/builtins/bswapsi2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/lib/builtins/bswapsi2.c Mon May 29 16:25:57 2017 (r319144) @@ -0,0 +1,23 @@ +/* ===-- bswapsi2.c - Implement __bswapsi2 ---------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + * + * This file implements __bswapsi2 for the compiler_rt library. + * + * ===----------------------------------------------------------------------=== + */ + +#include "int_lib.h" + +COMPILER_RT_ABI uint32_t __bswapsi2(uint32_t u) { + return ( + (((u)&0xff000000) >> 24) | + (((u)&0x00ff0000) >> 8) | + (((u)&0x0000ff00) << 8) | + (((u)&0x000000ff) << 24)); +} Modified: vendor/compiler-rt/dist/lib/lsan/lsan_common.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_common.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/lsan/lsan_common.cc Mon May 29 16:25:57 2017 (r319144) @@ -265,19 +265,21 @@ static void ProcessThreads(SuspendedThre } if (flags()->use_tls) { - LOG_THREADS("TLS at %p-%p.\n", tls_begin, tls_end); - if (cache_begin == cache_end) { - ScanRangeForPointers(tls_begin, tls_end, frontier, "TLS", kReachable); - } else { - // Because LSan should not be loaded with dlopen(), we can assume - // that allocator cache will be part of static TLS image. - CHECK_LE(tls_begin, cache_begin); - CHECK_GE(tls_end, cache_end); - if (tls_begin < cache_begin) - ScanRangeForPointers(tls_begin, cache_begin, frontier, "TLS", - kReachable); - if (tls_end > cache_end) - ScanRangeForPointers(cache_end, tls_end, frontier, "TLS", kReachable); + if (tls_begin) { + LOG_THREADS("TLS at %p-%p.\n", tls_begin, tls_end); + // If the tls and cache ranges don't overlap, scan full tls range, + // otherwise, only scan the non-overlapping portions + if (cache_begin == cache_end || tls_end < cache_begin || + tls_begin > cache_end) { + ScanRangeForPointers(tls_begin, tls_end, frontier, "TLS", kReachable); + } else { + if (tls_begin < cache_begin) + ScanRangeForPointers(tls_begin, cache_begin, frontier, "TLS", + kReachable); + if (tls_end > cache_end) + ScanRangeForPointers(cache_end, tls_end, frontier, "TLS", + kReachable); + } } if (dtls && !DTLSInDestruction(dtls)) { for (uptr j = 0; j < dtls->dtv_size; ++j) { Modified: vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc Mon May 29 16:25:57 2017 (r319144) @@ -91,12 +91,7 @@ LoadedModule *GetLinker() { return nullp // Required on Linux for initialization of TLS behavior, but should not be // required on Darwin. -void InitializePlatformSpecificModules() { - if (flags()->use_tls) { - Report("use_tls=1 is not supported on Darwin.\n"); - Die(); - } -} +void InitializePlatformSpecificModules() {} // Scans global variables for heap pointers. void ProcessGlobalRegions(Frontier *frontier) { Modified: vendor/compiler-rt/dist/lib/lsan/lsan_flags.inc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_flags.inc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/lsan/lsan_flags.inc Mon May 29 16:25:57 2017 (r319144) @@ -30,7 +30,7 @@ LSAN_FLAG(bool, use_globals, true, "Root set: include global variables (.data and .bss)") LSAN_FLAG(bool, use_stacks, true, "Root set: include thread stacks") LSAN_FLAG(bool, use_registers, true, "Root set: include thread registers") -LSAN_FLAG(bool, use_tls, !SANITIZER_MAC, +LSAN_FLAG(bool, use_tls, true, "Root set: include TLS and thread-specific storage") LSAN_FLAG(bool, use_root_regions, true, "Root set: include regions added via __lsan_register_root_region().") Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_primary32.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_primary32.h Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_primary32.h Mon May 29 16:25:57 2017 (r319144) @@ -319,5 +319,3 @@ class SizeClassAllocator32 { ByteMap possible_regions; SizeClassInfo size_class_info_array[kNumClasses]; }; - - Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h Mon May 29 16:25:57 2017 (r319144) @@ -380,7 +380,7 @@ void SetSoftRssLimitExceededCallback(voi // Functions related to signal handling. typedef void (*SignalHandlerType)(int, void *, void *); -bool IsHandledDeadlySignal(int signum); +HandleSignalMode GetHandleSignalMode(int signum); void InstallDeadlySignalHandlers(SignalHandlerType handler); const char *DescribeSignalOrException(int signo); // Alternative signal stack (POSIX-only). Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flag_parser.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flag_parser.h Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flag_parser.h Mon May 29 16:25:57 2017 (r319144) @@ -64,6 +64,11 @@ inline bool FlagHandler(&opaque_storage_); - u32 v = atomic_exchange(m, MtxUnlocked, memory_order_relaxed); + u32 v = atomic_exchange(m, MtxUnlocked, memory_order_release); CHECK_NE(v, MtxUnlocked); if (v == MtxSleeping) { #if SANITIZER_FREEBSD @@ -1394,7 +1394,7 @@ AndroidApiLevel AndroidGetApiLevel() { #endif -bool IsHandledDeadlySignal(int signum) { +HandleSignalMode GetHandleSignalMode(int signum) { switch (signum) { case SIGABRT: return common_flags()->handle_abort; @@ -1407,7 +1407,7 @@ bool IsHandledDeadlySignal(int signum) { case SIGBUS: return common_flags()->handle_sigbus; } - return false; + return kHandleSignalNo; } #if !SANITIZER_GO Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_s390.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_s390.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_s390.cc Mon May 29 16:25:57 2017 (r319144) @@ -178,6 +178,13 @@ static bool FixedCVE_2016_2143() { // 4.4.6+ is OK. if (minor == 4 && patch >= 6) return true; + if (minor == 4 && patch == 0 && ptr[0] == '-' && + internal_strstr(buf.version, "Ubuntu")) { + // Check Ubuntu 16.04 + int r1 = internal_simple_strtoll(ptr+1, &ptr, 10); + if (r1 >= 13) // 4.4.0-13 or later + return true; + } // Otherwise, OK if 4.5+. return minor >= 5; } else { Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc Mon May 29 16:25:57 2017 (r319144) @@ -370,6 +370,27 @@ uptr GetTlsSize() { void InitTlsSize() { } +uptr TlsBaseAddr() { + uptr segbase = 0; +#if defined(__x86_64__) + asm("movq %%gs:0,%0" : "=r"(segbase)); +#elif defined(__i386__) + asm("movl %%gs:0,%0" : "=r"(segbase)); +#endif + return segbase; +} + +// The size of the tls on darwin does not appear to be well documented, +// however the vm memory map suggests that it is 1024 uptrs in size, +// with a size of 0x2000 bytes on x86_64 and 0x1000 bytes on i386. +uptr TlsSize() { +#if defined(__x86_64__) || defined(__i386__) + return 1024 * sizeof(uptr); +#else + return 0; +#endif +} + void GetThreadStackAndTls(bool main, uptr *stk_addr, uptr *stk_size, uptr *tls_addr, uptr *tls_size) { #if !SANITIZER_GO @@ -377,8 +398,8 @@ void GetThreadStackAndTls(bool main, upt GetThreadStackTopAndBottom(main, &stack_top, &stack_bottom); *stk_addr = stack_bottom; *stk_size = stack_top - stack_bottom; - *tls_addr = 0; - *tls_size = 0; + *tls_addr = TlsBaseAddr(); + *tls_size = TlsSize(); #else *stk_addr = 0; *stk_size = 0; @@ -393,10 +414,10 @@ void ListOfModules::init() { memory_mapping.DumpListOfModules(&modules_); } -bool IsHandledDeadlySignal(int signum) { +HandleSignalMode GetHandleSignalMode(int signum) { // Handling fatal signals on watchOS and tvOS devices is disallowed. if ((SANITIZER_WATCHOS || SANITIZER_TVOS) && !(SANITIZER_IOSSIM)) - return false; + return kHandleSignalNo; switch (signum) { case SIGABRT: return common_flags()->handle_abort; @@ -409,7 +430,7 @@ bool IsHandledDeadlySignal(int signum) { case SIGBUS: return common_flags()->handle_sigbus; } - return false; + return kHandleSignalNo; } MacosVersion cached_macos_version = MACOS_VERSION_UNINITIALIZED; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix_libcdep.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix_libcdep.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix_libcdep.cc Mon May 29 16:25:57 2017 (r319144) @@ -134,7 +134,8 @@ void SleepForMillis(int millis) { void Abort() { #if !SANITIZER_GO // If we are handling SIGABRT, unhandle it first. - if (IsHandledDeadlySignal(SIGABRT)) { + // TODO(vitalybuka): Check if handler belongs to sanitizer. + if (GetHandleSignalMode(SIGABRT) != kHandleSignalNo) { struct sigaction sigact; internal_memset(&sigact, 0, sizeof(sigact)); sigact.sa_sigaction = (sa_sigaction_t)SIG_DFL; @@ -188,8 +189,26 @@ void UnsetAlternateSignalStack() { static void MaybeInstallSigaction(int signum, SignalHandlerType handler) { - if (!IsHandledDeadlySignal(signum)) - return; + switch (GetHandleSignalMode(signum)) { + case kHandleSignalNo: + return; + case kHandleSignalYes: { + struct sigaction sigact; + internal_memset(&sigact, 0, sizeof(sigact)); + CHECK_EQ(0, internal_sigaction(signum, nullptr, &sigact)); + if (sigact.sa_flags & SA_SIGINFO) { + if (sigact.sa_sigaction) return; + } else { + if (sigact.sa_handler != SIG_DFL && sigact.sa_handler != SIG_IGN && + sigact.sa_handler != SIG_ERR) + return; + } + break; + } + case kHandleSignalExclusive: + break; + } + struct sigaction sigact; internal_memset(&sigact, 0, sizeof(sigact)); sigact.sa_sigaction = (sa_sigaction_t)handler; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc Mon May 29 16:25:57 2017 (r319144) @@ -832,9 +832,9 @@ void InstallDeadlySignalHandlers(SignalH // FIXME: Decide what to do on Windows. } -bool IsHandledDeadlySignal(int signum) { +HandleSignalMode GetHandleSignalMode(int signum) { // FIXME: Decide what to do on Windows. - return false; + return kHandleSignalNo; } // Check based on flags if we should handle this exception. Modified: vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_flags_test.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_flags_test.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_flags_test.cc Mon May 29 16:25:57 2017 (r319144) @@ -78,13 +78,15 @@ TEST(SanitizerCommon, HandleSignalMode) TestFlag(kHandleSignalYes, "flag_name=0", kHandleSignalNo); TestFlag(kHandleSignalYes, "flag_name=no", kHandleSignalNo); TestFlag(kHandleSignalYes, "flag_name=false", kHandleSignalNo); + TestFlag(kHandleSignalNo, "flag_name=2", kHandleSignalExclusive); + TestFlag(kHandleSignalYes, "flag_name=exclusive", kHandleSignalExclusive); EXPECT_DEATH(TestFlag(kHandleSignalNo, "flag_name", kHandleSignalNo), "expected '='"); EXPECT_DEATH(TestFlag(kHandleSignalNo, "flag_name=", kHandleSignalNo), "Invalid value for signal handler option: ''"); - EXPECT_DEATH(TestFlag(kHandleSignalNo, "flag_name=2", kHandleSignalNo), - "Invalid value for signal handler option: '2'"); + EXPECT_DEATH(TestFlag(kHandleSignalNo, "flag_name=3", kHandleSignalNo), + "Invalid value for signal handler option: '3'"); EXPECT_DEATH(TestFlag(kHandleSignalNo, "flag_name=-1", kHandleSignalNo), "Invalid value for signal handler option: '-1'"); EXPECT_DEATH(TestFlag(kHandleSignalNo, "flag_name=on", kHandleSignalNo), Modified: vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.cpp ============================================================================== --- vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.cpp Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.cpp Mon May 29 16:25:57 2017 (r319144) @@ -18,7 +18,6 @@ #include "scudo_tls.h" -#include #include namespace __scudo { @@ -32,15 +31,17 @@ __attribute__((tls_model("initial-exec") THREADLOCAL ScudoThreadContext ThreadLocalContext; static void teardownThread(void *Ptr) { - uptr Iteration = reinterpret_cast(Ptr); + uptr I = reinterpret_cast(Ptr); // The glibc POSIX thread-local-storage deallocation routine calls user // provided destructors in a loop of PTHREAD_DESTRUCTOR_ITERATIONS. // We want to be called last since other destructors might call free and the // like, so we wait until PTHREAD_DESTRUCTOR_ITERATIONS before draining the // quarantine and swallowing the cache. - if (Iteration < PTHREAD_DESTRUCTOR_ITERATIONS) { - pthread_setspecific(PThreadKey, reinterpret_cast(Iteration + 1)); - return; + if (I > 1) { + // If pthread_setspecific fails, we will go ahead with the teardown. + if (LIKELY(pthread_setspecific(PThreadKey, + reinterpret_cast(I - 1)) == 0)) + return; } ThreadLocalContext.commitBack(); ScudoThreadState = ThreadTornDown; @@ -53,8 +54,9 @@ static void initOnce() { } void initThread() { - pthread_once(&GlobalInitialized, initOnce); - pthread_setspecific(PThreadKey, reinterpret_cast(1)); + CHECK_EQ(pthread_once(&GlobalInitialized, initOnce), 0); + CHECK_EQ(pthread_setspecific(PThreadKey, reinterpret_cast( + GetPthreadDestructorIterations())), 0); ThreadLocalContext.init(); ScudoThreadState = ThreadInitialized; } Modified: vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform.h ============================================================================== --- vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform.h Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform.h Mon May 29 16:25:57 2017 (r319144) @@ -816,6 +816,7 @@ void FlushShadowMemory(); void WriteMemoryProfile(char *buf, uptr buf_size, uptr nthread, uptr nlive); int ExtractResolvFDs(void *state, int *fds, int nfd); int ExtractRecvmsgFDs(void *msg, int *fds, int nfd); +void ImitateTlsWrite(ThreadState *thr, uptr tls_addr, uptr tls_size); int call_pthread_cancel_with_cleanup(int(*fn)(void *c, void *m, void *abstime), void *c, void *m, void *abstime, Modified: vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_linux.cc ============================================================================== --- vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_linux.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_linux.cc Mon May 29 16:25:57 2017 (r319144) @@ -320,6 +320,20 @@ int ExtractRecvmsgFDs(void *msgp, int *f return res; } +void ImitateTlsWrite(ThreadState *thr, uptr tls_addr, uptr tls_size) { + // Check that the thr object is in tls; + const uptr thr_beg = (uptr)thr; + const uptr thr_end = (uptr)thr + sizeof(*thr); + CHECK_GE(thr_beg, tls_addr); + CHECK_LE(thr_beg, tls_addr + tls_size); + CHECK_GE(thr_end, tls_addr); + CHECK_LE(thr_end, tls_addr + tls_size); + // Since the thr object is huge, skip it. + MemoryRangeImitateWrite(thr, /*pc=*/2, tls_addr, thr_beg - tls_addr); + MemoryRangeImitateWrite(thr, /*pc=*/2, thr_end, + tls_addr + tls_size - thr_end); +} + // Note: this function runs with async signals enabled, // so it must not touch any tsan state. int call_pthread_cancel_with_cleanup(int(*fn)(void *c, void *m, Modified: vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_mac.cc ============================================================================== --- vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_mac.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_mac.cc Mon May 29 16:25:57 2017 (r319144) @@ -75,12 +75,18 @@ static void *SignalSafeGetOrAllocate(upt static uptr main_thread_identity = 0; ALIGNED(64) static char main_thread_state[sizeof(ThreadState)]; +ThreadState **cur_thread_location() { + ThreadState **thread_identity = (ThreadState **)pthread_self(); + return ((uptr)thread_identity == main_thread_identity) ? nullptr + : thread_identity; +} + ThreadState *cur_thread() { - uptr thread_identity = (uptr)pthread_self(); - if (thread_identity == main_thread_identity || main_thread_identity == 0) { + ThreadState **thr_state_loc = cur_thread_location(); + if (thr_state_loc == nullptr || main_thread_identity == 0) { return (ThreadState *)&main_thread_state; } - ThreadState **fake_tls = (ThreadState **)MemToShadow(thread_identity); + ThreadState **fake_tls = (ThreadState **)MemToShadow((uptr)thr_state_loc); ThreadState *thr = (ThreadState *)SignalSafeGetOrAllocate( (uptr *)fake_tls, sizeof(ThreadState)); return thr; @@ -90,13 +96,13 @@ ThreadState *cur_thread() { // munmap first and then clear `fake_tls`; if we receive a signal in between, // handler will try to access the unmapped ThreadState. void cur_thread_finalize() { - uptr thread_identity = (uptr)pthread_self(); - if (thread_identity == main_thread_identity) { + ThreadState **thr_state_loc = cur_thread_location(); + if (thr_state_loc == nullptr) { // Calling dispatch_main() or xpc_main() actually invokes pthread_exit to // exit the main thread. Let's keep the main thread's ThreadState. return; } - ThreadState **fake_tls = (ThreadState **)MemToShadow(thread_identity); + ThreadState **fake_tls = (ThreadState **)MemToShadow((uptr)thr_state_loc); internal_munmap(*fake_tls, sizeof(ThreadState)); *fake_tls = nullptr; } @@ -240,6 +246,29 @@ void InitializePlatform() { } #if !SANITIZER_GO +void ImitateTlsWrite(ThreadState *thr, uptr tls_addr, uptr tls_size) { + // The pointer to the ThreadState object is stored in the shadow memory + // of the tls. + uptr tls_end = tls_addr + tls_size; + ThreadState **thr_state_loc = cur_thread_location(); + if (thr_state_loc == nullptr) { + MemoryRangeImitateWrite(thr, /*pc=*/2, tls_addr, tls_size); + } else { + uptr thr_state_start = (uptr)thr_state_loc; + uptr thr_state_end = thr_state_start + sizeof(uptr); + CHECK_GE(thr_state_start, tls_addr); + CHECK_LE(thr_state_start, tls_addr + tls_size); + CHECK_GE(thr_state_end, tls_addr); + CHECK_LE(thr_state_end, tls_addr + tls_size); + MemoryRangeImitateWrite(thr, /*pc=*/2, tls_addr, + thr_state_start - tls_addr); + MemoryRangeImitateWrite(thr, /*pc=*/2, thr_state_end, + tls_end - thr_state_end); + } +} +#endif + +#if !SANITIZER_GO // Note: this function runs with async signals enabled, // so it must not touch any tsan state. int call_pthread_cancel_with_cleanup(int(*fn)(void *c, void *m, Modified: vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_thread.cc ============================================================================== --- vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_thread.cc Mon May 29 16:25:53 2017 (r319143) +++ vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_thread.cc Mon May 29 16:25:57 2017 (r319144) @@ -248,19 +248,7 @@ void ThreadStart(ThreadState *thr, int t if (stk_addr && stk_size) MemoryRangeImitateWrite(thr, /*pc=*/ 1, stk_addr, stk_size); - if (tls_addr && tls_size) { - // Check that the thr object is in tls; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Mon May 29 16:26:07 2017 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 827BBD77871; Mon, 29 May 2017 16:26:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35FC580C78; Mon, 29 May 2017 16:26:07 +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 v4TGQ69A083253; Mon, 29 May 2017 16:26:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TGQ6BB083252; Mon, 29 May 2017 16:26:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705291626.v4TGQ6BB083252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 May 2017 16:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319145 - vendor/compiler-rt/compiler-rt-trunk-r304149 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 16:26:07 -0000 Author: dim Date: Mon May 29 16:26:06 2017 New Revision: 319145 URL: https://svnweb.freebsd.org/changeset/base/319145 Log: Tag compiler-rt trunk r304149. Added: vendor/compiler-rt/compiler-rt-trunk-r304149/ - copied from r319144, vendor/compiler-rt/dist/ From owner-svn-src-vendor@freebsd.org Mon May 29 16:26: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 98C51D778CC; Mon, 29 May 2017 16:26: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 3EBA880D06; Mon, 29 May 2017 16:26: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 v4TGQCKr083323; Mon, 29 May 2017 16:26:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TGQAN9083302; Mon, 29 May 2017 16:26:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705291626.v4TGQAN9083302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 May 2017 16:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319146 - in vendor/libc++/dist: . cmake include include/experimental lib test/libcxx test/libcxx/experimental/language.support test/libcxx/experimental/language.support/support.corouti... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 16:26:13 -0000 Author: dim Date: Mon May 29 16:26:10 2017 New Revision: 319146 URL: https://svnweb.freebsd.org/changeset/base/319146 Log: Vendor import of libc++ trunk r304149: https://llvm.org/svn/llvm-project/libcxx/trunk@304149 Added: vendor/libc++/dist/include/experimental/coroutine vendor/libc++/dist/test/libcxx/experimental/language.support/ vendor/libc++/dist/test/libcxx/experimental/language.support/support.coroutines/ vendor/libc++/dist/test/libcxx/experimental/language.support/support.coroutines/dialect_support.sh.cpp (contents, props changed) vendor/libc++/dist/test/libcxx/experimental/language.support/support.coroutines/version.sh.cpp (contents, props changed) vendor/libc++/dist/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/ vendor/libc++/dist/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp (contents, props changed) vendor/libc++/dist/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/assign.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/construct.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/address.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/void_handle.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.traits/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.traits/promise_type.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/expected.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/fullexpr-dtor.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/generator.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/go.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/multishot_func.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/includes.sh.cpp (contents, props changed) vendor/libc++/dist/test/support/coroutine_types.h (contents, props changed) vendor/libc++/dist/test/support/test.workarounds/c1xx_empty_parameter_pack_expansion.pass.cpp (contents, props changed) Deleted: vendor/libc++/dist/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/arrow.pass.cpp vendor/libc++/dist/test/support/test.workarounds/c1xx_broken_nullptr_conversion_operator.pass.cpp Modified: vendor/libc++/dist/CMakeLists.txt vendor/libc++/dist/cmake/config-ix.cmake vendor/libc++/dist/include/__config vendor/libc++/dist/include/__threading_support vendor/libc++/dist/include/algorithm vendor/libc++/dist/include/experimental/__config vendor/libc++/dist/include/iterator vendor/libc++/dist/include/memory vendor/libc++/dist/include/module.modulemap vendor/libc++/dist/lib/CMakeLists.txt vendor/libc++/dist/test/libcxx/double_include.sh.cpp vendor/libc++/dist/test/std/strings/basic.string/string.modifiers/string_erase/iter.pass.cpp vendor/libc++/dist/test/std/strings/basic.string/string.modifiers/string_erase/iter_iter.pass.cpp vendor/libc++/dist/test/std/strings/basic.string/string.modifiers/string_erase/pop_back.pass.cpp vendor/libc++/dist/test/std/strings/basic.string/string.modifiers/string_erase/size_size.pass.cpp vendor/libc++/dist/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp vendor/libc++/dist/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp vendor/libc++/dist/test/support/poisoned_hash_helper.hpp vendor/libc++/dist/test/support/test_macros.h vendor/libc++/dist/test/support/test_workarounds.h vendor/libc++/dist/test/support/uses_alloc_types.hpp vendor/libc++/dist/utils/libcxx/test/config.py vendor/libc++/dist/www/cxx1z_status.html Modified: vendor/libc++/dist/CMakeLists.txt ============================================================================== --- vendor/libc++/dist/CMakeLists.txt Mon May 29 16:26:06 2017 (r319145) +++ vendor/libc++/dist/CMakeLists.txt Mon May 29 16:26:10 2017 (r319146) @@ -452,6 +452,11 @@ add_compile_flags_if_supported(-nostdinc # the dylib when get ODR used by another function. add_compile_flags_if_supported(-fvisibility-inlines-hidden) +if (LIBCXX_CONFIGURE_IDE) + # This simply allows IDE to process + add_compile_flags_if_supported(-fcoroutines-ts) +endif() + # Let the library headers know they are currently being used to build the # library. add_definitions(-D_LIBCPP_BUILDING_LIBRARY) Modified: vendor/libc++/dist/cmake/config-ix.cmake ============================================================================== --- vendor/libc++/dist/cmake/config-ix.cmake Mon May 29 16:26:06 2017 (r319145) +++ vendor/libc++/dist/cmake/config-ix.cmake Mon May 29 16:26:10 2017 (r319146) @@ -41,7 +41,15 @@ if (LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG) if (MINGW) # Mingw64 requires quite a few "C" runtime libraries in order for basic # programs to link successfully with -nodefaultlibs. - list(APPEND CMAKE_REQUIRED_LIBRARIES mingw32 gcc gcc_eh mingwex msvcrt gcc) + if (LIBCXX_USE_COMPILER_RT) + set(MINGW_RUNTIME ${LIBCXX_BUILTINS_LIBRARY}) + else () + set(MINGW_RUNTIME gcc_s gcc) + endif() + set(MINGW_LIBRARIES mingw32 ${MINGW_RUNTIME} moldname mingwex msvcrt advapi32 + shell32 user32 kernel32 mingw32 ${MINGW_RUNTIME} + moldname mingwex msvcrt) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${MINGW_LIBRARIES}) endif() if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all") Modified: vendor/libc++/dist/include/__config ============================================================================== --- vendor/libc++/dist/include/__config Mon May 29 16:26:06 2017 (r319145) +++ vendor/libc++/dist/include/__config Mon May 29 16:26:10 2017 (r319146) @@ -1126,6 +1126,10 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit # define _LIBCPP_HAS_NO_IS_AGGREGATE #endif +#if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L +# define _LIBCPP_HAS_NO_COROUTINES +#endif + #endif // __cplusplus // Decide whether to use availability macros. Modified: vendor/libc++/dist/include/__threading_support ============================================================================== --- vendor/libc++/dist/include/__threading_support Mon May 29 16:26:06 2017 (r319145) +++ vendor/libc++/dist/include/__threading_support Mon May 29 16:26:10 2017 (r319146) @@ -27,7 +27,7 @@ # include # include #elif defined(_LIBCPP_HAS_THREAD_API_WIN32) -#include +#include #include #include #include <__undef_min_max> Modified: vendor/libc++/dist/include/algorithm ============================================================================== --- vendor/libc++/dist/include/algorithm Mon May 29 16:26:06 2017 (r319145) +++ vendor/libc++/dist/include/algorithm Mon May 29 16:26:10 2017 (r319146) @@ -35,6 +35,9 @@ template + InputIterator for_each_n(InputIterator first, Size n, Function f); // C++17 + template InputIterator find(InputIterator first, InputIterator last, const T& value); @@ -961,6 +964,26 @@ for_each(_InputIterator __first, _InputI return __f; } +#if _LIBCPP_STD_VER > 14 +// for_each_n + +template +inline _LIBCPP_INLINE_VISIBILITY +_InputIterator +for_each_n(_InputIterator __first, _Size __orig_n, _Function __f) +{ + typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize; + _IntegralSize __n = __orig_n; + while (__n > 0) + { + __f(*__first); + ++__first; + --__n; + } + return __first; +} +#endif + // find template Modified: vendor/libc++/dist/include/experimental/__config ============================================================================== --- vendor/libc++/dist/include/experimental/__config Mon May 29 16:26:06 2017 (r319145) +++ vendor/libc++/dist/include/experimental/__config Mon May 29 16:26:10 2017 (r319146) @@ -44,6 +44,13 @@ #define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM \ } } _LIBCPP_END_NAMESPACE_EXPERIMENTAL +#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES \ + _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace coroutines_v1 { + +#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES \ + } _LIBCPP_END_NAMESPACE_EXPERIMENTAL + +#define _VSTD_CORO _VSTD_EXPERIMENTAL::coroutines_v1 #define _VSTD_FS ::std::experimental::filesystem::v1 Added: vendor/libc++/dist/include/experimental/coroutine ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/include/experimental/coroutine Mon May 29 16:26:10 2017 (r319146) @@ -0,0 +1,270 @@ +// -*- C++ -*- +//===----------------------------- coroutine -----------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_EXPERIMENTAL_COROUTINE +#define _LIBCPP_EXPERIMENTAL_COROUTINE + +/** + experimental/coroutine synopsis + +// C++next + +namespace std { +namespace experimental { +inline namespace coroutines_v1 { + + // 18.11.1 coroutine traits +template +class coroutine_traits; +// 18.11.2 coroutine handle +template +class coroutine_handle; +// 18.11.2.7 comparison operators: +bool operator==(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT; +bool operator!=(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT; +bool operator<(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT; +bool operator<=(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT; +bool operator>=(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT; +bool operator>(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT; +// 18.11.3 trivial awaitables +struct suspend_never; +struct suspend_always; +// 18.11.2.8 hash support: +template struct hash; +template struct hash>; + +} // namespace coroutines_v1 +} // namespace experimental +} // namespace std + + */ + +#include +#include +#include +#include +#include // for hash +#include +#include +#include <__debug> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +#ifdef _LIBCPP_HAS_NO_COROUTINES +# if defined(_LIBCPP_WARNING) + _LIBCPP_WARNING(" cannot be used with this compiler") +# else +# warning cannot be used with this compiler +# endif +#endif + +#ifndef _LIBCPP_HAS_NO_COROUTINES + +_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES + +template +struct __coroutine_traits_sfinae {}; + +template +struct __coroutine_traits_sfinae< + _Tp, typename __void_t::type> +{ + using promise_type = typename _Tp::promise_type; +}; + +template +struct _LIBCPP_TEMPLATE_VIS coroutine_traits + : public __coroutine_traits_sfinae<_Ret> +{ +}; + +template +class _LIBCPP_TEMPLATE_VIS coroutine_handle; + +template <> +class _LIBCPP_TEMPLATE_VIS coroutine_handle { +public: + _LIBCPP_ALWAYS_INLINE + _LIBCPP_CONSTEXPR coroutine_handle() _NOEXCEPT : __handle_(nullptr) {} + + _LIBCPP_ALWAYS_INLINE + _LIBCPP_CONSTEXPR coroutine_handle(nullptr_t) _NOEXCEPT : __handle_(nullptr) {} + + _LIBCPP_ALWAYS_INLINE + coroutine_handle& operator=(nullptr_t) _NOEXCEPT { + __handle_ = nullptr; + return *this; + } + + _LIBCPP_ALWAYS_INLINE + _LIBCPP_CONSTEXPR void* address() const _NOEXCEPT { return __handle_; } + + _LIBCPP_ALWAYS_INLINE + _LIBCPP_CONSTEXPR explicit operator bool() const _NOEXCEPT { return __handle_; } + + _LIBCPP_ALWAYS_INLINE + void operator()() { resume(); } + + _LIBCPP_ALWAYS_INLINE + void resume() { + _LIBCPP_ASSERT(__is_suspended(), + "resume() can only be called on suspended coroutines"); + _LIBCPP_ASSERT(!done(), + "resume() has undefined behavior when the coroutine is done"); + __builtin_coro_resume(__handle_); + } + + _LIBCPP_ALWAYS_INLINE + void destroy() { + _LIBCPP_ASSERT(__is_suspended(), + "destroy() can only be called on suspended coroutines"); + __builtin_coro_destroy(__handle_); + } + + _LIBCPP_ALWAYS_INLINE + bool done() const { + _LIBCPP_ASSERT(__is_suspended(), + "done() can only be called on suspended coroutines"); + return __builtin_coro_done(__handle_); + } + +public: + _LIBCPP_ALWAYS_INLINE + static coroutine_handle from_address(void* __addr) _NOEXCEPT { + coroutine_handle __tmp; + __tmp.__handle_ = __addr; + return __tmp; + } + +private: + bool __is_suspended() const _NOEXCEPT { + // FIXME actually implement a check for if the coro is suspended. + return __handle_; + } + + template friend class coroutine_handle; + void* __handle_; +}; + +// 18.11.2.7 comparison operators: +inline _LIBCPP_ALWAYS_INLINE +bool operator==(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { + return __x.address() == __y.address(); +} +inline _LIBCPP_ALWAYS_INLINE +bool operator!=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { + return !(__x == __y); +} +inline _LIBCPP_ALWAYS_INLINE +bool operator<(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { + return less()(__x.address(), __y.address()); +} +inline _LIBCPP_ALWAYS_INLINE +bool operator>(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { + return __y < __x; +} +inline _LIBCPP_ALWAYS_INLINE +bool operator<=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { + return !(__x > __y); +} +inline _LIBCPP_ALWAYS_INLINE +bool operator>=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { + return !(__x < __y); +} + +template +class _LIBCPP_TEMPLATE_VIS coroutine_handle : public coroutine_handle<> { + using _Base = coroutine_handle<>; +public: +#ifndef _LIBCPP_CXX03_LANG + // 18.11.2.1 construct/reset + using coroutine_handle<>::coroutine_handle; +#else + _LIBCPP_ALWAYS_INLINE coroutine_handle() _NOEXCEPT : _Base() {} + _LIBCPP_ALWAYS_INLINE coroutine_handle(nullptr_t) _NOEXCEPT : _Base(nullptr) {} +#endif + _LIBCPP_INLINE_VISIBILITY + coroutine_handle& operator=(nullptr_t) _NOEXCEPT { + _Base::operator=(nullptr); + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + _Promise& promise() const { + return *reinterpret_cast<_Promise*>( + __builtin_coro_promise(this->__handle_, __alignof(_Promise), false)); + } + +public: + _LIBCPP_ALWAYS_INLINE + static coroutine_handle from_address(void* __addr) _NOEXCEPT { + coroutine_handle __tmp; + __tmp.__handle_ = __addr; + return __tmp; + } + + // NOTE: this overload isn't required by the standard but is needed so + // the deleted _Promise* overload doesn't make from_address(nullptr) + // ambiguous. + // FIXME: should from_address work with nullptr? + _LIBCPP_ALWAYS_INLINE + static coroutine_handle from_address(nullptr_t) _NOEXCEPT { + return {}; + } + + // from_address cannot be used with the coroutines promise type. + static coroutine_handle from_address(_Promise*) = delete; + + _LIBCPP_ALWAYS_INLINE + static coroutine_handle from_promise(_Promise& __promise) _NOEXCEPT { + coroutine_handle __tmp; + __tmp.__handle_ = __builtin_coro_promise(_VSTD::addressof(__promise), + __alignof(_Promise), true); + return __tmp; + } +}; + +struct _LIBCPP_TYPE_VIS suspend_never { + _LIBCPP_ALWAYS_INLINE + bool await_ready() const _NOEXCEPT { return true; } + _LIBCPP_ALWAYS_INLINE + void await_suspend(coroutine_handle<>) const _NOEXCEPT {} + _LIBCPP_ALWAYS_INLINE + void await_resume() const _NOEXCEPT {} +}; + +struct _LIBCPP_TYPE_VIS suspend_always { + _LIBCPP_ALWAYS_INLINE + bool await_ready() const _NOEXCEPT { return false; } + _LIBCPP_ALWAYS_INLINE + void await_suspend(coroutine_handle<>) const _NOEXCEPT {} + _LIBCPP_ALWAYS_INLINE + void await_resume() const _NOEXCEPT {} +}; + +_LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES + +_LIBCPP_BEGIN_NAMESPACE_STD + +template +struct hash<_VSTD_CORO::coroutine_handle<_Tp> > { + using __arg_type = _VSTD_CORO::coroutine_handle<_Tp>; + _LIBCPP_INLINE_VISIBILITY + size_t operator()(__arg_type const& __v) const _NOEXCEPT + {return hash()(__v.address());} +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // !defined(_LIBCPP_HAS_NO_COROUTINES) + +#endif /* _LIBCPP_EXPERIMENTAL_COROUTINE */ Modified: vendor/libc++/dist/include/iterator ============================================================================== --- vendor/libc++/dist/include/iterator Mon May 29 16:26:06 2017 (r319145) +++ vendor/libc++/dist/include/iterator Mon May 29 16:26:10 2017 (r319146) @@ -990,7 +990,6 @@ public: _LIBCPP_INLINE_VISIBILITY char_type operator*() const {return static_cast(__sbuf_->sgetc());} - _LIBCPP_INLINE_VISIBILITY char_type* operator->() const {return nullptr;} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++() { __sbuf_->sbumpc(); Modified: vendor/libc++/dist/include/memory ============================================================================== --- vendor/libc++/dist/include/memory Mon May 29 16:26:06 2017 (r319145) +++ vendor/libc++/dist/include/memory Mon May 29 16:26:10 2017 (r319146) @@ -2251,6 +2251,8 @@ void swap(__compressed_pair<_T1, _T2>& _ template struct _LIBCPP_TEMPLATE_VIS default_delete { + static_assert(!is_function<_Tp>::value, + "default_delete cannot be instantiated for function types"); #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY constexpr default_delete() noexcept = default; #else @@ -3653,6 +3655,18 @@ __shared_ptr_emplace<_Tp, _Alloc>::__on_ __a.deallocate(_PTraits::pointer_to(*this), 1); } +struct __shared_ptr_dummy_rebind_allocator_type; +template <> +class _LIBCPP_TEMPLATE_VIS allocator<__shared_ptr_dummy_rebind_allocator_type> +{ +public: + template + struct rebind + { + typedef allocator<_Other> other; + }; +}; + template class _LIBCPP_TEMPLATE_VIS enable_shared_from_this; template @@ -3921,6 +3935,17 @@ public: #endif // _LIBCPP_HAS_NO_VARIADICS private: + template ::value> + struct __shared_ptr_default_allocator + { + typedef allocator<_Yp> type; + }; + + template + struct __shared_ptr_default_allocator<_Yp, true> + { + typedef allocator<__shared_ptr_dummy_rebind_allocator_type> type; + }; template _LIBCPP_INLINE_VISIBILITY @@ -3939,8 +3964,7 @@ private: } } - _LIBCPP_INLINE_VISIBILITY - void __enable_weak_this(const volatile void*, const volatile void*) _NOEXCEPT {} + _LIBCPP_INLINE_VISIBILITY void __enable_weak_this(...) _NOEXCEPT {} template friend class _LIBCPP_TEMPLATE_VIS shared_ptr; template friend class _LIBCPP_TEMPLATE_VIS weak_ptr; @@ -3972,8 +3996,9 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, : __ptr_(__p) { unique_ptr<_Yp> __hold(__p); - typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, allocator<_Yp> > _CntrlBlk; - __cntrl_ = new _CntrlBlk(__p, default_delete<_Yp>(), allocator<_Yp>()); + typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; + typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, _AllocT > _CntrlBlk; + __cntrl_ = new _CntrlBlk(__p, default_delete<_Yp>(), _AllocT()); __hold.release(); __enable_weak_this(__p, __p); } @@ -3988,8 +4013,9 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _D try { #endif // _LIBCPP_NO_EXCEPTIONS - typedef __shared_ptr_pointer<_Yp*, _Dp, allocator<_Yp> > _CntrlBlk; - __cntrl_ = new _CntrlBlk(__p, __d, allocator<_Yp>()); + typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; + typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT > _CntrlBlk; + __cntrl_ = new _CntrlBlk(__p, __d, _AllocT()); __enable_weak_this(__p, __p); #ifndef _LIBCPP_NO_EXCEPTIONS } @@ -4010,8 +4036,9 @@ shared_ptr<_Tp>::shared_ptr(nullptr_t __ try { #endif // _LIBCPP_NO_EXCEPTIONS - typedef __shared_ptr_pointer > _CntrlBlk; - __cntrl_ = new _CntrlBlk(__p, __d, allocator<_Tp>()); + typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT; + typedef __shared_ptr_pointer _CntrlBlk; + __cntrl_ = new _CntrlBlk(__p, __d, _AllocT()); #ifndef _LIBCPP_NO_EXCEPTIONS } catch (...) @@ -4179,8 +4206,9 @@ shared_ptr<_Tp>::shared_ptr(unique_ptr<_ else #endif { - typedef __shared_ptr_pointer<_Yp*, _Dp, allocator<_Yp> > _CntrlBlk; - __cntrl_ = new _CntrlBlk(__r.get(), __r.get_deleter(), allocator<_Yp>()); + typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; + typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT > _CntrlBlk; + __cntrl_ = new _CntrlBlk(__r.get(), __r.get_deleter(), _AllocT()); __enable_weak_this(__r.get(), __r.get()); } __r.release(); @@ -4208,10 +4236,11 @@ shared_ptr<_Tp>::shared_ptr(unique_ptr<_ else #endif { + typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; typedef __shared_ptr_pointer<_Yp*, reference_wrapper::type>, - allocator<_Yp> > _CntrlBlk; - __cntrl_ = new _CntrlBlk(__r.get(), ref(__r.get_deleter()), allocator<_Yp>()); + _AllocT > _CntrlBlk; + __cntrl_ = new _CntrlBlk(__r.get(), ref(__r.get_deleter()), _AllocT()); __enable_weak_this(__r.get(), __r.get()); } __r.release(); Modified: vendor/libc++/dist/include/module.modulemap ============================================================================== --- vendor/libc++/dist/include/module.modulemap Mon May 29 16:26:06 2017 (r319145) +++ vendor/libc++/dist/include/module.modulemap Mon May 29 16:26:10 2017 (r319146) @@ -501,6 +501,10 @@ module std [system] { header "experimental/chrono" export * } + module coroutine { + header "experimental/coroutine" + export * + } module deque { header "experimental/deque" export * Modified: vendor/libc++/dist/lib/CMakeLists.txt ============================================================================== --- vendor/libc++/dist/lib/CMakeLists.txt Mon May 29 16:26:06 2017 (r319145) +++ vendor/libc++/dist/lib/CMakeLists.txt Mon May 29 16:26:10 2017 (r319146) @@ -242,14 +242,11 @@ endif() if (LIBCXX_ENABLE_STATIC) add_library(cxx_static STATIC $) target_link_libraries(cxx_static ${LIBCXX_LIBRARIES}) - set(STATIC_OUTPUT_NAME "c++") - if (WIN32) - set(STATIC_OUTPUT_NAME "libc++") - endif() + set(CMAKE_STATIC_LIBRARY_PREFIX "lib") set_target_properties(cxx_static PROPERTIES LINK_FLAGS "${LIBCXX_LINK_FLAGS}" - OUTPUT_NAME "${STATIC_OUTPUT_NAME}" + OUTPUT_NAME "c++" ) list(APPEND LIBCXX_TARGETS "cxx_static") Modified: vendor/libc++/dist/test/libcxx/double_include.sh.cpp ============================================================================== --- vendor/libc++/dist/test/libcxx/double_include.sh.cpp Mon May 29 16:26:06 2017 (r319145) +++ vendor/libc++/dist/test/libcxx/double_include.sh.cpp Mon May 29 16:26:10 2017 (r319146) @@ -137,6 +137,9 @@ #include #include #include +#if defined(__cpp_coroutines) +#include +#endif #include #include #include Added: vendor/libc++/dist/test/libcxx/experimental/language.support/support.coroutines/dialect_support.sh.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/libcxx/experimental/language.support/support.coroutines/dialect_support.sh.cpp Mon May 29 16:26:10 2017 (r319146) @@ -0,0 +1,59 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// REQUIRES: fcoroutines-ts + +// RUN: %build -fcoroutines-ts +// RUN: %run + +// A simple "breathing" test that checks that +// can be parsed and used in all dialects, including C++03 in order to match +// Clang's behavior. + +#include + +namespace coro = std::experimental::coroutines_v1; + +coro::suspend_always sa; +coro::suspend_never sn; + +struct MyFuture { + struct promise_type { + typedef coro::coroutine_handle HandleT; + coro::suspend_never initial_suspend() { return sn; } + coro::suspend_always final_suspend() { return sa; } + coro::suspend_never yield_value(int) { return sn; } + MyFuture get_return_object() { + MyFuture f(HandleT::from_promise(*this)); + return f; + } + void return_void() {} + void unhandled_exception() {} + }; + typedef promise_type::HandleT HandleT; + MyFuture() : p() {} + MyFuture(HandleT h) : p(h) {} + + coro::coroutine_handle p; +}; + +MyFuture test_coro() { + co_await sn; + co_yield 42; + co_return; +} + +int main() +{ + MyFuture f = test_coro(); + while (!f.p.done()) + f.p.resume(); + f.p.destroy(); +} Added: vendor/libc++/dist/test/libcxx/experimental/language.support/support.coroutines/version.sh.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/libcxx/experimental/language.support/support.coroutines/version.sh.cpp Mon May 29 16:26:10 2017 (r319146) @@ -0,0 +1,25 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 +// REQUIRES: fcoroutines-ts + +// RUN: %build -fcoroutines-ts +// RUN: %run + +#include + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION must be defined +#endif + +int main() +{ +} Added: vendor/libc++/dist/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp Mon May 29 16:26:10 2017 (r319146) @@ -0,0 +1,44 @@ +// UNSUPPORTED: c++98, c++03 + +#include + +template struct Tag {}; + +template +using SPtr = std::shared_ptr)>; + +template +using FnType = void(Tag); + +template +void TestFn(Tag) {} + +template +FnType* getFn() { + return &TestFn; +} + +struct Deleter { + template + void operator()(Tp) const { + using RawT = typename std::remove_pointer::type; + static_assert(std::is_function::value || + std::is_same::type, + std::nullptr_t>::value, + ""); + } +}; + +int main() { + { + SPtr<0> s; // OK + SPtr<1> s1(nullptr); // OK + SPtr<2> s2(getFn<2>(), Deleter{}); // OK + SPtr<3> s3(nullptr, Deleter{}); // OK + } + // expected-error@memory:* 2 {{static_assert failed "default_delete cannot be instantiated for function types"}} + { + SPtr<4> s4(getFn<4>()); // expected-note {{requested here}} + SPtr<5> s5(getFn<5>(), std::default_delete>{}); // expected-note {{requested here}} + } +} Added: vendor/libc++/dist/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp Mon May 29 16:26:10 2017 (r319146) @@ -0,0 +1,61 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +// template +// InputIterator for_each_n(InputIterator first, Size n, Function f); + + +#include +#include + +#include "test_iterators.h" + +struct for_each_test +{ + for_each_test(int c) : count(c) {} + int count; + void operator()(int& i) {++i; ++count;} +}; + +int main() +{ + typedef input_iterator Iter; + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned s = sizeof(ia)/sizeof(ia[0]); + + { + auto f = for_each_test(0); + Iter it = std::for_each_n(Iter(ia), 0, std::ref(f)); + assert(it == Iter(ia)); + assert(f.count == 0); + } + + { + auto f = for_each_test(0); + Iter it = std::for_each_n(Iter(ia), s, std::ref(f)); + + assert(it == Iter(ia+s)); + assert(f.count == s); + for (unsigned i = 0; i < s; ++i) + assert(ia[i] == static_cast(i+1)); + } + + { + auto f = for_each_test(0); + Iter it = std::for_each_n(Iter(ia), 1, std::ref(f)); + + assert(it == Iter(ia+1)); + assert(f.count == 1); + for (unsigned i = 0; i < 1; ++i) + assert(ia[i] == static_cast(i+2)); + } +} Added: vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.sh.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.sh.cpp Mon May 29 16:26:10 2017 (r319146) @@ -0,0 +1,62 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 +// REQUIRES: fcoroutines-ts + +// RUN: %build -fcoroutines-ts +// RUN: %run + +// + +// template +// struct coroutine_handle; + +// constexpr explicit operator bool() const noexcept + +#include +#include +#include + +#include "test_macros.h" + +namespace coro = std::experimental; + +template +void do_test() { + static_assert(std::is_nothrow_constructible::value, ""); + static_assert(!std::is_convertible::value, ""); + { + constexpr C c; ((void)c); + static_assert(bool(c) == false, ""); + } + { // null case + const C c = {}; ((void)c); + ASSERT_NOEXCEPT(bool(c)); + if (c) + assert(false); + else + assert(true); + assert(c.address() == nullptr); + assert(bool(c) == false); + } + { // non-null case + char dummy = 42; + C c = C::from_address((void*)&dummy); + assert(c.address() == &dummy); + assert(bool(c) == true); + } +} + +int main() +{ + do_test>(); + do_test>(); +} Added: vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.sh.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.sh.cpp Mon May 29 16:26:10 2017 (r319146) @@ -0,0 +1,64 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 +// REQUIRES: fcoroutines-ts + +// RUN: %build -fcoroutines-ts +// RUN: %run + +// + +// template +// struct coroutine_handle; + +// bool operator==(coroutine_handle<>, coroutine_handle<>) noexcept +// bool operator!=(coroutine_handle<>, coroutine_handle<>) noexcept + +#include +#include +#include +#include +#include + +#include "test_macros.h" + +namespace coro = std::experimental; + +template +void do_test(uintptr_t LHSVal, uintptr_t RHSVal) { + const C LHS = C::from_address(reinterpret_cast(LHSVal)); + const C RHS = C::from_address(reinterpret_cast(RHSVal)); + const bool ExpectIsEqual = (LHSVal == RHSVal); + assert((LHS == RHS) == ExpectIsEqual); + assert((RHS == LHS) == ExpectIsEqual); + assert((LHS != RHS) == !ExpectIsEqual); + assert((RHS != LHS) == !ExpectIsEqual); + { + static_assert(noexcept(LHS == RHS), ""); + static_assert(noexcept(LHS != RHS), ""); + ASSERT_SAME_TYPE(decltype(LHS == RHS), bool); + ASSERT_SAME_TYPE(decltype(LHS != RHS), bool); + } +} + +int main() +{ + std::pair const TestCases[] = { + {0, 0}, + {16, 16}, + {0, 16}, + {16, 0} + }; + for (auto& TC : TestCases) { + do_test>(TC.first, TC.second); + do_test>(TC.first, TC.second); + } +} Added: vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.sh.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.sh.cpp Mon May 29 16:26:10 2017 (r319146) @@ -0,0 +1,73 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 +// REQUIRES: fcoroutines-ts + +// RUN: %build -fcoroutines-ts +// RUN: %run + +// + +// template +// struct coroutine_handle; + +// bool operator<(coroutine_handle<>, coroutine_handle<>) noexcept +// bool operator>(coroutine_handle<>, coroutine_handle<>) noexcept +// bool operator>=(coroutine_handle<>, coroutine_handle<>) noexcept +// bool operator<=(coroutine_handle<>, coroutine_handle<>) noexcept + +#include +#include +#include +#include +#include + +#include "test_macros.h" + +namespace coro = std::experimental; + +template +void do_test(uintptr_t LHSVal, uintptr_t RHSVal) { + const C LHS = C::from_address(reinterpret_cast(LHSVal)); + const C RHS = C::from_address(reinterpret_cast(RHSVal)); + assert((LHS < RHS) == (LHSVal < RHSVal)); + assert((RHS < LHS) == (RHSVal < LHSVal)); + assert((LHS > RHS) == (LHSVal > RHSVal)); + assert((RHS > LHS) == (RHSVal > LHSVal)); + assert((LHS <= RHS) == (LHSVal <= RHSVal)); + assert((RHS <= LHS) == (RHSVal <= LHSVal)); + assert((LHS >= RHS) == (LHSVal >= RHSVal)); + assert((RHS >= LHS) == (RHSVal >= LHSVal)); + { + static_assert(noexcept(LHS < RHS), ""); + static_assert(noexcept(LHS > RHS), ""); + static_assert(noexcept(LHS <= RHS), ""); + static_assert(noexcept(LHS >= RHS), ""); + ASSERT_SAME_TYPE(decltype(LHS < RHS), bool); + ASSERT_SAME_TYPE(decltype(LHS > RHS), bool); + ASSERT_SAME_TYPE(decltype(LHS <= RHS), bool); + ASSERT_SAME_TYPE(decltype(LHS >= RHS), bool); + } +} + +int main() +{ + std::pair const TestCases[] = { + {0, 0}, + {16, 16}, + {0, 16}, + {16, 0} + }; + for (auto& TC : TestCases) { + do_test>(TC.first, TC.second); + do_test>(TC.first, TC.second); + } +} Added: vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.sh.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.sh.cpp Mon May 29 16:26:10 2017 (r319146) @@ -0,0 +1,48 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 +// REQUIRES: fcoroutines-ts + +// RUN: %build -fcoroutines-ts +// RUN: %run + +// + +// template +// struct coroutine_handle; + +// bool done() const + +#include +#include +#include +#include +#include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Mon May 29 16:26:28 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 5E64DD779BC; Mon, 29 May 2017 16:26:28 +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 12F7C80E93; Mon, 29 May 2017 16:26:28 +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 v4TGQRWV083488; Mon, 29 May 2017 16:26:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TGQRda083487; Mon, 29 May 2017 16:26:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705291626.v4TGQRda083487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 May 2017 16:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319149 - vendor/lld/lld-trunk-r304149 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 16:26:28 -0000 Author: dim Date: Mon May 29 16:26:26 2017 New Revision: 319149 URL: https://svnweb.freebsd.org/changeset/base/319149 Log: Tag lld trunk r304149. Added: vendor/lld/lld-trunk-r304149/ - copied from r319148, vendor/lld/dist/ From owner-svn-src-vendor@freebsd.org Mon May 29 16:26:18 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 4FD19D77914; Mon, 29 May 2017 16:26:18 +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 0841A80D90; Mon, 29 May 2017 16:26: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 v4TGQHtW083371; Mon, 29 May 2017 16:26:17 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TGQHXx083370; Mon, 29 May 2017 16:26:17 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705291626.v4TGQHXx083370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 May 2017 16:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319147 - vendor/libc++/libc++-trunk-r304149 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 16:26:18 -0000 Author: dim Date: Mon May 29 16:26:16 2017 New Revision: 319147 URL: https://svnweb.freebsd.org/changeset/base/319147 Log: Tag libc++ trunk r304149. Added: vendor/libc++/libc++-trunk-r304149/ - copied from r319146, vendor/libc++/dist/ From owner-svn-src-vendor@freebsd.org Mon May 29 16:26:24 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 3C4BCD77992; Mon, 29 May 2017 16:26:24 +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 E425380E23; Mon, 29 May 2017 16:26:23 +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 v4TGQNB0083439; Mon, 29 May 2017 16:26:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TGQKom083418; Mon, 29 May 2017 16:26:20 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705291626.v4TGQKom083418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 May 2017 16:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319148 - in vendor/lld/dist: COFF ELF test/COFF test/COFF/Inputs test/ELF test/ELF/Inputs test/ELF/linkerscript test/ELF/lto test/ELF/lto/Inputs X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 16:26:24 -0000 Author: dim Date: Mon May 29 16:26:20 2017 New Revision: 319148 URL: https://svnweb.freebsd.org/changeset/base/319148 Log: Vendor import of lld trunk r304149: https://llvm.org/svn/llvm-project/lld/trunk@304149 Added: vendor/lld/dist/test/COFF/Inputs/delayimports-error.yaml vendor/lld/dist/test/COFF/Inputs/oldname.yaml vendor/lld/dist/test/COFF/delayimports-error.test vendor/lld/dist/test/COFF/dllimport-gc.test vendor/lld/dist/test/ELF/Inputs/rodynamic.s (contents, props changed) vendor/lld/dist/test/ELF/gdb-index-dup-types.s (contents, props changed) vendor/lld/dist/test/ELF/linkerscript/arm-lscript.s (contents, props changed) vendor/lld/dist/test/ELF/lto/Inputs/relocation-model-pic.ll vendor/lld/dist/test/ELF/lto/relocation-model.ll vendor/lld/dist/test/ELF/relocatable-comdat.s (contents, props changed) vendor/lld/dist/test/ELF/rodynamic.s (contents, props changed) Modified: vendor/lld/dist/COFF/ICF.cpp vendor/lld/dist/COFF/InputFiles.cpp vendor/lld/dist/COFF/InputFiles.h vendor/lld/dist/COFF/MarkLive.cpp vendor/lld/dist/COFF/PDB.cpp vendor/lld/dist/COFF/Symbols.cpp vendor/lld/dist/COFF/Symbols.h vendor/lld/dist/COFF/Writer.cpp vendor/lld/dist/ELF/Config.h vendor/lld/dist/ELF/Driver.cpp vendor/lld/dist/ELF/ICF.cpp vendor/lld/dist/ELF/InputFiles.cpp vendor/lld/dist/ELF/InputSection.cpp vendor/lld/dist/ELF/InputSection.h vendor/lld/dist/ELF/LTO.cpp vendor/lld/dist/ELF/LinkerScript.cpp vendor/lld/dist/ELF/LinkerScript.h vendor/lld/dist/ELF/MapFile.cpp vendor/lld/dist/ELF/Options.td vendor/lld/dist/ELF/OutputSections.cpp vendor/lld/dist/ELF/OutputSections.h vendor/lld/dist/ELF/SyntheticSections.cpp vendor/lld/dist/ELF/SyntheticSections.h vendor/lld/dist/ELF/Writer.cpp vendor/lld/dist/ELF/Writer.h vendor/lld/dist/test/COFF/Inputs/import.yaml vendor/lld/dist/test/ELF/amdgpu-globals.s vendor/lld/dist/test/ELF/build-id.s vendor/lld/dist/test/ELF/gc-sections.s vendor/lld/dist/test/ELF/i386-tls-ie-shared.s vendor/lld/dist/test/ELF/linkerscript/sections-constraint.s vendor/lld/dist/test/ELF/relocation-size-shared.s vendor/lld/dist/test/ELF/relocation-size.s vendor/lld/dist/test/ELF/reproduce.s vendor/lld/dist/test/ELF/section-layout.s vendor/lld/dist/test/ELF/tls-i686.s Modified: vendor/lld/dist/COFF/ICF.cpp ============================================================================== --- vendor/lld/dist/COFF/ICF.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/COFF/ICF.cpp Mon May 29 16:26:20 2017 (r319148) @@ -56,7 +56,6 @@ private: std::vector Chunks; int Cnt = 0; - std::atomic NextId = {1}; std::atomic Repeat = {false}; }; @@ -98,10 +97,10 @@ void ICF::segregate(size_t Begin, size_t }); size_t Mid = Bound - Chunks.begin(); - // Split [Begin, End) into [Begin, Mid) and [Mid, End). - uint32_t Id = NextId++; + // Split [Begin, End) into [Begin, Mid) and [Mid, End). We use Mid as an + // equivalence class ID because every group ends with a unique index. for (size_t I = Begin; I < Mid; ++I) - Chunks[I]->Class[(Cnt + 1) % 2] = Id; + Chunks[I]->Class[(Cnt + 1) % 2] = Mid; // If we created a group, we need to iterate the main loop again. if (Mid != End) @@ -186,6 +185,7 @@ void ICF::forEachClass(std::function &Vec) { // Collect only mergeable sections and group by hash value. + uint32_t NextId = 1; for (Chunk *C : Vec) { - auto *SC = dyn_cast(C); - if (!SC) - continue; - - if (isEligible(SC)) { - // Set MSB to 1 to avoid collisions with non-hash classs. - SC->Class[0] = getHash(SC) | (1 << 31); - Chunks.push_back(SC); - } else { - SC->Class[0] = NextId++; + if (auto *SC = dyn_cast(C)) { + if (isEligible(SC)) + Chunks.push_back(SC); + else + SC->Class[0] = NextId++; } } - if (Chunks.empty()) - return; + // Initially, we use hash values to partition sections. + for (SectionChunk *SC : Chunks) + // Set MSB to 1 to avoid collisions with non-hash classs. + SC->Class[0] = getHash(SC) | (1 << 31); // From now on, sections in Chunks are ordered so that sections in // the same group are consecutive in the vector. @@ -229,14 +228,12 @@ void ICF::run(const std::vector // Compare static contents and assign unique IDs for each static content. forEachClass([&](size_t Begin, size_t End) { segregate(Begin, End, true); }); - ++Cnt; // Split groups by comparing relocations until convergence is obtained. do { Repeat = false; forEachClass( [&](size_t Begin, size_t End) { segregate(Begin, End, false); }); - ++Cnt; } while (Repeat); log("ICF needed " + Twine(Cnt) + " iterations"); Modified: vendor/lld/dist/COFF/InputFiles.cpp ============================================================================== --- vendor/lld/dist/COFF/InputFiles.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/COFF/InputFiles.cpp Mon May 29 16:26:20 2017 (r319148) @@ -48,13 +48,11 @@ namespace coff { /// alias to Target. static void checkAndSetWeakAlias(SymbolTable *Symtab, InputFile *F, SymbolBody *Source, SymbolBody *Target) { - auto *U = dyn_cast(Source); - if (!U) - return; - else if (!U->WeakAlias) + if (auto *U = dyn_cast(Source)) { + if (U->WeakAlias && U->WeakAlias != Target) + Symtab->reportDuplicate(Source->symbol(), F); U->WeakAlias = Target; - else if (U->WeakAlias != Target) - Symtab->reportDuplicate(Source->symbol(), F); + } } ArchiveFile::ArchiveFile(MemoryBufferRef M) : InputFile(ArchiveKind, M) {} @@ -153,8 +151,10 @@ void ObjectFile::initializeSymbols() { uint32_t NumSymbols = COFFObj->getNumberOfSymbols(); SymbolBodies.reserve(NumSymbols); SparseSymbolBodies.resize(NumSymbols); + SmallVector, 8> WeakAliases; int32_t LastSectionNumber = 0; + for (uint32_t I = 0; I < NumSymbols; ++I) { // Get a COFFSymbolRef object. ErrorOr SymOrErr = COFFObj->getSymbol(I); @@ -185,9 +185,12 @@ void ObjectFile::initializeSymbols() { I += Sym.getNumberOfAuxSymbols(); LastSectionNumber = Sym.getSectionNumber(); } - for (auto WeakAlias : WeakAliases) - checkAndSetWeakAlias(Symtab, this, WeakAlias.first, - SparseSymbolBodies[WeakAlias.second]); + + for (auto &KV : WeakAliases) { + SymbolBody *Sym = KV.first; + uint32_t Idx = KV.second; + checkAndSetWeakAlias(Symtab, this, Sym, SparseSymbolBodies[Idx]); + } } SymbolBody *ObjectFile::createUndefined(COFFSymbolRef Sym) { Modified: vendor/lld/dist/COFF/InputFiles.h ============================================================================== --- vendor/lld/dist/COFF/InputFiles.h Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/COFF/InputFiles.h Mon May 29 16:26:20 2017 (r319148) @@ -10,6 +10,7 @@ #ifndef LLD_COFF_INPUT_FILES_H #define LLD_COFF_INPUT_FILES_H +#include "Config.h" #include "lld/Core/LLVM.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseSet.h" @@ -161,7 +162,9 @@ private: // for details about the format. class ImportFile : public InputFile { public: - explicit ImportFile(MemoryBufferRef M) : InputFile(ImportKind, M) {} + explicit ImportFile(MemoryBufferRef M) + : InputFile(ImportKind, M), Live(!Config->DoGC) {} + static bool classof(const InputFile *F) { return F->kind() == ImportKind; } DefinedImportData *ImpSym = nullptr; @@ -176,6 +179,14 @@ public: StringRef ExternalName; const coff_import_header *Hdr; Chunk *Location = nullptr; + + // We want to eliminate dllimported symbols if no one actually refers them. + // This "Live" bit is used to keep track of which import library members + // are actually in use. + // + // If the Live bit is turned off by MarkLive, Writer will ignore dllimported + // symbols provided by this import library member. + bool Live; }; // Used for LTO. Modified: vendor/lld/dist/COFF/MarkLive.cpp ============================================================================== --- vendor/lld/dist/COFF/MarkLive.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/COFF/MarkLive.cpp Mon May 29 16:26:20 2017 (r319148) @@ -37,19 +37,26 @@ void markLive(const std::vector Worklist.push_back(C); }; + auto AddSym = [&](SymbolBody *B) { + if (auto *Sym = dyn_cast(B)) + Enqueue(Sym->getChunk()); + else if (auto *Sym = dyn_cast(B)) + Sym->File->Live = true; + else if (auto *Sym = dyn_cast(B)) + Sym->WrappedSym->File->Live = true; + }; + // Add GC root chunks. for (SymbolBody *B : Config->GCRoot) - if (auto *D = dyn_cast(B)) - Enqueue(D->getChunk()); + AddSym(B); while (!Worklist.empty()) { SectionChunk *SC = Worklist.pop_back_val(); assert(SC->isLive() && "We mark as live when pushing onto the worklist!"); // Mark all symbols listed in the relocation table for this section. - for (SymbolBody *S : SC->symbols()) - if (auto *D = dyn_cast(S)) - Enqueue(D->getChunk()); + for (SymbolBody *B : SC->symbols()) + AddSym(B); // Mark associative sections if any. for (SectionChunk *C : SC->children()) Modified: vendor/lld/dist/COFF/PDB.cpp ============================================================================== --- vendor/lld/dist/COFF/PDB.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/COFF/PDB.cpp Mon May 29 16:26:20 2017 (r319148) @@ -99,6 +99,12 @@ static void addTypeInfo(pdb::TpiStreamBu static void mergeDebugT(SymbolTable *Symtab, pdb::PDBFileBuilder &Builder, codeview::TypeTableBuilder &TypeTable, codeview::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; + // Visit all .debug$T sections to add them to Builder. for (ObjectFile *File : Symtab->ObjectFiles) { ArrayRef Data = getDebugSection(File, ".debug$T"); @@ -109,16 +115,11 @@ static void mergeDebugT(SymbolTable *Sym codeview::CVTypeArray Types; BinaryStreamReader Reader(Stream); SmallVector SourceToDest; - // 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; Handler.addSearchPath(llvm::sys::path::parent_path(File->getName())); if (auto EC = Reader.readArray(Types, Reader.getLength())) fatal(EC, "Reader::readArray failed"); - if (auto Err = codeview::mergeTypeStreams(IDTable, TypeTable, SourceToDest, - &Handler, Types)) + if (auto Err = codeview::mergeTypeAndIdRecords( + IDTable, TypeTable, SourceToDest, &Handler, Types)) fatal(Err, "codeview::mergeTypeStreams failed"); } Modified: vendor/lld/dist/COFF/Symbols.cpp ============================================================================== --- vendor/lld/dist/COFF/Symbols.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/COFF/Symbols.cpp Mon May 29 16:26:20 2017 (r319148) @@ -61,16 +61,19 @@ COFFSymbolRef DefinedCOFF::getCOFFSymbol return COFFSymbolRef(reinterpret_cast(Sym)); } +static Chunk *makeImportThunk(DefinedImportData *S, uint16_t Machine) { + if (Machine == AMD64) + return make(S); + if (Machine == I386) + return make(S); + assert(Machine == ARMNT); + return make(S); +} + DefinedImportThunk::DefinedImportThunk(StringRef Name, DefinedImportData *S, uint16_t Machine) - : Defined(DefinedImportThunkKind, Name) { - switch (Machine) { - case AMD64: Data = make(S); return; - case I386: Data = make(S); return; - case ARMNT: Data = make(S); return; - default: llvm_unreachable("unknown machine type"); - } -} + : Defined(DefinedImportThunkKind, Name), WrappedSym(S), + Data(makeImportThunk(S, Machine)) {} Defined *Undefined::getWeakAlias() { // A weak alias may be a weak alias to another symbol, so check recursively. Modified: vendor/lld/dist/COFF/Symbols.h ============================================================================== --- vendor/lld/dist/COFF/Symbols.h Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/COFF/Symbols.h Mon May 29 16:26:20 2017 (r319148) @@ -300,7 +300,6 @@ public: void setLocation(Chunk *AddressTable) { File->Location = AddressTable; } uint16_t getOrdinal() { return File->Hdr->OrdinalHint; } -private: ImportFile *File; }; @@ -320,6 +319,8 @@ public: uint64_t getRVA() { return Data->getRVA(); } Chunk *getChunk() { return Data; } + DefinedImportData *WrappedSym; + private: Chunk *Data; }; Modified: vendor/lld/dist/COFF/Writer.cpp ============================================================================== --- vendor/lld/dist/COFF/Writer.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/COFF/Writer.cpp Mon May 29 16:26:20 2017 (r319148) @@ -365,6 +365,9 @@ void Writer::createImportTables() { // the same order as in the command line. (That affects DLL // initialization order, and this ordering is MSVC-compatible.) for (ImportFile *File : Symtab->ImportFiles) { + if (!File->Live) + continue; + std::string DLL = StringRef(File->DLLName).lower(); if (Config->DLLOrder.count(DLL) == 0) Config->DLLOrder[DLL] = Config->DLLOrder.size(); @@ -372,19 +375,28 @@ void Writer::createImportTables() { OutputSection *Text = createSection(".text"); for (ImportFile *File : Symtab->ImportFiles) { + if (!File->Live) + continue; + if (DefinedImportThunk *Thunk = File->ThunkSym) Text->addChunk(Thunk->getChunk()); + if (Config->DelayLoads.count(StringRef(File->DLLName).lower())) { + if (!File->ThunkSym) + fatal("cannot delay-load " + toString(File) + + " due to import of data: " + toString(*File->ImpSym)); DelayIdata.add(File->ImpSym); } else { Idata.add(File->ImpSym); } } + if (!Idata.empty()) { OutputSection *Sec = createSection(".idata"); for (Chunk *C : Idata.getChunks()) Sec->addChunk(C); } + if (!DelayIdata.empty()) { Defined *Helper = cast(Config->DelayLoadHelper); DelayIdata.create(Helper); @@ -437,6 +449,14 @@ Optional Writer::createSy if (!D->getChunk()->isLive()) return None; + if (auto *Sym = dyn_cast(Def)) + if (!Sym->File->Live) + return None; + + if (auto *Sym = dyn_cast(Def)) + if (!Sym->WrappedSym->File->Live) + return None; + coff_symbol16 Sym; StringRef Name = Def->getName(); if (Name.size() > COFF::NameSize) { @@ -491,14 +511,17 @@ void Writer::createSymbolAndStringTable( Sec->setStringTableOff(addEntryToStringTable(Name)); } - for (lld::coff::ObjectFile *File : Symtab->ObjectFiles) - for (SymbolBody *B : File->getSymbols()) - if (auto *D = dyn_cast(B)) - if (!D->WrittenToSymtab) { - D->WrittenToSymtab = true; - if (Optional Sym = createSymbol(D)) - OutputSymtab.push_back(*Sym); - } + for (lld::coff::ObjectFile *File : Symtab->ObjectFiles) { + for (SymbolBody *B : File->getSymbols()) { + auto *D = dyn_cast(B); + if (!D || D->WrittenToSymtab) + continue; + D->WrittenToSymtab = true; + + if (Optional Sym = createSymbol(D)) + OutputSymtab.push_back(*Sym); + } + } OutputSection *LastSection = OutputSections.back(); // We position the symbol table to be adjacent to the end of the last section. @@ -782,19 +805,15 @@ void Writer::writeBuildId() { if (BuildId == nullptr) return; - MD5 Hash; - MD5::MD5Result Res; - - Hash.update(ArrayRef{Buffer->getBufferStart(), - Buffer->getBufferEnd()}); - Hash.final(Res); - assert(BuildId->DI->Signature.CVSignature == OMF::Signature::PDB70 && "only PDB 7.0 is supported"); - assert(sizeof(Res) == sizeof(BuildId->DI->PDB70.Signature) && + assert(sizeof(BuildId->DI->PDB70.Signature) == 16 && "signature size mismatch"); - memcpy(BuildId->DI->PDB70.Signature, Res.Bytes.data(), - sizeof(codeview::PDB70DebugInfo::Signature)); + + // Compute an MD5 hash. + ArrayRef Buf(Buffer->getBufferStart(), Buffer->getBufferEnd()); + memcpy(BuildId->DI->PDB70.Signature, MD5::hash(Buf).data(), 16); + // TODO(compnerd) track the Age BuildId->DI->PDB70.Age = 1; } Modified: vendor/lld/dist/ELF/Config.h ============================================================================== --- vendor/lld/dist/ELF/Config.h Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/ELF/Config.h Mon May 29 16:26:20 2017 (r319148) @@ -145,6 +145,7 @@ struct Configuration { bool ZNow; bool ZOrigin; bool ZRelro; + bool ZRodynamic; bool ZText; bool ExitEarly; bool ZWxneeded; Modified: vendor/lld/dist/ELF/Driver.cpp ============================================================================== --- vendor/lld/dist/ELF/Driver.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/ELF/Driver.cpp Mon May 29 16:26:20 2017 (r319148) @@ -572,10 +572,14 @@ static std::pair getHashStyl // -build-id=sha1 are actually tree hashes for performance reasons. static std::pair> getBuildId(opt::InputArgList &Args) { - if (Args.hasArg(OPT_build_id)) + auto *Arg = Args.getLastArg(OPT_build_id, OPT_build_id_eq); + if (!Arg) + return {BuildIdKind::None, {}}; + + if (Arg->getOption().getID() == OPT_build_id) return {BuildIdKind::Fast, {}}; - StringRef S = getString(Args, OPT_build_id_eq, "none"); + StringRef S = Arg->getValue(); if (S == "md5") return {BuildIdKind::Md5, {}}; if (S == "sha1" || S == "tree") @@ -688,6 +692,7 @@ void LinkerDriver::readConfigs(opt::Inpu Config->ZNow = hasZOption(Args, "now"); Config->ZOrigin = hasZOption(Args, "origin"); Config->ZRelro = !hasZOption(Args, "norelro"); + Config->ZRodynamic = hasZOption(Args, "rodynamic"); Config->ZStackSize = getZOptionValue(Args, "stack-size", 0); Config->ZText = !hasZOption(Args, "notext"); Config->ZWxneeded = hasZOption(Args, "wxneeded"); Modified: vendor/lld/dist/ELF/ICF.cpp ============================================================================== --- vendor/lld/dist/ELF/ICF.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/ELF/ICF.cpp Mon May 29 16:26:20 2017 (r319148) @@ -326,9 +326,9 @@ void ICF::forEachClass(std::functi size_t NumShards = 256; size_t Step = Sections.size() / NumShards; parallelForEachN(0, NumShards, [&](size_t I) { - forEachClassRange(I * Step, (I + 1) * Step, Fn); + size_t End = (I == NumShards - 1) ? Sections.size() : (I + 1) * Step; + forEachClassRange(I * Step, End, Fn); }); - forEachClassRange(Step * NumShards, Sections.size(), Fn); ++Cnt; } Modified: vendor/lld/dist/ELF/InputFiles.cpp ============================================================================== --- vendor/lld/dist/ELF/InputFiles.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/ELF/InputFiles.cpp Mon May 29 16:26:20 2017 (r319148) @@ -281,18 +281,20 @@ bool elf::ObjectFile::shouldMerge( template void elf::ObjectFile::initializeSections( DenseSet &ComdatGroups) { + const ELFFile &Obj = this->getObj(); + ArrayRef ObjSections = check(this->getObj().sections(), toString(this)); - const ELFFile &Obj = this->getObj(); uint64_t Size = ObjSections.size(); this->Sections.resize(Size); - unsigned I = -1; + StringRef SectionStringTable = check(Obj.getSectionStringTable(ObjSections), toString(this)); - for (const Elf_Shdr &Sec : ObjSections) { - ++I; + + for (size_t I = 0, E = ObjSections.size(); I < E; I++) { if (this->Sections[I] == &InputSection::Discarded) continue; + const Elf_Shdr &Sec = ObjSections[I]; // SHF_EXCLUDE'ed sections are discarded by the linker. However, // if -r is given, we'll let the final link discard such sections. @@ -303,13 +305,22 @@ void elf::ObjectFile::initializeSe } switch (Sec.sh_type) { - case SHT_GROUP: - this->Sections[I] = &InputSection::Discarded; - if (ComdatGroups - .insert( - CachedHashStringRef(getShtGroupSignature(ObjSections, Sec))) - .second) + case SHT_GROUP: { + // We discard comdat sections usually. When -r we should not do that. We + // still do deduplication in this case to simplify implementation, because + // otherwise merging group sections together would requre additional + // regeneration of its contents. + bool New = ComdatGroups + .insert(CachedHashStringRef( + getShtGroupSignature(ObjSections, Sec))) + .second; + if (New && Config->Relocatable) + this->Sections[I] = createInputSection(Sec, SectionStringTable); + else + this->Sections[I] = &InputSection::Discarded; + if (New) continue; + for (uint32_t SecIndex : getShtGroupEntries(Sec)) { if (SecIndex >= Size) fatal(toString(this) + @@ -317,6 +328,7 @@ void elf::ObjectFile::initializeSe this->Sections[SecIndex] = &InputSection::Discarded; } break; + } case SHT_SYMTAB: this->initSymtab(ObjSections, &Sec); break; Modified: vendor/lld/dist/ELF/InputSection.cpp ============================================================================== --- vendor/lld/dist/ELF/InputSection.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/ELF/InputSection.cpp Mon May 29 16:26:20 2017 (r319148) @@ -23,6 +23,7 @@ #include "llvm/Support/Compression.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Path.h" +#include "llvm/Support/Threading.h" #include using namespace llvm; @@ -172,7 +173,8 @@ void InputSectionBase::uncompress() { if (Error E = Dec.decompress({OutputBuf, Size})) fatal(toString(this) + ": decompress failed: " + llvm::toString(std::move(E))); - Data = ArrayRef((uint8_t *)OutputBuf, Size); + this->Data = ArrayRef((uint8_t *)OutputBuf, Size); + this->Flags &= ~(uint64_t)SHF_COMPRESSED; } uint64_t SectionBase::getOffset(const DefinedRegular &Sym) const { @@ -293,6 +295,24 @@ bool InputSectionBase::classof(const Sec return S->kind() != Output; } +void InputSection::copyShtGroup(uint8_t *Buf) { + assert(this->Type == SHT_GROUP); + + ArrayRef From = getDataAs(); + uint32_t *To = reinterpret_cast(Buf); + + // First entry is a flag word, we leave it unchanged. + *To++ = From[0]; + + // Here we adjust indices of sections that belong to group as it + // might change during linking. + ArrayRef Sections = this->File->getSections(); + for (uint32_t Val : From.slice(1)) { + uint32_t Index = read32(&Val, Config->Endianness); + write32(To++, Sections[Index]->OutSec->SectionIndex, Config->Endianness); + } +} + InputSectionBase *InputSection::getRelocatedSection() { assert(this->Type == SHT_RELA || this->Type == SHT_REL); ArrayRef Sections = this->File->getSections(); @@ -678,6 +698,13 @@ template void InputSection: return; } + // If -r is given, linker should keep SHT_GROUP sections. We should fixup + // them, see copyShtGroup(). + if (this->Type == SHT_GROUP) { + copyShtGroup(Buf + OutSecOff); + return; + } + // Copy section contents from source object file to output file // and then apply relocations. memcpy(Buf + OutSecOff, Data.data(), Data.size()); @@ -866,7 +893,7 @@ const SectionPiece *MergeInputSection::g // it is not just an addition to a base output offset. uint64_t MergeInputSection::getOffset(uint64_t Offset) const { // Initialize OffsetMap lazily. - std::call_once(InitOffsetMap, [&] { + llvm::call_once(InitOffsetMap, [&] { OffsetMap.reserve(Pieces.size()); for (const SectionPiece &Piece : Pieces) OffsetMap[Piece.InputOff] = Piece.OutputOff; Modified: vendor/lld/dist/ELF/InputSection.h ============================================================================== --- vendor/lld/dist/ELF/InputSection.h Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/ELF/InputSection.h Mon May 29 16:26:20 2017 (r319148) @@ -18,6 +18,7 @@ #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/TinyPtrVector.h" #include "llvm/Object/ELF.h" +#include "llvm/Support/Threading.h" #include namespace lld { @@ -248,7 +249,7 @@ private: std::vector Hashes; mutable llvm::DenseMap OffsetMap; - mutable std::once_flag InitOffsetMap; + mutable llvm::once_flag InitOffsetMap; llvm::DenseSet LiveOffsets; }; @@ -318,6 +319,8 @@ public: private: template void copyRelocations(uint8_t *Buf, llvm::ArrayRef Rels); + + void copyShtGroup(uint8_t *Buf); }; // The list of all input sections. Modified: vendor/lld/dist/ELF/LTO.cpp ============================================================================== --- vendor/lld/dist/ELF/LTO.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/ELF/LTO.cpp Mon May 29 16:26:20 2017 (r319148) @@ -73,7 +73,12 @@ static std::unique_ptr createL Conf.Options = InitTargetOptionsFromCodeGenFlags(); Conf.Options.RelaxELFRelocations = true; - Conf.RelocModel = Config->Pic ? Reloc::PIC_ : Reloc::Static; + if (Config->Relocatable) + Conf.RelocModel = None; + else if (Config->Pic) + Conf.RelocModel = Reloc::PIC_; + else + Conf.RelocModel = Reloc::Static; Conf.CodeModel = GetCodeModelFromCMModel(); Conf.DisableVerify = Config->DisableVerify; Conf.DiagHandler = diagnosticHandler; Modified: vendor/lld/dist/ELF/LinkerScript.cpp ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/ELF/LinkerScript.cpp Mon May 29 16:26:20 2017 (r319148) @@ -20,6 +20,8 @@ #include "SymbolTable.h" #include "Symbols.h" #include "SyntheticSections.h" +#include "Target.h" +#include "Threads.h" #include "Writer.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringRef.h" @@ -198,6 +200,15 @@ bool OutputSectionCommand::classof(const return C->Kind == OutputSectionKind; } +// Fill [Buf, Buf + Size) with Filler. +// This is used for linker script "=fillexp" command. +static void fill(uint8_t *Buf, size_t Size, uint32_t Filler) { + size_t I = 0; + for (; I + 4 < Size; I += 4) + memcpy(Buf + I, &Filler, 4); + memcpy(Buf + I, &Filler, Size - I); +} + bool InputSectionDescription::classof(const BaseCommand *C) { return C->Kind == InputSectionKind; } @@ -263,16 +274,16 @@ static bool matchConstraints(ArrayRef +std::vector LinkerScript::computeInputSections(const InputSectionDescription *Cmd) { - std::vector Ret; + std::vector Ret; // Collects all sections that satisfy constraints of Cmd. for (const SectionPattern &Pat : Cmd->SectionPatterns) { @@ -294,7 +305,7 @@ LinkerScript::computeInputSections(const !Pat.SectionPat.match(Sec->Name)) continue; - Ret.push_back(Sec); + Ret.push_back(cast(Sec)); Sec->Assigned = true; } @@ -309,8 +320,8 @@ LinkerScript::computeInputSections(const // --sort-section is handled as an inner SORT command. // 3. If one SORT command is given, and if it is SORT_NONE, don't sort. // 4. If no SORT command is given, sort according to --sort-section. - InputSectionBase **Begin = Ret.data() + SizeBefore; - InputSectionBase **End = Ret.data() + Ret.size(); + InputSection **Begin = Ret.data() + SizeBefore; + InputSection **End = Ret.data() + Ret.size(); if (Pat.SortOuter != SortSectionPolicy::None) { if (Pat.SortInner == SortSectionPolicy::Default) sortSections(Begin, End, Config->SortSection); @@ -493,7 +504,7 @@ void LinkerScript::addOrphanSections(Out Sec->SectionIndex = Index; } auto *ISD = make(""); - ISD->Sections.push_back(S); + ISD->Sections.push_back(cast(S)); Cmd->Commands.push_back(ISD); } } @@ -684,7 +695,6 @@ void LinkerScript::adjustSectionsBeforeS // '.' is assigned to, but creating these section should not have any bad // consequeces and gives us a section to put the symbol in. uint64_t Flags = SHF_ALLOC; - uint32_t Type = SHT_PROGBITS; for (int I = 0, E = Opt.Commands.size(); I != E; ++I) { auto *Cmd = dyn_cast(Opt.Commands[I]); @@ -692,14 +702,13 @@ void LinkerScript::adjustSectionsBeforeS continue; if (OutputSection *Sec = Cmd->Sec) { Flags = Sec->Flags; - Type = Sec->Type; continue; } if (isAllSectionDescription(*Cmd)) continue; - auto *OutSec = make(Cmd->Name, Type, Flags); + auto *OutSec = make(Cmd->Name, SHT_PROGBITS, Flags); OutSec->SectionIndex = I; OutputSections->push_back(OutSec); Cmd->Sec = OutSec; @@ -875,20 +884,20 @@ void LinkerScript::synchronize() { if (!Cmd) continue; ArrayRef Sections = Cmd->Sec->Sections; - std::vector ScriptSections; - DenseSet ScriptSectionsSet; + std::vector ScriptSections; + DenseSet ScriptSectionsSet; for (BaseCommand *Base : Cmd->Commands) { auto *ISD = dyn_cast(Base); if (!ISD) continue; - for (InputSectionBase *&IS : ISD->Sections) { + for (InputSection *&IS : ISD->Sections) { if (IS->Live) { ScriptSections.push_back(&IS); ScriptSectionsSet.insert(IS); } } } - std::vector Missing; + std::vector Missing; for (InputSection *IS : Sections) if (!ScriptSectionsSet.count(IS)) Missing.push_back(IS); @@ -896,7 +905,7 @@ void LinkerScript::synchronize() { auto ISD = make(""); ISD->Sections = Missing; Cmd->Commands.push_back(ISD); - for (InputSectionBase *&IS : ISD->Sections) + for (InputSection *&IS : ISD->Sections) if (IS->Live) ScriptSections.push_back(&IS); } @@ -1034,10 +1043,12 @@ OutputSectionCommand *LinkerScript::getC return I->second; } -Optional LinkerScript::getFiller(OutputSection *Sec) { - if (OutputSectionCommand *Cmd = getCmd(Sec)) - return Cmd->Filler; - return None; +uint32_t OutputSectionCommand::getFiller() { + if (Filler) + return *Filler; + if (Sec->Flags & SHF_EXECINSTR) + return Target->TrapInstr; + return 0; } static void writeInt(uint8_t *Buf, uint64_t Data, uint64_t Size) { @@ -1053,11 +1064,45 @@ static void writeInt(uint8_t *Buf, uint6 llvm_unreachable("unsupported Size argument"); } -void LinkerScript::writeDataBytes(OutputSection *Sec, uint8_t *Buf) { - if (OutputSectionCommand *Cmd = getCmd(Sec)) - for (BaseCommand *Base : Cmd->Commands) - if (auto *Data = dyn_cast(Base)) - writeInt(Buf + Data->Offset, Data->Expression().getValue(), Data->Size); +template void OutputSectionCommand::writeTo(uint8_t *Buf) { + Sec->Loc = Buf; + + // We may have already rendered compressed content when using + // -compress-debug-sections option. Write it together with header. + if (!Sec->CompressedData.empty()) { + memcpy(Buf, Sec->ZDebugHeader.data(), Sec->ZDebugHeader.size()); + memcpy(Buf + Sec->ZDebugHeader.size(), Sec->CompressedData.data(), + Sec->CompressedData.size()); + return; + } + + // Write leading padding. + ArrayRef Sections = Sec->Sections; + uint32_t Filler = getFiller(); + if (Filler) + fill(Buf, Sections.empty() ? Sec->Size : Sections[0]->OutSecOff, Filler); + + parallelForEachN(0, Sections.size(), [=](size_t I) { + InputSection *IS = Sections[I]; + IS->writeTo(Buf); + + // Fill gaps between sections. + if (Filler) { + uint8_t *Start = Buf + IS->OutSecOff + IS->getSize(); + uint8_t *End; + if (I + 1 == Sections.size()) + End = Buf + Sec->Size; + else + End = Buf + Sections[I + 1]->OutSecOff; + fill(Start, End - Start, Filler); + } + }); + + // Linker scripts may have BYTE()-family commands with which you + // can write arbitrary bytes to the output. Process them if any. + for (BaseCommand *Base : Commands) + if (auto *Data = dyn_cast(Base)) + writeInt(Buf + Data->Offset, Data->Expression().getValue(), Data->Size); } bool LinkerScript::hasLMA(OutputSection *Sec) { @@ -1104,3 +1149,8 @@ size_t LinkerScript::getPhdrIndex(const error(Loc + ": section header '" + PhdrName + "' is not listed in PHDRS"); return 0; } + +template void OutputSectionCommand::writeTo(uint8_t *Buf); +template void OutputSectionCommand::writeTo(uint8_t *Buf); +template void OutputSectionCommand::writeTo(uint8_t *Buf); +template void OutputSectionCommand::writeTo(uint8_t *Buf); Modified: vendor/lld/dist/ELF/LinkerScript.h ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.h Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/ELF/LinkerScript.h Mon May 29 16:26:20 2017 (r319148) @@ -130,6 +130,9 @@ struct OutputSectionCommand : BaseComman ConstraintKind Constraint = ConstraintKind::NoConstraint; std::string Location; std::string MemoryRegionName; + + template void writeTo(uint8_t *Buf); + uint32_t getFiller(); }; // This struct represents one section match pattern in SECTIONS() command. @@ -157,7 +160,7 @@ struct InputSectionDescription : BaseCom // will be associated with this InputSectionDescription. std::vector SectionPatterns; - std::vector Sections; + std::vector Sections; }; // Represents an ASSERT(). @@ -213,11 +216,10 @@ struct ScriptConfiguration { class LinkerScript final { llvm::DenseMap SecToCommand; - OutputSectionCommand *getCmd(OutputSection *Sec) const; void assignSymbol(SymbolAssignment *Cmd, bool InSec); void setDot(Expr E, const Twine &Loc, bool InSec); - std::vector + std::vector computeInputSections(const InputSectionDescription *); std::vector @@ -244,6 +246,7 @@ class LinkerScript final { MemoryRegion *CurMemRegion = nullptr; public: + OutputSectionCommand *getCmd(OutputSection *Sec) const; bool hasPhdrsCommands() { return !Opt.PhdrsCommands.empty(); } uint64_t getDot() { return Dot; } OutputSection *getOutputSection(const Twine &Loc, StringRef S); @@ -263,7 +266,6 @@ public: std::vector createPhdrs(); bool ignoreInterpSection(); - llvm::Optional getFiller(OutputSection *Sec); bool hasLMA(OutputSection *Sec); bool shouldKeep(InputSectionBase *S); void assignOffsets(OutputSectionCommand *Cmd); @@ -272,7 +274,6 @@ public: void synchronize(); void assignAddresses(std::vector &Phdrs); - void writeDataBytes(OutputSection *Sec, uint8_t *Buf); void addSymbol(SymbolAssignment *Cmd); void processCommands(OutputSectionFactory &Factory); Modified: vendor/lld/dist/ELF/MapFile.cpp ============================================================================== --- vendor/lld/dist/ELF/MapFile.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/ELF/MapFile.cpp Mon May 29 16:26:20 2017 (r319148) @@ -132,12 +132,17 @@ void elf::writeMapFile(llvm::ArrayRefName << '\n'; // Dump symbols for each input section. - for (InputSection *IS : OSec->Sections) { - writeHeader(OS, OSec->Addr + IS->OutSecOff, IS->getSize(), - IS->Alignment); - OS << indent(1) << toString(IS) << '\n'; - for (DefinedRegular *Sym : SectionSyms[IS]) - OS << SymStr[Sym] << '\n'; + for (BaseCommand *Base : Cmd->Commands) { + auto *ISD = dyn_cast(Base); + if (!ISD) + continue; + for (InputSection *IS : ISD->Sections) { + writeHeader(OS, OSec->Addr + IS->OutSecOff, IS->getSize(), + IS->Alignment); + OS << indent(1) << toString(IS) << '\n'; + for (DefinedRegular *Sym : SectionSyms[IS]) + OS << SymStr[Sym] << '\n'; + } } } } Modified: vendor/lld/dist/ELF/Options.td ============================================================================== --- vendor/lld/dist/ELF/Options.td Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/ELF/Options.td Mon May 29 16:26:20 2017 (r319148) @@ -313,6 +313,7 @@ def alias_o_output2 : Separate<["--"], " def alias_pie_pic_executable: F<"pic-executable">, Alias; def alias_print_map_M: Flag<["-"], "M">, Alias; def alias_relocatable_r: Flag<["-"], "r">, Alias; +def alias_reproduce_eq: J<"reproduce=">, Alias; def alias_retain_symbols_file: S<"retain-symbols-file">, Alias; def alias_rpath_R: JoinedOrSeparate<["-"], "R">, Alias; def alias_rpath_rpath: J<"rpath=">, Alias; Modified: vendor/lld/dist/ELF/OutputSections.cpp ============================================================================== --- vendor/lld/dist/ELF/OutputSections.cpp Mon May 29 16:26:16 2017 (r319147) +++ vendor/lld/dist/ELF/OutputSections.cpp Mon May 29 16:26:20 2017 (r319148) @@ -103,7 +103,7 @@ template void OutputSection // Write section contents to a temporary buffer and compress it. std::vector Buf(Size); - writeTo(Buf.data()); + Script->getCmd(this)->writeTo(Buf.data()); if (Error E = zlib::compress(toStringRef(Buf), CompressedData)) fatal("compress failed: " + llvm::toString(std::move(E))); @@ -112,6 +112,19 @@ template void OutputSection Flags |= SHF_COMPRESSED; } +template static void finalizeShtGroup(OutputSection *Sec) { + // sh_link field for SHT_GROUP sections should contain the section index of + // the symbol table. + Sec->Link = InX::SymTab->OutSec->SectionIndex; + + // sh_link then contain index of an entry in symbol table section which + // provides signature of the section group. + elf::ObjectFile *Obj = Sec->Sections[0]->getFile(); + assert(Config->Relocatable && Sec->Sections.size() == 1); + ArrayRef Symbols = Obj->getSymbols(); + Sec->Info = InX::SymTab->getSymbolIndex(Symbols[Sec->Sections[0]->Info - 1]); +} + template void OutputSection::finalize() { if ((this->Flags & SHF_LINK_ORDER) && !this->Sections.empty()) { std::sort(Sections.begin(), Sections.end(), compareByFilePosition); @@ -126,6 +139,11 @@ template void OutputSection } uint32_t Type = this->Type; + if (Type == SHT_GROUP) { + finalizeShtGroup(this); + return; + } + if (!Config->CopyRelocs || (Type != SHT_RELA && Type != SHT_REL)) return; @@ -259,69 +277,6 @@ void OutputSection::sortCtorsDtors() { std::stable_sort(Sections.begin(), Sections.end(), compCtors); } -// Fill [Buf, Buf + Size) with Filler. -// This is used for linker script "=fillexp" command. -static void fill(uint8_t *Buf, size_t Size, uint32_t Filler) { - size_t I = 0; - for (; I + 4 < Size; I += 4) - memcpy(Buf + I, &Filler, 4); - memcpy(Buf + I, &Filler, Size - I); -} - -uint32_t OutputSection::getFiller() { - // Determine what to fill gaps between InputSections with, as specified by the - // linker script. If nothing is specified and this is an executable section, - // fall back to trap instructions to prevent bad diassembly and detect invalid - // jumps to padding. - if (Optional Filler = Script->getFiller(this)) - return *Filler; - if (Flags & SHF_EXECINSTR) - return Target->TrapInstr; - return 0; -} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Mon May 29 16:26: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 7EB64D77A4E; Mon, 29 May 2017 16:26: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 24D0180F34; Mon, 29 May 2017 16:26: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 v4TGQXju083552; Mon, 29 May 2017 16:26:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TGQVhR083535; Mon, 29 May 2017 16:26:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705291626.v4TGQVhR083535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 May 2017 16:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319150 - in vendor/lldb/dist: docs include/lldb include/lldb/API include/lldb/Core include/lldb/Host include/lldb/Host/common include/lldb/Target include/lldb/Utility packages/Python/l... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 16:26:34 -0000 Author: dim Date: Mon May 29 16:26:31 2017 New Revision: 319150 URL: https://svnweb.freebsd.org/changeset/base/319150 Log: Vendor import of lldb trunk r304149: https://llvm.org/svn/llvm-project/lldb/trunk@304149 Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/num_threads/ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/num_threads/Makefile (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/num_threads/main.cpp (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/sbstructureddata/ vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/sbstructureddata/TestStructuredDataAPI.py (contents, props changed) Deleted: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/Makefile vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/TestNumThreads.py vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/main.cpp Modified: vendor/lldb/dist/docs/lldb-gdb-remote.txt vendor/lldb/dist/include/lldb/API/SBStructuredData.h vendor/lldb/dist/include/lldb/API/SBTrace.h vendor/lldb/dist/include/lldb/Core/StructuredData.h vendor/lldb/dist/include/lldb/Core/StructuredDataImpl.h vendor/lldb/dist/include/lldb/Core/TraceOptions.h vendor/lldb/dist/include/lldb/Host/Editline.h vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h vendor/lldb/dist/include/lldb/Target/Process.h vendor/lldb/dist/include/lldb/Utility/StringExtractor.h vendor/lldb/dist/include/lldb/lldb-enumerations.h vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/main.cpp vendor/lldb/dist/scripts/interface/SBStructuredData.i vendor/lldb/dist/scripts/lldb.swig vendor/lldb/dist/source/API/SBProcess.cpp vendor/lldb/dist/source/API/SBStructuredData.cpp vendor/lldb/dist/source/API/SBThread.cpp vendor/lldb/dist/source/API/SBTrace.cpp vendor/lldb/dist/source/Commands/CommandObjectThread.cpp vendor/lldb/dist/source/Core/FormatEntity.cpp vendor/lldb/dist/source/Core/StructuredData.cpp vendor/lldb/dist/source/Host/common/Editline.cpp vendor/lldb/dist/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp vendor/lldb/dist/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.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/Plugins/Process/gdb-remote/ProcessGDBRemote.h vendor/lldb/dist/source/Target/Process.cpp vendor/lldb/dist/source/Target/Thread.cpp vendor/lldb/dist/source/Utility/StringExtractor.cpp vendor/lldb/dist/source/Utility/StringExtractorGDBRemote.cpp vendor/lldb/dist/source/Utility/StringExtractorGDBRemote.h vendor/lldb/dist/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp vendor/lldb/dist/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp Modified: vendor/lldb/dist/docs/lldb-gdb-remote.txt ============================================================================== --- vendor/lldb/dist/docs/lldb-gdb-remote.txt Mon May 29 16:26:26 2017 (r319149) +++ vendor/lldb/dist/docs/lldb-gdb-remote.txt Mon May 29 16:26:31 2017 (r319150) @@ -209,6 +209,163 @@ send packet: QListThreadsInStopReply read packet: OK //---------------------------------------------------------------------- +// jTraceStart: +// +// BRIEF +// Packet for starting trace of type lldb::TraceType. The following +// parameters should be appended to the packet formatted as a JSON +// dictionary, where the schematic for the JSON dictionary in terms of +// the recognized Keys is given below in the table. +// Different tracing types could require different custom parameters. +// Such custom tracing parameters if needed should be collectively +// specified in a JSON dictionary and the dictionary can be appended +// to this packet (as Value corresponding to "params"). Since sending +// JSON data over gdb-remote protocol has certain limitations, binary +// escaping convention should be used. +// +// Following is the list of parameters - +// +// Key Value (Integer) (O)Optional/ +// (except params which should be a (M)Mandatory +// JSON dictionary) +// ========== ==================================================== +// +// type The type of trace to start (see M +// lldb-enumerations for TraceType) +// +// buffersize The size of the buffer to allocate M +// for trace gathering. +// +// threadid The id of the thread to start tracing O +// on. +// +// metabuffersize The size of buffer to hold meta data O +// used for decoding the trace data. +// +// params Any parameters that are specific to O +// certain trace technologies should be +// collectively specified as a JSON +// dictionary +// ========== ==================================================== +// +// Each tracing instance is identified by a trace id which is returned +// as the reply to this packet. In case the tracing failed to begin an +// error code is returned instead. +//---------------------------------------------------------------------- + +send packet: jTraceStart:{"type":,"buffersize":}] +read packet: /E + +//---------------------------------------------------------------------- +// jTraceStop: +// +// BRIEF +// Stop tracing instance with trace id , of course trace +// needs to be started before. The following parameters should be +// formatted as a JSON dictionary to the packet. Since sending +// JSON data over gdb-remote protocol has certain limitations, binary +// escaping convention should be used. +// +// Following is the list of parameters - +// +// Key Value (Integer) (O)Optional/ +// (M)Mandatory +// ========== ==================================================== +// +// traceid The trace id of the tracing instance M +// +// threadid The id of the thread to stop tracing O +// on. Since could map to +// multiple trace instances (in case it +// maps to the complete process), the +// threadid of a particular thread could +// be appended as "threadid:;" +// to stop tracing on that thread. +// ========== ==================================================== +// +// An OK response is sent in case of success else an error code is +// returned. +//---------------------------------------------------------------------- + +send packet: jTraceStop:{"traceid":}] +read packet: /E + +//---------------------------------------------------------------------- +// jTraceBufferRead: +// +// BRIEF +// Packet for reading the trace for tracing instance , i.e the +// id obtained from StartTrace API. The following parameters should be +// formatted as a JSON dictionary to the packet. Since sending +// JSON data over gdb-remote protocol has certain limitations, binary +// escaping convention should be used. +// +// Following is the list of parameters - +// +// Key Value (Integer) (O)Optional/ +// (M)Mandatory +// ========== ==================================================== +// traceid The trace id of the tracing instance M +// +// offset The offset to start reading the data M +// from. +// +// buffersize The size of the data intended to read. M +// +// threadid The id of the thread to retrieve data O +// from. +// ========== ==================================================== +// +// The trace data is sent as raw binary data if the read was successful +// else an error code is sent. +//---------------------------------------------------------------------- + +send packet: jTraceBufferRead:{"traceid":,"offset":,"buffersize":}] +read packet: /E + +//---------------------------------------------------------------------- +// jTraceMetaRead: +// +// BRIEF +// Similar Packet as above except it reads meta data. +//---------------------------------------------------------------------- + +/---------------------------------------------------------------------- +// jTraceConfigRead: +// +// BRIEF +// Request the trace configuration for the tracing instance with id +// . +// +// Following is the list of parameters - +// +// Key Value (Integer) (O)Optional/ +// (M)Mandatory +// ========== ==================================================== +// traceid The trace id of the tracing instance M +// +// threadid The id of the thread to obtain trace O +// configuration from. Since +// could map to multiple trace instances +// (in case it maps to the complete +// process), the threadid of a particular +// thread could be appended as +// "threadid:;" to obtain the +// trace configuration of that thread. +// ========== ==================================================== +// +// In the response packet the trace configuration is sent as text, +// formatted as a JSON dictionary. Since sending JSON data over +// gdb-remote protocol has certain limitations, binary escaping +// convention is used. +// In case the trace instance with the was not found, an +// error code is returned. +//---------------------------------------------------------------------- + +send packet: jTraceConfigRead:{"traceid":} +read packet: {"conf1":,"conf2":,"params":{"paramName":paramValue}]}];/E + +//---------------------------------------------------------------------- // "qRegisterInfo" // // BRIEF Modified: vendor/lldb/dist/include/lldb/API/SBStructuredData.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBStructuredData.h Mon May 29 16:26:26 2017 (r319149) +++ vendor/lldb/dist/include/lldb/API/SBStructuredData.h Mon May 29 16:26:31 2017 (r319150) @@ -37,11 +37,70 @@ public: lldb::SBError GetDescription(lldb::SBStream &stream) const; + //------------------------------------------------------------------ + /// Return the type of data in this data structure + //------------------------------------------------------------------ + lldb::StructuredDataType GetType() const; + + //------------------------------------------------------------------ + /// Return the size (i.e. number of elements) in this data structure + /// if it is an array or dictionary type. For other types, 0 will be + // returned. + //------------------------------------------------------------------ + size_t GetSize() const; + + //------------------------------------------------------------------ + /// Return the value corresponding to a key if this data structure + /// is a dictionary type. + //------------------------------------------------------------------ + lldb::SBStructuredData GetValueForKey(const char *key) const; + + //------------------------------------------------------------------ + /// Return the value corresponding to an index if this data structure + /// is array. + //------------------------------------------------------------------ + lldb::SBStructuredData GetItemAtIndex(size_t idx) const; + + //------------------------------------------------------------------ + /// Return the integer value if this data structure is an integer type. + //------------------------------------------------------------------ + uint64_t GetIntegerValue(uint64_t fail_value = 0) const; + + //------------------------------------------------------------------ + /// Return the floating point value if this data structure is a floating + /// type. + //------------------------------------------------------------------ + double GetFloatValue(double fail_value = 0.0) const; + + //------------------------------------------------------------------ + /// Return the boolean value if this data structure is a boolean type. + //------------------------------------------------------------------ + bool GetBooleanValue(bool fail_value = false) const; + + //------------------------------------------------------------------ + /// Provides the string value if this data structure is a string type. + /// + /// @param[out] dst + /// pointer where the string value will be written. In case it is null, + /// nothing will be written at @dst. + /// + /// @param[in] dst_len + /// max number of characters that can be written at @dst. In case it is + /// zero, nothing will be written at @dst. If this length is not enough + /// to write the complete string value, (dst_len-1) bytes of the string + /// value will be written at @dst followed by a null character. + /// + /// @return + /// Returns the byte size needed to completely write the string value at + /// @dst in all cases. + //------------------------------------------------------------------ + size_t GetStringValue(char *dst, size_t dst_len) const; + protected: friend class SBTraceOptions; StructuredDataImplUP m_impl_up; }; -} +} // namespace lldb #endif /* SBStructuredData_h */ Modified: vendor/lldb/dist/include/lldb/API/SBTrace.h ============================================================================== --- vendor/lldb/dist/include/lldb/API/SBTrace.h Mon May 29 16:26:26 2017 (r319149) +++ vendor/lldb/dist/include/lldb/API/SBTrace.h Mon May 29 16:26:31 2017 (r319150) @@ -40,7 +40,7 @@ public: /// /// @param[in] thread_id /// Tracing could be started for the complete process or a - /// single thread, in the first case the uid obtained would + /// single thread, in the first case the traceid obtained would /// map to all the threads existing within the process and the /// ones spawning later. The thread_id parameter can be used in /// such a scenario to select the trace data for a specific @@ -68,16 +68,17 @@ public: /// An error explaining what went wrong. /// /// @param[in] thread_id - /// The user id could map to a tracing instance for a thread + /// The trace id could map to a tracing instance for a thread /// or could also map to a group of threads being traced with /// the same trace options. A thread_id is normally optional /// except in the case of tracing a complete process and tracing /// needs to switched off on a particular thread. /// A situation could occur where initially a thread (lets say - /// thread A) is being individually traced with a particular uid - /// and then tracing is started on the complete process, in this - /// case thread A will continue without any change. All newly - /// spawned threads would be traced with the uid of the process. + /// thread A) is being individually traced with a particular + /// trace id and then tracing is started on the complete + /// process, in this case thread A will continue without any + /// change. All newly spawned threads would be traced with the + /// trace id of the process. /// Now if the StopTrace API is called for the whole process, /// thread A will not be stopped and must be stopped separately. //------------------------------------------------------------------ Modified: vendor/lldb/dist/include/lldb/Core/StructuredData.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/StructuredData.h Mon May 29 16:26:26 2017 (r319149) +++ vendor/lldb/dist/include/lldb/Core/StructuredData.h Mon May 29 16:26:31 2017 (r319150) @@ -13,7 +13,8 @@ #include "llvm/ADT/StringRef.h" #include "lldb/Utility/ConstString.h" -#include "lldb/Utility/FileSpec.h" // for FileSpec +#include "lldb/Utility/FileSpec.h" // for FileSpec +#include "lldb/lldb-enumerations.h" // for StructuredDataType #include #include @@ -71,46 +72,38 @@ public: typedef std::shared_ptr DictionarySP; typedef std::shared_ptr GenericSP; - enum class Type { - eTypeInvalid = -1, - eTypeNull = 0, - eTypeGeneric, - eTypeArray, - eTypeInteger, - eTypeFloat, - eTypeBoolean, - eTypeString, - eTypeDictionary - }; - class Object : public std::enable_shared_from_this { public: - Object(Type t = Type::eTypeInvalid) : m_type(t) {} + Object(lldb::StructuredDataType t = lldb::eStructuredDataTypeInvalid) + : m_type(t) {} virtual ~Object() = default; virtual bool IsValid() const { return true; } - virtual void Clear() { m_type = Type::eTypeInvalid; } + virtual void Clear() { m_type = lldb::eStructuredDataTypeInvalid; } - Type GetType() const { return m_type; } + lldb::StructuredDataType GetType() const { return m_type; } - void SetType(Type t) { m_type = t; } + void SetType(lldb::StructuredDataType t) { m_type = t; } Array *GetAsArray() { - return ((m_type == Type::eTypeArray) ? static_cast(this) - : nullptr); + return ((m_type == lldb::eStructuredDataTypeArray) + ? static_cast(this) + : nullptr); } Dictionary *GetAsDictionary() { - return ((m_type == Type::eTypeDictionary) - ? static_cast(this) - : nullptr); + return ( + (m_type == lldb::eStructuredDataTypeDictionary) + ? static_cast(this) + : nullptr); } Integer *GetAsInteger() { - return ((m_type == Type::eTypeInteger) ? static_cast(this) - : nullptr); + return ((m_type == lldb::eStructuredDataTypeInteger) + ? static_cast(this) + : nullptr); } uint64_t GetIntegerValue(uint64_t fail_value = 0) { @@ -119,8 +112,9 @@ public: } Float *GetAsFloat() { - return ((m_type == Type::eTypeFloat) ? static_cast(this) - : nullptr); + return ((m_type == lldb::eStructuredDataTypeFloat) + ? static_cast(this) + : nullptr); } double GetFloatValue(double fail_value = 0.0) { @@ -129,8 +123,9 @@ public: } Boolean *GetAsBoolean() { - return ((m_type == Type::eTypeBoolean) ? static_cast(this) - : nullptr); + return ((m_type == lldb::eStructuredDataTypeBoolean) + ? static_cast(this) + : nullptr); } bool GetBooleanValue(bool fail_value = false) { @@ -139,8 +134,9 @@ public: } String *GetAsString() { - return ((m_type == Type::eTypeString) ? static_cast(this) - : nullptr); + return ((m_type == lldb::eStructuredDataTypeString) + ? static_cast(this) + : nullptr); } llvm::StringRef GetStringValue(const char *fail_value = nullptr) { @@ -152,8 +148,9 @@ public: } Generic *GetAsGeneric() { - return ((m_type == Type::eTypeGeneric) ? static_cast(this) - : nullptr); + return ((m_type == lldb::eStructuredDataTypeGeneric) + ? static_cast(this) + : nullptr); } ObjectSP GetObjectForDotSeparatedPath(llvm::StringRef path); @@ -163,12 +160,12 @@ public: virtual void Dump(Stream &s, bool pretty_print = true) const = 0; private: - Type m_type; + lldb::StructuredDataType m_type; }; class Array : public Object { public: - Array() : Object(Type::eTypeArray) {} + Array() : Object(lldb::eStructuredDataTypeArray) {} ~Array() override = default; @@ -288,7 +285,8 @@ public: class Integer : public Object { public: - Integer(uint64_t i = 0) : Object(Type::eTypeInteger), m_value(i) {} + Integer(uint64_t i = 0) + : Object(lldb::eStructuredDataTypeInteger), m_value(i) {} ~Integer() override = default; @@ -304,7 +302,8 @@ public: class Float : public Object { public: - Float(double d = 0.0) : Object(Type::eTypeFloat), m_value(d) {} + Float(double d = 0.0) : Object(lldb::eStructuredDataTypeFloat), + m_value(d) {} ~Float() override = default; @@ -320,7 +319,8 @@ public: class Boolean : public Object { public: - Boolean(bool b = false) : Object(Type::eTypeBoolean), m_value(b) {} + Boolean(bool b = false) : Object(lldb::eStructuredDataTypeBoolean), + m_value(b) {} ~Boolean() override = default; @@ -336,9 +336,10 @@ public: class String : public Object { public: - String() : Object(Type::eTypeString) {} + String() : Object(lldb::eStructuredDataTypeString) {} explicit String(llvm::StringRef S) - : Object(Type::eTypeString), m_value(S) {} + : Object(lldb::eStructuredDataTypeString), + m_value(S) {} void SetValue(llvm::StringRef S) { m_value = S; } @@ -352,7 +353,8 @@ public: class Dictionary : public Object { public: - Dictionary() : Object(Type::eTypeDictionary), m_dict() {} + Dictionary() : Object(lldb::eStructuredDataTypeDictionary), + m_dict() {} ~Dictionary() override = default; @@ -522,7 +524,7 @@ public: class Null : public Object { public: - Null() : Object(Type::eTypeNull) {} + Null() : Object(lldb::eStructuredDataTypeNull) {} ~Null() override = default; @@ -534,7 +536,7 @@ public: class Generic : public Object { public: explicit Generic(void *object = nullptr) - : Object(Type::eTypeGeneric), m_object(object) {} + : Object(lldb::eStructuredDataTypeGeneric), m_object(object) {} void SetValue(void *value) { m_object = value; } Modified: vendor/lldb/dist/include/lldb/Core/StructuredDataImpl.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/StructuredDataImpl.h Mon May 29 16:26:26 2017 (r319149) +++ vendor/lldb/dist/include/lldb/Core/StructuredDataImpl.h Mon May 29 16:26:31 2017 (r319150) @@ -15,7 +15,9 @@ #include "lldb/Target/StructuredDataPlugin.h" #include "lldb/Utility/Status.h" #include "lldb/Utility/Stream.h" +#include "lldb/lldb-enumerations.h" #include "lldb/lldb-forward.h" +#include "llvm/ADT/StringRef.h" #pragma mark-- #pragma mark StructuredDataImpl @@ -78,18 +80,77 @@ public: return plugin_sp->GetDescription(m_data_sp, stream); } - StructuredData::ObjectSP GetObjectSP() { - return m_data_sp; + StructuredData::ObjectSP GetObjectSP() { return m_data_sp; } + + void SetObjectSP(const StructuredData::ObjectSP &obj) { m_data_sp = obj; } + + lldb::StructuredDataType GetType() const { + return (m_data_sp ? m_data_sp->GetType() : + lldb::eStructuredDataTypeInvalid); + } + + size_t GetSize() const { + if (!m_data_sp) + return 0; + + if (m_data_sp->GetType() == lldb::eStructuredDataTypeDictionary) { + auto dict = m_data_sp->GetAsDictionary(); + return (dict->GetSize()); + } else if (m_data_sp->GetType() == lldb::eStructuredDataTypeArray) { + auto array = m_data_sp->GetAsArray(); + return (array->GetSize()); + } else + return 0; + } + + StructuredData::ObjectSP GetValueForKey(const char *key) const { + if (m_data_sp) { + auto dict = m_data_sp->GetAsDictionary(); + if (dict) + return dict->GetValueForKey(llvm::StringRef(key)); + } + return StructuredData::ObjectSP(); + } + + StructuredData::ObjectSP GetItemAtIndex(size_t idx) const { + if (m_data_sp) { + auto array = m_data_sp->GetAsArray(); + if (array) + return array->GetItemAtIndex(idx); + } + return StructuredData::ObjectSP(); } - void SetObjectSP(const StructuredData::ObjectSP &obj) { - m_data_sp = obj; + uint64_t GetIntegerValue(uint64_t fail_value = 0) const { + return (m_data_sp ? m_data_sp->GetIntegerValue(fail_value) : fail_value); } -private: + double GetFloatValue(double fail_value = 0.0) const { + return (m_data_sp ? m_data_sp->GetFloatValue(fail_value) : fail_value); + } + bool GetBooleanValue(bool fail_value = false) const { + return (m_data_sp ? m_data_sp->GetBooleanValue(fail_value) : fail_value); + } + + size_t GetStringValue(char *dst, size_t dst_len) const { + if (!m_data_sp) + return 0; + + llvm::StringRef result = m_data_sp->GetStringValue(); + if (result.empty()) + return 0; + + if (!dst || !dst_len) { + char s[1]; + return (::snprintf(s, 1, "%s", result.data())); + } + return (::snprintf(dst, dst_len, "%s", result.data())); + } + +private: lldb::StructuredDataPluginWP m_plugin_wp; StructuredData::ObjectSP m_data_sp; }; -} +} // namespace lldb_private #endif Modified: vendor/lldb/dist/include/lldb/Core/TraceOptions.h ============================================================================== --- vendor/lldb/dist/include/lldb/Core/TraceOptions.h Mon May 29 16:26:26 2017 (r319149) +++ vendor/lldb/dist/include/lldb/Core/TraceOptions.h Mon May 29 16:26:31 2017 (r319150) @@ -18,8 +18,7 @@ namespace lldb_private { class TraceOptions { public: - TraceOptions() - : m_trace_params(new StructuredData::Dictionary()) {} + TraceOptions() : m_trace_params(new StructuredData::Dictionary()) {} const StructuredData::DictionarySP &getTraceParams() const { return m_trace_params; @@ -43,7 +42,7 @@ public: void setThreadID(lldb::tid_t thread_id) { m_thread_id = thread_id; } - lldb::tid_t getThreadID() { return m_thread_id; } + lldb::tid_t getThreadID() const { return m_thread_id; } private: lldb::TraceType m_type; Modified: vendor/lldb/dist/include/lldb/Host/Editline.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/Editline.h Mon May 29 16:26:26 2017 (r319149) +++ vendor/lldb/dist/include/lldb/Host/Editline.h Mon May 29 16:26:31 2017 (r319150) @@ -82,8 +82,14 @@ using EditLineStringStreamType = std::st using EditLineCharType = char; #endif +#ifdef EL_CLIENTDATA /* editline with wide support + wide char read function */ +using EditLineGetCharType = wchar_t; +#else +using EditLineGetCharType = char; +#endif + typedef int (*EditlineGetCharCallbackType)(::EditLine *editline, - EditLineCharType *c); + EditLineGetCharType *c); typedef unsigned char (*EditlineCommandCallbackType)(::EditLine *editline, int ch); typedef const char *(*EditlinePromptCallbackType)(::EditLine *editline); @@ -270,7 +276,7 @@ private: /// Character reading implementation for EditLine that supports our multi-line /// editing trickery. - int GetCharacter(EditLineCharType *c); + int GetCharacter(EditLineGetCharType *c); /// Prompt implementation for EditLine. const char *Prompt(); @@ -323,7 +329,7 @@ private: /// single or multi-line editing. void ConfigureEditor(bool multiline); - bool CompleteCharacter(char ch, EditLineCharType &out); + bool CompleteCharacter(char ch, EditLineGetCharType &out); private: #if LLDB_EDITLINE_USE_WCHAR Modified: vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h Mon May 29 16:26:26 2017 (r319149) +++ vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h Mon May 29 16:26:31 2017 (r319150) @@ -10,6 +10,7 @@ #ifndef liblldb_NativeProcessProtocol_h_ #define liblldb_NativeProcessProtocol_h_ +#include "lldb/Core/TraceOptions.h" #include "lldb/Host/MainLoop.h" #include "lldb/Utility/Status.h" #include "lldb/lldb-private-forward.h" @@ -308,6 +309,108 @@ public: static Status Attach(lldb::pid_t pid, NativeDelegate &native_delegate, MainLoop &mainloop, NativeProcessProtocolSP &process_sp); + //------------------------------------------------------------------ + /// StartTracing API for starting a tracing instance with the + /// TraceOptions on a specific thread or process. + /// + /// @param[in] config + /// The configuration to use when starting tracing. + /// + /// @param[out] error + /// Status indicates what went wrong. + /// + /// @return + /// The API returns a user_id which can be used to get trace + /// data, trace configuration or stopping the trace instance. + /// The user_id is a key to identify and operate with a tracing + /// instance. It may refer to the complete process or a single + /// thread. + //------------------------------------------------------------------ + virtual lldb::user_id_t StartTrace(const TraceOptions &config, + Status &error) { + error.SetErrorString("Not implemented"); + return LLDB_INVALID_UID; + } + + //------------------------------------------------------------------ + /// StopTracing API as the name suggests stops a tracing instance. + /// + /// @param[in] uid + /// The user id of the trace intended to be stopped. Now a + /// user_id may map to multiple threads in which case this API + /// could be used to stop the tracing for a specific thread by + /// supplying its thread id. + /// + /// @param[in] thread + /// Thread is needed when the complete process is being traced + /// and the user wishes to stop tracing on a particular thread. + /// + /// @return + /// Status indicating what went wrong. + //------------------------------------------------------------------ + virtual Status StopTrace(lldb::user_id_t uid, + lldb::tid_t thread = LLDB_INVALID_THREAD_ID) { + return Status("Not implemented"); + } + + //------------------------------------------------------------------ + /// This API provides the trace data collected in the form of raw + /// data. + /// + /// @param[in] uid thread + /// The uid and thread provide the context for the trace + /// instance. + /// + /// @param[in] buffer + /// The buffer provides the destination buffer where the trace + /// data would be read to. The buffer should be truncated to the + /// filled length by this function. + /// + /// @param[in] offset + /// There is possibility to read partially the trace data from + /// a specified offset where in such cases the buffer provided + /// may be smaller than the internal trace collection container. + /// + /// @return + /// The size of the data actually read. + //------------------------------------------------------------------ + virtual Status GetData(lldb::user_id_t uid, lldb::tid_t thread, + llvm::MutableArrayRef &buffer, + size_t offset = 0) { + return Status("Not implemented"); + } + + //------------------------------------------------------------------ + /// Similar API as above except it aims to provide any extra data + /// useful for decoding the actual trace data. + //------------------------------------------------------------------ + virtual Status GetMetaData(lldb::user_id_t uid, lldb::tid_t thread, + llvm::MutableArrayRef &buffer, + size_t offset = 0) { + return Status("Not implemented"); + } + + //------------------------------------------------------------------ + /// API to query the TraceOptions for a given user id + /// + /// @param[in] uid + /// The user id of the tracing instance. + /// + /// @param[in] config + /// The thread id of the tracing instance, in case configuration + /// for a specific thread is needed should be specified in the + /// config. + /// + /// @param[out] error + /// Status indicates what went wrong. + /// + /// @param[out] config + /// The actual configuration being used for tracing. + //------------------------------------------------------------------ + virtual Status GetTraceConfig(lldb::user_id_t uid, TraceOptions &config) { + return Status("Not implemented"); + } + protected: lldb::pid_t m_pid; @@ -381,6 +484,6 @@ protected: private: void SynchronouslyNotifyProcessStateChanged(lldb::StateType state); }; -} +} // namespace lldb_private #endif // #ifndef liblldb_NativeProcessProtocol_h_ Modified: vendor/lldb/dist/include/lldb/Target/Process.h ============================================================================== --- vendor/lldb/dist/include/lldb/Target/Process.h Mon May 29 16:26:26 2017 (r319149) +++ vendor/lldb/dist/include/lldb/Target/Process.h Mon May 29 16:26:31 2017 (r319150) @@ -2781,7 +2781,7 @@ public: /// GetTraceConfig should supply the actual used trace /// configuration. //------------------------------------------------------------------ - virtual lldb::user_id_t StartTrace(lldb::TraceOptionsSP &options, + virtual lldb::user_id_t StartTrace(const TraceOptions &options, Status &error) { error.SetErrorString("Not implemented"); return LLDB_INVALID_UID; @@ -2796,9 +2796,8 @@ public: /// In the other case that tracing on an individual thread needs /// to be stopped a thread_id can be supplied. //------------------------------------------------------------------ - virtual void StopTrace(lldb::user_id_t uid, lldb::tid_t thread_id, - Status &error) { - error.SetErrorString("Not implemented"); + virtual Status StopTrace(lldb::user_id_t uid, lldb::tid_t thread_id) { + return Status("Not implemented"); } //------------------------------------------------------------------ @@ -2809,21 +2808,19 @@ public: /// may not. The thread_id should be used to select a particular /// thread for trace extraction. //------------------------------------------------------------------ - virtual size_t GetData(lldb::user_id_t uid, lldb::tid_t thread_id, - Status &error, void *buf, size_t size, + virtual Status GetData(lldb::user_id_t uid, lldb::tid_t thread_id, + llvm::MutableArrayRef &buffer, size_t offset = 0) { - error.SetErrorString("Not implemented"); - return 0; + return Status("Not implemented"); } //------------------------------------------------------------------ /// Similar API as above except for obtaining meta data //------------------------------------------------------------------ - virtual size_t GetMetaData(lldb::user_id_t uid, lldb::tid_t thread_id, - Status &error, void *buf, size_t size, + virtual Status GetMetaData(lldb::user_id_t uid, lldb::tid_t thread_id, + llvm::MutableArrayRef &buffer, size_t offset = 0) { - error.SetErrorString("Not implemented"); - return 0; + return Status("Not implemented"); } //------------------------------------------------------------------ @@ -2835,10 +2832,8 @@ public: /// configuration used by a specific thread. The thread_id specified /// should also match the uid otherwise an error will be returned. //------------------------------------------------------------------ - virtual void GetTraceConfig(lldb::user_id_t uid, Status &error, - lldb::TraceOptionsSP &options) { - error.SetErrorString("Not implemented"); - return; + virtual Status GetTraceConfig(lldb::user_id_t uid, TraceOptions &options) { + return Status("Not implemented"); } protected: Modified: vendor/lldb/dist/include/lldb/Utility/StringExtractor.h ============================================================================== --- vendor/lldb/dist/include/lldb/Utility/StringExtractor.h Mon May 29 16:26:26 2017 (r319149) +++ vendor/lldb/dist/include/lldb/Utility/StringExtractor.h Mon May 29 16:26:31 2017 (r319150) @@ -111,6 +111,8 @@ public: size_t GetHexByteStringTerminatedBy(std::string &str, char terminator); + bool ConsumeFront(const llvm::StringRef &str); + const char *Peek() { if (m_index < m_packet.size()) return m_packet.c_str() + m_index; Modified: vendor/lldb/dist/include/lldb/lldb-enumerations.h ============================================================================== --- vendor/lldb/dist/include/lldb/lldb-enumerations.h Mon May 29 16:26:26 2017 (r319149) +++ vendor/lldb/dist/include/lldb/lldb-enumerations.h Mon May 29 16:26:31 2017 (r319150) @@ -725,6 +725,18 @@ enum TraceType { eTraceTypeProcessorTrace }; +enum StructuredDataType { + eStructuredDataTypeInvalid = -1, + eStructuredDataTypeNull = 0, + eStructuredDataTypeGeneric, + eStructuredDataTypeArray, + eStructuredDataTypeInteger, + eStructuredDataTypeFloat, + eStructuredDataTypeBoolean, + eStructuredDataTypeString, + eStructuredDataTypeDictionary +}; + FLAGS_ENUM(TypeClass){ eTypeClassInvalid = (0u), eTypeClassArray = (1u << 0), eTypeClassBlockPointer = (1u << 1), eTypeClassBuiltin = (1u << 2), 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 Mon May 29 16:26:26 2017 (r319149) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py Mon May 29 16:26:31 2017 (r319150) @@ -18,15 +18,9 @@ from lldbsuite.test import lldbutil class UnwindFromExpressionTest(TestBase): mydir = TestBase.compute_mydir(__file__) + main_spec = lldb.SBFileSpec("main.cpp", False) - def setUp(self): - # Call super's setUp(). - TestBase.setUp(self) - - @add_test_categories(['pyapi']) - @expectedFailureAll(oslist=["windows"]) - def test_unwind_expression(self): - """Test unwinding from an expression.""" + def build_and_run_to_bkpt(self): self.build() exe = os.path.join(os.getcwd(), "a.out") @@ -35,9 +29,8 @@ class UnwindFromExpressionTest(TestBase) self.assertTrue(target, VALID_TARGET) # Create the breakpoint. - main_spec = lldb.SBFileSpec("main.cpp", False) breakpoint = target.BreakpointCreateBySourceRegex( - "// Set a breakpoint here to get started", main_spec) + "// 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. @@ -52,24 +45,60 @@ class UnwindFromExpressionTest(TestBase) "instead the actual state is: '%s'" % lldbutil.state_type_to_str(process.GetState())) - thread = lldbutil.get_one_thread_stopped_at_breakpoint( + self.thread = lldbutil.get_one_thread_stopped_at_breakpoint( process, breakpoint) self.assertIsNotNone( - thread, "Expected one thread to be stopped at the breakpoint") + self.thread, "Expected one thread to be stopped at the breakpoint") + + # Next set a breakpoint in this function, set up Expression options to stop on + # breakpoint hits, and call the function. + self.fun_bkpt = self.target().BreakpointCreateBySourceRegex( + "// Stop inside the function here.", self.main_spec) + self.assertTrue(self.fun_bkpt, VALID_BREAKPOINT) + + + @no_debug_info_test + @expectedFailureAll(bugnumber="llvm.org/pr33164") + def test_conditional_bktp(self): + """ + Test conditional breakpoint handling in the IgnoreBreakpoints = False case + """ + self.build_and_run_to_bkpt() + + self.fun_bkpt.SetCondition("0") # Should not get hit + options = lldb.SBExpressionOptions() + options.SetIgnoreBreakpoints(False) + options.SetUnwindOnError(False) + + main_frame = self.thread.GetFrameAtIndex(0) + val = main_frame.EvaluateExpression("second_function(47)", options) + self.assertTrue( + val.GetError().Success(), + "We did complete the execution.") + self.assertEquals(47, val.GetValueAsSigned()) + + @add_test_categories(['pyapi']) + @expectedFailureAll(oslist=["windows"]) + def test_unwind_expression(self): + """Test unwinding from an expression.""" + self.build_and_run_to_bkpt() + + # Run test with varying one thread timeouts to also test the halting + # logic in the IgnoreBreakpoints = False case + self.do_unwind_test(self.thread, self.fun_bkpt, 1000) + self.do_unwind_test(self.thread, self.fun_bkpt, 100000) + + def do_unwind_test(self, thread, bkpt, timeout): # # Use Python API to evaluate expressions while stopped in a stack frame. # main_frame = thread.GetFrameAtIndex(0) - # Next set a breakpoint in this function, set up Expression options to stop on - # breakpoint hits, and call the function. - fun_bkpt = target.BreakpointCreateBySourceRegex( - "// Stop inside the function here.", main_spec) - self.assertTrue(fun_bkpt, VALID_BREAKPOINT) options = lldb.SBExpressionOptions() options.SetIgnoreBreakpoints(False) options.SetUnwindOnError(False) + options.SetOneThreadTimeoutInMicroSeconds(timeout) val = main_frame.EvaluateExpression("a_function_to_call()", options) @@ -82,7 +111,7 @@ class UnwindFromExpressionTest(TestBase) "And the reason was right.") thread = lldbutil.get_one_thread_stopped_at_breakpoint( - process, fun_bkpt) + self.process(), bkpt) self.assertTrue( thread.IsValid(), "We are indeed stopped at our breakpoint") Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/main.cpp ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/main.cpp Mon May 29 16:26:26 2017 (r319149) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/unwind_expression/main.cpp Mon May 29 16:26:31 2017 (r319150) @@ -7,8 +7,16 @@ a_function_to_call() return static_value; } +int second_function(int x){ + for(int i=0; i<10; ++i) { + a_function_to_call(); + } + return x; +} + int main (int argc, char const *argv[]) { a_function_to_call(); // Set a breakpoint here to get started + second_function(1); return 0; } Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/num_threads/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/num_threads/Makefile Mon May 29 16:26:31 2017 (r319150) @@ -0,0 +1,5 @@ +LEVEL = ../../../make + +CXX_SOURCES := main.cpp +ENABLE_THREADS := YES +include $(LEVEL)/Makefile.rules Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py Mon May 29 16:26:31 2017 (r319150) @@ -0,0 +1,61 @@ +""" +Test number of threads. +""" + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Mon May 29 16:26: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 8582ED77A87; Mon, 29 May 2017 16:26: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 3B67880F8B; Mon, 29 May 2017 16:26: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 v4TGQbtY083601; Mon, 29 May 2017 16:26:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4TGQb99083600; Mon, 29 May 2017 16:26:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705291626.v4TGQb99083600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 29 May 2017 16:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319151 - vendor/lldb/lldb-trunk-r304149 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2017 16:26:38 -0000 Author: dim Date: Mon May 29 16:26:37 2017 New Revision: 319151 URL: https://svnweb.freebsd.org/changeset/base/319151 Log: Tag lldb trunk r304149. Added: vendor/lldb/lldb-trunk-r304149/ - copied from r319150, vendor/lldb/dist/ From owner-svn-src-vendor@freebsd.org Tue May 30 17:37: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 BF82EB94A7C; Tue, 30 May 2017 17:37: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 7A6DB71569; Tue, 30 May 2017 17:37: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 v4UHbXwe045619; Tue, 30 May 2017 17:37:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UHbWpE045604; Tue, 30 May 2017 17:37:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705301737.v4UHbWpE045604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 May 2017 17:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319230 - in vendor/llvm/dist: docs docs/Proposals include/llvm/Analysis include/llvm/CodeGen include/llvm/DebugInfo/CodeView include/llvm/DebugInfo/PDB/Native include/llvm/MC include/l... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:37:34 -0000 Author: dim Date: Tue May 30 17:37:31 2017 New Revision: 319230 URL: https://svnweb.freebsd.org/changeset/base/319230 Log: Vendor import of llvm trunk r304222: https://llvm.org/svn/llvm-project/llvm/trunk@304222 Added: vendor/llvm/dist/docs/Proposals/VectorizationPlan.rst vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSubsection.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/DebugChecksumsSubsection.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/DebugFrameDataSubsection.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/DebugInlineeLinesSubsection.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/DebugLinesSubsection.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/DebugSubsection.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/DebugSubsectionRecord.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/DebugSubsectionVisitor.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/DebugSymbolsSubsection.cpp (contents, props changed) vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrDFP.td vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrHFP.td vendor/llvm/dist/test/CodeGen/AArch64/reg-scavenge-frame.mir vendor/llvm/dist/test/CodeGen/AMDGPU/sdwa-scalar-ops.mir vendor/llvm/dist/test/CodeGen/X86/bitcast-and-setcc-128.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-and-setcc-256.ll vendor/llvm/dist/test/CodeGen/X86/xchg-nofold.ll vendor/llvm/dist/test/MC/Mips/macro-li.d.s (contents, props changed) vendor/llvm/dist/test/MC/Mips/macro-li.s.s (contents, props changed) Deleted: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugFragment.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugFragmentRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugFragmentVisitor.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugLineFragment.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugUnknownFragment.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/StringTable.h vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleDebugFragment.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleDebugFragmentRecord.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleDebugFragmentVisitor.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleDebugLineFragment.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/StringTable.cpp vendor/llvm/dist/test/Transforms/LoopVectorize/AArch64/no_vector_instructions.ll vendor/llvm/dist/tools/llvm-readobj/CodeView.h Modified: vendor/llvm/dist/docs/Vectorizers.rst vendor/llvm/dist/docs/index.rst vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h vendor/llvm/dist/include/llvm/CodeGen/DIE.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeView.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h vendor/llvm/dist/include/llvm/MC/ConstantPools.h vendor/llvm/dist/include/llvm/Support/ManagedStatic.h vendor/llvm/dist/include/llvm/TableGen/Record.h vendor/llvm/dist/include/llvm/Transforms/Scalar/GVNExpression.h vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/CodeViewDebug.h vendor/llvm/dist/lib/CodeGen/GlobalISel/Localizer.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp vendor/llvm/dist/lib/CodeGen/TargetLoweringBase.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CMakeLists.txt vendor/llvm/dist/lib/DebugInfo/CodeView/EnumTables.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/SymbolDumper.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp vendor/llvm/dist/lib/MC/MCCodeView.cpp vendor/llvm/dist/lib/Support/APFloat.cpp vendor/llvm/dist/lib/Support/Timer.cpp vendor/llvm/dist/lib/TableGen/Record.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64FrameLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIFoldOperands.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIPeepholeSDWA.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelLowering.cpp vendor/llvm/dist/lib/Target/Mips/AsmParser/MipsAsmParser.cpp vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.cpp vendor/llvm/dist/lib/Target/Mips/MipsInstrFPU.td vendor/llvm/dist/lib/Target/Mips/MipsRegisterInfo.td vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZ.td vendor/llvm/dist/lib/Target/SystemZ/SystemZFeatures.td vendor/llvm/dist/lib/Target/SystemZ/SystemZISelLowering.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrFP.td vendor/llvm/dist/lib/Target/SystemZ/SystemZInstrFormats.td vendor/llvm/dist/lib/Target/SystemZ/SystemZScheduleZ13.td vendor/llvm/dist/lib/Target/SystemZ/SystemZScheduleZ196.td vendor/llvm/dist/lib/Target/SystemZ/SystemZScheduleZEC12.td vendor/llvm/dist/lib/Target/SystemZ/SystemZSubtarget.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZSubtarget.h vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Transforms/Scalar/NewGVN.cpp vendor/llvm/dist/lib/Transforms/Vectorize/LoopVectorize.cpp vendor/llvm/dist/test/CodeGen/AMDGPU/add.v2i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/bfe-combine.ll vendor/llvm/dist/test/CodeGen/AMDGPU/commute-compares.ll vendor/llvm/dist/test/CodeGen/AMDGPU/commute_modifiers.ll vendor/llvm/dist/test/CodeGen/AMDGPU/copy-illegal-type.ll vendor/llvm/dist/test/CodeGen/AMDGPU/cvt_f32_ubyte.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fabs.f64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fabs.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fadd.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fadd64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fcanonicalize.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fmul.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fneg-fabs.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fneg-fabs.f64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fneg-fabs.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fneg.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fract.f64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fsub.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fsub64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/immv216.ll vendor/llvm/dist/test/CodeGen/AMDGPU/insert_vector_elt.v2i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.div.fixup.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.div.fmas.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.fcmp.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.fmul.legacy.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.s.barrier.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.fma.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.fmuladd.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.maxnum.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.minnum.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/mad24-get-global-id.ll vendor/llvm/dist/test/CodeGen/AMDGPU/madak.ll vendor/llvm/dist/test/CodeGen/AMDGPU/madmk.ll vendor/llvm/dist/test/CodeGen/AMDGPU/mul.ll vendor/llvm/dist/test/CodeGen/AMDGPU/scratch-simple.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sdiv.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sdwa-peephole.ll vendor/llvm/dist/test/CodeGen/AMDGPU/select.f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/shift-and-i128-ubfe.ll vendor/llvm/dist/test/CodeGen/AMDGPU/shift-and-i64-ubfe.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sminmax.v2i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/srem.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sub.v2i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/udiv.ll vendor/llvm/dist/test/CodeGen/AMDGPU/urem.ll vendor/llvm/dist/test/CodeGen/AMDGPU/use-sgpr-multiple-times.ll vendor/llvm/dist/test/CodeGen/AMDGPU/v_mac_f16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/wqm.ll vendor/llvm/dist/test/CodeGen/WebAssembly/negative-base-reg.ll vendor/llvm/dist/test/CodeGen/X86/mul-constant-i16.ll vendor/llvm/dist/test/CodeGen/X86/mul-constant-i32.ll vendor/llvm/dist/test/CodeGen/X86/mul-constant-i64.ll vendor/llvm/dist/test/CodeGen/X86/setcc-lowering.ll vendor/llvm/dist/test/CodeGen/X86/vector-sext.ll vendor/llvm/dist/test/MC/AArch64/ldr-pseudo.s vendor/llvm/dist/test/MC/Disassembler/SystemZ/insns-z13.txt vendor/llvm/dist/test/MC/Disassembler/SystemZ/insns.txt vendor/llvm/dist/test/MC/SystemZ/insn-bad-z13.s vendor/llvm/dist/test/MC/SystemZ/insn-bad-z196.s vendor/llvm/dist/test/MC/SystemZ/insn-bad-zEC12.s vendor/llvm/dist/test/MC/SystemZ/insn-bad.s vendor/llvm/dist/test/MC/SystemZ/insn-good-z13.s vendor/llvm/dist/test/MC/SystemZ/insn-good-z196.s vendor/llvm/dist/test/MC/SystemZ/insn-good-zEC12.s vendor/llvm/dist/test/MC/SystemZ/insn-good.s vendor/llvm/dist/tools/llvm-pdbdump/C13DebugFragmentVisitor.cpp vendor/llvm/dist/tools/llvm-pdbdump/C13DebugFragmentVisitor.h vendor/llvm/dist/tools/llvm-pdbdump/LLVMOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbdump/YAMLOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbdump/llvm-pdbdump.cpp vendor/llvm/dist/tools/llvm-readobj/COFFDumper.cpp vendor/llvm/dist/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp vendor/llvm/dist/unittests/Support/ManagedStatic.cpp vendor/llvm/dist/utils/TableGen/GlobalISelEmitter.cpp vendor/llvm/dist/utils/TableGen/X86FoldTablesEmitter.cpp Added: vendor/llvm/dist/docs/Proposals/VectorizationPlan.rst ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/docs/Proposals/VectorizationPlan.rst Tue May 30 17:37:31 2017 (r319230) @@ -0,0 +1,182 @@ +================== +Vectorization Plan +================== + +.. contents:: + :local: + +Abstract +======== +The vectorization transformation can be rather complicated, involving several +potential alternatives, especially for outer-loops [1]_ but also possibly for +innermost loops. These alternatives may have significant performance impact, +both positive and negative. A cost model is therefore employed to identify the +best alternative, including the alternative of avoiding any transformation +altogether. + +The Vectorization Plan is an explicit model for describing vectorization +candidates. It serves for both optimizing candidates including estimating their +cost reliably, and for performing their final translation into IR. This +facilitates dealing with multiple vectorization candidates. + +High-level Design +================= + +Vectorization Workflow +---------------------- +VPlan-based vectorization involves three major steps, taking a "scenario-based +approach" to vectorization planning: + +1. Legal Step: check if a loop can be legally vectorized; encode contraints and + artifacts if so. +2. Plan Step: + + a. Build initial VPlans following the constraints and decisions taken by + Legal Step 1, and compute their cost. + b. Apply optimizations to the VPlans, possibly forking additional VPlans. + Prune sub-optimal VPlans having relatively high cost. +3. Execute Step: materialize the best VPlan. Note that this is the only step + that modifies the IR. + +Design Guidelines +----------------- +In what follows, the term "input IR" refers to code that is fed into the +vectorizer whereas the term "output IR" refers to code that is generated by the +vectorizer. The output IR contains code that has been vectorized or "widened" +according to a loop Vectorization Factor (VF), and/or loop unroll-and-jammed +according to an Unroll Factor (UF). +The design of VPlan follows several high-level guidelines: + +1. Analysis-like: building and manipulating VPlans must not modify the input IR. + In particular, if the best option is not to vectorize at all, the + vectorization process terminates before reaching Step 3, and compilation + should proceed as if VPlans had not been built. + +2. Align Cost & Execute: each VPlan must support both estimating the cost and + generating the output IR code, such that the cost estimation evaluates the + to-be-generated code reliably. + +3. Support vectorizing additional constructs: + + a. Outer-loop vectorization. In particular, VPlan must be able to model the + control-flow of the output IR which may include multiple basic-blocks and + nested loops. + b. SLP vectorization. + c. Combinations of the above, including nested vectorization: vectorizing + both an inner loop and an outer-loop at the same time (each with its own + VF and UF), mixed vectorization: vectorizing a loop with SLP patterns + inside [4]_, (re)vectorizing input IR containing vector code. + d. Function vectorization [2]_. + +4. Support multiple candidates efficiently. In particular, similar candidates + related to a range of possible VF's and UF's must be represented efficiently. + Potential versioning needs to be supported efficiently. + +5. Support vectorizing idioms, such as interleaved groups of strided loads or + stores. This is achieved by modeling a sequence of output instructions using + a "Recipe", which is responsible for computing its cost and generating its + code. + +6. Encapsulate Single-Entry Single-Exit regions (SESE). During vectorization + such regions may need to be, for example, predicated and linearized, or + replicated VF*UF times to handle scalarized and predicated instructions. + Innerloops are also modelled as SESE regions. + +Low-level Design +================ +The low-level design of VPlan comprises of the following classes. + +:LoopVectorizationPlanner: + A LoopVectorizationPlanner is designed to handle the vectorization of a loop + or a loop nest. It can construct, optimize and discard one or more VPlans, + each VPlan modelling a distinct way to vectorize the loop or the loop nest. + Once the best VPlan is determined, including the best VF and UF, this VPlan + drives the generation of output IR. + +:VPlan: + A model of a vectorized candidate for a given input IR loop or loop nest. This + candidate is represented using a Hierarchical CFG. VPlan supports estimating + the cost and driving the generation of the output IR code it represents. + +:Hierarchical CFG: + A control-flow graph whose nodes are basic-blocks or Hierarchical CFG's. The + Hierarchical CFG data structure is similar to the Tile Tree [5]_, where + cross-Tile edges are lifted to connect Tiles instead of the original + basic-blocks as in Sharir [6]_, promoting the Tile encapsulation. The terms + Region and Block are used rather than Tile [5]_ to avoid confusion with loop + tiling. + +:VPBlockBase: + The building block of the Hierarchical CFG. A pure-virtual base-class of + VPBasicBlock and VPRegionBlock, see below. VPBlockBase models the hierarchical + control-flow relations with other VPBlocks. Note that in contrast to the IR + BasicBlock, a VPBlockBase models its control-flow successors and predecessors + directly, rather than through a Terminator branch or through predecessor + branches that "use" the VPBlockBase. + +:VPBasicBlock: + VPBasicBlock is a subclass of VPBlockBase, and serves as the leaves of the + Hierarchical CFG. It represents a sequence of output IR instructions that will + appear consecutively in an output IR basic-block. The instructions of this + basic-block originate from one or more VPBasicBlocks. VPBasicBlock holds a + sequence of zero or more VPRecipes that model the cost and generation of the + output IR instructions. + +:VPRegionBlock: + VPRegionBlock is a subclass of VPBlockBase. It models a collection of + VPBasicBlocks and VPRegionBlocks which form a SESE subgraph of the output IR + CFG. A VPRegionBlock may indicate that its contents are to be replicated a + constant number of times when output IR is generated, effectively representing + a loop with constant trip-count that will be completely unrolled. This is used + to support scalarized and predicated instructions with a single model for + multiple candidate VF's and UF's. + +:VPRecipeBase: + A pure-virtual base class modeling a sequence of one or more output IR + instructions, possibly based on one or more input IR instructions. These + input IR instructions are referred to as "Ingredients" of the Recipe. A Recipe + may specify how its ingredients are to be transformed to produce the output IR + instructions; e.g., cloned once, replicated multiple times or widened + according to selected VF. + +:VPTransformState: + Stores information used for generating output IR, passed from + LoopVectorizationPlanner to its selected VPlan for execution, and used to pass + additional information down to VPBlocks and VPRecipes. + +Related LLVM components +----------------------- +1. SLP Vectorizer: one can compare the VPlan model with LLVM's existing SLP + tree, where TSLP [3]_ adds Plan Step 2.b. + +2. RegionInfo: one can compare VPlan's H-CFG with the Region Analysis as used by + Polly [7]_. + +References +---------- +.. [1] "Outer-loop vectorization: revisited for short SIMD architectures", Dorit + Nuzman and Ayal Zaks, PACT 2008. + +.. [2] "Proposal for function vectorization and loop vectorization with function + calls", Xinmin Tian, [`cfe-dev + `_]., + March 2, 2016. + See also `review `_. + +.. [3] "Throttling Automatic Vectorization: When Less is More", Vasileios + Porpodas and Tim Jones, PACT 2015 and LLVM Developers' Meeting 2015. + +.. [4] "Exploiting mixed SIMD parallelism by reducing data reorganization + overhead", Hao Zhou and Jingling Xue, CGO 2016. + +.. [5] "Register Allocation via Hierarchical Graph Coloring", David Callahan and + Brian Koblenz, PLDI 1991 + +.. [6] "Structural analysis: A new approach to flow analysis in optimizing + compilers", M. Sharir, Journal of Computer Languages, Jan. 1980 + +.. [7] "Enabling Polyhedral Optimizations in LLVM", Tobias Grosser, Diploma + thesis, 2011. + +.. [8] "Introducing VPlan to the Loop Vectorizer", Gil Rapaport and Ayal Zaks, + European LLVM Developers' Meeting 2017. Modified: vendor/llvm/dist/docs/Vectorizers.rst ============================================================================== --- vendor/llvm/dist/docs/Vectorizers.rst Tue May 30 17:16:08 2017 (r319229) +++ vendor/llvm/dist/docs/Vectorizers.rst Tue May 30 17:37:31 2017 (r319230) @@ -382,6 +382,17 @@ And Linpack-pc with the same configuration. Result is .. image:: linpack-pc.png +Ongoing Development Directions +------------------------------ + +.. toctree:: + :hidden: + + Proposals/VectorizationPlan + +:doc:`Proposals/VectorizationPlan` + Modeling the process and upgrading the infrastructure of LLVM's Loop Vectorizer. + .. _slp-vectorizer: The SLP Vectorizer Modified: vendor/llvm/dist/docs/index.rst ============================================================================== --- vendor/llvm/dist/docs/index.rst Tue May 30 17:16:08 2017 (r319229) +++ vendor/llvm/dist/docs/index.rst Tue May 30 17:37:31 2017 (r319230) @@ -528,6 +528,7 @@ can be better. CodeOfConduct Proposals/GitHubMove + Proposals/VectorizationPlan :doc:`CodeOfConduct` Proposal to adopt a code of conduct on the LLVM social spaces (lists, events, @@ -536,6 +537,8 @@ can be better. :doc:`Proposals/GitHubMove` Proposal to move from SVN/Git to GitHub. +:doc:`Proposals/VectorizationPlan` + Proposal to model the process and upgrade the infrastructure of LLVM's Loop Vectorizer. Indices and tables ================== Modified: vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Tue May 30 17:16:08 2017 (r319229) +++ vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Tue May 30 17:37:31 2017 (r319230) @@ -1536,8 +1536,7 @@ class ScalarEvolution { (public) /// Determine if the SCEV can be evaluated at loop's entry. It is true if it /// doesn't depend on a SCEVUnknown of an instruction which is dominated by /// the header of loop L. - bool isAvailableAtLoopEntry(const SCEV *S, const Loop *L, DominatorTree &DT, - LoopInfo &LI); + bool isAvailableAtLoopEntry(const SCEV *S, const Loop *L); /// Return true if the given SCEV changes value in a known way in the /// specified loop. This property being true implies that the value is Modified: vendor/llvm/dist/include/llvm/CodeGen/DIE.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/DIE.h Tue May 30 17:16:08 2017 (r319229) +++ vendor/llvm/dist/include/llvm/CodeGen/DIE.h Tue May 30 17:37:31 2017 (r319230) @@ -383,11 +383,11 @@ class DIEValue { (private) return; #define HANDLE_DIEVALUE_SMALL(T) \ case is##T: \ - destruct(); + destruct(); \ return; #define HANDLE_DIEVALUE_LARGE(T) \ case is##T: \ - destruct(); + destruct(); \ return; #include "llvm/CodeGen/DIEValue.def" } Modified: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeView.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeView.h Tue May 30 17:16:08 2017 (r319229) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeView.h Tue May 30 17:37:31 2017 (r319230) @@ -13,6 +13,8 @@ #include #include +#include "llvm/Support/Endian.h" + namespace llvm { namespace codeview { @@ -291,7 +293,7 @@ enum class ModifierOptions : uint16_t { }; CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(ModifierOptions) -enum class ModuleDebugFragmentKind : uint32_t { +enum class DebugSubsectionKind : uint32_t { None = 0, Symbols = 0xf1, Lines = 0xf2, @@ -549,6 +551,24 @@ enum class FileChecksumKind : uint8_t { None, MD5, SHA enum LineFlags : uint16_t { LF_None = 0, LF_HaveColumns = 1, // CV_LINES_HAVE_COLUMNS +}; + +/// Data in the the SUBSEC_FRAMEDATA subection. +struct FrameData { + support::ulittle32_t RvaStart; + support::ulittle32_t CodeSize; + support::ulittle32_t LocalSize; + support::ulittle32_t ParamsSize; + support::ulittle32_t MaxStackSize; + support::ulittle32_t FrameFunc; + support::ulittle16_t PrologSize; + support::ulittle16_t SavedRegsSize; + support::ulittle32_t Flags; + enum : uint32_t { + HasSEH = 1 << 0, + HasEH = 1 << 1, + IsFunctionStart = 1 << 2, + }; }; } } Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h Tue May 30 17:37:31 2017 (r319230) @@ -0,0 +1,98 @@ +//===- DebugChecksumsSubsection.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_DEBUGCHECKSUMSSUBSECTION_H +#define LLVM_DEBUGINFO_CODEVIEW_DEBUGCHECKSUMSSUBSECTION_H + +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/DebugInfo/CodeView/DebugSubsection.h" +#include "llvm/Support/Allocator.h" +#include "llvm/Support/BinaryStreamArray.h" +#include "llvm/Support/BinaryStreamReader.h" +#include "llvm/Support/Endian.h" + +namespace llvm { +namespace codeview { + +class DebugStringTableSubsection; + +struct FileChecksumEntry { + uint32_t FileNameOffset; // Byte offset of filename in global stringtable. + FileChecksumKind Kind; // The type of checksum. + ArrayRef Checksum; // The bytes of the checksum. +}; +} +} + +namespace llvm { +template <> struct VarStreamArrayExtractor { +public: + typedef void ContextType; + + static Error extract(BinaryStreamRef Stream, uint32_t &Len, + codeview::FileChecksumEntry &Item); +}; +} + +namespace llvm { +namespace codeview { +class DebugChecksumsSubsectionRef final : public DebugSubsectionRef { + typedef VarStreamArray FileChecksumArray; + typedef FileChecksumArray::Iterator Iterator; + +public: + DebugChecksumsSubsectionRef() + : DebugSubsectionRef(DebugSubsectionKind::FileChecksums) {} + + static bool classof(const DebugSubsectionRef *S) { + return S->kind() == DebugSubsectionKind::FileChecksums; + } + + bool valid() const { return Checksums.valid(); } + + Error initialize(BinaryStreamReader Reader); + Error initialize(BinaryStreamRef Stream); + + Iterator begin() { return Checksums.begin(); } + Iterator end() { return Checksums.end(); } + + const FileChecksumArray &getArray() const { return Checksums; } + +private: + FileChecksumArray Checksums; +}; + +class DebugChecksumsSubsection final : public DebugSubsection { +public: + explicit DebugChecksumsSubsection(DebugStringTableSubsection &Strings); + + static bool classof(const DebugSubsection *S) { + return S->kind() == DebugSubsectionKind::FileChecksums; + } + + void addChecksum(StringRef FileName, FileChecksumKind Kind, + ArrayRef Bytes); + + uint32_t calculateSerializedSize() const override; + Error commit(BinaryStreamWriter &Writer) const override; + uint32_t mapChecksumOffset(StringRef FileName) const; + +private: + DebugStringTableSubsection &Strings; + + DenseMap OffsetMap; + uint32_t SerializedSize = 0; + llvm::BumpPtrAllocator Storage; + std::vector Checksums; +}; +} +} + +#endif Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h Tue May 30 17:37:31 2017 (r319230) @@ -0,0 +1,59 @@ +//===- DebugFrameDataSubsection.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_DEBUGFRAMEDATASUBSECTION_H +#define LLVM_DEBUGINFO_CODEVIEW_DEBUGFRAMEDATASUBSECTION_H + +#include "llvm/DebugInfo/CodeView/CodeView.h" +#include "llvm/DebugInfo/CodeView/DebugSubsection.h" +#include "llvm/Support/BinaryStreamReader.h" +#include "llvm/Support/Error.h" + +namespace llvm { +namespace codeview { +class DebugFrameDataSubsectionRef final : public DebugSubsectionRef { +public: + DebugFrameDataSubsectionRef() + : DebugSubsectionRef(DebugSubsectionKind::FrameData) {} + static bool classof(const DebugSubsection *S) { + return S->kind() == DebugSubsectionKind::FrameData; + } + + Error initialize(BinaryStreamReader Reader); + + FixedStreamArray::Iterator begin() const { return Frames.begin(); } + FixedStreamArray::Iterator end() const { return Frames.end(); } + + const void *getRelocPtr() const { return RelocPtr; } + +private: + const uint32_t *RelocPtr = nullptr; + FixedStreamArray Frames; +}; + +class DebugFrameDataSubsection final : public DebugSubsection { +public: + DebugFrameDataSubsection() + : DebugSubsection(DebugSubsectionKind::FrameData) {} + static bool classof(const DebugSubsection *S) { + return S->kind() == DebugSubsectionKind::FrameData; + } + + uint32_t calculateSerializedSize() const override; + Error commit(BinaryStreamWriter &Writer) const override; + + void addFrameData(const FrameData &Frame); + +private: + std::vector Frames; +}; +} +} + +#endif Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h Tue May 30 17:37:31 2017 (r319230) @@ -0,0 +1,105 @@ +//===- DebugInlineeLinesSubsection.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_BUGINLINEELINESSUBSECTION_H +#define LLVM_DEBUGINFO_CODEVIEW_BUGINLINEELINESSUBSECTION_H + +#include "llvm/DebugInfo/CodeView/DebugSubsection.h" +#include "llvm/DebugInfo/CodeView/Line.h" +#include "llvm/Support/BinaryStreamArray.h" +#include "llvm/Support/BinaryStreamReader.h" +#include "llvm/Support/Error.h" + +namespace llvm { +namespace codeview { + +class DebugInlineeLinesSubsectionsRef; +class DebugChecksumsSubsection; + +enum class InlineeLinesSignature : uint32_t { + Normal, // CV_INLINEE_SOURCE_LINE_SIGNATURE + ExtraFiles // CV_INLINEE_SOURCE_LINE_SIGNATURE_EX +}; + +struct InlineeSourceLineHeader { + TypeIndex Inlinee; // ID of the function that was inlined. + support::ulittle32_t FileID; // Offset into FileChecksums subsection. + support::ulittle32_t SourceLineNum; // First line of inlined code. + // If extra files present: + // ulittle32_t ExtraFileCount; + // ulittle32_t Files[]; +}; + +struct InlineeSourceLine { + const InlineeSourceLineHeader *Header; + FixedStreamArray ExtraFiles; +}; +} + +template <> struct VarStreamArrayExtractor { + typedef bool ContextType; + + static Error extract(BinaryStreamRef Stream, uint32_t &Len, + codeview::InlineeSourceLine &Item, bool HasExtraFiles); +}; + +namespace codeview { +class DebugInlineeLinesSubsectionRef final : public DebugSubsectionRef { + typedef VarStreamArray LinesArray; + typedef LinesArray::Iterator Iterator; + +public: + DebugInlineeLinesSubsectionRef(); + + static bool classof(const DebugSubsectionRef *S) { + return S->kind() == DebugSubsectionKind::InlineeLines; + } + + Error initialize(BinaryStreamReader Reader); + bool hasExtraFiles() const; + + Iterator begin() const { return Lines.begin(); } + Iterator end() const { return Lines.end(); } + +private: + InlineeLinesSignature Signature; + VarStreamArray Lines; +}; + +class DebugInlineeLinesSubsection final : public DebugSubsection { +public: + DebugInlineeLinesSubsection(DebugChecksumsSubsection &Checksums, + bool HasExtraFiles); + + static bool classof(const DebugSubsection *S) { + return S->kind() == DebugSubsectionKind::InlineeLines; + } + + Error commit(BinaryStreamWriter &Writer) const override; + uint32_t calculateSerializedSize() const override; + + void addInlineSite(TypeIndex FuncId, StringRef FileName, uint32_t SourceLine); + void addExtraFile(StringRef FileName); + +private: + DebugChecksumsSubsection &Checksums; + + bool HasExtraFiles = false; + uint32_t ExtraFileCount = 0; + + struct Entry { + std::vector ExtraFiles; + InlineeSourceLineHeader Header; + }; + std::vector Entries; +}; +} +} + +#endif Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h Tue May 30 17:37:31 2017 (r319230) @@ -0,0 +1,143 @@ +//===- DebugLinesSubsection.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_MODULEDEBUGLINEFRAGMENT_H +#define LLVM_DEBUGINFO_CODEVIEW_MODULEDEBUGLINEFRAGMENT_H + +#include "llvm/DebugInfo/CodeView/DebugSubsection.h" +#include "llvm/DebugInfo/CodeView/Line.h" +#include "llvm/Support/BinaryStreamArray.h" +#include "llvm/Support/BinaryStreamReader.h" +#include "llvm/Support/Error.h" + +namespace llvm { +namespace codeview { + +class DebugChecksumsSubsection; +class DebugStringTableSubsection; + +// Corresponds to the `CV_DebugSLinesHeader_t` structure. +struct LineFragmentHeader { + support::ulittle32_t RelocOffset; // Code offset of line contribution. + support::ulittle16_t RelocSegment; // Code segment of line contribution. + support::ulittle16_t Flags; // See LineFlags enumeration. + support::ulittle32_t CodeSize; // Code size of this line contribution. +}; + +// Corresponds to the `CV_DebugSLinesFileBlockHeader_t` structure. +struct LineBlockFragmentHeader { + support::ulittle32_t NameIndex; // Offset of FileChecksum entry in File + // checksums buffer. The checksum entry then + // contains another offset into the string + // table of the actual name. + support::ulittle32_t NumLines; // Number of lines + support::ulittle32_t BlockSize; // Code size of block, in bytes. + // The following two variable length arrays appear immediately after the + // header. The structure definitions follow. + // LineNumberEntry Lines[NumLines]; + // ColumnNumberEntry Columns[NumLines]; +}; + +// Corresponds to `CV_Line_t` structure +struct LineNumberEntry { + support::ulittle32_t Offset; // Offset to start of code bytes for line number + support::ulittle32_t Flags; // Start:24, End:7, IsStatement:1 +}; + +// Corresponds to `CV_Column_t` structure +struct ColumnNumberEntry { + support::ulittle16_t StartColumn; + support::ulittle16_t EndColumn; +}; + +struct LineColumnEntry { + support::ulittle32_t NameIndex; + FixedStreamArray LineNumbers; + FixedStreamArray Columns; +}; + +class LineColumnExtractor { +public: + typedef const LineFragmentHeader *ContextType; + + static Error extract(BinaryStreamRef Stream, uint32_t &Len, + LineColumnEntry &Item, const LineFragmentHeader *Ctx); +}; + +class DebugLinesSubsectionRef final : public DebugSubsectionRef { + friend class LineColumnExtractor; + typedef VarStreamArray LineInfoArray; + typedef LineInfoArray::Iterator Iterator; + +public: + DebugLinesSubsectionRef(); + + static bool classof(const DebugSubsectionRef *S) { + return S->kind() == DebugSubsectionKind::Lines; + } + + Error initialize(BinaryStreamReader Reader); + + Iterator begin() const { return LinesAndColumns.begin(); } + Iterator end() const { return LinesAndColumns.end(); } + + const LineFragmentHeader *header() const { return Header; } + + bool hasColumnInfo() const; + +private: + const LineFragmentHeader *Header = nullptr; + LineInfoArray LinesAndColumns; +}; + +class DebugLinesSubsection final : public DebugSubsection { + struct Block { + Block(uint32_t ChecksumBufferOffset) + : ChecksumBufferOffset(ChecksumBufferOffset) {} + + uint32_t ChecksumBufferOffset; + std::vector Lines; + std::vector Columns; + }; + +public: + DebugLinesSubsection(DebugChecksumsSubsection &Checksums, + DebugStringTableSubsection &Strings); + + static bool classof(const DebugSubsection *S) { + return S->kind() == DebugSubsectionKind::Lines; + } + + void createBlock(StringRef FileName); + void addLineInfo(uint32_t Offset, const LineInfo &Line); + void addLineAndColumnInfo(uint32_t Offset, const LineInfo &Line, + uint32_t ColStart, uint32_t ColEnd); + + uint32_t calculateSerializedSize() const override; + Error commit(BinaryStreamWriter &Writer) const override; + + void setRelocationAddress(uint16_t Segment, uint16_t Offset); + void setCodeSize(uint32_t Size); + void setFlags(LineFlags Flags); + + bool hasColumnInfo() const; + +private: + DebugChecksumsSubsection &Checksums; + + uint16_t RelocOffset = 0; + uint16_t RelocSegment = 0; + uint32_t CodeSize = 0; + LineFlags Flags = LF_None; + std::vector Blocks; +}; +} +} + +#endif Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h Tue May 30 17:37:31 2017 (r319230) @@ -0,0 +1,86 @@ +//===- DebugStringTableSubsection.h - CodeView String Table -----*- 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_DEBUGSTRINGTABLESUBSECTION_H +#define LLVM_DEBUGINFO_CODEVIEW_DEBUGSTRINGTABLESUBSECTION_H + +#include "llvm/ADT/StringMap.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/DebugInfo/CodeView/DebugSubsection.h" +#include "llvm/Support/BinaryStreamRef.h" +#include "llvm/Support/Error.h" + +#include + +namespace llvm { + +class BinaryStreamReader; +class BinaryStreamRef; +class BinaryStreamWriter; + +namespace codeview { + +/// Represents a read-only view of a CodeView string table. This is a very +/// simple flat buffer consisting of null-terminated strings, where strings +/// are retrieved by their offset in the buffer. DebugStringTableSubsectionRef +/// does not own the underlying storage for the buffer. +class DebugStringTableSubsectionRef : public DebugSubsectionRef { +public: + DebugStringTableSubsectionRef(); + + static bool classof(const DebugSubsectionRef *S) { + return S->kind() == DebugSubsectionKind::StringTable; + } + + Error initialize(BinaryStreamRef Contents); + + Expected getString(uint32_t Offset) const; + + bool valid() const { return Stream.valid(); } + +private: + BinaryStreamRef Stream; +}; + +/// Represents a read-write view of a CodeView string table. +/// DebugStringTableSubsection owns the underlying storage for the table, and is +/// capable of serializing the string table into a format understood by +/// DebugStringTableSubsectionRef. +class DebugStringTableSubsection : public DebugSubsection { +public: + DebugStringTableSubsection(); + + static bool classof(const DebugSubsection *S) { + return S->kind() == DebugSubsectionKind::StringTable; + } + + // If string S does not exist in the string table, insert it. + // Returns the ID for S. + uint32_t insert(StringRef S); + + // Return the ID for string S. Assumes S exists in the table. + uint32_t getStringId(StringRef S) const; + + uint32_t calculateSerializedSize() const override; + Error commit(BinaryStreamWriter &Writer) const override; + + uint32_t size() const; + + StringMap::const_iterator begin() const { return Strings.begin(); } + + StringMap::const_iterator end() const { return Strings.end(); } + +private: + StringMap Strings; + uint32_t StringSize = 1; +}; +} +} + +#endif Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSubsection.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSubsection.h Tue May 30 17:37:31 2017 (r319230) @@ -0,0 +1,52 @@ +//===- DebugSubsection.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_MODULEDEBUGFRAGMENT_H +#define LLVM_DEBUGINFO_CODEVIEW_MODULEDEBUGFRAGMENT_H + +#include "llvm/DebugInfo/CodeView/CodeView.h" +#include "llvm/Support/BinaryStreamWriter.h" +#include "llvm/Support/Casting.h" + +namespace llvm { +namespace codeview { + +class DebugSubsectionRef { +public: + explicit DebugSubsectionRef(DebugSubsectionKind Kind) : Kind(Kind) {} + virtual ~DebugSubsectionRef(); + + static bool classof(const DebugSubsectionRef *S) { return true; } + + DebugSubsectionKind kind() const { return Kind; } + +protected: + DebugSubsectionKind Kind; +}; + +class DebugSubsection { +public: + explicit DebugSubsection(DebugSubsectionKind Kind) : Kind(Kind) {} + virtual ~DebugSubsection(); + + static bool classof(const DebugSubsection *S) { return true; } + + DebugSubsectionKind kind() const { return Kind; } + + virtual Error commit(BinaryStreamWriter &Writer) const = 0; + virtual uint32_t calculateSerializedSize() const = 0; + +protected: + DebugSubsectionKind Kind; +}; + +} // namespace codeview +} // namespace llvm + +#endif // LLVM_DEBUGINFO_CODEVIEW_MODULEDEBUGFRAGMENT_H Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h Tue May 30 17:37:31 2017 (r319230) @@ -0,0 +1,77 @@ +//===- DebugSubsection.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_MODULEDEBUGFRAGMENTRECORD_H +#define LLVM_DEBUGINFO_CODEVIEW_MODULEDEBUGFRAGMENTRECORD_H + +#include "llvm/DebugInfo/CodeView/CodeView.h" +#include "llvm/Support/BinaryStreamArray.h" +#include "llvm/Support/BinaryStreamRef.h" +#include "llvm/Support/BinaryStreamWriter.h" +#include "llvm/Support/Endian.h" +#include "llvm/Support/Error.h" + +namespace llvm { +namespace codeview { + +class DebugSubsection; + +// Corresponds to the `CV_DebugSSubsectionHeader_t` structure. +struct DebugSubsectionHeader { + support::ulittle32_t Kind; // codeview::DebugSubsectionKind enum + support::ulittle32_t Length; // number of bytes occupied by this record. +}; + +class DebugSubsectionRecord { +public: + DebugSubsectionRecord(); + DebugSubsectionRecord(DebugSubsectionKind Kind, BinaryStreamRef Data); + + static Error initialize(BinaryStreamRef Stream, DebugSubsectionRecord &Info); + + uint32_t getRecordLength() const; + DebugSubsectionKind kind() const; + BinaryStreamRef getRecordData() const; + +private: + DebugSubsectionKind Kind; + BinaryStreamRef Data; +}; + +class DebugSubsectionRecordBuilder { +public: + DebugSubsectionRecordBuilder(DebugSubsectionKind Kind, DebugSubsection &Frag); + uint32_t calculateSerializedLength(); + Error commit(BinaryStreamWriter &Writer); + +private: + DebugSubsectionKind Kind; + DebugSubsection &Frag; +}; + +} // namespace codeview + +template <> struct VarStreamArrayExtractor { + typedef void ContextType; + + static Error extract(BinaryStreamRef Stream, uint32_t &Length, + codeview::DebugSubsectionRecord &Info) { + if (auto EC = codeview::DebugSubsectionRecord::initialize(Stream, Info)) + return EC; + Length = Info.getRecordLength(); + return Error::success(); + } +}; + +namespace codeview { +typedef VarStreamArray DebugSubsectionArray; +} +} // namespace llvm + +#endif // LLVM_DEBUGINFO_CODEVIEW_MODULEDEBUGFRAGMENTRECORD_H Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h Tue May 30 17:37:31 2017 (r319230) @@ -0,0 +1,66 @@ +//===- DebugSubsectionVisitor.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_MODULEDEBUGFRAGMENTVISITOR_H +#define LLVM_DEBUGINFO_CODEVIEW_MODULEDEBUGFRAGMENTVISITOR_H + +#include "llvm/Support/Error.h" +#include + +namespace llvm { + +namespace codeview { + +class DebugChecksumsSubsectionRef; +class DebugSubsectionRecord; +class DebugInlineeLinesSubsectionRef; +class DebugLinesSubsectionRef; +class DebugUnknownSubsectionRef; + +class DebugSubsectionVisitor { +public: + virtual ~DebugSubsectionVisitor() = default; + + virtual Error visitUnknown(DebugUnknownSubsectionRef &Unknown) { + return Error::success(); + } + virtual Error visitLines(DebugLinesSubsectionRef &Lines) { + return Error::success(); + } + + virtual Error visitFileChecksums(DebugChecksumsSubsectionRef &Checksums) { + return Error::success(); + } + + virtual Error visitInlineeLines(DebugInlineeLinesSubsectionRef &Inlinees) { + return Error::success(); + } + + virtual Error finished() { return Error::success(); } +}; + +Error visitDebugSubsection(const DebugSubsectionRecord &R, + DebugSubsectionVisitor &V); + +template +Error visitDebugSubsections(T &&FragmentRange, DebugSubsectionVisitor &V) { + for (const auto &L : FragmentRange) { + if (auto EC = visitDebugSubsection(L, V)) + return EC; + } + if (auto EC = V.finished()) + return EC; + return Error::success(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Tue May 30 17:37: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 EBFE8B94A8C; Tue, 30 May 2017 17:37: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 A28807156E; Tue, 30 May 2017 17:37: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 v4UHbb4a045665; Tue, 30 May 2017 17:37:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UHbbbU045664; Tue, 30 May 2017 17:37:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705301737.v4UHbbbU045664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 May 2017 17:37:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319231 - vendor/llvm/llvm-trunk-r304222 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:37:39 -0000 Author: dim Date: Tue May 30 17:37:37 2017 New Revision: 319231 URL: https://svnweb.freebsd.org/changeset/base/319231 Log: Tag llvm trunk r304222. Added: vendor/llvm/llvm-trunk-r304222/ - copied from r319230, vendor/llvm/dist/ From owner-svn-src-vendor@freebsd.org Tue May 30 17:37:48 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 B8C4BB94B0B; Tue, 30 May 2017 17:37:48 +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 4AB997161F; Tue, 30 May 2017 17:37:48 +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 v4UHblek045793; Tue, 30 May 2017 17:37:47 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UHbik6045762; Tue, 30 May 2017 17:37:44 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705301737.v4UHbik6045762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 May 2017 17:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319233 - in vendor/clang/dist: include/clang-c include/clang/Basic include/clang/Frontend include/clang/Lex include/clang/Serialization include/clang/StaticAnalyzer/Checkers include/cl... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:37:48 -0000 Author: dim Date: Tue May 30 17:37:44 2017 New Revision: 319233 URL: https://svnweb.freebsd.org/changeset/base/319233 Log: Vendor import of clang trunk r304222: https://llvm.org/svn/llvm-project/cfe/trunk@304222 Added: vendor/clang/dist/lib/StaticAnalyzer/Checkers/IteratorChecker.cpp (contents, props changed) vendor/clang/dist/test/Analysis/iterator-range.cpp (contents, props changed) vendor/clang/dist/test/CodeGen/altivec-ct.c (contents, props changed) vendor/clang/dist/test/Lexer/preamble2.c (contents, props changed) vendor/clang/dist/test/Modules/Inputs/preprocess/a.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/preprocess/b.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/preprocess/c.h (contents, props changed) vendor/clang/dist/test/Modules/preprocess-nested.cpp (contents, props changed) vendor/clang/dist/test/Modules/preprocess-unavailable.cpp (contents, props changed) vendor/clang/dist/test/SemaOpenCL/arithmetic-conversions.cl Deleted: vendor/clang/dist/lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp vendor/clang/dist/test/Analysis/iterator-past-end.cpp Modified: vendor/clang/dist/include/clang-c/Index.h vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Frontend/ASTUnit.h vendor/clang/dist/include/clang/Lex/Preprocessor.h vendor/clang/dist/include/clang/Lex/PreprocessorLexer.h vendor/clang/dist/include/clang/Lex/PreprocessorOptions.h vendor/clang/dist/include/clang/Serialization/ASTBitCodes.h vendor/clang/dist/include/clang/StaticAnalyzer/Checkers/Checkers.td vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp vendor/clang/dist/lib/Frontend/ASTUnit.cpp vendor/clang/dist/lib/Frontend/SerializedDiagnosticPrinter.cpp vendor/clang/dist/lib/Headers/altivec.h vendor/clang/dist/lib/Lex/Lexer.cpp vendor/clang/dist/lib/Lex/PPDirectives.cpp vendor/clang/dist/lib/Lex/PPLexerChange.cpp vendor/clang/dist/lib/Lex/Pragma.cpp vendor/clang/dist/lib/Lex/Preprocessor.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaOpenMP.cpp vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/CMakeLists.txt vendor/clang/dist/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/ProgramState.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/RegionStore.cpp vendor/clang/dist/test/Analysis/Inputs/system-header-simulator-cxx.h vendor/clang/dist/test/Analysis/diagnostics/explicit-suppression.cpp vendor/clang/dist/test/Analysis/pthreadlock.c vendor/clang/dist/test/Analysis/taint-generic.c vendor/clang/dist/test/CodeGen/arm_neon_intrinsics.c vendor/clang/dist/test/CodeGen/union-align.c vendor/clang/dist/test/CodeGenOpenCL/bool_cast.cl vendor/clang/dist/test/Lexer/preamble.c vendor/clang/dist/test/Modules/Inputs/preprocess/module.modulemap vendor/clang/dist/test/OpenMP/target_data_messages.c vendor/clang/dist/test/OpenMP/target_enter_data_map_messages.c vendor/clang/dist/test/OpenMP/target_enter_data_nowait_messages.cpp vendor/clang/dist/test/OpenMP/target_exit_data_map_messages.c vendor/clang/dist/test/OpenMP/target_exit_data_nowait_messages.cpp vendor/clang/dist/test/OpenMP/target_map_messages.cpp vendor/clang/dist/test/OpenMP/target_teams_map_messages.cpp vendor/clang/dist/test/SemaOpenCL/clang-builtin-version.cl vendor/clang/dist/test/SemaOpenCL/cond.cl vendor/clang/dist/test/SemaOpenCL/to_addr_builtin.cl vendor/clang/dist/tools/c-index-test/c-index-test.c vendor/clang/dist/tools/libclang/CIndex.cpp vendor/clang/dist/tools/libclang/libclang.exports Modified: vendor/clang/dist/include/clang-c/Index.h ============================================================================== --- vendor/clang/dist/include/clang-c/Index.h Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/include/clang-c/Index.h Tue May 30 17:37:44 2017 (r319233) @@ -32,7 +32,7 @@ * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. */ #define CINDEX_VERSION_MAJOR 0 -#define CINDEX_VERSION_MINOR 40 +#define CINDEX_VERSION_MINOR 41 #define CINDEX_VERSION_ENCODE(major, minor) ( \ ((major) * 10000) \ @@ -1417,6 +1417,15 @@ enum CXSaveError { CINDEX_LINKAGE int clang_saveTranslationUnit(CXTranslationUnit TU, const char *FileName, unsigned options); + +/** + * \brief Suspend a translation unit in order to free memory associated with it. + * + * A suspended translation unit uses significantly less memory but on the other + * side does not support any other calls than \c clang_reparseTranslationUnit + * to resume it or \c clang_disposeTranslationUnit to dispose it completely. + */ +CINDEX_LINKAGE unsigned clang_suspendTranslationUnit(CXTranslationUnit); /** * \brief Destroy the specified CXTranslationUnit object. Modified: vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td Tue May 30 17:37:44 2017 (r319233) @@ -525,6 +525,8 @@ def err_pp_module_begin_without_module_end : Error< def err_pp_module_end_without_module_begin : Error< "no matching '#pragma clang module begin' for this " "'#pragma clang module end'">; +def note_pp_module_begin_here : Note< + "entering module '%0' due to this pragma">; def err_defined_macro_name : Error<"'defined' cannot be used as a macro name">; def err_paste_at_start : Error< Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Tue May 30 17:37:44 2017 (r319233) @@ -8312,8 +8312,13 @@ def err_opencl_bitfields : Error< "bit-fields are not supported in OpenCL">; def err_opencl_vla : Error< "variable length arrays are not supported in OpenCL">; +def err_opencl_scalar_type_rank_greater_than_vector_type : Error< + "scalar operand type has greater rank than the type of the vector " + "element. (%0 and %1)">; def err_bad_kernel_param_type : Error< "%0 cannot be used as the type of a kernel parameter">; +def err_opencl_implicit_function_decl : Error< + "implicit declaration of function %0 is invalid in OpenCL">; def err_record_with_pointers_kernel_param : Error< "%select{struct|union}0 kernel parameters may not contain pointers">; def note_within_field_of_type : Note< @@ -8744,8 +8749,8 @@ def err_omp_not_mappable_type : Error< "type %0 is not mappable to target">; def err_omp_invalid_map_type_for_directive : Error< "%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">; -def err_omp_no_map_for_directive : Error< - "expected at least one map clause for '#pragma omp %0'">; +def err_omp_no_clause_for_directive : Error< + "expected at least one %0 clause for '#pragma omp %1'">; def note_omp_polymorphic_in_target : Note< "mappable type cannot be polymorphic">; def note_omp_static_member_in_target : Note< Modified: vendor/clang/dist/include/clang/Frontend/ASTUnit.h ============================================================================== --- vendor/clang/dist/include/clang/Frontend/ASTUnit.h Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/include/clang/Frontend/ASTUnit.h Tue May 30 17:37:44 2017 (r319233) @@ -878,6 +878,11 @@ class ASTUnit : public ModuleLoader { (public) ArrayRef RemappedFiles = None, IntrusiveRefCntPtr VFS = nullptr); + /// \brief Free data that will be re-generated on the next parse. + /// + /// Preamble-related data is not affected. + void ResetForParse(); + /// \brief Perform code completion at the given file, line, and /// column within this translation unit. /// Modified: vendor/clang/dist/include/clang/Lex/Preprocessor.h ============================================================================== --- vendor/clang/dist/include/clang/Lex/Preprocessor.h Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/include/clang/Lex/Preprocessor.h Tue May 30 17:37:44 2017 (r319233) @@ -283,6 +283,44 @@ class Preprocessor { /// This is used when loading a precompiled preamble. std::pair SkipMainFilePreamble; + class PreambleConditionalStackStore { + enum State { + Off = 0, + Recording = 1, + Replaying = 2, + }; + + public: + PreambleConditionalStackStore() : ConditionalStackState(Off) {} + + void startRecording() { ConditionalStackState = Recording; } + void startReplaying() { ConditionalStackState = Replaying; } + bool isRecording() const { return ConditionalStackState == Recording; } + bool isReplaying() const { return ConditionalStackState == Replaying; } + + ArrayRef getStack() const { + return ConditionalStack; + } + + void doneReplaying() { + ConditionalStack.clear(); + ConditionalStackState = Off; + } + + void setStack(ArrayRef s) { + if (!isRecording() && !isReplaying()) + return; + ConditionalStack.clear(); + ConditionalStack.append(s.begin(), s.end()); + } + + bool hasRecordedPreamble() const { return !ConditionalStack.empty(); } + + private: + SmallVector ConditionalStack; + State ConditionalStackState; + } PreambleConditionalStack; + /// \brief The current top of the stack that we're lexing from if /// not expanding a macro and we are lexing directly from source code. /// @@ -1695,6 +1733,11 @@ class Preprocessor { /// \brief Return true if we're in the top-level file, not in a \#include. bool isInPrimaryFile() const; + /// \brief Return true if we're in the main file (specifically, if we are 0 + /// (zero) levels deep \#include. This is used by the lexer to determine if + /// it needs to generate errors about unterminated \#if directives. + bool isInMainFile() const; + /// \brief Handle cases where the \#include name is expanded /// from a macro as multiple tokens, which need to be glued together. /// @@ -1931,6 +1974,27 @@ class Preprocessor { const FileEntry *getModuleHeaderToIncludeForDiagnostics(SourceLocation IncLoc, Module *M, SourceLocation MLoc); + + bool isRecordingPreamble() const { + return PreambleConditionalStack.isRecording(); + } + + bool hasRecordedPreamble() const { + return PreambleConditionalStack.hasRecordedPreamble(); + } + + ArrayRef getPreambleConditionalStack() const { + return PreambleConditionalStack.getStack(); + } + + void setRecordedPreambleConditionalStack(ArrayRef s) { + PreambleConditionalStack.setStack(s); + } + + void setReplayablePreambleConditionalStack(ArrayRef s) { + PreambleConditionalStack.startReplaying(); + PreambleConditionalStack.setStack(s); + } private: // Macro handling. Modified: vendor/clang/dist/include/clang/Lex/PreprocessorLexer.h ============================================================================== --- vendor/clang/dist/include/clang/Lex/PreprocessorLexer.h Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/include/clang/Lex/PreprocessorLexer.h Tue May 30 17:37:44 2017 (r319233) @@ -17,6 +17,7 @@ #include "clang/Lex/MultipleIncludeOpt.h" #include "clang/Lex/Token.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" namespace clang { @@ -175,6 +176,11 @@ class PreprocessorLexer { (public) } conditional_iterator conditional_end() const { return ConditionalStack.end(); + } + + void setConditionalLevels(ArrayRef CL) { + ConditionalStack.clear(); + ConditionalStack.append(CL.begin(), CL.end()); } }; Modified: vendor/clang/dist/include/clang/Lex/PreprocessorOptions.h ============================================================================== --- vendor/clang/dist/include/clang/Lex/PreprocessorOptions.h Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/include/clang/Lex/PreprocessorOptions.h Tue May 30 17:37:44 2017 (r319233) @@ -80,7 +80,14 @@ class PreprocessorOptions { (public) /// The boolean indicates whether the preamble ends at the start of a new /// line. std::pair PrecompiledPreambleBytes; - + + /// \brief True indicates that a preamble is being generated. + /// + /// When the lexer is done, one of the things that need to be preserved is the + /// conditional #if stack, so the ASTWriter/ASTReader can save/restore it when + /// processing the rest of the file. + bool GeneratePreamble; + /// The implicit PTH input included at the start of the translation unit, or /// empty. std::string ImplicitPTHInclude; @@ -144,6 +151,7 @@ class PreprocessorOptions { (public) AllowPCHWithCompilerErrors(false), DumpDeserializedPCHDecls(false), PrecompiledPreambleBytes(0, true), + GeneratePreamble(false), RemappedFilesKeepOriginalName(true), RetainRemappedFileBuffers(false), ObjCXXARCStandardLibrary(ARCXX_nolib) { } Modified: vendor/clang/dist/include/clang/Serialization/ASTBitCodes.h ============================================================================== --- vendor/clang/dist/include/clang/Serialization/ASTBitCodes.h Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/include/clang/Serialization/ASTBitCodes.h Tue May 30 17:37:44 2017 (r319233) @@ -607,6 +607,9 @@ namespace clang { /// \brief Record code for \#pragma pack options. PACK_PRAGMA_OPTIONS = 61, + + /// \brief The stack of open #ifs/#ifdefs recorded in a preamble. + PP_CONDITIONAL_STACK = 62, }; /// \brief Record types used within a source manager block. Modified: vendor/clang/dist/include/clang/StaticAnalyzer/Checkers/Checkers.td ============================================================================== --- vendor/clang/dist/include/clang/StaticAnalyzer/Checkers/Checkers.td Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/include/clang/StaticAnalyzer/Checkers/Checkers.td Tue May 30 17:37:44 2017 (r319233) @@ -279,14 +279,14 @@ def VirtualCallChecker : Checker<"VirtualCall">, let ParentPackage = CplusplusAlpha in { +def IteratorRangeChecker : Checker<"IteratorRange">, + HelpText<"Check for iterators used outside their valid ranges">, + DescFile<"IteratorChecker.cpp">; + def MisusedMovedObjectChecker: Checker<"MisusedMovedObject">, HelpText<"Method calls on a moved-from object and copying a moved-from " "object will be reported">, DescFile<"MisusedMovedObjectChecker.cpp">; - -def IteratorPastEndChecker : Checker<"IteratorPastEnd">, - HelpText<"Check iterators used past end">, - DescFile<"IteratorPastEndChecker.cpp">; } // end: "alpha.cplusplus" Modified: vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h ============================================================================== --- vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h Tue May 30 17:37:44 2017 (r319233) @@ -43,6 +43,7 @@ typedef std::unique_ptr(*Constraint ProgramStateManager &, SubEngine *); typedef std::unique_ptr(*StoreManagerCreator)( ProgramStateManager &); +typedef llvm::ImmutableMap TaintedSubRegions; //===----------------------------------------------------------------------===// // ProgramStateTrait - Traits used by the Generic Data Map of a ProgramState. @@ -343,6 +344,9 @@ class ProgramState : public llvm::FoldingSetNode { (pu ProgramStateRef addTaint(const Stmt *S, const LocationContext *LCtx, TaintTagType Kind = TaintTagGeneric) const; + /// Create a new state in which the value is marked as tainted. + ProgramStateRef addTaint(SVal V, TaintTagType Kind = TaintTagGeneric) const; + /// Create a new state in which the symbol is marked as tainted. ProgramStateRef addTaint(SymbolRef S, TaintTagType Kind = TaintTagGeneric) const; @@ -351,6 +355,14 @@ class ProgramState : public llvm::FoldingSetNode { (pu ProgramStateRef addTaint(const MemRegion *R, TaintTagType Kind = TaintTagGeneric) const; + /// Create a new state in a which a sub-region of a given symbol is tainted. + /// This might be necessary when referring to regions that can not have an + /// individual symbol, e.g. if they are represented by the default binding of + /// a LazyCompoundVal. + ProgramStateRef addPartialTaint(SymbolRef ParentSym, + const SubRegion *SubRegion, + TaintTagType Kind = TaintTagGeneric) const; + /// Check if the statement is tainted in the current state. bool isTainted(const Stmt *S, const LocationContext *LCtx, TaintTagType Kind = TaintTagGeneric) const; @@ -453,6 +465,7 @@ class ProgramStateManager { (private) std::unique_ptr ConstraintMgr; ProgramState::GenericDataMap::Factory GDMFactory; + TaintedSubRegions::Factory TSRFactory; typedef llvm::DenseMap > GDMContextsTy; GDMContextsTy GDMContexts; Modified: vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h ============================================================================== --- vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h Tue May 30 17:37:44 2017 (r319233) @@ -35,6 +35,16 @@ template<> struct ProgramStateTrait static void *GDMIndex() { static int index = 0; return &index; } }; +/// The GDM component mapping derived symbols' parent symbols to their +/// underlying regions. This is used to efficiently check whether a symbol is +/// tainted when it represents a sub-region of a tainted symbol. +struct DerivedSymTaint {}; +typedef llvm::ImmutableMap DerivedSymTaintImpl; +template<> struct ProgramStateTrait + : public ProgramStatePartialTrait { + static void *GDMIndex() { static int index; return &index; } +}; + class TaintManager { TaintManager() {} Modified: vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp Tue May 30 17:37:44 2017 (r319233) @@ -578,8 +578,7 @@ void CodeGenFunction::EmitCoroutineBody(const Coroutin EmitBlock(FinalBB); CurCoro.Data->CurrentAwaitKind = AwaitKind::Final; EmitStmt(S.getFinalSuspendStmt()); - } - else { + } else { // We don't need FinalBB. Emit it to make sure the block is deleted. EmitBlock(FinalBB, /*IsFinished=*/true); } Modified: vendor/clang/dist/lib/Frontend/ASTUnit.cpp ============================================================================== --- vendor/clang/dist/lib/Frontend/ASTUnit.cpp Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/Frontend/ASTUnit.cpp Tue May 30 17:37:44 2017 (r319233) @@ -1036,8 +1036,6 @@ static void checkAndSanitizeDiags(SmallVectorImpl PCHContainerOps, std::unique_ptr OverrideMainBuffer, IntrusiveRefCntPtr VFS) { - SavedMainFileBuffer.reset(); - if (!Invocation) return true; @@ -1090,17 +1088,11 @@ bool ASTUnit::Parse(std::shared_ptrcreateFileManager(); FileMgr = &Clang->getFileManager(); } - SourceMgr = new SourceManager(getDiagnostics(), *FileMgr, - UserFilesAreVolatile); - TheSema.reset(); - Ctx = nullptr; - PP = nullptr; - Reader = nullptr; - // Clear out old caches and data. - TopLevelDecls.clear(); - clearFileLevelDecls(); + ResetForParse(); + SourceMgr = new SourceManager(getDiagnostics(), *FileMgr, + UserFilesAreVolatile); if (!OverrideMainBuffer) { checkAndRemoveNonDriverDiags(StoredDiagnostics); TopLevelDeclsInPreamble.clear(); @@ -1999,6 +1991,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine( PreprocessorOptions &PPOpts = CI->getPreprocessorOpts(); PPOpts.RemappedFilesKeepOriginalName = RemappedFilesKeepOriginalName; PPOpts.AllowPCHWithCompilerErrors = AllowPCHWithCompilerErrors; + PPOpts.GeneratePreamble = PrecompilePreambleAfterNParses != 0; // Override the resources path. CI->getHeaderSearchOpts().ResourceDir = ResourceFilesPath; @@ -2113,6 +2106,19 @@ bool ASTUnit::Reparse(std::shared_ptrAdd(BitCodeAbbrevOp(RECORD_FILENAME)); Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10)); // Mapped file ID. Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // Size. - Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // Modifcation time. + Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // Modification time. Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 16)); // Text size. Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // File name text. Abbrevs.set(RECORD_FILENAME, Stream.EmitBlockInfoAbbrev(BLOCK_DIAG, Modified: vendor/clang/dist/lib/Headers/altivec.h ============================================================================== --- vendor/clang/dist/lib/Headers/altivec.h Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/Headers/altivec.h Tue May 30 17:37:44 2017 (r319233) @@ -2887,87 +2887,79 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn /* vec_ctf */ -static __inline__ vector float __ATTRS_o_ai vec_ctf(vector int __a, int __b) { - return __builtin_altivec_vcfsx(__a, __b); -} - -static __inline__ vector float __ATTRS_o_ai vec_ctf(vector unsigned int __a, - int __b) { - return __builtin_altivec_vcfux((vector int)__a, __b); -} - #ifdef __VSX__ -static __inline__ vector double __ATTRS_o_ai -vec_ctf(vector unsigned long long __a, int __b) { - vector double __ret = __builtin_convertvector(__a, vector double); - __ret *= (vector double)(vector unsigned long long)((0x3ffULL - __b) << 52); - return __ret; -} - -static __inline__ vector double __ATTRS_o_ai -vec_ctf(vector signed long long __a, int __b) { - vector double __ret = __builtin_convertvector(__a, vector double); - __ret *= (vector double)(vector unsigned long long)((0x3ffULL - __b) << 52); - return __ret; -} +#define vec_ctf(__a, __b) \ + _Generic((__a), vector int \ + : (vector float)__builtin_altivec_vcfsx((__a), (__b)), \ + vector unsigned int \ + : (vector float)__builtin_altivec_vcfux((vector int)(__a), (__b)), \ + vector unsigned long long \ + : (__builtin_convertvector((vector unsigned long long)(__a), \ + vector double) * \ + (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \ + << 52)), \ + vector signed long long \ + : (__builtin_convertvector((vector signed long long)(__a), \ + vector double) * \ + (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \ + << 52))) +#else +#define vec_ctf(__a, __b) \ + _Generic((__a), vector int \ + : (vector float)__builtin_altivec_vcfsx((__a), (__b)), \ + vector unsigned int \ + : (vector float)__builtin_altivec_vcfux((vector int)(__a), (__b))) #endif /* vec_vcfsx */ -static __inline__ vector float __attribute__((__always_inline__)) -vec_vcfsx(vector int __a, int __b) { - return __builtin_altivec_vcfsx(__a, __b); -} +#define vec_vcfux __builtin_altivec_vcfux /* vec_vcfux */ -static __inline__ vector float __attribute__((__always_inline__)) -vec_vcfux(vector unsigned int __a, int __b) { - return __builtin_altivec_vcfux((vector int)__a, __b); -} +#define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b)) /* vec_cts */ -static __inline__ vector int __ATTRS_o_ai vec_cts(vector float __a, int __b) { - return __builtin_altivec_vctsxs(__a, __b); -} - #ifdef __VSX__ -static __inline__ vector signed long long __ATTRS_o_ai -vec_cts(vector double __a, int __b) { - __a *= (vector double)(vector unsigned long long)((0x3ffULL + __b) << 52); - return __builtin_convertvector(__a, vector signed long long); -} +#define vec_cts(__a, __b) \ + _Generic((__a), vector float \ + : __builtin_altivec_vctsxs((__a), (__b)), vector double \ + : __extension__({ \ + vector double __ret = \ + (__a) * \ + (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \ + << 52); \ + __builtin_convertvector(__ret, vector signed long long); \ + })) +#else +#define vec_cts __builtin_altivec_vctsxs #endif /* vec_vctsxs */ -static __inline__ vector int __attribute__((__always_inline__)) -vec_vctsxs(vector float __a, int __b) { - return __builtin_altivec_vctsxs(__a, __b); -} +#define vec_vctsxs __builtin_altivec_vctsxs /* vec_ctu */ -static __inline__ vector unsigned int __ATTRS_o_ai vec_ctu(vector float __a, - int __b) { - return __builtin_altivec_vctuxs(__a, __b); -} - #ifdef __VSX__ -static __inline__ vector unsigned long long __ATTRS_o_ai -vec_ctu(vector double __a, int __b) { - __a *= (vector double)(vector unsigned long long)((0x3ffULL + __b) << 52); - return __builtin_convertvector(__a, vector unsigned long long); -} +#define vec_ctu(__a, __b) \ + _Generic((__a), vector float \ + : __builtin_altivec_vctuxs((__a), (__b)), vector double \ + : __extension__({ \ + vector double __ret = \ + (__a) * \ + (vector double)(vector unsigned long long)((0x3ffULL + __b) \ + << 52); \ + __builtin_convertvector(__ret, vector unsigned long long); \ + })) +#else +#define vec_ctu __builtin_altivec_vctuxs #endif /* vec_vctuxs */ -static __inline__ vector unsigned int __attribute__((__always_inline__)) -vec_vctuxs(vector float __a, int __b) { - return __builtin_altivec_vctuxs(__a, __b); -} +#define vec_vctuxs __builtin_altivec_vctuxs /* vec_signed */ Modified: vendor/clang/dist/lib/Lex/Lexer.cpp ============================================================================== --- vendor/clang/dist/lib/Lex/Lexer.cpp Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/Lex/Lexer.cpp Tue May 30 17:37:44 2017 (r319233) @@ -550,8 +550,6 @@ namespace { enum PreambleDirectiveKind { PDK_Skipped, - PDK_StartIf, - PDK_EndIf, PDK_Unknown }; @@ -574,8 +572,6 @@ std::pair Lexer::ComputePreamble(Strin bool InPreprocessorDirective = false; Token TheTok; - Token IfStartTok; - unsigned IfCount = 0; SourceLocation ActiveCommentLoc; unsigned MaxLineOffset = 0; @@ -658,33 +654,18 @@ std::pair Lexer::ComputePreamble(Strin .Case("sccs", PDK_Skipped) .Case("assert", PDK_Skipped) .Case("unassert", PDK_Skipped) - .Case("if", PDK_StartIf) - .Case("ifdef", PDK_StartIf) - .Case("ifndef", PDK_StartIf) + .Case("if", PDK_Skipped) + .Case("ifdef", PDK_Skipped) + .Case("ifndef", PDK_Skipped) .Case("elif", PDK_Skipped) .Case("else", PDK_Skipped) - .Case("endif", PDK_EndIf) + .Case("endif", PDK_Skipped) .Default(PDK_Unknown); switch (PDK) { case PDK_Skipped: continue; - case PDK_StartIf: - if (IfCount == 0) - IfStartTok = HashTok; - - ++IfCount; - continue; - - case PDK_EndIf: - // Mismatched #endif. The preamble ends here. - if (IfCount == 0) - break; - - --IfCount; - continue; - case PDK_Unknown: // We don't know what this directive is; stop at the '#'. break; @@ -705,16 +686,13 @@ std::pair Lexer::ComputePreamble(Strin } while (true); SourceLocation End; - if (IfCount) - End = IfStartTok.getLocation(); - else if (ActiveCommentLoc.isValid()) + if (ActiveCommentLoc.isValid()) End = ActiveCommentLoc; // don't truncate a decl comment. else End = TheTok.getLocation(); return std::make_pair(End.getRawEncoding() - StartLoc.getRawEncoding(), - IfCount? IfStartTok.isAtStartOfLine() - : TheTok.isAtStartOfLine()); + TheTok.isAtStartOfLine()); } /// AdvanceToTokenCharacter - Given a location that specifies the start of a @@ -2570,6 +2548,11 @@ bool Lexer::LexEndOfFile(Token &Result, const char *Cu return true; } + if (PP->isRecordingPreamble() && !PP->isInMainFile()) { + PP->setRecordedPreambleConditionalStack(ConditionalStack); + ConditionalStack.clear(); + } + // Issue diagnostics for unterminated #if and missing newline. // If we are in a #if directive, emit an error. Modified: vendor/clang/dist/lib/Lex/PPDirectives.cpp ============================================================================== --- vendor/clang/dist/lib/Lex/PPDirectives.cpp Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/Lex/PPDirectives.cpp Tue May 30 17:37:44 2017 (r319233) @@ -1906,6 +1906,25 @@ void Preprocessor::HandleIncludeDirective(SourceLocati } } + // The #included file will be considered to be a system header if either it is + // in a system include directory, or if the #includer is a system include + // header. + SrcMgr::CharacteristicKind FileCharacter = + SourceMgr.getFileCharacteristic(FilenameTok.getLocation()); + if (File) + FileCharacter = std::max(HeaderInfo.getFileDirFlavor(File), FileCharacter); + + // Ask HeaderInfo if we should enter this #include file. If not, #including + // this file will have no effect. + bool SkipHeader = false; + if (ShouldEnter && File && + !HeaderInfo.ShouldEnterIncludeFile(*this, File, isImport, + getLangOpts().Modules, + SuggestedModule.getModule())) { + ShouldEnter = false; + SkipHeader = true; + } + if (Callbacks) { // Notify the callback object that we've seen an inclusion directive. Callbacks->InclusionDirective( @@ -1913,18 +1932,13 @@ void Preprocessor::HandleIncludeDirective(SourceLocati LangOpts.MSVCCompat ? NormalizedPath.c_str() : Filename, isAngled, FilenameRange, File, SearchPath, RelativePath, ShouldEnter ? nullptr : SuggestedModule.getModule()); + if (SkipHeader && !SuggestedModule.getModule()) + Callbacks->FileSkipped(*File, FilenameTok, FileCharacter); } if (!File) return; - // The #included file will be considered to be a system header if either it is - // in a system include directory, or if the #includer is a system include - // header. - SrcMgr::CharacteristicKind FileCharacter = - std::max(HeaderInfo.getFileDirFlavor(File), - SourceMgr.getFileCharacteristic(FilenameTok.getLocation())); - // FIXME: If we have a suggested module, and we've already visited this file, // don't bother entering it again. We know it has no further effect. @@ -1962,19 +1976,6 @@ void Preprocessor::HandleIncludeDirective(SourceLocati Diag(FilenameTok, DiagId) << Path << FixItHint::CreateReplacement(Range, Path); } - } - - // Ask HeaderInfo if we should enter this #include file. If not, #including - // this file will have no effect. - bool SkipHeader = false; - if (ShouldEnter && - !HeaderInfo.ShouldEnterIncludeFile(*this, File, isImport, - getLangOpts().Modules, - SuggestedModule.getModule())) { - ShouldEnter = false; - SkipHeader = true; - if (Callbacks) - Callbacks->FileSkipped(*File, FilenameTok, FileCharacter); } // If we don't need to enter the file, stop now. Modified: vendor/clang/dist/lib/Lex/PPLexerChange.cpp ============================================================================== --- vendor/clang/dist/lib/Lex/PPLexerChange.cpp Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/Lex/PPLexerChange.cpp Tue May 30 17:37:44 2017 (r319233) @@ -46,6 +46,12 @@ bool Preprocessor::isInPrimaryFile() const { }); } +bool Preprocessor::isInMainFile() const { + if (IsFileLexer()) + return IncludeMacroStack.size() == 0; + return true; +} + /// getCurrentLexer - Return the current file lexer being lexed from. Note /// that this ignores any potentially active macro expansions and _Pragma /// expansions going on at the time. Modified: vendor/clang/dist/lib/Lex/Pragma.cpp ============================================================================== --- vendor/clang/dist/lib/Lex/Pragma.cpp Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/Lex/Pragma.cpp Tue May 30 17:37:44 2017 (r319233) @@ -1407,6 +1407,24 @@ struct PragmaModuleBeginHandler : public PragmaHandler M = NewM; } + // If the module isn't available, it doesn't make sense to enter it. + if (!M->isAvailable()) { + Module::Requirement Requirement; + Module::UnresolvedHeaderDirective MissingHeader; + (void)M->isAvailable(PP.getLangOpts(), PP.getTargetInfo(), + Requirement, MissingHeader); + if (MissingHeader.FileNameLoc.isValid()) { + PP.Diag(MissingHeader.FileNameLoc, diag::err_module_header_missing) + << MissingHeader.IsUmbrella << MissingHeader.FileName; + } else { + PP.Diag(M->DefinitionLoc, diag::err_module_unavailable) + << M->getFullModuleName() << Requirement.second << Requirement.first; + } + PP.Diag(BeginLoc, diag::note_pp_module_begin_here) + << M->getTopLevelModuleName(); + return; + } + // Enter the scope of the submodule. PP.EnterSubmodule(M, BeginLoc, /*ForPragma*/true); PP.EnterAnnotationToken(SourceRange(BeginLoc, ModuleName.back().second), Modified: vendor/clang/dist/lib/Lex/Preprocessor.cpp ============================================================================== --- vendor/clang/dist/lib/Lex/Preprocessor.cpp Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/Lex/Preprocessor.cpp Tue May 30 17:37:44 2017 (r319233) @@ -150,6 +150,9 @@ Preprocessor::Preprocessor(std::shared_ptrPPOpts->GeneratePreamble) + PreambleConditionalStack.startRecording(); } Preprocessor::~Preprocessor() { @@ -532,6 +535,12 @@ void Preprocessor::EnterMainSourceFile() { // Start parsing the predefines. EnterSourceFile(FID, nullptr, SourceLocation()); + + // Restore the conditional stack from the preamble, if there is one. + if (PreambleConditionalStack.isReplaying()) { + CurPPLexer->setConditionalLevels(PreambleConditionalStack.getStack()); + PreambleConditionalStack.doneReplaying(); + } } void Preprocessor::EndSourceFile() { Modified: vendor/clang/dist/lib/Sema/SemaDecl.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaDecl.cpp Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/Sema/SemaDecl.cpp Tue May 30 17:37:44 2017 (r319233) @@ -12509,6 +12509,9 @@ NamedDecl *Sema::ImplicitlyDefineFunction(SourceLocati unsigned diag_id; if (II.getName().startswith("__builtin_")) diag_id = diag::warn_builtin_unknown; + // OpenCL v2.0 s6.9.u - Implicit function declaration is not supported. + else if (getLangOpts().OpenCL) + diag_id = diag::err_opencl_implicit_function_decl; else if (getLangOpts().C99) diag_id = diag::ext_implicit_function_decl; else Modified: vendor/clang/dist/lib/Sema/SemaExpr.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaExpr.cpp Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/Sema/SemaExpr.cpp Tue May 30 17:37:44 2017 (r319233) @@ -8074,28 +8074,38 @@ QualType Sema::InvalidLogicalVectorOperands(SourceLoca /// rank; for C, Obj-C, and C++ we allow any real scalar conversion except /// for float->int. /// +/// OpenCL V2.0 6.2.6.p2: +/// An error shall occur if any scalar operand type has greater rank +/// than the type of the vector element. +/// /// \param scalar - if non-null, actually perform the conversions /// \return true if the operation fails (but without diagnosing the failure) static bool tryVectorConvertAndSplat(Sema &S, ExprResult *scalar, QualType scalarTy, QualType vectorEltTy, - QualType vectorTy) { + QualType vectorTy, + unsigned &DiagID) { // The conversion to apply to the scalar before splatting it, // if necessary. CastKind scalarCast = CK_Invalid; if (vectorEltTy->isIntegralType(S.Context)) { + if (S.getLangOpts().OpenCL && (scalarTy->isRealFloatingType() || + (scalarTy->isIntegerType() && + S.Context.getIntegerTypeOrder(vectorEltTy, scalarTy) < 0))) { + DiagID = diag::err_opencl_scalar_type_rank_greater_than_vector_type; + return true; + } if (!scalarTy->isIntegralType(S.Context)) return true; - if (S.getLangOpts().OpenCL && - S.Context.getIntegerTypeOrder(vectorEltTy, scalarTy) < 0) - return true; scalarCast = CK_IntegralCast; } else if (vectorEltTy->isRealFloatingType()) { if (scalarTy->isRealFloatingType()) { if (S.getLangOpts().OpenCL && - S.Context.getFloatingTypeOrder(vectorEltTy, scalarTy) < 0) + S.Context.getFloatingTypeOrder(vectorEltTy, scalarTy) < 0) { + DiagID = diag::err_opencl_scalar_type_rank_greater_than_vector_type; return true; + } scalarCast = CK_FloatingCast; } else if (scalarTy->isIntegralType(S.Context)) @@ -8341,10 +8351,12 @@ QualType Sema::CheckVectorOperands(ExprResult &LHS, Ex // If there's a vector type and a scalar, try to convert the scalar to // the vector element type and splat. + unsigned DiagID = diag::err_typecheck_vector_not_convertable; if (!RHSVecType) { if (isa(LHSVecType)) { if (!tryVectorConvertAndSplat(*this, &RHS, RHSType, - LHSVecType->getElementType(), LHSType)) + LHSVecType->getElementType(), LHSType, + DiagID)) return LHSType; } else { if (!tryGCCVectorConvertAndSplat(*this, &RHS, &LHS)) @@ -8355,7 +8367,7 @@ QualType Sema::CheckVectorOperands(ExprResult &LHS, Ex if (isa(RHSVecType)) { if (!tryVectorConvertAndSplat(*this, (IsCompAssign ? nullptr : &LHS), LHSType, RHSVecType->getElementType(), - RHSType)) + RHSType, DiagID)) return RHSType; } else { if (LHS.get()->getValueKind() == VK_LValue || @@ -8431,7 +8443,7 @@ QualType Sema::CheckVectorOperands(ExprResult &LHS, Ex } // Otherwise, use the generic diagnostic. - Diag(Loc, diag::err_typecheck_vector_not_convertable) + Diag(Loc, DiagID) << LHSType << RHSType << LHS.get()->getSourceRange() << RHS.get()->getSourceRange(); return QualType(); Modified: vendor/clang/dist/lib/Sema/SemaOpenMP.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaOpenMP.cpp Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/Sema/SemaOpenMP.cpp Tue May 30 17:37:44 2017 (r319233) @@ -5929,16 +5929,17 @@ StmtResult Sema::ActOnOpenMPTargetParallelForDirective B, DSAStack->isCancelRegion()); } -/// \brief Check for existence of a map clause in the list of clauses. -static bool HasMapClause(ArrayRef Clauses) { - for (ArrayRef::iterator I = Clauses.begin(), E = Clauses.end(); - I != E; ++I) { - if (*I != nullptr && (*I)->getClauseKind() == OMPC_map) { - return true; - } - } +/// Check for existence of a map clause in the list of clauses. +static bool hasClauses(ArrayRef Clauses, + const OpenMPClauseKind K) { + return llvm::any_of( + Clauses, [K](const OMPClause *C) { return C->getClauseKind() == K; }); +} - return false; +template +static bool hasClauses(ArrayRef Clauses, const OpenMPClauseKind K, + const Params... ClauseTypes) { + return hasClauses(Clauses, K) || hasClauses(Clauses, ClauseTypes...); } StmtResult Sema::ActOnOpenMPTargetDataDirective(ArrayRef Clauses, @@ -5952,8 +5953,9 @@ StmtResult Sema::ActOnOpenMPTargetDataDirective(ArrayR // OpenMP [2.10.1, Restrictions, p. 97] // At least one map clause must appear on the directive. - if (!HasMapClause(Clauses)) { - Diag(StartLoc, diag::err_omp_no_map_for_directive) + if (!hasClauses(Clauses, OMPC_map, OMPC_use_device_ptr)) { + Diag(StartLoc, diag::err_omp_no_clause_for_directive) + << "'map' or 'use_device_ptr'" << getOpenMPDirectiveName(OMPD_target_data); return StmtError(); } @@ -5970,9 +5972,9 @@ Sema::ActOnOpenMPTargetEnterDataDirective(ArrayRef Clauses, SourceLocation StartLoc, SourceLocation EndLoc) { - bool seenMotionClause = false; - for (auto *C : Clauses) { - if (C->getClauseKind() == OMPC_to || C->getClauseKind() == OMPC_from) - seenMotionClause = true; - } - if (!seenMotionClause) { + if (!hasClauses(Clauses, OMPC_to, OMPC_from)) { Diag(StartLoc, diag::err_omp_at_least_one_motion_clause_required); return StmtError(); } Modified: vendor/clang/dist/lib/Serialization/ASTReader.cpp ============================================================================== --- vendor/clang/dist/lib/Serialization/ASTReader.cpp Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/Serialization/ASTReader.cpp Tue May 30 17:37:44 2017 (r319233) @@ -2925,6 +2925,21 @@ ASTReader::ReadASTBlock(ModuleFile &F, unsigned Client } break; + case PP_CONDITIONAL_STACK: + if (!Record.empty()) { + SmallVector ConditionalStack; + for (unsigned Idx = 0, N = Record.size() - 1; Idx < N; /* in loop */) { + auto Loc = ReadSourceLocation(F, Record, Idx); + bool WasSkipping = Record[Idx++]; + bool FoundNonSkip = Record[Idx++]; + bool FoundElse = Record[Idx++]; + ConditionalStack.push_back( + {Loc, WasSkipping, FoundNonSkip, FoundElse}); + } + PP.setReplayablePreambleConditionalStack(ConditionalStack); + } + break; + case PP_COUNTER_VALUE: if (!Record.empty() && Listener) Listener->ReadCounter(F, Record[0]); Modified: vendor/clang/dist/lib/Serialization/ASTWriter.cpp ============================================================================== --- vendor/clang/dist/lib/Serialization/ASTWriter.cpp Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/Serialization/ASTWriter.cpp Tue May 30 17:37:44 2017 (r319233) @@ -1093,6 +1093,7 @@ void ASTWriter::WriteBlockInfoBlock() { RECORD(UNUSED_LOCAL_TYPEDEF_NAME_CANDIDATES); RECORD(DELETE_EXPRS_TO_ANALYZE); RECORD(CUDA_PRAGMA_FORCE_HOST_DEVICE_DEPTH); + RECORD(PP_CONDITIONAL_STACK); // SourceManager Block. BLOCK(SOURCE_MANAGER_BLOCK); @@ -2300,6 +2301,18 @@ void ASTWriter::WritePreprocessor(const Preprocessor & if (PP.getCounterValue() != 0) { RecordData::value_type Record[] = {PP.getCounterValue()}; Stream.EmitRecord(PP_COUNTER_VALUE, Record); + } + + if (PP.isRecordingPreamble() && PP.hasRecordedPreamble()) { + assert(!IsModule); + for (const auto &Cond : PP.getPreambleConditionalStack()) { + AddSourceLocation(Cond.IfLoc, Record); + Record.push_back(Cond.WasSkipping); + Record.push_back(Cond.FoundNonSkip); + Record.push_back(Cond.FoundElse); + } + Stream.EmitRecord(PP_CONDITIONAL_STACK, Record); + Record.clear(); } // Enter the preprocessor block. Modified: vendor/clang/dist/lib/StaticAnalyzer/Checkers/CMakeLists.txt ============================================================================== --- vendor/clang/dist/lib/StaticAnalyzer/Checkers/CMakeLists.txt Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/StaticAnalyzer/Checkers/CMakeLists.txt Tue May 30 17:37:44 2017 (r319233) @@ -39,7 +39,7 @@ add_clang_library(clangStaticAnalyzerCheckers GenericTaintChecker.cpp GTestChecker.cpp IdenticalExprChecker.cpp - IteratorPastEndChecker.cpp + IteratorChecker.cpp IvarInvalidationChecker.cpp LLVMConventionsChecker.cpp LocalizationChecker.cpp Modified: vendor/clang/dist/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp ============================================================================== --- vendor/clang/dist/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp Tue May 30 17:37:40 2017 (r319232) +++ vendor/clang/dist/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp Tue May 30 17:37:44 2017 (r319233) @@ -65,22 +65,9 @@ class GenericTaintChecker : public Checker< check::Pos /// and thus, is tainted. static bool isStdin(const Expr *E, CheckerContext &C); - /// This is called from getPointedToSymbol() to resolve symbol references for - /// the region underlying a LazyCompoundVal. This is the default binding - /// for the LCV, which could be a conjured symbol from a function call that *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Tue May 30 17:37:56 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 0E3DCB94B59; Tue, 30 May 2017 17:37:56 +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 B2532716D4; Tue, 30 May 2017 17:37:55 +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 v4UHbsuE045893; Tue, 30 May 2017 17:37:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UHbsgf045892; Tue, 30 May 2017 17:37:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705301737.v4UHbsgf045892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 May 2017 17:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319235 - vendor/compiler-rt/compiler-rt-trunk-r304222 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:37:56 -0000 Author: dim Date: Tue May 30 17:37:54 2017 New Revision: 319235 URL: https://svnweb.freebsd.org/changeset/base/319235 Log: Tag compiler-rt trunk r304222. Added: vendor/compiler-rt/compiler-rt-trunk-r304222/ - copied from r319234, vendor/compiler-rt/dist/ From owner-svn-src-vendor@freebsd.org Tue May 30 17:38:00 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 83891B94B82; Tue, 30 May 2017 17:38:00 +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 605C071738; Tue, 30 May 2017 17:38:00 +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 v4UHbxx9045952; Tue, 30 May 2017 17:37:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UHbxYP045948; Tue, 30 May 2017 17:37:59 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705301737.v4UHbxYP045948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 May 2017 17:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319236 - in vendor/libc++/dist: include include/experimental test/std/experimental/language.support/support.coroutines test/std/experimental/language.support/support.coroutines/corouti... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:38:00 -0000 Author: dim Date: Tue May 30 17:37:59 2017 New Revision: 319236 URL: https://svnweb.freebsd.org/changeset/base/319236 Log: Vendor import of libc++ trunk r304222: https://llvm.org/svn/llvm-project/libcxx/trunk@304222 Added: vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/lit.local.cfg Modified: vendor/libc++/dist/include/experimental/coroutine vendor/libc++/dist/include/module.modulemap Modified: vendor/libc++/dist/include/experimental/coroutine ============================================================================== --- vendor/libc++/dist/include/experimental/coroutine Tue May 30 17:37:54 2017 (r319235) +++ vendor/libc++/dist/include/experimental/coroutine Tue May 30 17:37:59 2017 (r319236) @@ -145,6 +145,19 @@ class _LIBCPP_TEMPLATE_VIS coroutine_handle { (p return __tmp; } + // FIXME: Should from_address(nullptr) be allowed? + _LIBCPP_ALWAYS_INLINE + static coroutine_handle from_address(nullptr_t) _NOEXCEPT { + return coroutine_handle(nullptr); + } + + template + static coroutine_handle from_address(_Tp*) { + static_assert(_CallIsValid, + "coroutine_handle::from_address cannot be called with " + "non-void pointers"); + } + private: bool __is_suspended() const _NOEXCEPT { // FIXME actually implement a check for if the coro is suspended. @@ -218,11 +231,22 @@ class _LIBCPP_TEMPLATE_VIS coroutine_handle : public c // FIXME: should from_address work with nullptr? _LIBCPP_ALWAYS_INLINE static coroutine_handle from_address(nullptr_t) _NOEXCEPT { - return {}; + return coroutine_handle(nullptr); } - // from_address cannot be used with the coroutines promise type. - static coroutine_handle from_address(_Promise*) = delete; + template + static coroutine_handle from_address(_Tp*) { + static_assert(_CallIsValid, + "coroutine_handle::from_address cannot be called with " + "non-void pointers"); + } + + template + static coroutine_handle from_address(_Promise*) { + static_assert(_CallIsValid, + "coroutine_handle::from_address cannot be used with " + "pointers to the coroutine's promise type; use 'from_promise' instead"); + } _LIBCPP_ALWAYS_INLINE static coroutine_handle from_promise(_Promise& __promise) _NOEXCEPT { Modified: vendor/libc++/dist/include/module.modulemap ============================================================================== --- vendor/libc++/dist/include/module.modulemap Tue May 30 17:37:54 2017 (r319235) +++ vendor/libc++/dist/include/module.modulemap Tue May 30 17:37:59 2017 (r319236) @@ -502,6 +502,7 @@ module std [system] { export * } module coroutine { + requires coroutines header "experimental/coroutine" export * } Added: vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp Tue May 30 17:37:59 2017 (r319236) @@ -0,0 +1,46 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 +// + +// template +// struct coroutine_handle; + +// static coroutine_handle from_address(void*) noexcept + +// Test that `from_address` is explicitly ill-formed when called with a typed +// pointer. The user cannot possibly have a typed pointer to the coroutine. +// FIXME: This behavior is an extension, and should upstreamed into the TS or +// the test removed if the TS changes are rejected. + +#include +#include +#include + +namespace coro = std::experimental; + +int main() +{ + { + using H = coro::coroutine_handle<>; + // expected-error@experimental/coroutine:* 3 {{coroutine_handle::from_address cannot be called with non-void pointers}} + H::from_address((int*)nullptr); // expected-note {{requested here}} + H::from_address((const void*)nullptr); // expected-note {{requested here}} + H::from_address((const char*)nullptr); // expected-note {{requested here}} + } + { + using H = coro::coroutine_handle; + // expected-error@experimental/coroutine:* 1 {{static_assert failed "coroutine_handle::from_address cannot be used with pointers to the coroutine's promise type; use 'from_promise' instead"}} + H::from_address((const char*)nullptr); // expected-note {{requested here}} + // expected-error@experimental/coroutine:* 1 {{coroutine_handle::from_address cannot be called with non-void pointers}} + H::from_address((int*)nullptr); // expected-note {{requested here}} + } +} Added: vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/lit.local.cfg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/lit.local.cfg Tue May 30 17:37:59 2017 (r319236) @@ -0,0 +1,9 @@ +# If the compiler doesn't support coroutines mark all of the tests under +# this directory as unsupported. Otherwise add the required `-fcoroutines-ts` +# flag. +if 'fcoroutines-ts' not in config.available_features: + config.unsupported = True +else: + import copy + config.test_format.cxx = copy.deepcopy(config.test_format.cxx) + config.test_format.cxx.compile_flags += ['-fcoroutines-ts'] From owner-svn-src-vendor@freebsd.org Tue May 30 17:37:53 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 11F72B94B37; Tue, 30 May 2017 17:37:53 +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 B9A5971684; Tue, 30 May 2017 17:37:52 +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 v4UHbpJW045845; Tue, 30 May 2017 17:37:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UHbpYD045844; Tue, 30 May 2017 17:37:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705301737.v4UHbpYD045844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 May 2017 17:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319234 - vendor/clang/clang-trunk-r304222 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:37:53 -0000 Author: dim Date: Tue May 30 17:37:51 2017 New Revision: 319234 URL: https://svnweb.freebsd.org/changeset/base/319234 Log: Tag clang trunk r304222. Added: vendor/clang/clang-trunk-r304222/ - copied from r319233, vendor/clang/dist/ From owner-svn-src-vendor@freebsd.org Tue May 30 17:38: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 8932DB94C20; Tue, 30 May 2017 17:38: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 55265718C3; Tue, 30 May 2017 17:38: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 v4UHcCMq046176; Tue, 30 May 2017 17:38:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UHcCe5046175; Tue, 30 May 2017 17:38:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705301738.v4UHcCe5046175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 May 2017 17:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319240 - vendor/lldb/dist/include/lldb/Utility X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:38:13 -0000 Author: dim Date: Tue May 30 17:38:12 2017 New Revision: 319240 URL: https://svnweb.freebsd.org/changeset/base/319240 Log: Vendor import of lldb trunk r304222: https://llvm.org/svn/llvm-project/lldb/trunk@304222 Modified: vendor/lldb/dist/include/lldb/Utility/Log.h Modified: vendor/lldb/dist/include/lldb/Utility/Log.h ============================================================================== --- vendor/lldb/dist/include/lldb/Utility/Log.h Tue May 30 17:38:08 2017 (r319239) +++ vendor/lldb/dist/include/lldb/Utility/Log.h Tue May 30 17:38:12 2017 (r319240) @@ -18,6 +18,7 @@ #include "llvm/ADT/StringMap.h" // for StringMap #include "llvm/ADT/StringRef.h" // for StringRef, StringLiteral #include "llvm/Support/FormatVariadic.h" +#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/RWMutex.h" #include @@ -29,9 +30,6 @@ namespace llvm { class raw_ostream; -} -namespace llvm { -template class ManagedStatic; } //---------------------------------------------------------------------- // Logging Options From owner-svn-src-vendor@freebsd.org Tue May 30 17:38:07 2017 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B956B94BC6; Tue, 30 May 2017 17:38:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D75CC717FC; Tue, 30 May 2017 17:38:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UHc5PU046072; Tue, 30 May 2017 17:38:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UHc4Hl046059; Tue, 30 May 2017 17:38:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705301738.v4UHc4Hl046059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 May 2017 17:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319238 - in vendor/lld/dist: ELF test/ELF/linkerscript X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:38:07 -0000 Author: dim Date: Tue May 30 17:38:04 2017 New Revision: 319238 URL: https://svnweb.freebsd.org/changeset/base/319238 Log: Vendor import of lld trunk r304222: https://llvm.org/svn/llvm-project/lld/trunk@304222 Added: vendor/lld/dist/test/ELF/linkerscript/bss-fill.s (contents, props changed) Modified: vendor/lld/dist/ELF/LinkerScript.cpp vendor/lld/dist/ELF/LinkerScript.h vendor/lld/dist/ELF/MapFile.cpp vendor/lld/dist/ELF/MapFile.h vendor/lld/dist/ELF/OutputSections.cpp vendor/lld/dist/ELF/ScriptParser.cpp vendor/lld/dist/ELF/Writer.cpp vendor/lld/dist/test/ELF/linkerscript/align.s vendor/lld/dist/test/ELF/linkerscript/merge-sections.s vendor/lld/dist/test/ELF/linkerscript/symbol-reserved.s Modified: vendor/lld/dist/ELF/LinkerScript.cpp ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.cpp Tue May 30 17:38:02 2017 (r319237) +++ vendor/lld/dist/ELF/LinkerScript.cpp Tue May 30 17:38:04 2017 (r319238) @@ -52,11 +52,12 @@ LinkerScript *elf::Script; uint64_t ExprValue::getValue() const { if (Sec) { if (Sec->getOutputSection()) - return Sec->getOffset(Val) + Sec->getOutputSection()->Addr; + return alignTo(Sec->getOffset(Val) + Sec->getOutputSection()->Addr, + Alignment); error("unable to evaluate expression: input section " + Sec->Name + " has no output section assigned"); } - return Val; + return alignTo(Val, Alignment); } uint64_t ExprValue::getSecAddr() const { @@ -143,7 +144,7 @@ void LinkerScript::assignSymbol(SymbolAssignment *Cmd, } else { Sym->Section = V.Sec; if (Sym->Section->Flags & SHF_ALLOC) - Sym->Value = V.Val; + Sym->Value = alignTo(V.Val, V.Alignment); else Sym->Value = V.getValue(); } @@ -290,6 +291,9 @@ LinkerScript::computeInputSections(const InputSectionD size_t SizeBefore = Ret.size(); for (InputSectionBase *Sec : InputSections) { + if (!isa(Sec)) + continue; + if (Sec->Assigned) continue; @@ -1075,6 +1079,9 @@ template void OutputSectionCommand::write Sec->CompressedData.size()); return; } + + if (Sec->Type == SHT_NOBITS) + return; // Write leading padding. ArrayRef Sections = Sec->Sections; Modified: vendor/lld/dist/ELF/LinkerScript.h ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.h Tue May 30 17:38:02 2017 (r319237) +++ vendor/lld/dist/ELF/LinkerScript.h Tue May 30 17:38:04 2017 (r319238) @@ -41,7 +41,12 @@ struct ExprValue { SectionBase *Sec; uint64_t Val; bool ForceAbsolute; + uint64_t Alignment = 1; + ExprValue(SectionBase *Sec, bool ForceAbsolute, uint64_t Val, + uint64_t Alignment) + : Sec(Sec), Val(Val), ForceAbsolute(ForceAbsolute), Alignment(Alignment) { + } ExprValue(SectionBase *Sec, bool ForceAbsolute, uint64_t Val) : Sec(Sec), Val(Val), ForceAbsolute(ForceAbsolute) {} ExprValue(SectionBase *Sec, uint64_t Val) : ExprValue(Sec, false, Val) {} Modified: vendor/lld/dist/ELF/MapFile.cpp ============================================================================== --- vendor/lld/dist/ELF/MapFile.cpp Tue May 30 17:38:02 2017 (r319237) +++ vendor/lld/dist/ELF/MapFile.cpp Tue May 30 17:38:04 2017 (r319238) @@ -100,7 +100,7 @@ getSymbolStrings(ArrayRef Syms) { } template -void elf::writeMapFile(llvm::ArrayRef Script) { +void elf::writeMapFile(llvm::ArrayRef Script) { if (Config->MapFile.empty()) return; @@ -123,10 +123,7 @@ void elf::writeMapFile(llvm::ArrayRef S << " Align Out In Symbol\n"; // Print out file contents. - for (BaseCommand *Base : Script) { - auto *Cmd = dyn_cast(Base); - if (!Cmd) - continue; + for (OutputSectionCommand *Cmd : Script) { OutputSection *OSec = Cmd->Sec; writeHeader(OS, OSec->Addr, OSec->Size, OSec->Alignment); OS << OSec->Name << '\n'; @@ -147,7 +144,7 @@ void elf::writeMapFile(llvm::ArrayRef S } } -template void elf::writeMapFile(ArrayRef); -template void elf::writeMapFile(ArrayRef); -template void elf::writeMapFile(ArrayRef); -template void elf::writeMapFile(ArrayRef); +template void elf::writeMapFile(ArrayRef); +template void elf::writeMapFile(ArrayRef); +template void elf::writeMapFile(ArrayRef); +template void elf::writeMapFile(ArrayRef); Modified: vendor/lld/dist/ELF/MapFile.h ============================================================================== --- vendor/lld/dist/ELF/MapFile.h Tue May 30 17:38:02 2017 (r319237) +++ vendor/lld/dist/ELF/MapFile.h Tue May 30 17:38:04 2017 (r319238) @@ -14,8 +14,9 @@ namespace lld { namespace elf { -struct BaseCommand; -template void writeMapFile(llvm::ArrayRef Script); +struct OutputSectionCommand; +template +void writeMapFile(llvm::ArrayRef Script); } } Modified: vendor/lld/dist/ELF/OutputSections.cpp ============================================================================== --- vendor/lld/dist/ELF/OutputSections.cpp Tue May 30 17:38:02 2017 (r319237) +++ vendor/lld/dist/ELF/OutputSections.cpp Tue May 30 17:38:04 2017 (r319238) @@ -117,7 +117,7 @@ template static void finalizeShtGroup(Out // the symbol table. Sec->Link = InX::SymTab->OutSec->SectionIndex; - // sh_link then contain index of an entry in symbol table section which + // sh_info then contain index of an entry in symbol table section which // provides signature of the section group. elf::ObjectFile *Obj = Sec->Sections[0]->getFile(); assert(Config->Relocatable && Sec->Sections.size() == 1); Modified: vendor/lld/dist/ELF/ScriptParser.cpp ============================================================================== --- vendor/lld/dist/ELF/ScriptParser.cpp Tue May 30 17:38:02 2017 (r319237) +++ vendor/lld/dist/ELF/ScriptParser.cpp Tue May 30 17:38:04 2017 (r319238) @@ -859,7 +859,11 @@ Expr ScriptParser::readPrimary() { expect(","); Expr E2 = readExpr(); expect(")"); - return [=] { return alignTo(E().getValue(), E2().getValue()); }; + return [=] { + ExprValue V = E(); + V.Alignment = E2().getValue(); + return V; + }; } if (Tok == "ALIGNOF") { StringRef Name = readParenLiteral(); Modified: vendor/lld/dist/ELF/Writer.cpp ============================================================================== --- vendor/lld/dist/ELF/Writer.cpp Tue May 30 17:38:02 2017 (r319237) +++ vendor/lld/dist/ELF/Writer.cpp Tue May 30 17:38:04 2017 (r319238) @@ -74,6 +74,7 @@ template class Writer { (private) std::unique_ptr Buffer; std::vector OutputSections; + std::vector OutputSectionCommands; OutputSectionFactory Factory{OutputSections}; void addRelIpltSymbols(); @@ -262,6 +263,10 @@ template void Writer::run() { Script->fabricateDefaultCommands(); } + for (BaseCommand *Base : Script->Opt.Commands) + if (auto *Cmd = dyn_cast(Base)) + OutputSectionCommands.push_back(Cmd); + // If -compressed-debug-sections is specified, we need to compress // .debug_* sections. Do it right now because it changes the size of // output sections. @@ -311,7 +316,7 @@ template void Writer::run() { // Handle -Map option. - writeMapFile(Script->Opt.Commands); + writeMapFile(OutputSectionCommands); if (ErrorCount) return; @@ -1201,8 +1206,6 @@ template void Writer::finalizeSecti if (ErrorCount) return; - // So far we have added sections from input object files. - // This function adds linker-created Out::* sections. addPredefinedSections(); removeUnusedSyntheticSections(OutputSections); @@ -1270,8 +1273,20 @@ template void Writer::addPredefined // ARM ABI requires .ARM.exidx to be terminated by some piece of data. // We have the terminater synthetic section class. Add that at the end. auto *OS = dyn_cast_or_null(findSection(".ARM.exidx")); - if (OS && !OS->Sections.empty() && !Config->Relocatable) - OS->addSection(make()); + if (!OS || OS->Sections.empty() || Config->Relocatable) + return; + + auto *Sentinel = make(); + OS->addSection(Sentinel); + // If there are linker script commands existing at this point then add the + // sentinel to the last of these too. + if (OutputSectionCommand *C = Script->getCmd(OS)) { + auto ISD = std::find_if(C->Commands.rbegin(), C->Commands.rend(), + [](const BaseCommand *Base) { + return isa(Base); + }); + cast(*ISD)->Sections.push_back(Sentinel); + } } // The linker is expected to define SECNAME_start and SECNAME_end @@ -1315,10 +1330,9 @@ void Writer::addStartStopSymbols(OutputSection * template OutputSectionCommand *Writer::findSectionCommand(StringRef Name) { - for (BaseCommand *Base : Script->Opt.Commands) - if (auto *Cmd = dyn_cast(Base)) - if (Cmd->Name == Name) - return Cmd; + for (OutputSectionCommand *Cmd : OutputSectionCommands) + if (Cmd->Name == Name) + return Cmd; return nullptr; } @@ -1713,7 +1727,7 @@ template void Writer::writeHeader() EHdr->e_ehsize = sizeof(Elf_Ehdr); EHdr->e_phnum = Phdrs.size(); EHdr->e_shentsize = sizeof(Elf_Shdr); - EHdr->e_shnum = OutputSections.size() + 1; + EHdr->e_shnum = OutputSectionCommands.size() + 1; EHdr->e_shstrndx = InX::ShStrTab->OutSec->SectionIndex; if (Config->EMachine == EM_ARM) @@ -1745,8 +1759,8 @@ template void Writer::writeHeader() // Write the section header table. Note that the first table entry is null. auto *SHdrs = reinterpret_cast(Buf + EHdr->e_shoff); - for (OutputSection *Sec : OutputSections) - Sec->writeHeaderTo(++SHdrs); + for (OutputSectionCommand *Cmd : OutputSectionCommands) + Cmd->Sec->writeHeaderTo(++SHdrs); } // Open a result file. @@ -1769,10 +1783,7 @@ template void Writer::openFile() { template void Writer::writeSectionsBinary() { uint8_t *Buf = Buffer->getBufferStart(); - for (BaseCommand *Base : Script->Opt.Commands) { - auto *Cmd = dyn_cast(Base); - if (!Cmd) - continue; + for (OutputSectionCommand *Cmd : OutputSectionCommands) { OutputSection *Sec = Cmd->Sec; if (Sec->Flags & SHF_ALLOC) Cmd->writeTo(Buf + Sec->Offset); @@ -1799,19 +1810,13 @@ template void Writer::writeSections // In -r or -emit-relocs mode, write the relocation sections first as in // ELf_Rel targets we might find out that we need to modify the relocated // section while doing it. - for (BaseCommand *Base : Script->Opt.Commands) { - auto *Cmd = dyn_cast(Base); - if (!Cmd) - continue; + for (OutputSectionCommand *Cmd : OutputSectionCommands) { OutputSection *Sec = Cmd->Sec; if (Sec->Type == SHT_REL || Sec->Type == SHT_RELA) Cmd->writeTo(Buf + Sec->Offset); } - for (BaseCommand *Base : Script->Opt.Commands) { - auto *Cmd = dyn_cast(Base); - if (!Cmd) - continue; + for (OutputSectionCommand *Cmd : OutputSectionCommands) { OutputSection *Sec = Cmd->Sec; if (Sec != Out::Opd && Sec != EhFrameHdr && Sec->Type != SHT_REL && Sec->Type != SHT_RELA) Modified: vendor/lld/dist/test/ELF/linkerscript/align.s ============================================================================== --- vendor/lld/dist/test/ELF/linkerscript/align.s Tue May 30 17:38:02 2017 (r319237) +++ vendor/lld/dist/test/ELF/linkerscript/align.s Tue May 30 17:38:04 2017 (r319238) @@ -64,7 +64,7 @@ # SYMBOLS-NEXT: 0000000000010000 *ABS* 00000000 __code_base__ # SYMBOLS-NEXT: 0000000000001000 *ABS* 00000000 VAR # SYMBOLS-NEXT: 0000000000011000 .bbb 00000000 __start_bbb -# SYMBOLS-NEXT: 0000000000012000 *ABS* 00000000 __end_bbb +# SYMBOLS-NEXT: 0000000000012000 .bbb 00000000 __end_bbb .global _start _start: Added: vendor/lld/dist/test/ELF/linkerscript/bss-fill.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/test/ELF/linkerscript/bss-fill.s Tue May 30 17:38:04 2017 (r319238) @@ -0,0 +1,7 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o +# RUN: echo "SECTIONS { .bss : { . += 0x10000; *(.bss) } =0xFF };" > %t.script +# RUN: ld.lld -o %t --script %t.script %t.o + +.section .bss,"",@nobits +.short 0 Modified: vendor/lld/dist/test/ELF/linkerscript/merge-sections.s ============================================================================== --- vendor/lld/dist/test/ELF/linkerscript/merge-sections.s Tue May 30 17:38:02 2017 (r319237) +++ vendor/lld/dist/test/ELF/linkerscript/merge-sections.s Tue May 30 17:38:04 2017 (r319238) @@ -31,6 +31,16 @@ # 0x19E = begin + sizeof(.foo) = 0x190 + 0xE # CHECK-NEXT: Value: 0x19E +# Check that we don't crash with --gc-sections +# RUN: ld.lld --gc-sections -o %t2 --script %t.script %t -shared +# RUN: llvm-readobj -s -t %t2 | FileCheck %s --check-prefix=GC + +# GC: Name: .foo +# GC-NEXT: Type: SHT_PROGBITS +# GC-NEXT: Flags [ +# GC-NEXT: SHF_ALLOC +# GC-NEXT: ] + .section .foo.1a,"aMS",@progbits,1 .asciz "foo" Modified: vendor/lld/dist/test/ELF/linkerscript/symbol-reserved.s ============================================================================== --- vendor/lld/dist/test/ELF/linkerscript/symbol-reserved.s Tue May 30 17:38:02 2017 (r319237) +++ vendor/lld/dist/test/ELF/linkerscript/symbol-reserved.s Tue May 30 17:38:04 2017 (r319238) @@ -11,6 +11,12 @@ # SHARED: 0000000000000005 .dynsym 00000000 .hidden newsym +# RUN: echo "PROVIDE_HIDDEN(newsym = ALIGN(__ehdr_start, CONSTANT(MAXPAGESIZE)) + 5);" > %t.script +# RUN: ld.lld -o %t1 %t.script %t +# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=ALIGNED %s + +# ALIGNED: 0000000000200005 .text 00000000 .hidden newsym + .global _start _start: lea newsym(%rip),%rax From owner-svn-src-vendor@freebsd.org Tue May 30 17:38:09 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 DA55EB94BF0; Tue, 30 May 2017 17:38:09 +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 8DBD97184C; Tue, 30 May 2017 17:38:09 +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 v4UHc8HV046123; Tue, 30 May 2017 17:38:08 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UHc88t046122; Tue, 30 May 2017 17:38:08 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705301738.v4UHc88t046122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 May 2017 17:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319239 - vendor/lld/lld-trunk-r304222 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:38:10 -0000 Author: dim Date: Tue May 30 17:38:08 2017 New Revision: 319239 URL: https://svnweb.freebsd.org/changeset/base/319239 Log: Tag lld trunk r304222. Added: vendor/lld/lld-trunk-r304222/ - copied from r319238, vendor/lld/dist/ From owner-svn-src-vendor@freebsd.org Tue May 30 17:38:03 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 705B2B94B93; Tue, 30 May 2017 17:38:03 +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 2697971783; Tue, 30 May 2017 17:38:03 +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 v4UHc2nP046011; Tue, 30 May 2017 17:38:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UHc2l5046010; Tue, 30 May 2017 17:38:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705301738.v4UHc2l5046010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 May 2017 17:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319237 - vendor/libc++/libc++-trunk-r304222 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:38:03 -0000 Author: dim Date: Tue May 30 17:38:02 2017 New Revision: 319237 URL: https://svnweb.freebsd.org/changeset/base/319237 Log: Tag libc++ trunk r304222. Added: vendor/libc++/libc++-trunk-r304222/ - copied from r319236, vendor/libc++/dist/ From owner-svn-src-vendor@freebsd.org Tue May 30 17:38:16 2017 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A959AB94C4B; Tue, 30 May 2017 17:38:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C22B7191D; Tue, 30 May 2017 17:38:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UHcFG5046228; Tue, 30 May 2017 17:38:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UHcFrD046227; Tue, 30 May 2017 17:38:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705301738.v4UHcFrD046227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 30 May 2017 17:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319241 - vendor/lldb/lldb-trunk-r304222 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 17:38:16 -0000 Author: dim Date: Tue May 30 17:38:15 2017 New Revision: 319241 URL: https://svnweb.freebsd.org/changeset/base/319241 Log: Tag lldb trunk r304222. Added: vendor/lldb/lldb-trunk-r304222/ - copied from r319240, vendor/lldb/dist/ From owner-svn-src-vendor@freebsd.org Wed May 31 19:27:44 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 1607CB87946; Wed, 31 May 2017 19:27:44 +0000 (UTC) (envelope-from jkim@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 A5F46654F6; Wed, 31 May 2017 19:27:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VJRgt7002005; Wed, 31 May 2017 19:27:42 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VJRbaw001951; Wed, 31 May 2017 19:27:37 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201705311927.v4VJRbaw001951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 31 May 2017 19:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319352 - in vendor/byacc/dist: . package package/debian package/pkgsrc test/btyacc test/yacc X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 19:27:44 -0000 Author: jkim Date: Wed May 31 19:27:37 2017 New Revision: 319352 URL: https://svnweb.freebsd.org/changeset/base/319352 Log: Import byacc 20170430. Modified: vendor/byacc/dist/CHANGES vendor/byacc/dist/MANIFEST vendor/byacc/dist/VERSION vendor/byacc/dist/btyaccpar.c vendor/byacc/dist/btyaccpar.skel vendor/byacc/dist/config.guess vendor/byacc/dist/config.sub vendor/byacc/dist/defs.h vendor/byacc/dist/main.c vendor/byacc/dist/output.c vendor/byacc/dist/package/byacc.spec vendor/byacc/dist/package/debian/changelog vendor/byacc/dist/package/mingw-byacc.spec vendor/byacc/dist/package/pkgsrc/Makefile vendor/byacc/dist/test/btyacc/btyacc_calc1.tab.c vendor/byacc/dist/test/btyacc/btyacc_demo.tab.c vendor/byacc/dist/test/btyacc/btyacc_destroy1.tab.c vendor/byacc/dist/test/btyacc/btyacc_destroy2.tab.c vendor/byacc/dist/test/btyacc/btyacc_destroy3.tab.c vendor/byacc/dist/test/btyacc/calc.tab.c vendor/byacc/dist/test/btyacc/calc1.tab.c vendor/byacc/dist/test/btyacc/calc2.tab.c vendor/byacc/dist/test/btyacc/calc3.tab.c vendor/byacc/dist/test/btyacc/code_calc.code.c vendor/byacc/dist/test/btyacc/code_error.code.c vendor/byacc/dist/test/btyacc/empty.tab.c vendor/byacc/dist/test/btyacc/err_inherit3.tab.c vendor/byacc/dist/test/btyacc/err_inherit4.tab.c vendor/byacc/dist/test/btyacc/err_syntax10.tab.c vendor/byacc/dist/test/btyacc/err_syntax11.tab.c vendor/byacc/dist/test/btyacc/err_syntax12.tab.c vendor/byacc/dist/test/btyacc/err_syntax18.tab.c vendor/byacc/dist/test/btyacc/err_syntax20.tab.c vendor/byacc/dist/test/btyacc/error.tab.c vendor/byacc/dist/test/btyacc/expr.oxout.tab.c vendor/byacc/dist/test/btyacc/grammar.tab.c vendor/byacc/dist/test/btyacc/inherit0.tab.c vendor/byacc/dist/test/btyacc/inherit1.tab.c vendor/byacc/dist/test/btyacc/inherit2.tab.c vendor/byacc/dist/test/btyacc/ok_syntax1.tab.c vendor/byacc/dist/test/btyacc/pure_calc.tab.c vendor/byacc/dist/test/btyacc/pure_error.tab.c vendor/byacc/dist/test/btyacc/quote_calc-s.tab.c vendor/byacc/dist/test/btyacc/quote_calc.tab.c vendor/byacc/dist/test/btyacc/quote_calc2-s.tab.c vendor/byacc/dist/test/btyacc/quote_calc2.tab.c vendor/byacc/dist/test/btyacc/quote_calc3-s.tab.c vendor/byacc/dist/test/btyacc/quote_calc3.tab.c vendor/byacc/dist/test/btyacc/quote_calc4-s.tab.c vendor/byacc/dist/test/btyacc/quote_calc4.tab.c vendor/byacc/dist/test/btyacc/rename_debug.c vendor/byacc/dist/test/btyacc/varsyntax_calc1.tab.c vendor/byacc/dist/test/yacc/big_l.output vendor/byacc/dist/test/yacc/calc3.tab.c vendor/byacc/dist/test/yacc/ok_syntax1.tab.c vendor/byacc/dist/test/yacc/pure_calc.tab.c vendor/byacc/dist/test/yacc/pure_error.tab.c vendor/byacc/dist/yaccpar.c vendor/byacc/dist/yaccpar.skel Modified: vendor/byacc/dist/CHANGES ============================================================================== --- vendor/byacc/dist/CHANGES Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/CHANGES Wed May 31 19:27:37 2017 (r319352) @@ -1,3 +1,33 @@ +2017-04-30 Thomas E. Dickey + + * test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/expr.oxout.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, t est/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/rename_debug.c, btyaccpar.c, btyaccpar.skel: + fix another uninitialized variable warning in "make check_make" for btyacc + + * test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/calc3.tab.c, btyaccpar.c, btyaccpar.skel, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/calc3.tab.c, yaccpar.c, defs.h, yaccpar.skel, output.c: + fix some compiler warnings for "make check_make" by adding section init_vars, + which initializes the body_vars for pure-parser configuration. + +2017-04-30 Tom.Shields + + * output.c: + use YY_NO_LEAKS set in configure --with-no-leaks, in the generated code + +2017-04-30 Julien.Ramseier + + * main.c, test/yacc/big_l.output: + fix typo in unsupported-flag warning message + +2017-04-30 Thomas E. Dickey + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + +2017-03-18 Thomas E. Dickey + + * config.sub: 2017-02-07 + + * config.guess: 2017-03-05 + 2017-02-01 Thomas E. Dickey * test/btyacc/expr.oxout.error, test/btyacc/expr.oxout.output, test/btyacc/expr.oxout.tab.c, test/btyacc/expr.oxout.tab.h, test/yacc/expr.oxout.error, test/yacc/expr.oxout.output, test/yacc/expr.oxout.tab.c, test/yacc/expr.oxout.tab.h: Modified: vendor/byacc/dist/MANIFEST ============================================================================== --- vendor/byacc/dist/MANIFEST Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/MANIFEST Wed May 31 19:27:37 2017 (r319352) @@ -1,4 +1,4 @@ -MANIFEST for byacc-20170201, version t20170201 +MANIFEST for byacc-20170430, version t20170430 -------------------------------------------------------------------------------- MANIFEST this file ACKNOWLEDGEMENTS original version of byacc - 1993 Modified: vendor/byacc/dist/VERSION ============================================================================== --- vendor/byacc/dist/VERSION Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/VERSION Wed May 31 19:27:37 2017 (r319352) @@ -1 +1 @@ -20170201 +20170430 Modified: vendor/byacc/dist/btyaccpar.c ============================================================================== --- vendor/byacc/dist/btyaccpar.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/btyaccpar.c Wed May 31 19:27:37 2017 (r319352) @@ -2,7 +2,7 @@ * @Id: skel2c,v 1.4 2016/06/07 00:26:09 tom Exp @ */ -/* @Id: btyaccpar.skel,v 1.5 2016/12/02 22:02:28 tom Exp @ */ +/* @Id: btyaccpar.skel,v 1.6 2017/04/30 23:40:34 tom Exp @ */ #include "defs.h" @@ -449,6 +449,23 @@ const char *const body_2[] = " }", " if (yydebug)", " fprintf(stderr, \"%sdebug[<# of symbols on state stack>]\\n\", YYPREFIX);", + "#endif", + "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", + " memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range));", + "#endif", + "", + 0 +}; + +const char *const init_vars[] = +{ + " yyerrflag = 0;", + " yychar = 0;", + " memset(&yyval, 0, sizeof(yyval));", + " memset(&yylval, 0, sizeof(yylval));", + "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", + " memset(&yyloc, 0, sizeof(yyloc));", + " memset(&yylloc, 0, sizeof(yylloc));", "#endif", "", 0 Modified: vendor/byacc/dist/btyaccpar.skel ============================================================================== --- vendor/byacc/dist/btyaccpar.skel Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/btyaccpar.skel Wed May 31 19:27:37 2017 (r319352) @@ -1,4 +1,4 @@ -/* $Id: btyaccpar.skel,v 1.5 2016/12/02 22:02:28 tom Exp $ */ +/* $Id: btyaccpar.skel,v 1.7 2017/05/01 00:13:19 tom Exp $ */ #include "defs.h" @@ -384,6 +384,19 @@ YYPARSE_DECL() } if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); +#endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + +%% init_vars + yyerrflag = 0; + yychar = 0; + memset(&yyval, 0, sizeof(yyval)); + memset(&yylval, 0, sizeof(yylval)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(&yyloc, 0, sizeof(yyloc)); + memset(&yylloc, 0, sizeof(yylloc)); #endif %% body_3 Modified: vendor/byacc/dist/config.guess ============================================================================== --- vendor/byacc/dist/config.guess Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/config.guess Wed May 31 19:27:37 2017 (r319352) @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2017-01-01' +timestamp='2017-03-05' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -837,10 +837,11 @@ EOF UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -1342,6 +1343,9 @@ EOF exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + NSX-?:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux Modified: vendor/byacc/dist/config.sub ============================================================================== --- vendor/byacc/dist/config.sub Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/config.sub Wed May 31 19:27:37 2017 (r319352) @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2017-01-01' +timestamp='2017-02-07' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -947,6 +947,9 @@ case $basic_machine in ;; nsr-tandem) basic_machine=nsr-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki Modified: vendor/byacc/dist/defs.h ============================================================================== --- vendor/byacc/dist/defs.h Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/defs.h Wed May 31 19:27:37 2017 (r319352) @@ -1,4 +1,4 @@ -/* $Id: defs.h,v 1.56 2017/02/02 00:44:38 tom Exp $ */ +/* $Id: defs.h,v 1.57 2017/04/30 23:29:11 tom Exp $ */ #ifdef HAVE_CONFIG_H #include @@ -307,6 +307,7 @@ extern const char *const hdr_defs[]; extern const char *const hdr_vars[]; extern const char *const body_1[]; extern const char *const body_vars[]; +extern const char *const init_vars[]; extern const char *const body_2[]; extern const char *const body_3[]; extern const char *const trailer[]; Modified: vendor/byacc/dist/main.c ============================================================================== --- vendor/byacc/dist/main.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/main.c Wed May 31 19:27:37 2017 (r319352) @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.59 2017/02/02 00:44:38 tom Exp $ */ +/* $Id: main.c,v 1.60 2017/04/30 20:57:56 Julien.Ramseier Exp $ */ #include #ifndef _WIN32 @@ -266,7 +266,7 @@ setflag(int ch) #if defined(YYBTYACC) locations = 1; #else - unsupported_flag_warning("-B", "reconfigure with --enable-btyacc"); + unsupported_flag_warning("-L", "reconfigure with --enable-btyacc"); #endif break; Modified: vendor/byacc/dist/output.c ============================================================================== --- vendor/byacc/dist/output.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/output.c Wed May 31 19:27:37 2017 (r319352) @@ -1,4 +1,4 @@ -/* $Id: output.c,v 1.79 2016/12/02 20:42:38 tom Exp $ */ +/* $Id: output.c,v 1.81 2017/04/30 23:23:32 tom Exp $ */ #include "defs.h" @@ -1584,7 +1584,20 @@ output_pure_parser(FILE * fp) putc_code(fp, '\n'); } +#if defined(YY_NO_LEAKS) static void +output_no_leaks(FILE * fp) +{ + putc_code(fp, '\n'); + + if (fp == code_file) + ++outline; + fputs("#define YY_NO_LEAKS 1\n", fp); + putc_code(fp, '\n'); +} +#endif + +static void output_trailing_text(void) { int c, last; @@ -1985,6 +1998,9 @@ output(void) output_prefix(fp); output_pure_parser(fp); +#if defined(YY_NO_LEAKS) + output_no_leaks(fp); +#endif output_stored_text(fp); output_stype(fp); #if defined(YYBTYACC) @@ -2068,6 +2084,10 @@ output(void) write_section(code_file, body_vars); } write_section(code_file, body_2); + if (pure_parser) + { + write_section(code_file, init_vars); + } #if defined(YYBTYACC) if (initial_action) output_initial_action(); Modified: vendor/byacc/dist/package/byacc.spec ============================================================================== --- vendor/byacc/dist/package/byacc.spec Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/package/byacc.spec Wed May 31 19:27:37 2017 (r319352) @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20170201 +%define AppVersion 20170430 %define UseProgram yacc -# $XTermId: byacc.spec,v 1.33 2017/02/01 09:55:04 tom Exp $ +# $XTermId: byacc.spec,v 1.34 2017/04/30 20:55:15 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 Modified: vendor/byacc/dist/package/debian/changelog ============================================================================== --- vendor/byacc/dist/package/debian/changelog Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/package/debian/changelog Wed May 31 19:27:37 2017 (r319352) @@ -1,3 +1,9 @@ +byacc (20170430) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey Sun, 30 Apr 2017 16:55:15 -0400 + byacc (20170201) unstable; urgency=low * maintenance updates Modified: vendor/byacc/dist/package/mingw-byacc.spec ============================================================================== --- vendor/byacc/dist/package/mingw-byacc.spec Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/package/mingw-byacc.spec Wed May 31 19:27:37 2017 (r319352) @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20170201 +%define AppVersion 20170430 %define UseProgram yacc -# $XTermId: mingw-byacc.spec,v 1.15 2017/02/01 09:55:04 tom Exp $ +# $XTermId: mingw-byacc.spec,v 1.16 2017/04/30 20:55:15 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 Modified: vendor/byacc/dist/package/pkgsrc/Makefile ============================================================================== --- vendor/byacc/dist/package/pkgsrc/Makefile Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/package/pkgsrc/Makefile Wed May 31 19:27:37 2017 (r319352) @@ -1,7 +1,7 @@ # $NetBSD: Makefile,v 1.9 2008/07/24 17:13:00 tonnerre Exp $ # -DISTNAME= byacc-20170201 +DISTNAME= byacc-20170430 PKGREVISION= 1 CATEGORIES= devel MASTER_SITES= ftp://invisible-island.net/byacc/ Modified: vendor/byacc/dist/test/btyacc/btyacc_calc1.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/btyacc_calc1.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/btyacc_calc1.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -818,7 +818,19 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + yyerrflag = 0; + yychar = 0; + memset(&yyval, 0, sizeof(yyval)); + memset(&yylval, 0, sizeof(yylval)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(&yyloc, 0, sizeof(yyloc)); + memset(&yylloc, 0, sizeof(yylloc)); +#endif + #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; yyps->save = 0; @@ -1525,7 +1537,7 @@ case 28: yyval.vval = yystack.l_mark[-1].vval; } break; -#line 1529 "btyacc_calc1.tab.c" +#line 1541 "btyacc_calc1.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/btyacc_demo.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/btyacc_demo.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/btyacc_demo.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -1330,6 +1330,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -2103,7 +2106,7 @@ case 59: #line 197 "btyacc_demo.y" { yyval.code = yystack.l_mark[-1].code; } break; -#line 2107 "btyacc_demo.tab.c" +#line 2110 "btyacc_demo.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/btyacc_destroy1.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/btyacc_destroy1.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/btyacc_destroy1.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -662,6 +662,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1225,7 +1228,7 @@ case 9: #line 86 "btyacc_destroy1.y" { yyval.nlist = yystack.l_mark[-5].nlist; } break; -#line 1229 "btyacc_destroy1.tab.c" +#line 1232 "btyacc_destroy1.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/btyacc_destroy2.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/btyacc_destroy2.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/btyacc_destroy2.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -662,6 +662,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1225,7 +1228,7 @@ case 9: #line 86 "btyacc_destroy2.y" { yyval.nlist = yystack.l_mark[-5].nlist; } break; -#line 1229 "btyacc_destroy2.tab.c" +#line 1232 "btyacc_destroy2.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/btyacc_destroy3.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/btyacc_destroy3.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/btyacc_destroy3.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -662,6 +662,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1225,7 +1228,7 @@ case 9: #line 89 "btyacc_destroy3.y" { yyval.nlist = yystack.l_mark[-5].nlist; } break; -#line 1229 "btyacc_destroy3.tab.c" +#line 1232 "btyacc_destroy3.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/calc.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/calc.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/calc.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -657,6 +657,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1231,7 +1234,7 @@ case 18: #line 63 "calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1235 "calc.tab.c" +#line 1238 "calc.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/calc1.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/calc1.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/calc1.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -801,6 +801,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1478,7 +1481,7 @@ case 28: yyval.vval = yystack.l_mark[-1].vval; } break; -#line 1482 "calc1.tab.c" +#line 1485 "calc1.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/calc2.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/calc2.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/calc2.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -670,6 +670,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1244,7 +1247,7 @@ case 18: #line 70 "calc2.y" { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1248 "calc2.tab.c" +#line 1251 "calc2.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/calc3.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/calc3.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/calc3.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -675,7 +675,19 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + yyerrflag = 0; + yychar = 0; + memset(&yyval, 0, sizeof(yyval)); + memset(&yylval, 0, sizeof(yylval)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(&yyloc, 0, sizeof(yyloc)); + memset(&yylloc, 0, sizeof(yylloc)); +#endif + #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; yyps->save = 0; @@ -1249,7 +1261,7 @@ case 18: #line 73 "calc3.y" { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1253 "calc3.tab.c" +#line 1265 "calc3.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/code_calc.code.c ============================================================================== --- vendor/byacc/dist/test/btyacc/code_calc.code.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/code_calc.code.c Wed May 31 19:27:37 2017 (r319352) @@ -530,6 +530,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1104,7 +1107,7 @@ case 18: #line 67 "code_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1108 "code_calc.code.c" +#line 1111 "code_calc.code.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/code_error.code.c ============================================================================== --- vendor/byacc/dist/test/btyacc/code_error.code.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/code_error.code.c Wed May 31 19:27:37 2017 (r319352) @@ -500,6 +500,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: vendor/byacc/dist/test/btyacc/empty.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/empty.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/empty.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -519,6 +519,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: vendor/byacc/dist/test/btyacc/err_inherit3.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/err_inherit3.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/err_inherit3.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -619,6 +619,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1189,7 +1192,7 @@ case 13: #line 75 "err_inherit3.y" { yyval.nlist = yystack.l_mark[0].nlist; } break; -#line 1193 "err_inherit3.tab.c" +#line 1196 "err_inherit3.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/err_inherit4.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/err_inherit4.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/err_inherit4.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -617,6 +617,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1179,7 +1182,7 @@ case 11: #line 77 "err_inherit4.y" { yyval.nlist = yystack.l_mark[0].nlist; yyloc = yystack.p_mark[1]; } break; -#line 1183 "err_inherit4.tab.c" +#line 1186 "err_inherit4.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/err_syntax10.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax10.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/err_syntax10.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -518,6 +518,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: vendor/byacc/dist/test/btyacc/err_syntax11.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax11.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/err_syntax11.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -524,6 +524,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: vendor/byacc/dist/test/btyacc/err_syntax12.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax12.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/err_syntax12.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -530,6 +530,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: vendor/byacc/dist/test/btyacc/err_syntax18.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax18.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/err_syntax18.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -527,6 +527,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1045,7 +1048,7 @@ case 1: #line 9 "err_syntax18.y" { yyval = yystack.l_mark[1]; } break; -#line 1049 "err_syntax18.tab.c" +#line 1052 "err_syntax18.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/err_syntax20.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax20.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/err_syntax20.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -522,6 +522,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1040,7 +1043,7 @@ case 1: #line 12 "err_syntax20.y" { yystack.l_mark[-1].rechk = 3; } break; -#line 1044 "err_syntax20.tab.c" +#line 1047 "err_syntax20.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/error.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/error.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/error.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -523,6 +523,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: vendor/byacc/dist/test/btyacc/expr.oxout.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/expr.oxout.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/expr.oxout.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -1943,6 +1943,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -2515,7 +2518,7 @@ case 10: yyyGenIntNode(8,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); yyyAdjustINRC(8,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} break; -#line 2519 "expr.oxout.tab.c" +#line 2522 "expr.oxout.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/grammar.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/grammar.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/grammar.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -1496,6 +1496,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -2684,7 +2687,7 @@ case 114: yyval.declarator->func_def = FUNC_ANSI; } break; -#line 2688 "grammar.tab.c" +#line 2691 "grammar.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/inherit0.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/inherit0.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/inherit0.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -542,6 +542,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1100,7 +1103,7 @@ case 11: #line 43 "inherit0.y" { yyval = yystack.l_mark[0]; } break; -#line 1104 "inherit0.tab.c" +#line 1107 "inherit0.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/inherit1.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/inherit1.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/inherit1.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -563,6 +563,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1125,7 +1128,7 @@ case 11: #line 71 "inherit1.y" { yyval.nlist = yystack.l_mark[0].nlist; } break; -#line 1129 "inherit1.tab.c" +#line 1132 "inherit1.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/inherit2.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/inherit2.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/inherit2.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -618,6 +618,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1184,7 +1187,7 @@ case 12: #line 75 "inherit2.y" { yyval.nlist = yystack.l_mark[0].nlist; } break; -#line 1188 "inherit2.tab.c" +#line 1191 "inherit2.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/ok_syntax1.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/ok_syntax1.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/ok_syntax1.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -698,7 +698,19 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + yyerrflag = 0; + yychar = 0; + memset(&yyval, 0, sizeof(yyval)); + memset(&yylval, 0, sizeof(yylval)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(&yyloc, 0, sizeof(yyloc)); + memset(&yylloc, 0, sizeof(yylloc)); +#endif + #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; yyps->save = 0; @@ -1272,7 +1284,7 @@ case 18: #line 101 "ok_syntax1.y" { yyval.ival = (*base) * yystack.l_mark[-1].ival + yystack.l_mark[0].ival; } break; -#line 1276 "ok_syntax1.tab.c" +#line 1288 "ok_syntax1.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/pure_calc.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/pure_calc.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/pure_calc.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -671,7 +671,19 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + yyerrflag = 0; + yychar = 0; + memset(&yyval, 0, sizeof(yyval)); + memset(&yylval, 0, sizeof(yylval)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(&yyloc, 0, sizeof(yyloc)); + memset(&yylloc, 0, sizeof(yylloc)); +#endif + #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; yyps->save = 0; @@ -1245,7 +1257,7 @@ case 18: #line 69 "pure_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1249 "pure_calc.tab.c" +#line 1261 "pure_calc.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/pure_error.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/pure_error.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/pure_error.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -539,6 +539,18 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + + yyerrflag = 0; + yychar = 0; + memset(&yyval, 0, sizeof(yyval)); + memset(&yylval, 0, sizeof(yylval)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(&yyloc, 0, sizeof(yyloc)); + memset(&yylloc, 0, sizeof(yylloc)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; Modified: vendor/byacc/dist/test/btyacc/quote_calc-s.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/quote_calc-s.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/quote_calc-s.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -675,6 +675,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1249,7 +1252,7 @@ case 18: #line 70 "quote_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1253 "quote_calc-s.tab.c" +#line 1256 "quote_calc-s.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/quote_calc.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/quote_calc.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/quote_calc.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -681,6 +681,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1255,7 +1258,7 @@ case 18: #line 70 "quote_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1259 "quote_calc.tab.c" +#line 1262 "quote_calc.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/quote_calc2-s.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/quote_calc2-s.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/quote_calc2-s.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -675,6 +675,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1249,7 +1252,7 @@ case 18: #line 70 "quote_calc2.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1253 "quote_calc2-s.tab.c" +#line 1256 "quote_calc2-s.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/quote_calc2.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/quote_calc2.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/quote_calc2.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -681,6 +681,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1255,7 +1258,7 @@ case 18: #line 70 "quote_calc2.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1259 "quote_calc2.tab.c" +#line 1262 "quote_calc2.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/quote_calc3-s.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/quote_calc3-s.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/quote_calc3-s.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -676,6 +676,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1250,7 +1253,7 @@ case 18: #line 70 "quote_calc3.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1254 "quote_calc3-s.tab.c" +#line 1257 "quote_calc3-s.tab.c" default: break; } Modified: vendor/byacc/dist/test/btyacc/quote_calc3.tab.c ============================================================================== --- vendor/byacc/dist/test/btyacc/quote_calc3.tab.c Wed May 31 19:26:20 2017 (r319351) +++ vendor/byacc/dist/test/btyacc/quote_calc3.tab.c Wed May 31 19:27:37 2017 (r319352) @@ -676,6 +676,9 @@ YYPARSE_DECL() if (yydebug) fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); #endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif #if YYBTYACC yyps = yyNewState(0); if (yyps == 0) goto yyenomem; @@ -1250,7 +1253,7 @@ case 18: #line 70 "quote_calc3.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1254 "quote_calc3.tab.c" +#line 1257 "quote_calc3.tab.c" default: break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Wed May 31 19:28:23 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 6CDEAB8799F; Wed, 31 May 2017 19:28:23 +0000 (UTC) (envelope-from jkim@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 2363B65617; Wed, 31 May 2017 19:28:23 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VJSMl1002092; Wed, 31 May 2017 19:28:22 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VJSMaT002091; Wed, 31 May 2017 19:28:22 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201705311928.v4VJSMaT002091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 31 May 2017 19:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319353 - vendor/byacc/20170430 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 19:28:23 -0000 Author: jkim Date: Wed May 31 19:28:22 2017 New Revision: 319353 URL: https://svnweb.freebsd.org/changeset/base/319353 Log: Tag byacc 20170430. Added: vendor/byacc/20170430/ - copied from r319352, vendor/byacc/dist/ From owner-svn-src-vendor@freebsd.org Wed May 31 22:40:27 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 6C9A5BD3084; Wed, 31 May 2017 22:40:27 +0000 (UTC) (envelope-from jkim@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 EBC796F5B5; Wed, 31 May 2017 22:40:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VMeQgR081349; Wed, 31 May 2017 22:40:26 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VMeOpe081333; Wed, 31 May 2017 22:40:24 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201705312240.v4VMeOpe081333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 31 May 2017 22:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319363 - in vendor-sys/acpica/dist: generate/unix generate/unix/acpiexec generate/unix/iasl source/common source/compiler source/compiler/parsers source/compiler/preprocessor source/co... X-SVN-Group: vendor-sys 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, 31 May 2017 22:40:27 -0000 Author: jkim Date: Wed May 31 22:40:24 2017 New Revision: 319363 URL: https://svnweb.freebsd.org/changeset/base/319363 Log: Import ACPICA 20170531. Added: vendor-sys/acpica/dist/source/common/dmswitch.c (contents, props changed) vendor-sys/acpica/dist/source/components/dispatcher/dspkginit.c (contents, props changed) vendor-sys/acpica/dist/source/components/utilities/utresdecode.c (contents, props changed) vendor-sys/acpica/dist/source/tools/acpiexec/aeexception.c (contents, props changed) vendor-sys/acpica/dist/tests/misc/converterSample.asl Deleted: vendor-sys/acpica/dist/source/compiler/parsers/ vendor-sys/acpica/dist/source/compiler/preprocessor/ Modified: vendor-sys/acpica/dist/generate/unix/Makefile.common vendor-sys/acpica/dist/generate/unix/Makefile.config vendor-sys/acpica/dist/generate/unix/Makefile.rules vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/source/common/acfileio.c vendor-sys/acpica/dist/source/common/adfile.c vendor-sys/acpica/dist/source/common/adisasm.c vendor-sys/acpica/dist/source/common/adwalk.c vendor-sys/acpica/dist/source/common/ahids.c vendor-sys/acpica/dist/source/common/ahpredef.c vendor-sys/acpica/dist/source/common/ahtable.c vendor-sys/acpica/dist/source/common/ahuuids.c vendor-sys/acpica/dist/source/common/dmextern.c vendor-sys/acpica/dist/source/common/dmrestag.c vendor-sys/acpica/dist/source/common/dmtable.c vendor-sys/acpica/dist/source/common/dmtbdump.c vendor-sys/acpica/dist/source/common/dmtbinfo.c vendor-sys/acpica/dist/source/compiler/aslascii.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/aslcompiler.l vendor-sys/acpica/dist/source/compiler/asldefine.h vendor-sys/acpica/dist/source/compiler/aslexternal.c vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/aslhelp.c vendor-sys/acpica/dist/source/compiler/aslhelpers.y vendor-sys/acpica/dist/source/compiler/aslload.c vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmap.c vendor-sys/acpica/dist/source/compiler/asloffset.c vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/aslparser.y vendor-sys/acpica/dist/source/compiler/aslresource.c vendor-sys/acpica/dist/source/compiler/aslresources.y vendor-sys/acpica/dist/source/compiler/aslrestype2s.c vendor-sys/acpica/dist/source/compiler/aslrules.y vendor-sys/acpica/dist/source/compiler/aslstartup.c vendor-sys/acpica/dist/source/compiler/aslsupport.l vendor-sys/acpica/dist/source/compiler/asltokens.y vendor-sys/acpica/dist/source/compiler/asltree.c vendor-sys/acpica/dist/source/compiler/asltypes.y vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/aslxref.c vendor-sys/acpica/dist/source/compiler/cvcompiler.c vendor-sys/acpica/dist/source/compiler/cvdisasm.c vendor-sys/acpica/dist/source/compiler/cvparser.c vendor-sys/acpica/dist/source/compiler/dtcompiler.h vendor-sys/acpica/dist/source/compiler/dtfield.c vendor-sys/acpica/dist/source/compiler/dttable1.c vendor-sys/acpica/dist/source/compiler/dttable2.c vendor-sys/acpica/dist/source/compiler/dttemplate.h vendor-sys/acpica/dist/source/compiler/dtutils.c vendor-sys/acpica/dist/source/components/debugger/dbexec.c vendor-sys/acpica/dist/source/components/debugger/dbobject.c vendor-sys/acpica/dist/source/components/debugger/dbxface.c vendor-sys/acpica/dist/source/components/disassembler/dmbuffer.c vendor-sys/acpica/dist/source/components/disassembler/dmdeferred.c vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c vendor-sys/acpica/dist/source/components/disassembler/dmresrc.c vendor-sys/acpica/dist/source/components/disassembler/dmresrcl2.c vendor-sys/acpica/dist/source/components/disassembler/dmwalk.c vendor-sys/acpica/dist/source/components/dispatcher/dsargs.c vendor-sys/acpica/dist/source/components/dispatcher/dsdebug.c vendor-sys/acpica/dist/source/components/dispatcher/dsmethod.c vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c vendor-sys/acpica/dist/source/components/dispatcher/dsutils.c vendor-sys/acpica/dist/source/components/dispatcher/dswexec.c vendor-sys/acpica/dist/source/components/dispatcher/dswload.c vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c vendor-sys/acpica/dist/source/components/events/evxfevnt.c vendor-sys/acpica/dist/source/components/executer/exdebug.c vendor-sys/acpica/dist/source/components/executer/exdump.c vendor-sys/acpica/dist/source/components/executer/exoparg1.c vendor-sys/acpica/dist/source/components/executer/exresolv.c vendor-sys/acpica/dist/source/components/namespace/nsaccess.c vendor-sys/acpica/dist/source/components/namespace/nsnames.c vendor-sys/acpica/dist/source/components/namespace/nsutils.c vendor-sys/acpica/dist/source/components/namespace/nsxfeval.c vendor-sys/acpica/dist/source/components/parser/psobject.c vendor-sys/acpica/dist/source/components/parser/psopcode.c vendor-sys/acpica/dist/source/components/parser/psparse.c vendor-sys/acpica/dist/source/components/resources/rscalc.c vendor-sys/acpica/dist/source/components/resources/rsdump.c vendor-sys/acpica/dist/source/components/resources/rsdumpinfo.c vendor-sys/acpica/dist/source/components/resources/rsinfo.c vendor-sys/acpica/dist/source/components/resources/rsmisc.c vendor-sys/acpica/dist/source/components/resources/rsserial.c vendor-sys/acpica/dist/source/components/tables/tbfadt.c vendor-sys/acpica/dist/source/components/tables/tbutils.c vendor-sys/acpica/dist/source/components/utilities/utdecode.c vendor-sys/acpica/dist/source/components/utilities/utownerid.c vendor-sys/acpica/dist/source/components/utilities/utresrc.c vendor-sys/acpica/dist/source/components/utilities/utxfmutex.c vendor-sys/acpica/dist/source/include/acapps.h vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acglobal.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acopcode.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/acpredef.h vendor-sys/acpica/dist/source/include/acresrc.h vendor-sys/acpica/dist/source/include/acrestyp.h vendor-sys/acpica/dist/source/include/actbl1.h vendor-sys/acpica/dist/source/include/actbl2.h vendor-sys/acpica/dist/source/include/actbl3.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/include/acutils.h vendor-sys/acpica/dist/source/include/acuuid.h vendor-sys/acpica/dist/source/include/amlcode.h vendor-sys/acpica/dist/source/include/amlresrc.h vendor-sys/acpica/dist/source/include/platform/acgcc.h vendor-sys/acpica/dist/source/include/platform/acintel.h vendor-sys/acpica/dist/source/os_specific/service_layers/osunixxf.c vendor-sys/acpica/dist/source/tools/acpidump/apmain.c vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h vendor-sys/acpica/dist/source/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpisrc/asremove.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c Modified: vendor-sys/acpica/dist/generate/unix/Makefile.common ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.common Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/generate/unix/Makefile.common Wed May 31 22:40:24 2017 (r319363) @@ -7,22 +7,36 @@ $(PROGS): FORCE @cd $(BUILD_DIRECTORY_PATH)/$@; \ mkdir -p obj; \ $(MAKE) || exit "$$?"; \ - ls -al ../bin/$@; \ echo ""; # +# List just shows the status of each tool +# +status: FORCE + @for toolname in $(PROGS); do \ + (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ + pwd; \ + if [ -d "obj" ] ; then \ + echo " `ls -1 obj | wc -l` files, `stat -c%s obj/$$toolname` bytes"; \ + else \ + echo " Clean"; \ + fi; \ + ); \ + done; + +# # Simple clean removes all .obj files, but leaves the executables # in the local bin directory # clean: FORCE @for toolname in $(PROGS); do \ (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ + pwd; \ if [ -d "obj" ] ; then \ - echo "Removing $$toolname:"; \ - pwd; \ - $(MAKE) clean; \ - rmdir obj; \ - echo ""; \ + echo " Removing `ls -1 obj | wc -l` files"; \ + rm -r obj; \ + else \ + echo " Clean"; \ fi; \ ); \ done; @@ -53,7 +67,11 @@ install: FORCE @for toolname in $(PROGS); do \ (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ pwd; \ - $(MAKE) PROG=$$toolname install; \ + if [ -d "obj" ] ; then \ + $(MAKE) PROG=$$toolname install; \ + else \ + echo " Clean"; \ + fi; \ ); \ done; Modified: vendor-sys/acpica/dist/generate/unix/Makefile.config ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.config Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/generate/unix/Makefile.config Wed May 31 22:40:24 2017 (r319363) @@ -89,7 +89,7 @@ INSTALLPROG = \ RENAMEPROG = \ @if [ -e "$(PROG).exe" ] ; then \ mv $(PROG).exe $(PROG); \ - echo "Renamed $(PROG).exe to $(PROG)"; \ + echo "- Rename $(PROG).exe to $(PROG)"; \ fi; # @@ -98,7 +98,7 @@ RENAMEPROG = \ COPYPROG = \ @mkdir -p ../$(BINDIR); \ cp -f $(PROG) ../$(BINDIR); \ - echo "Copied $(PROG) to $(FINAL_PROG)"; + echo "- Copy $(PROG) to $(FINAL_PROG)"; # # Main ACPICA source directories Modified: vendor-sys/acpica/dist/generate/unix/Makefile.rules ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.rules Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/generate/unix/Makefile.rules Wed May 31 22:40:24 2017 (r319363) @@ -11,14 +11,16 @@ $(FINAL_PROG) : $(PROG) $(COPYPROG) $(PROG) : $(INTERMEDIATES) $(MISC) $(OBJECTS) - $(LINKPROG) + @echo "- Link" $(PROG) + @$(LINKPROG) $(RENAMEPROG) $(OBJDIR)/%.o : %.c $(HEADERS) $(ACPICA_HEADERS) - $(COMPILEOBJ) + @echo $(PROG) $< + @$(COMPILEOBJ) clean : - rm -f $(PROG) $(PROG).exe $(OBJECTS) $(OBJDIR)/*.o $(INTERMEDIATES) $(MISC) + @rm -f $(PROG) $(PROG).exe $(OBJECTS) $(OBJDIR)/*.o $(INTERMEDIATES) $(MISC) install : $(INSTALLPROG) Modified: vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Wed May 31 22:40:24 2017 (r319363) @@ -42,6 +42,7 @@ OBJECTS = \ $(OBJDIR)/acgetline.o\ $(OBJDIR)/acfileio.o\ $(OBJDIR)/aeexec.o\ + $(OBJDIR)/aeexception.o\ $(OBJDIR)/aehandlers.o\ $(OBJDIR)/aeinitfile.o\ $(OBJDIR)/aemain.o\ @@ -224,6 +225,7 @@ OBJECTS = \ $(OBJDIR)/utownerid.o\ $(OBJDIR)/utnonansi.o\ $(OBJDIR)/utpredef.o\ + $(OBJDIR)/utresdecode.o\ $(OBJDIR)/utresrc.o\ $(OBJDIR)/utstate.o\ $(OBJDIR)/utstring.o\ Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/iasl/Makefile Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile Wed May 31 22:40:24 2017 (r319363) @@ -121,6 +121,7 @@ OBJECTS = \ $(OBJDIR)/dmresrcl2.o\ $(OBJDIR)/dmresrcs.o\ $(OBJDIR)/dmrestag.o\ + $(OBJDIR)/dmswitch.o\ $(OBJDIR)/dmtable.o\ $(OBJDIR)/dmtables.o\ $(OBJDIR)/dmtbdump.o\ @@ -224,6 +225,7 @@ OBJECTS = \ $(OBJDIR)/utobject.o\ $(OBJDIR)/utownerid.o\ $(OBJDIR)/utpredef.o\ + $(OBJDIR)/utresdecode.o\ $(OBJDIR)/utresrc.o\ $(OBJDIR)/utstate.o\ $(OBJDIR)/utstrtoul64.o\ @@ -277,13 +279,15 @@ CFLAGS += \ include ../Makefile.rules # -# Function to safely execute yacc +# Function to safely execute yacc: +# Generate the output files to a temporary directory, +# move the file to $(OBJDIR), and discard the directory. # safe_yacc = \ _d=`mktemp -d $(OBJDIR)/$(1).XXXXXX` &&\ cd $$_d &&\ $(YACC) $(YFLAGS) -v -d -p$(1) $(abspath $(2)) &&\ - cd - &&\ + cd - > /dev/null;\ mv $$_d/y.tab$(suffix $(3)) $(3);\ _r=$$?;\ rm -fr $$_d;\ @@ -293,28 +297,35 @@ safe_yacc = \ # Macro processing for iASL .y files # $(OBJDIR)/aslcompiler.y : $(ASL_PARSER) - $(MACROPROC) $(MFLAGS) $(ASL_COMPILER)/aslparser.y > $@ + @echo "- " $(MACROPROC) " Preprocess main iASL parser" + @$(MACROPROC) $(MFLAGS) $(ASL_COMPILER)/aslparser.y > $@ # # Parser and Lexer - intermediate C files # $(OBJDIR)/aslcompilerlex.c : $(ASL_LEXER) - $(LEX) $(LFLAGS) -PAslCompiler -o$@ $(ASL_COMPILER)/aslcompiler.l + @echo "- " $(LEX) " "$< + @$(LEX) $(LFLAGS) -PAslCompiler -o$@ $(ASL_COMPILER)/aslcompiler.l $(OBJDIR)/aslcompilerparse.c $(OBJDIR)/aslcompiler.y.h : $(OBJDIR)/aslcompiler.y - $(call safe_yacc,AslCompiler,$<,$@) + @echo "- " $(YACC) " "$< + @$(call safe_yacc,AslCompiler,$<,$@) $(OBJDIR)/dtparserlex.c : $(ASL_COMPILER)/dtparser.l $(OBJDIR)/dtparser.y.h - $(LEX) $(LFLAGS) -PDtParser -o$@ $< + @echo "- " $(LEX) " "$< + @$(LEX) $(LFLAGS) -PDtParser -o$@ $< $(OBJDIR)/dtparserparse.c $(OBJDIR)/dtparser.y.h : $(ASL_COMPILER)/dtparser.y - $(call safe_yacc,DtParser,$<,$@) + @echo "- " $(YACC) " "$< + @$(call safe_yacc,DtParser,$<,$@) $(OBJDIR)/prparserlex.c : $(ASL_COMPILER)/prparser.l $(OBJDIR)/prparser.y.h - $(LEX) $(LFLAGS) -PPrParser -o$@ $< + @echo "- " $(LEX) " "$< + @$(LEX) $(LFLAGS) -PPrParser -o$@ $< $(OBJDIR)/prparserparse.c $(OBJDIR)/prparser.y.h : $(ASL_COMPILER)/prparser.y - $(call safe_yacc,PrParser,$<,$@) + @echo "- " $(YACC) " "$< + @$(call safe_yacc,PrParser,$<,$@) # # Parsers and Lexers - final object files @@ -323,19 +334,25 @@ $(OBJDIR)/prparserparse.c $(OBJDIR)/prparser.y.h : # by the utilities above and they are not necessarily ANSI C, etc. # $(OBJDIR)/aslcompilerlex.o : $(OBJDIR)/aslcompilerlex.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< $(OBJDIR)/aslcompilerparse.o : $(OBJDIR)/aslcompilerparse.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< $(OBJDIR)/dtparserlex.o : $(OBJDIR)/dtparserlex.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< $(OBJDIR)/dtparserparse.o : $(OBJDIR)/dtparserparse.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< $(OBJDIR)/prparserlex.o : $(OBJDIR)/prparserlex.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< $(OBJDIR)/prparserparse.o : $(OBJDIR)/prparserparse.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< + @echo "- " "Intermediate" $< + @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $< Modified: vendor-sys/acpica/dist/source/common/acfileio.c ============================================================================== --- vendor-sys/acpica/dist/source/common/acfileio.c Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/source/common/acfileio.c Wed May 31 22:40:24 2017 (r319363) @@ -531,8 +531,6 @@ AcValidateTableHeader ( if (!AcpiUtValidNameseg (TableHeader.Signature)) { - fprintf (stderr, "Invalid table signature: 0x%8.8X\n", - *ACPI_CAST_PTR (UINT32, TableHeader.Signature)); return (AE_BAD_SIGNATURE); } Modified: vendor-sys/acpica/dist/source/common/adfile.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adfile.c Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/source/common/adfile.c Wed May 31 22:40:24 2017 (r319363) @@ -316,11 +316,6 @@ FlGenerateFilename ( */ NewFilename = UtStringCacheCalloc ((ACPI_SIZE) strlen (InputFilename) + strlen (Suffix) + 2); - if (!NewFilename) - { - return (NULL); - } - strcpy (NewFilename, InputFilename); /* Try to find the last dot in the filename */ @@ -364,11 +359,6 @@ FlStrdup ( NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1); - if (!NewString) - { - return (NULL); - } - strcpy (NewString, String); return (NewString); } Modified: vendor-sys/acpica/dist/source/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adisasm.c Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/source/common/adisasm.c Wed May 31 22:40:24 2017 (r319363) @@ -537,7 +537,7 @@ AdDisassembleOneTable ( * the entire tree with the new information (namely, the * number of arguments per method) */ - if (AcpiDmGetExternalMethodCount ()) + if (AcpiDmGetUnresolvedExternalMethodCount ()) { Status = AdReparseOneTable (Table, File, OwnerId); if (ACPI_FAILURE (Status)) @@ -553,7 +553,7 @@ AdDisassembleOneTable ( * 1) Convert fixed-offset references to resource descriptors * to symbolic references (Note: modifies namespace) */ - AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode); + AcpiDmConvertParseObjects (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode); /* Optional displays */ @@ -616,7 +616,7 @@ AdReparseOneTable ( fprintf (stderr, "\nFound %u external control methods, " "reparsing with new information\n", - AcpiDmGetExternalMethodCount ()); + AcpiDmGetUnresolvedExternalMethodCount ()); /* Reparse, rebuild namespace */ @@ -642,7 +642,7 @@ AdReparseOneTable ( /* New namespace, add the external definitions first */ - AcpiDmAddExternalsToNamespace (); + AcpiDmAddExternalListToNamespace (); /* For -ca option: clear the list of comment addresses. */ Modified: vendor-sys/acpica/dist/source/common/adwalk.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adwalk.c Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/source/common/adwalk.c Wed May 31 22:40:24 2017 (r319363) @@ -208,11 +208,16 @@ AcpiDmInspectPossibleArgs ( ACPI_PARSE_OBJECT *Op); static ACPI_STATUS -AcpiDmResourceDescendingOp ( +AcpiDmCommonDescendingOp ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context); +static ACPI_STATUS +AcpiDmProcessResourceDescriptors ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context); /******************************************************************************* * @@ -395,21 +400,21 @@ AcpiDmCrossReferenceNamespace ( /******************************************************************************* * - * FUNCTION: AcpiDmConvertResourceIndexes + * FUNCTION: AcpiDmConvertParseObjects * * PARAMETERS: ParseTreeRoot - Root of the parse tree * NamespaceRoot - Root of the internal namespace * * RETURN: None * - * DESCRIPTION: Convert fixed-offset references to resource descriptors to - * symbolic references. Should only be called after namespace has - * been cross referenced. + * DESCRIPTION: Begin parse tree walk to perform conversions needed for + * disassembly. These include resource descriptors and switch/case + * operations. * ******************************************************************************/ void -AcpiDmConvertResourceIndexes ( +AcpiDmConvertParseObjects ( ACPI_PARSE_OBJECT *ParseTreeRoot, ACPI_NAMESPACE_NODE *NamespaceRoot) { @@ -443,9 +448,14 @@ AcpiDmConvertResourceIndexes ( Info.Level = 0; Info.WalkState = WalkState; - AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmResourceDescendingOp, + AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmCommonDescendingOp, AcpiDmCommonAscendingOp, &Info); ACPI_FREE (WalkState); + + if (AcpiGbl_TempListHead) { + AcpiDmClearTempList(); + } + return; } @@ -737,7 +747,6 @@ AcpiDmLoadDescendingOp ( WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - ObjectType = OpInfo->ObjectType; ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); /* Only interested in operators that create new names */ @@ -754,7 +763,7 @@ AcpiDmLoadDescendingOp ( { /* For all named operators, get the new name */ - Path = (char *) Op->Named.Path; + Path = Op->Named.Path; if (!Path && Op->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP) { @@ -875,7 +884,6 @@ AcpiDmXrefDescendingOp ( WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - ObjectType = OpInfo->ObjectType; ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); if ((!(OpInfo->Flags & AML_NAMED)) && @@ -885,26 +893,7 @@ AcpiDmXrefDescendingOp ( { goto Exit; } - else if (Op->Common.Parent && - Op->Common.Parent->Common.AmlOpcode == AML_EXTERNAL_OP) - { - /* External() NamePath */ - Path = Op->Common.Value.String; - ObjectType = (ACPI_OBJECT_TYPE) Op->Common.Next->Common.Value.Integer; - if (ObjectType == ACPI_TYPE_METHOD) - { - ParamCount = (UINT32) - Op->Common.Next->Common.Next->Common.Value.Integer; - } - - Flags |= ACPI_EXT_RESOLVED_REFERENCE | ACPI_EXT_ORIGIN_FROM_OPCODE; - AcpiDmAddOpToExternalList (Op, Path, - (UINT8) ObjectType, ParamCount, Flags); - - goto Exit; - } - /* Get the NamePath from the appropriate place */ if (OpInfo->Flags & AML_NAMED) @@ -924,9 +913,10 @@ AcpiDmXrefDescendingOp ( Path = NextOp->Common.Value.String; } } - else if (Op->Common.AmlOpcode == AML_SCOPE_OP) + else if (Op->Common.AmlOpcode == AML_SCOPE_OP || + Op->Common.AmlOpcode == AML_EXTERNAL_OP) { - Path = (char *) Op->Named.Path; + Path = Op->Named.Path; } } else if (OpInfo->Flags & AML_CREATE) @@ -1060,21 +1050,59 @@ Exit: return (AE_OK); } +/******************************************************************************* + * + * FUNCTION: AcpiDmCommonDescendingOp + * + * PARAMETERS: ASL_WALK_CALLBACK + * + * RETURN: ACPI_STATUS + * + * DESCRIPTION: Perform parse tree preprocessing before main disassembly walk. + * + ******************************************************************************/ +static ACPI_STATUS +AcpiDmCommonDescendingOp ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context) +{ + ACPI_STATUS Status; + + /* Resource descriptor conversion */ + + Status = AcpiDmProcessResourceDescriptors (Op, Level, Context); + + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Switch/Case conversion */ + + Status = AcpiDmProcessSwitch (Op); + + return (AE_OK); +} + + /******************************************************************************* * - * FUNCTION: AcpiDmResourceDescendingOp + * FUNCTION: AcpiDmProcessResourceDescriptors * * PARAMETERS: ASL_WALK_CALLBACK * - * RETURN: None + * RETURN: ACPI_STATUS * - * DESCRIPTION: Process one parse op during symbolic resource index conversion. + * DESCRIPTION: Convert fixed-offset references to resource descriptors to + * symbolic references. Should only be called after namespace has + * been cross referenced. * ******************************************************************************/ static ACPI_STATUS -AcpiDmResourceDescendingOp ( +AcpiDmProcessResourceDescriptors ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context) @@ -1085,7 +1113,6 @@ AcpiDmResourceDescendingOp ( ACPI_OBJECT_TYPE ObjectType; ACPI_STATUS Status; - WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); @@ -1111,10 +1138,10 @@ AcpiDmResourceDescendingOp ( * If so, convert the reference into a symbolic reference. */ AcpiDmCheckResourceReference (Op, WalkState); + return (AE_OK); } - /******************************************************************************* * * FUNCTION: AcpiDmCommonAscendingOp @@ -1135,14 +1162,11 @@ AcpiDmCommonAscendingOp ( void *Context) { ACPI_OP_WALK_INFO *Info = Context; - const ACPI_OPCODE_INFO *OpInfo; ACPI_OBJECT_TYPE ObjectType; /* Close scope if necessary */ - OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - ObjectType = OpInfo->ObjectType; ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); if (AcpiNsOpensScope (ObjectType)) @@ -1152,7 +1176,6 @@ AcpiDmCommonAscendingOp ( return (AE_OK); } - /******************************************************************************* * Modified: vendor-sys/acpica/dist/source/common/ahids.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahids.c Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/source/common/ahids.c Wed May 31 22:40:24 2017 (r319363) @@ -187,6 +187,7 @@ const AH_DEVICE_ID AslDeviceIds[] = {"ACPI0011", "Generic Buttons Device"}, {"ACPI0012", "NVDIMM Root Device"}, {"ACPI0013", "Generic Event Device"}, + {"ACPI0014", "Wireless Power Calibration Device"}, {"ADMA0F28", "Intel Audio DMA"}, {"AMCR0F28", "Intel Audio Machine Driver"}, {"ATK4001", "Asus Radio Control Button"}, Modified: vendor-sys/acpica/dist/source/common/ahpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahpredef.c Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/source/common/ahpredef.c Wed May 31 22:40:24 2017 (r319363) @@ -254,6 +254,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_FPS", "Fan Performance States", "Returns a list of supported fan performance states"), AH_PREDEF ("_FSL", "Fan Set Level", "Control method that sets the fan device's speed level (performance state)"), AH_PREDEF ("_FST", "Fan Status", "Returns current status information for a fan device"), + AH_PREDEF ("_FUN", "Function Number", "Resource descriptor field"), AH_PREDEF ("_GAI", "Get Averaging Interval", "Returns the power meter averaging interval"), AH_PREDEF ("_GCP", "Get Capabilities", "Get device time capabilities"), AH_PREDEF ("_GHL", "Get Hardware Limit", "Returns the hardware limit enforced by the power meter"), @@ -270,6 +271,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_GWS", "Get Wake Status", "Return status of wake alarms"), AH_PREDEF ("_HE_", "High-Edge", "Interrupt triggering, Resource Descriptor field"), AH_PREDEF ("_HID", "Hardware ID", "Returns a device's Plug and Play Hardware ID"), + AH_PREDEF ("_HMA", "Heterogeneous Memory Attributes", "Returns a list of HMAT structures."), AH_PREDEF ("_HOT", "Hot Temperature", "Returns the critical temperature for sleep (entry to S4)"), AH_PREDEF ("_HPP", "Hot Plug Parameters", "Returns a list of hot-plug information for a PCI device"), AH_PREDEF ("_HPX", "Hot Plug Parameter Extensions", "Returns a list of hot-plug information for a PCI device. Supersedes _HPP"), @@ -287,6 +289,9 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_LL_", "Low Level", "Interrupt polarity, Resource Descriptor field"), AH_PREDEF ("_LPD", "Low Power Dependencies", "Returns a list of dependencies for low power idle entry"), AH_PREDEF ("_LPI", "Low Power Idle States", "Returns a list of supported low power idle states"), + AH_PREDEF ("_LSI", "Label Storage Information", "Returns information about the Label Storage Area associated with the NVDIMM object."), + AH_PREDEF ("_LSR", "Label Storage Read", "Returns label data from the Label Storage Area of the NVDIMM object."), + AH_PREDEF ("_LSW", "Label Storage Write", "Writes label data in to the Label Storage Area of the NVDIMM object."), AH_PREDEF ("_MAF", "Maximum Address Fixed", "Resource Descriptor field"), AH_PREDEF ("_MAT", "Multiple APIC Table Entry", "Returns a list of MADT APIC structure entries"), AH_PREDEF ("_MAX", "Maximum Base Address", "Resource Descriptor field"), @@ -439,6 +444,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_UPC", "USB Port Capabilities", "Returns a list of USB port capabilities"), AH_PREDEF ("_UPD", "User Presence Detect", "Returns user detection information"), AH_PREDEF ("_UPP", "User Presence Polling", "Returns the recommended user presence polling interval"), + AH_PREDEF ("_VAL", "Pin Configuration Value", "Resource Descriptor field"), AH_PREDEF ("_VEN", "Vendor Data", "Resource Descriptor field"), AH_PREDEF ("_VPO", "Video Post Options", "Returns the implemented video post options"), AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"), Modified: vendor-sys/acpica/dist/source/common/ahtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahtable.c Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/source/common/ahtable.c Wed May 31 22:40:24 2017 (r319363) @@ -218,6 +218,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_FPDT, "Firmware Performance Data Table"}, {ACPI_SIG_GTDT, "Generic Timer Description Table"}, {ACPI_SIG_HEST, "Hardware Error Source Table"}, + {ACPI_SIG_HMAT, "Heterogeneous Memory Attributes Table"}, {ACPI_SIG_HPET, "High Precision Event Timer table"}, {ACPI_SIG_IORT, "IO Remapping Table"}, {ACPI_SIG_IVRS, "I/O Virtualization Reporting Structure"}, @@ -232,6 +233,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_NFIT, "NVDIMM Firmware Interface Table"}, {ACPI_SIG_PCCT, "Platform Communications Channel Table"}, {ACPI_SIG_PMTT, "Platform Memory Topology Table"}, + {ACPI_SIG_PPTT, "Processor Properties Topology Table"}, {ACPI_SIG_RASF, "RAS Features Table"}, {ACPI_RSDP_NAME,"Root System Description Pointer"}, {ACPI_SIG_RSDT, "Root System Description Table"}, @@ -253,6 +255,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_WDDT, "Watchdog Description Table"}, {ACPI_SIG_WDRT, "Watchdog Resource Table"}, {ACPI_SIG_WPBT, "Windows Platform Binary Table"}, + {ACPI_SIG_WSMT, "Windows SMM Security Migrations Table"}, {ACPI_SIG_XENV, "Xen Environment table"}, {ACPI_SIG_XSDT, "Extended System Description Table"}, {NULL, NULL} Modified: vendor-sys/acpica/dist/source/common/ahuuids.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahuuids.c Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/source/common/ahuuids.c Wed May 31 22:40:24 2017 (r319363) @@ -186,6 +186,10 @@ const AH_UUID Gbl_AcpiUuids[] = {"Persistent Virtual Disk", UUID_PERSISTENT_VIRTUAL_DISK}, {"Persistent Virtual CD", UUID_PERSISTENT_VIRTUAL_CD}, + {"[Processor Properties]", NULL}, + {"Cache Properties", UUID_CACHE_PROPERTIES}, + {"Physical Package Property", UUID_PHYSICAL_PROPERTY}, + {"[Miscellaneous]", NULL}, {"Platform-wide Capabilities", UUID_PLATFORM_CAPABILITIES}, {"Dynamic Enumeration", UUID_DYNAMIC_ENUMERATION}, Modified: vendor-sys/acpica/dist/source/common/dmextern.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmextern.c Wed May 31 21:54:21 2017 (r319362) +++ vendor-sys/acpica/dist/source/common/dmextern.c Wed May 31 22:40:24 2017 (r319363) @@ -199,7 +199,10 @@ static const char *AcpiGbl_DmTypeNames[] = #define METHOD_SEPARATORS " \t,()\n" +static const char *ExternalConflictMessage = + " // Conflicts with a later declaration"; + /* Local prototypes */ static const char * @@ -211,6 +214,16 @@ AcpiDmNormalizeParentPrefix ( ACPI_PARSE_OBJECT *Op, char *Path); +static ACPI_STATUS +AcpiDmGetExternalAndInternalPath ( + ACPI_NAMESPACE_NODE *Node, + char **ExternalPath, + char **InternalPath); + +static ACPI_STATUS +AcpiDmRemoveRootPrefix ( + char **Path); + static void AcpiDmAddPathToExternalList ( char *Path, @@ -226,7 +239,22 @@ AcpiDmCreateNewExternal ( UINT32 Value, UINT16 Flags); +static void +AcpiDmCheckForExternalConflict ( + char *Path); +static ACPI_STATUS +AcpiDmResolveExternal ( + char *Path, + UINT8 Type, + ACPI_NAMESPACE_NODE **Node); + + +static void +AcpiDmConflictingDeclaration ( + char *Path); + + /******************************************************************************* * * FUNCTION: AcpiDmGetObjectTypeName @@ -582,7 +610,7 @@ AcpiDmGetExternalsFromFile ( { /* Add the external(s) to the namespace */ - AcpiDmAddExternalsToNamespace (); + AcpiDmAddExternalListToNamespace (); AcpiOsPrintf ("%s: Imported %u external method definitions\n", Gbl_ExternalRefFilename, ImportCount); @@ -698,6 +726,86 @@ AcpiDmAddOpToExternalList ( /******************************************************************************* * + * FUNCTION: AcpiDmGetExternalAndInternalPath + * + * PARAMETERS: Node - Namespace node for object to be added + * ExternalPath - Will contain the external path of the node + * InternalPath - Will contain the internal path of the node + * + * RETURN: None + * + * DESCRIPTION: Get the External and Internal path from the given node. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmGetExternalAndInternalPath ( + ACPI_NAMESPACE_NODE *Node, + char **ExternalPath, + char **InternalPath) +{ + ACPI_STATUS Status; + + + if (!Node) + { + return (AE_BAD_PARAMETER); + } + + /* Get the full external and internal pathnames to the node */ + + *ExternalPath = AcpiNsGetExternalPathname (Node); + if (!*ExternalPath) + { + return (AE_BAD_PATHNAME); + } + + Status = AcpiNsInternalizeName (*ExternalPath, InternalPath); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (*ExternalPath); + return (Status); + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmRemoveRootPrefix + * + * PARAMETERS: Path - Remove Root prefix from this Path + * + * RETURN: None + * + * DESCRIPTION: Remove the root prefix character '\' from Path. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmRemoveRootPrefix ( + char **Path) +{ + char *InputPath = *Path; + + + if ((*InputPath == AML_ROOT_PREFIX) && (InputPath[1])) + { + if (!memmove(InputPath, InputPath+1, strlen(InputPath))) + { + return (AE_ERROR); + } + + *Path = InputPath; + } + + return (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmAddNodeToExternalList * * PARAMETERS: Node - Namespace node for object to be added @@ -727,46 +835,27 @@ AcpiDmAddNodeToExternalList ( { char *ExternalPath; char *InternalPath; - char *Temp; ACPI_STATUS Status; ACPI_FUNCTION_TRACE (DmAddNodeToExternalList); - - if (!Node) - { - return_VOID; - } - /* Get the full external and internal pathnames to the node */ - ExternalPath = AcpiNsGetExternalPathname (Node); - if (!ExternalPath) - { - return_VOID; - } - - Status = AcpiNsInternalizeName (ExternalPath, &InternalPath); + Status = AcpiDmGetExternalAndInternalPath (Node, &ExternalPath, &InternalPath); if (ACPI_FAILURE (Status)) { - ACPI_FREE (ExternalPath); return_VOID; } /* Remove the root backslash */ - if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1])) + Status = AcpiDmRemoveRootPrefix (&ExternalPath); + if (ACPI_FAILURE (Status)) { - Temp = ACPI_ALLOCATE_ZEROED (strlen (ExternalPath) + 1); - if (!Temp) - { - return_VOID; - } - - strcpy (Temp, &ExternalPath[1]); ACPI_FREE (ExternalPath); - ExternalPath = Temp; + ACPI_FREE (InternalPath); + return_VOID; } /* Create the new External() declaration node */ @@ -1013,68 +1102,171 @@ AcpiDmCreateNewExternal ( /******************************************************************************* * - * FUNCTION: AcpiDmAddExternalsToNamespace + * FUNCTION: AcpiDmResolveExternal * - * PARAMETERS: None + * PARAMETERS: Path - Path of the external + * Type - Type of the external + * Node - Input node for AcpiNsLookup * + * RETURN: Status + * + * DESCRIPTION: Resolve the external within the namespace by AcpiNsLookup. + * If the returned node is an external and has the same type + * we assume that it was either an existing external or a + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmResolveExternal ( + char *Path, + UINT8 Type, + ACPI_NAMESPACE_NODE **Node) +{ + ACPI_STATUS Status; + + + Status = AcpiNsLookup (NULL, Path, Type, + ACPI_IMODE_LOAD_PASS1, + ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, + NULL, Node); + + if (!Node) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "while adding external to namespace [%s]", Path)); + } + + /* Note the asl code "external(a) external(a)" is acceptable ASL */ + + else if ((*Node)->Type == Type && + (*Node)->Flags & ANOBJ_IS_EXTERNAL) + { + return (AE_OK); + } + else + { + ACPI_EXCEPTION ((AE_INFO, AE_ERROR, + "[%s] has conflicting declarations", Path)); + } + + return (AE_ERROR); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmCreateSubobjectForExternal + * + * PARAMETERS: Type - Type of the external + * Node - Namespace node from AcpiNsLookup + * ParamCount - Value to be used for Method + * * RETURN: None * - * DESCRIPTION: Add all externals to the namespace. Allows externals to be + * DESCRIPTION: Add one external to the namespace. Allows external to be * "resolved". * ******************************************************************************/ void -AcpiDmAddExternalsToNamespace ( - void) +AcpiDmCreateSubobjectForExternal ( + UINT8 Type, + ACPI_NAMESPACE_NODE **Node, + UINT32 ParamCount) { - ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node; ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; - while (External) + switch (Type) { - /* Add the external name (object) into the namespace */ + case ACPI_TYPE_METHOD: - Status = AcpiNsLookup (NULL, External->InternalPath, External->Type, - ACPI_IMODE_LOAD_PASS1, - ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, - NULL, &Node); + /* For methods, we need to save the argument count */ - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, - "while adding external to namespace [%s]", - External->Path)); - } + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); + ObjDesc->Method.ParamCount = (UINT8) ParamCount; + (*Node)->Object = ObjDesc; + break; - else switch (External->Type) - { - case ACPI_TYPE_METHOD: + case ACPI_TYPE_REGION: - /* For methods, we need to save the argument count */ + /* Regions require a region sub-object */ - ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); - ObjDesc->Method.ParamCount = (UINT8) External->Value; - Node->Object = ObjDesc; - break; + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); + ObjDesc->Region.Node = *Node; + (*Node)->Object = ObjDesc; + break; - case ACPI_TYPE_REGION: + default: - /* Regions require a region sub-object */ + break; + } +} - ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); - ObjDesc->Region.Node = Node; - Node->Object = ObjDesc; - break; - default: +/******************************************************************************* + * + * FUNCTION: AcpiDmAddOneExternalToNamespace + * + * PARAMETERS: Path - External parse object + * Type - Type of parse object + * ParamCount - External method parameter count + * + * RETURN: None + * + * DESCRIPTION: Add one external to the namespace by resolvign the external + * (by performing a namespace lookup) and annotating the resulting + * namespace node with the approperiate information if the type + * is ACPI_TYPE_REGION or ACPI_TYPE_METHOD. + * + ******************************************************************************/ - break; - } +void +AcpiDmAddOneExternalToNamespace ( + char *Path, + UINT8 Type, + UINT32 ParamCount) +{ + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node; + + Status = AcpiDmResolveExternal (Path, Type, &Node); + + if (ACPI_FAILURE (Status)) + { + return; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Wed May 31 22:41:09 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 30076BD30F7; Wed, 31 May 2017 22:41:09 +0000 (UTC) (envelope-from jkim@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 D98CD6F73B; Wed, 31 May 2017 22:41:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4VMf7ZZ081417; Wed, 31 May 2017 22:41:07 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4VMf7Rf081416; Wed, 31 May 2017 22:41:07 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201705312241.v4VMf7Rf081416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 31 May 2017 22:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319364 - vendor-sys/acpica/20170531 X-SVN-Group: vendor-sys 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, 31 May 2017 22:41:09 -0000 Author: jkim Date: Wed May 31 22:41:07 2017 New Revision: 319364 URL: https://svnweb.freebsd.org/changeset/base/319364 Log: Tag ACPICA 20170531. Added: vendor-sys/acpica/20170531/ - copied from r319363, vendor-sys/acpica/dist/ From owner-svn-src-vendor@freebsd.org Thu Jun 1 20:58:40 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 1751EB7EA58; Thu, 1 Jun 2017 20:58:40 +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 7CB5F67C3D; Thu, 1 Jun 2017 20:58:39 +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 v51KwcPt034971; Thu, 1 Jun 2017 20:58:38 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51KwblD034957; Thu, 1 Jun 2017 20:58:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012058.v51KwblD034957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 20:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319461 - in vendor/llvm/dist: docs include/llvm include/llvm/Analysis include/llvm/CodeGen include/llvm/CodeGen/GlobalISel include/llvm/DebugInfo include/llvm/DebugInfo/CodeView includ... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:58:40 -0000 Author: dim Date: Thu Jun 1 20:58:36 2017 New Revision: 319461 URL: https://svnweb.freebsd.org/changeset/base/319461 Log: Vendor import of llvm trunk r304460: https://llvm.org/svn/llvm-project/llvm/trunk@304460 Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeViewSymbols.def vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeViewTypes.def vendor/llvm/dist/include/llvm/ObjectYAML/CodeViewYAMLDebugSections.h (contents, props changed) vendor/llvm/dist/include/llvm/ObjectYAML/CodeViewYAMLSymbols.h (contents, props changed) vendor/llvm/dist/include/llvm/ObjectYAML/CodeViewYAMLTypes.h (contents, props changed) vendor/llvm/dist/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h (contents, props changed) vendor/llvm/dist/lib/CodeGen/LiveRangeShrink.cpp (contents, props changed) vendor/llvm/dist/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp (contents, props changed) vendor/llvm/dist/lib/ObjectYAML/CodeViewYAMLSymbols.cpp (contents, props changed) vendor/llvm/dist/lib/ObjectYAML/CodeViewYAMLTypes.cpp (contents, props changed) vendor/llvm/dist/test/Analysis/CFLAliasAnalysis/Andersen/struct.ll vendor/llvm/dist/test/CodeGen/AArch64/addcarry-crash.ll vendor/llvm/dist/test/CodeGen/AArch64/pr33172.ll vendor/llvm/dist/test/CodeGen/AMDGPU/waitcnt-permute.mir vendor/llvm/dist/test/CodeGen/Hexagon/invalid-dotnew-attempt.mir vendor/llvm/dist/test/CodeGen/Hexagon/loop-idiom/pmpy-long-loop.ll vendor/llvm/dist/test/CodeGen/Hexagon/mul64-sext.ll vendor/llvm/dist/test/CodeGen/PowerPC/logic-ops-on-compares.ll vendor/llvm/dist/test/CodeGen/PowerPC/memCmpUsedInZeroEqualityComparison.ll vendor/llvm/dist/test/CodeGen/PowerPC/memcmp.ll vendor/llvm/dist/test/CodeGen/PowerPC/memcmpIR.ll vendor/llvm/dist/test/CodeGen/PowerPC/ppc64-get-cache-line-size.ll vendor/llvm/dist/test/CodeGen/PowerPC/testComparesieqsll.ll vendor/llvm/dist/test/CodeGen/PowerPC/testComparesiequll.ll vendor/llvm/dist/test/CodeGen/PowerPC/testCompareslleqsll.ll vendor/llvm/dist/test/CodeGen/PowerPC/testComparesllequll.ll vendor/llvm/dist/test/CodeGen/PowerPC/vec_xxpermdi.ll vendor/llvm/dist/test/CodeGen/X86/eh-unknown.ll vendor/llvm/dist/test/CodeGen/X86/gnu-seh-nolpads.ll vendor/llvm/dist/test/CodeGen/X86/lrshrink.ll vendor/llvm/dist/test/CodeGen/X86/pr32610.ll vendor/llvm/dist/test/MC/ARM/mixed-arm-thumb-bl-fixup.ll vendor/llvm/dist/test/Other/new-pm-thinlto-defaults.ll vendor/llvm/dist/test/ThinLTO/X86/newpm-basic.ll vendor/llvm/dist/test/Transforms/CodeExtractor/PartialInlineAlloca.ll vendor/llvm/dist/test/Transforms/CodeExtractor/PartialInlineAlloca2.ll vendor/llvm/dist/test/Transforms/CodeExtractor/PartialInlineAlloca4.ll vendor/llvm/dist/test/Transforms/CodeExtractor/PartialInlineAlloca5.ll vendor/llvm/dist/test/Transforms/CodeExtractor/PartialInlineLiveAcross.ll vendor/llvm/dist/test/Transforms/CodeExtractor/PartialInlineNoLiveOut.ll vendor/llvm/dist/test/Transforms/LoopVectorize/AArch64/no_vector_instructions.ll vendor/llvm/dist/test/Transforms/LowerExpectIntrinsic/expect_nonboolean.ll vendor/llvm/dist/test/Transforms/NewGVN/pr33185.ll vendor/llvm/dist/test/Transforms/ThinLTOBitcodeWriter/new-pm.ll Deleted: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVSymbolTypes.def vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeRecords.def vendor/llvm/dist/test/CodeGen/PowerPC/pristine-and-livein.mir vendor/llvm/dist/test/ThinLTO/X86/error-newpm.ll vendor/llvm/dist/test/Transforms/GVN/PRE/phi-translate-2.ll vendor/llvm/dist/tools/llvm-pdbdump/YamlSerializationContext.h vendor/llvm/dist/tools/llvm-pdbdump/YamlSymbolDumper.cpp vendor/llvm/dist/tools/llvm-pdbdump/YamlSymbolDumper.h vendor/llvm/dist/tools/llvm-pdbdump/YamlTypeDumper.cpp vendor/llvm/dist/tools/llvm-pdbdump/YamlTypeDumper.h Modified: vendor/llvm/dist/docs/Vectorizers.rst vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h vendor/llvm/dist/include/llvm/Analysis/ValueTracking.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h vendor/llvm/dist/include/llvm/CodeGen/ISDOpcodes.h vendor/llvm/dist/include/llvm/CodeGen/MIRYamlMapping.h vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h vendor/llvm/dist/include/llvm/CodeGen/MachineConstantPool.h vendor/llvm/dist/include/llvm/CodeGen/MachineFunction.h vendor/llvm/dist/include/llvm/CodeGen/MachineFunctionInitializer.h vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h vendor/llvm/dist/include/llvm/CodeGen/MachineInstrBundleIterator.h vendor/llvm/dist/include/llvm/CodeGen/MachineLoopInfo.h vendor/llvm/dist/include/llvm/CodeGen/MachineModuleInfo.h vendor/llvm/dist/include/llvm/CodeGen/Passes.h vendor/llvm/dist/include/llvm/CodeGen/TargetPassConfig.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeView.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolSerializer.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDatabaseVisitor.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDeserializer.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeSerializer.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h vendor/llvm/dist/include/llvm/DebugInfo/DIContext.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFContext.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/RawConstants.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/TpiHashing.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/PDBContext.h vendor/llvm/dist/include/llvm/IR/Attributes.h vendor/llvm/dist/include/llvm/IR/Function.h vendor/llvm/dist/include/llvm/IR/Instructions.h vendor/llvm/dist/include/llvm/InitializePasses.h vendor/llvm/dist/include/llvm/Object/WindowsResource.h vendor/llvm/dist/include/llvm/Passes/PassBuilder.h vendor/llvm/dist/include/llvm/Support/ARMTargetParser.def vendor/llvm/dist/include/llvm/Support/BinaryStreamReader.h vendor/llvm/dist/include/llvm/Support/YAMLTraits.h vendor/llvm/dist/include/llvm/TableGen/Record.h vendor/llvm/dist/include/llvm/Target/TargetLowering.h vendor/llvm/dist/include/llvm/Target/TargetMachine.h vendor/llvm/dist/include/llvm/Transforms/Scalar/GVN.h vendor/llvm/dist/include/llvm/Transforms/Utils/CodeExtractor.h vendor/llvm/dist/include/llvm/module.modulemap vendor/llvm/dist/lib/Analysis/CFLGraph.h vendor/llvm/dist/lib/Analysis/ConstantFolding.cpp vendor/llvm/dist/lib/Analysis/EHPersonalities.cpp vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist/lib/Analysis/MemoryDependenceAnalysis.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp vendor/llvm/dist/lib/Analysis/ValueTracking.cpp vendor/llvm/dist/lib/Bitcode/Writer/BitcodeWriter.cpp vendor/llvm/dist/lib/CodeGen/AggressiveAntiDepBreaker.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/EHStreamer.cpp vendor/llvm/dist/lib/CodeGen/CMakeLists.txt vendor/llvm/dist/lib/CodeGen/CodeGen.cpp vendor/llvm/dist/lib/CodeGen/CodeGenPrepare.cpp vendor/llvm/dist/lib/CodeGen/CriticalAntiDepBreaker.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/Localizer.cpp vendor/llvm/dist/lib/CodeGen/ImplicitNullChecks.cpp vendor/llvm/dist/lib/CodeGen/MIRParser/MIRParser.cpp vendor/llvm/dist/lib/CodeGen/MIRPrinter.cpp vendor/llvm/dist/lib/CodeGen/MachineBasicBlock.cpp vendor/llvm/dist/lib/CodeGen/MachineInstr.cpp vendor/llvm/dist/lib/CodeGen/MachineModuleInfo.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp vendor/llvm/dist/lib/CodeGen/TargetLoweringBase.cpp vendor/llvm/dist/lib/CodeGen/TargetPassConfig.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CVTypeVisitor.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/EnumTables.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/SymbolDumper.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFContext.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/InfoStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/PDBContext.cpp vendor/llvm/dist/lib/Fuzzer/test/dump_coverage.test vendor/llvm/dist/lib/IR/Attributes.cpp vendor/llvm/dist/lib/IR/Function.cpp vendor/llvm/dist/lib/IR/Instructions.cpp vendor/llvm/dist/lib/LTO/LTOBackend.cpp vendor/llvm/dist/lib/MC/MCCodeView.cpp vendor/llvm/dist/lib/Object/MachOObjectFile.cpp vendor/llvm/dist/lib/Object/WindowsResource.cpp vendor/llvm/dist/lib/ObjectYAML/CMakeLists.txt vendor/llvm/dist/lib/ObjectYAML/LLVMBuild.txt vendor/llvm/dist/lib/Passes/PassBuilder.cpp vendor/llvm/dist/lib/Support/BinaryStreamReader.cpp vendor/llvm/dist/lib/Support/Unix/Path.inc vendor/llvm/dist/lib/TableGen/Record.cpp vendor/llvm/dist/lib/TableGen/TGParser.cpp vendor/llvm/dist/lib/TableGen/TGParser.h vendor/llvm/dist/lib/Target/AArch64/AArch64.td vendor/llvm/dist/lib/Target/AArch64/AArch64SchedM1.td vendor/llvm/dist/lib/Target/AArch64/AArch64TargetMachine.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetMachine.h vendor/llvm/dist/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp vendor/llvm/dist/lib/Target/AMDGPU/DSInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp vendor/llvm/dist/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.h vendor/llvm/dist/lib/Target/AMDGPU/SIDefines.h vendor/llvm/dist/lib/Target/AMDGPU/SIInsertWaitcnts.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.td vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.h vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.h vendor/llvm/dist/lib/Target/ARM/ARMExpandPseudoInsts.cpp vendor/llvm/dist/lib/Target/ARM/ARMFrameLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb.td vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb2.td vendor/llvm/dist/lib/Target/ARM/ARMTargetMachine.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetMachine.h vendor/llvm/dist/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp vendor/llvm/dist/lib/Target/ARM/Thumb1FrameLowering.cpp vendor/llvm/dist/lib/Target/AVR/AVRISelLowering.cpp vendor/llvm/dist/lib/Target/AVR/AVRInstrInfo.td vendor/llvm/dist/lib/Target/AVR/AVRTargetMachine.cpp vendor/llvm/dist/lib/Target/AVR/AVRTargetMachine.h vendor/llvm/dist/lib/Target/BPF/BPFTargetMachine.cpp vendor/llvm/dist/lib/Target/BPF/CMakeLists.txt vendor/llvm/dist/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonISelLowering.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrInfo.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrInfo.h vendor/llvm/dist/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonPatterns.td vendor/llvm/dist/lib/Target/Hexagon/HexagonTargetMachine.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp vendor/llvm/dist/lib/Target/Lanai/LanaiTargetMachine.cpp vendor/llvm/dist/lib/Target/Lanai/LanaiTargetMachine.h vendor/llvm/dist/lib/Target/MSP430/MSP430TargetMachine.cpp vendor/llvm/dist/lib/Target/Mips/Mips16FrameLowering.cpp vendor/llvm/dist/lib/Target/Mips/MipsTargetMachine.cpp vendor/llvm/dist/lib/Target/Mips/MipsTargetMachine.h vendor/llvm/dist/lib/Target/NVPTX/NVPTXTargetMachine.cpp vendor/llvm/dist/lib/Target/NVPTX/NVPTXTargetMachine.h 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/PPCInstr64Bit.td vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.h vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.td vendor/llvm/dist/lib/Target/PowerPC/PPCInstrVSX.td vendor/llvm/dist/lib/Target/PowerPC/PPCTargetMachine.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCTargetMachine.h vendor/llvm/dist/lib/Target/PowerPC/PPCTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCTargetTransformInfo.h vendor/llvm/dist/lib/Target/RISCV/RISCVTargetMachine.cpp vendor/llvm/dist/lib/Target/Sparc/SparcTargetMachine.cpp vendor/llvm/dist/lib/Target/Sparc/SparcTargetMachine.h vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetMachine.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetMachine.h vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp vendor/llvm/dist/lib/Target/X86/InstPrinter/X86InstComments.cpp vendor/llvm/dist/lib/Target/X86/X86FloatingPoint.cpp vendor/llvm/dist/lib/Target/X86/X86FrameLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.h vendor/llvm/dist/lib/Target/X86/X86InstrInfo.cpp vendor/llvm/dist/lib/Target/X86/X86TargetMachine.cpp vendor/llvm/dist/lib/Target/X86/X86TargetMachine.h vendor/llvm/dist/lib/Target/XCore/XCoreTargetMachine.cpp vendor/llvm/dist/lib/Transforms/Coroutines/CoroCleanup.cpp vendor/llvm/dist/lib/Transforms/Coroutines/CoroEarly.cpp vendor/llvm/dist/lib/Transforms/Coroutines/CoroElide.cpp vendor/llvm/dist/lib/Transforms/Coroutines/CoroSplit.cpp vendor/llvm/dist/lib/Transforms/IPO/PartialInlining.cpp vendor/llvm/dist/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/PGOInstrumentation.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/SanitizerCoverage.cpp vendor/llvm/dist/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp vendor/llvm/dist/lib/Transforms/Scalar/NewGVN.cpp vendor/llvm/dist/lib/Transforms/Utils/CodeExtractor.cpp vendor/llvm/dist/lib/Transforms/Utils/PredicateInfo.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyLibCalls.cpp vendor/llvm/dist/lib/Transforms/Vectorize/LoopVectorize.cpp vendor/llvm/dist/test/Bitcode/thinlto-function-summary-callgraph.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/localizer.mir vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/select-pr32733.mir vendor/llvm/dist/test/CodeGen/AArch64/misched-fusion-aes.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.ds.swizzle.ll vendor/llvm/dist/test/CodeGen/AMDGPU/merge-m0.mir vendor/llvm/dist/test/CodeGen/AMDGPU/sdwa-scalar-ops.mir vendor/llvm/dist/test/CodeGen/ARM/cmpxchg-O0.ll vendor/llvm/dist/test/CodeGen/ARM/v6-jumptable-clobber.mir vendor/llvm/dist/test/CodeGen/AVR/rot.ll vendor/llvm/dist/test/CodeGen/MIR/Generic/multiRunPass.mir vendor/llvm/dist/test/CodeGen/Mips/compactbranches/empty-block.mir vendor/llvm/dist/test/CodeGen/PowerPC/expand-isel.ll vendor/llvm/dist/test/CodeGen/Thumb2/tbb-removeadd.mir vendor/llvm/dist/test/CodeGen/X86/2007-01-08-InstrSched.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/irtranslator-call.ll vendor/llvm/dist/test/CodeGen/X86/add-of-carry.ll vendor/llvm/dist/test/CodeGen/X86/addcarry.ll vendor/llvm/dist/test/CodeGen/X86/avg.ll vendor/llvm/dist/test/CodeGen/X86/avx.ll vendor/llvm/dist/test/CodeGen/X86/avx512-cmp-kor-sequence.ll vendor/llvm/dist/test/CodeGen/X86/avx512-gather-scatter-intrin.ll vendor/llvm/dist/test/CodeGen/X86/avx512-intrinsics-upgrade.ll vendor/llvm/dist/test/CodeGen/X86/avx512-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/avx512-mask-spills.ll vendor/llvm/dist/test/CodeGen/X86/avx512bw-intrinsics-upgrade.ll vendor/llvm/dist/test/CodeGen/X86/avx512bw-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/avx512bwvl-intrinsics-upgrade.ll vendor/llvm/dist/test/CodeGen/X86/avx512cdvl-intrinsics-upgrade.ll vendor/llvm/dist/test/CodeGen/X86/avx512cdvl-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/avx512dq-intrinsics-upgrade.ll vendor/llvm/dist/test/CodeGen/X86/avx512dq-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/avx512dqvl-intrinsics-upgrade.ll vendor/llvm/dist/test/CodeGen/X86/avx512dqvl-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/avx512ifma-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/avx512ifmavl-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/avx512vl-intrinsics-upgrade.ll vendor/llvm/dist/test/CodeGen/X86/avx512vl-intrinsics.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-and-setcc-128.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-and-setcc-256.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-setcc-128.ll vendor/llvm/dist/test/CodeGen/X86/bitcast-setcc-256.ll vendor/llvm/dist/test/CodeGen/X86/bswap_tree2.ll vendor/llvm/dist/test/CodeGen/X86/fmsubadd-combine.ll vendor/llvm/dist/test/CodeGen/X86/fold-tied-op.ll vendor/llvm/dist/test/CodeGen/X86/fp128-i128.ll vendor/llvm/dist/test/CodeGen/X86/implicit-null-checks.mir vendor/llvm/dist/test/CodeGen/X86/madd.ll vendor/llvm/dist/test/CodeGen/X86/misched-matrix.ll vendor/llvm/dist/test/CodeGen/X86/mul-constant-i16.ll vendor/llvm/dist/test/CodeGen/X86/mul-constant-i32.ll vendor/llvm/dist/test/CodeGen/X86/mul-constant-i64.ll vendor/llvm/dist/test/CodeGen/X86/oddshuffles.ll vendor/llvm/dist/test/CodeGen/X86/pmul.ll vendor/llvm/dist/test/CodeGen/X86/pr32284.ll vendor/llvm/dist/test/CodeGen/X86/rotate.ll vendor/llvm/dist/test/CodeGen/X86/sad.ll vendor/llvm/dist/test/CodeGen/X86/select.ll vendor/llvm/dist/test/CodeGen/X86/setcc-lowering.ll vendor/llvm/dist/test/CodeGen/X86/setcc-wide-types.ll vendor/llvm/dist/test/CodeGen/X86/shrink_vmul_sse.ll vendor/llvm/dist/test/CodeGen/X86/sse41.ll vendor/llvm/dist/test/CodeGen/X86/vector-bitreverse.ll vendor/llvm/dist/test/CodeGen/X86/vector-blend.ll vendor/llvm/dist/test/CodeGen/X86/x86-interleaved-access.ll vendor/llvm/dist/test/CodeGen/X86/xchg-nofold.ll vendor/llvm/dist/test/DebugInfo/MIR/X86/empty-inline.mir vendor/llvm/dist/test/DebugInfo/omit-empty.ll vendor/llvm/dist/test/Instrumentation/SanitizerCoverage/coverage-dbg.ll vendor/llvm/dist/test/Instrumentation/SanitizerCoverage/coverage.ll vendor/llvm/dist/test/Instrumentation/SanitizerCoverage/seh.ll vendor/llvm/dist/test/MC/AMDGPU/ds-err.s vendor/llvm/dist/test/MC/AMDGPU/ds.s vendor/llvm/dist/test/MC/ARM/big-endian-thumb-fixup.s vendor/llvm/dist/test/MC/Disassembler/AMDGPU/gfx8_dasm_all.txt vendor/llvm/dist/test/Other/new-pm-defaults.ll vendor/llvm/dist/test/Transforms/GVN/PRE/pre-gep-load.ll vendor/llvm/dist/test/Transforms/GVN/PRE/pre-load.ll vendor/llvm/dist/test/Transforms/Inline/AArch64/gep-cost.ll vendor/llvm/dist/test/Transforms/InstCombine/ctpop.ll vendor/llvm/dist/test/Transforms/InstCombine/intrinsics.ll vendor/llvm/dist/test/Transforms/NewGVN/completeness.ll vendor/llvm/dist/test/Transforms/PGOProfile/branch1.ll vendor/llvm/dist/test/Transforms/Util/PredicateInfo/condprop.ll vendor/llvm/dist/test/Transforms/Util/PredicateInfo/testandor.ll vendor/llvm/dist/test/tools/llvm-config/cflags.test vendor/llvm/dist/test/tools/llvm-cvtres/Inputs/test_resource.rc vendor/llvm/dist/test/tools/llvm-cvtres/Inputs/test_resource.res vendor/llvm/dist/test/tools/llvm-cvtres/resource.test vendor/llvm/dist/tools/bugpoint/OptimizerDriver.cpp vendor/llvm/dist/tools/llvm-config/BuildVariables.inc.in vendor/llvm/dist/tools/llvm-config/llvm-config.cpp vendor/llvm/dist/tools/llvm-cvtres/llvm-cvtres.cpp vendor/llvm/dist/tools/llvm-dwarfdump/llvm-dwarfdump.cpp vendor/llvm/dist/tools/llvm-objdump/MachODump.cpp vendor/llvm/dist/tools/llvm-objdump/llvm-objdump.cpp vendor/llvm/dist/tools/llvm-pdbdump/Analyze.cpp vendor/llvm/dist/tools/llvm-pdbdump/CMakeLists.txt vendor/llvm/dist/tools/llvm-pdbdump/CompactTypeDumpVisitor.cpp vendor/llvm/dist/tools/llvm-pdbdump/PdbYaml.cpp vendor/llvm/dist/tools/llvm-pdbdump/PdbYaml.h vendor/llvm/dist/tools/llvm-pdbdump/YAMLOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbdump/YAMLOutputStyle.h vendor/llvm/dist/tools/llvm-pdbdump/llvm-pdbdump.cpp vendor/llvm/dist/tools/llvm-readobj/ELFDumper.cpp vendor/llvm/dist/tools/obj2yaml/macho2yaml.cpp vendor/llvm/dist/tools/opt/NewPMDriver.cpp vendor/llvm/dist/tools/opt/NewPMDriver.h vendor/llvm/dist/tools/opt/opt.cpp vendor/llvm/dist/unittests/ADT/ArrayRefTest.cpp vendor/llvm/dist/unittests/IR/AttributesTest.cpp vendor/llvm/dist/unittests/Support/TargetParserTest.cpp vendor/llvm/dist/utils/TableGen/AsmMatcherEmitter.cpp vendor/llvm/dist/utils/TableGen/AsmWriterEmitter.cpp vendor/llvm/dist/utils/TableGen/Attributes.cpp vendor/llvm/dist/utils/TableGen/CodeEmitterGen.cpp vendor/llvm/dist/utils/TableGen/CodeGenDAGPatterns.cpp vendor/llvm/dist/utils/TableGen/CodeGenDAGPatterns.h vendor/llvm/dist/utils/TableGen/CodeGenRegisters.cpp vendor/llvm/dist/utils/TableGen/CodeGenRegisters.h vendor/llvm/dist/utils/TableGen/CodeGenSchedule.cpp vendor/llvm/dist/utils/TableGen/FixedLenDecoderEmitter.cpp vendor/llvm/dist/utils/TableGen/GlobalISelEmitter.cpp vendor/llvm/dist/utils/TableGen/OptParserEmitter.cpp vendor/llvm/dist/utils/TableGen/RegisterBankEmitter.cpp vendor/llvm/dist/utils/TableGen/RegisterInfoEmitter.cpp vendor/llvm/dist/utils/TableGen/SearchableTableEmitter.cpp vendor/llvm/dist/utils/TableGen/SubtargetEmitter.cpp vendor/llvm/dist/utils/TableGen/X86FoldTablesEmitter.cpp Modified: vendor/llvm/dist/docs/Vectorizers.rst ============================================================================== --- vendor/llvm/dist/docs/Vectorizers.rst Thu Jun 1 20:46:43 2017 (r319460) +++ vendor/llvm/dist/docs/Vectorizers.rst Thu Jun 1 20:58:36 2017 (r319461) @@ -44,12 +44,12 @@ Users can control the vectorization SIMD width using t $ clang -mllvm -force-vector-width=8 ... $ opt -loop-vectorize -force-vector-width=8 ... -Users can control the unroll factor using the command line flag "-force-vector-unroll" +Users can control the unroll factor using the command line flag "-force-vector-interleave" .. code-block:: console - $ clang -mllvm -force-vector-unroll=2 ... - $ opt -loop-vectorize -force-vector-unroll=2 ... + $ clang -mllvm -force-vector-interleave=2 ... + $ opt -loop-vectorize -force-vector-interleave=2 ... Pragma loop hint directives ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Thu Jun 1 20:46:43 2017 (r319460) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Thu Jun 1 20:58:36 2017 (r319461) @@ -454,6 +454,9 @@ class TargetTransformInfo { (public) /// \brief Don't restrict interleaved unrolling to small loops. bool enableAggressiveInterleaving(bool LoopHasReductions) const; + /// \brief Enable inline expansion of memcmp + bool expandMemCmp(Instruction *I, unsigned &MaxLoadSize) const; + /// \brief Enable matching of interleaved access groups. bool enableInterleavedAccessVectorization() const; @@ -828,6 +831,7 @@ class TargetTransformInfo::Concept { (public) unsigned VF) = 0; virtual bool supportsEfficientVectorElementLoadStore() = 0; virtual bool enableAggressiveInterleaving(bool LoopHasReductions) = 0; + virtual bool expandMemCmp(Instruction *I, unsigned &MaxLoadSize) = 0; virtual bool enableInterleavedAccessVectorization() = 0; virtual bool isFPVectorizationPotentiallyUnsafe() = 0; virtual bool allowsMisalignedMemoryAccesses(LLVMContext &Context, @@ -1046,6 +1050,9 @@ class TargetTransformInfo::Model final : public Target bool enableAggressiveInterleaving(bool LoopHasReductions) override { return Impl.enableAggressiveInterleaving(LoopHasReductions); + } + bool expandMemCmp(Instruction *I, unsigned &MaxLoadSize) override { + return Impl.expandMemCmp(I, MaxLoadSize); } bool enableInterleavedAccessVectorization() override { return Impl.enableInterleavedAccessVectorization(); Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Thu Jun 1 20:46:43 2017 (r319460) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Thu Jun 1 20:58:36 2017 (r319461) @@ -274,6 +274,8 @@ class TargetTransformInfoImplBase { (public) bool enableAggressiveInterleaving(bool LoopHasReductions) { return false; } + bool expandMemCmp(Instruction *I, unsigned &MaxLoadSize) { return false; } + bool enableInterleavedAccessVectorization() { return false; } bool isFPVectorizationPotentiallyUnsafe() { return false; } Modified: vendor/llvm/dist/include/llvm/Analysis/ValueTracking.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ValueTracking.h Thu Jun 1 20:46:43 2017 (r319460) +++ vendor/llvm/dist/include/llvm/Analysis/ValueTracking.h Thu Jun 1 20:58:36 2017 (r319461) @@ -85,6 +85,8 @@ template class ArrayRef; const Instruction *CxtI = nullptr, const DominatorTree *DT = nullptr); + bool isOnlyUsedInZeroEqualityComparison(const Instruction *CxtI); + /// Return true if the given value is known to be non-zero when defined. For /// vectors, return true if every element is known to be non-zero when /// defined. For pointers, if the context instruction and dominator tree are Modified: vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h Thu Jun 1 20:46:43 2017 (r319460) +++ vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h Thu Jun 1 20:58:36 2017 (r319461) @@ -396,7 +396,7 @@ class RegisterBankInfo { (protected) mutable DenseMap> MapOfInstructionMappings; - /// Create a RegisterBankInfo that can accomodate up to \p NumRegBanks + /// Create a RegisterBankInfo that can accommodate up to \p NumRegBanks /// RegisterBank instances. RegisterBankInfo(RegisterBank **RegBanks, unsigned NumRegBanks); Modified: vendor/llvm/dist/include/llvm/CodeGen/ISDOpcodes.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/ISDOpcodes.h Thu Jun 1 20:46:43 2017 (r319460) +++ vendor/llvm/dist/include/llvm/CodeGen/ISDOpcodes.h Thu Jun 1 20:58:36 2017 (r319461) @@ -410,11 +410,21 @@ namespace ISD { /// then the result type must also be a vector type. SETCC, - /// Like SetCC, ops #0 and #1 are the LHS and RHS operands to compare, but + /// Like SetCC, ops #0 and #1 are the LHS and RHS operands to compare, and /// op #2 is a *carry value*. This operator checks the result of /// "LHS - RHS - Carry", and can be used to compare two wide integers: /// (setcce lhshi rhshi (subc lhslo rhslo) cc). Only valid for integers. + /// FIXME: This node is deprecated in favor of SETCCCARRY. + /// It is kept around for now to provide a smooth transition path + /// toward the use of SETCCCARRY and will eventually be removed. SETCCE, + + /// Like SetCC, ops #0 and #1 are the LHS and RHS operands to compare, but + /// op #2 is a boolean indicating if there is an incoming carry. This + /// operator checks the result of "LHS - RHS - Carry", and can be used to + /// compare two wide integers: (setcce lhshi rhshi (subc lhslo rhslo) cc). + /// Only valid for integers. + SETCCCARRY, /// SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded /// integer shift operations. The operation ordering is: Modified: vendor/llvm/dist/include/llvm/CodeGen/MIRYamlMapping.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MIRYamlMapping.h Thu Jun 1 20:46:43 2017 (r319460) +++ vendor/llvm/dist/include/llvm/CodeGen/MIRYamlMapping.h Thu Jun 1 20:58:36 2017 (r319461) @@ -381,7 +381,6 @@ struct MachineFunction { StringRef Name; unsigned Alignment = 0; bool ExposesReturnsTwice = false; - bool NoVRegs; // GISel MachineFunctionProperties. bool Legalized = false; bool RegBankSelected = false; @@ -406,7 +405,6 @@ template <> struct MappingTraits { YamlIO.mapRequired("name", MF.Name); YamlIO.mapOptional("alignment", MF.Alignment); YamlIO.mapOptional("exposesReturnsTwice", MF.ExposesReturnsTwice); - YamlIO.mapOptional("noVRegs", MF.NoVRegs); YamlIO.mapOptional("legalized", MF.Legalized); YamlIO.mapOptional("regBankSelected", MF.RegBankSelected); YamlIO.mapOptional("selected", MF.Selected); Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h Thu Jun 1 20:46:43 2017 (r319460) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h Thu Jun 1 20:58:36 2017 (r319461) @@ -335,6 +335,9 @@ class MachineBasicBlock (public) return make_range(livein_begin(), livein_end()); } + /// Remove entry from the livein set and return iterator to the next. + livein_iterator removeLiveIn(livein_iterator I); + /// Get the clobber mask for the start of this basic block. Funclets use this /// to prevent register allocation across funclet transitions. const uint32_t *getBeginClobberMask(const TargetRegisterInfo *TRI) const; Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineConstantPool.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineConstantPool.h Thu Jun 1 20:46:43 2017 (r319460) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineConstantPool.h Thu Jun 1 20:58:36 2017 (r319461) @@ -1,4 +1,4 @@ -//===-- CodeGen/MachineConstantPool.h - Abstract Constant Pool --*- C++ -*-===// +//===- CodeGen/MachineConstantPool.h - Abstract Constant Pool ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -18,29 +18,28 @@ #include "llvm/ADT/DenseSet.h" #include "llvm/MC/SectionKind.h" -#include #include #include namespace llvm { class Constant; -class FoldingSetNodeID; class DataLayout; -class TargetMachine; -class Type; +class FoldingSetNodeID; class MachineConstantPool; class raw_ostream; +class Type; /// Abstract base class for all machine specific constantpool value subclasses. /// class MachineConstantPoolValue { virtual void anchor(); + Type *Ty; public: explicit MachineConstantPoolValue(Type *ty) : Ty(ty) {} - virtual ~MachineConstantPoolValue() {} + virtual ~MachineConstantPoolValue() = default; /// getType - get type of this MachineConstantPoolValue. /// @@ -81,6 +80,7 @@ class MachineConstantPoolEntry { (public) : Alignment(A) { Val.ConstVal = V; } + MachineConstantPoolEntry(MachineConstantPoolValue *V, unsigned A) : Alignment(A) { Val.MachineCPVal = V; @@ -153,13 +153,12 @@ class MachineConstantPool { (public) /// print - Used by the MachineFunction printer to print information about /// constant pool objects. Implemented in MachineFunction.cpp - /// void print(raw_ostream &OS) const; /// dump - Call print(cerr) to be called from the debugger. void dump() const; }; -} // End llvm namespace +} // end namespace llvm -#endif +#endif // LLVM_CODEGEN_MACHINECONSTANTPOOL_H Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineFunction.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineFunction.h Thu Jun 1 20:46:43 2017 (r319460) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineFunction.h Thu Jun 1 20:58:36 2017 (r319461) @@ -1,4 +1,4 @@ -//===-- llvm/CodeGen/MachineFunction.h --------------------------*- C++ -*-===// +//===- llvm/CodeGen/MachineFunction.h ---------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -18,38 +18,61 @@ #ifndef LLVM_CODEGEN_MACHINEFUNCTION_H #define LLVM_CODEGEN_MACHINEFUNCTION_H +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/BitVector.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/ilist.h" +#include "llvm/ADT/iterator.h" #include "llvm/ADT/Optional.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" #include "llvm/Analysis/EHPersonalities.h" #include "llvm/CodeGen/MachineBasicBlock.h" +#include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/IR/DebugLoc.h" +#include "llvm/IR/Instructions.h" #include "llvm/IR/Metadata.h" #include "llvm/MC/MCDwarf.h" #include "llvm/MC/MCSymbol.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/ArrayRecycler.h" +#include "llvm/Support/AtomicOrdering.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Recycler.h" +#include +#include +#include +#include +#include namespace llvm { -class Value; +class BasicBlock; +class BlockAddress; +class DataLayout; +class DIExpression; +class DILocalVariable; +class DILocation; class Function; -class GCModuleInfo; -class MachineRegisterInfo; -class MachineFrameInfo; +class GlobalValue; class MachineConstantPool; +class MachineFrameInfo; +class MachineFunction; class MachineJumpTableInfo; class MachineModuleInfo; +class MachineRegisterInfo; class MCContext; +class MCInstrDesc; class Pass; class PseudoSourceValueManager; +class raw_ostream; +class SlotIndexes; class TargetMachine; -class TargetSubtargetInfo; class TargetRegisterClass; -struct MachinePointerInfo; +class TargetSubtargetInfo; struct WinEHFuncInfo; template <> struct ilist_alloc_traits { @@ -137,27 +160,33 @@ class MachineFunctionProperties { (public) bool hasProperty(Property P) const { return Properties[static_cast(P)]; } + MachineFunctionProperties &set(Property P) { Properties.set(static_cast(P)); return *this; } + MachineFunctionProperties &reset(Property P) { Properties.reset(static_cast(P)); return *this; } + /// Reset all the properties. MachineFunctionProperties &reset() { Properties.reset(); return *this; } + MachineFunctionProperties &set(const MachineFunctionProperties &MFP) { Properties |= MFP.Properties; return *this; } + MachineFunctionProperties &reset(const MachineFunctionProperties &MFP) { Properties.reset(MFP.Properties); return *this; } + // Returns true if all properties set in V (i.e. required by a pass) are set // in this. bool verifyRequiredProperties(const MachineFunctionProperties &V) const { @@ -180,18 +209,17 @@ struct SEHHandler { const BlockAddress *RecoverBA; }; - /// This structure is used to retain landing pad info for the current function. struct LandingPadInfo { MachineBasicBlock *LandingPadBlock; // Landing pad block. SmallVector BeginLabels; // Labels prior to invoke. SmallVector EndLabels; // Labels after invoke. SmallVector SEHHandlers; // SEH handlers active at this lpad. - MCSymbol *LandingPadLabel; // Label at beginning of landing pad. - std::vector TypeIds; // List of type ids (filters negative). + MCSymbol *LandingPadLabel = nullptr; // Label at beginning of landing pad. + std::vector TypeIds; // List of type ids (filters negative). explicit LandingPadInfo(MachineBasicBlock *MBB) - : LandingPadBlock(MBB), LandingPadLabel(nullptr) {} + : LandingPadBlock(MBB) {} }; class MachineFunction { @@ -239,7 +267,7 @@ class MachineFunction { Recycler BasicBlockRecycler; // List of machine basic blocks in function - typedef ilist BasicBlockListType; + using BasicBlockListType = ilist; BasicBlockListType BasicBlocks; /// FunctionNumber - This provides a unique ID for each function emitted in @@ -281,7 +309,7 @@ class MachineFunction { std::vector LandingPads; /// Map a landing pad's EH symbol to the call site indexes. - DenseMap > LPadToCallSiteMap; + DenseMap> LPadToCallSiteMap; /// Map of invoke call site index values to associated begin EH_LABEL. DenseMap CallSiteMap; @@ -303,9 +331,6 @@ class MachineFunction { /// \} - MachineFunction(const MachineFunction &) = delete; - void operator=(const MachineFunction&) = delete; - /// Clear all the members of this MachineFunction, but the ones used /// to initialize again the MachineFunction. /// More specifically, this deallocates all the dynamically allocated @@ -316,8 +341,8 @@ class MachineFunction { /// In particular, the XXXInfo data structure. /// \pre Fn, Target, MMI, and FunctionNumber are properly set. void init(); -public: +public: struct VariableDbgInfo { const DILocalVariable *Var; const DIExpression *Expr; @@ -328,11 +353,13 @@ class MachineFunction { unsigned Slot, const DILocation *Loc) : Var(Var), Expr(Expr), Slot(Slot), Loc(Loc) {} }; - typedef SmallVector VariableDbgInfoMapTy; + using VariableDbgInfoMapTy = SmallVector; VariableDbgInfoMapTy VariableDbgInfos; MachineFunction(const Function *Fn, const TargetMachine &TM, unsigned FunctionNum, MachineModuleInfo &MMI); + MachineFunction(const MachineFunction &) = delete; + MachineFunction &operator=(const MachineFunction &) = delete; ~MachineFunction(); /// Reset the instance as if it was just created. @@ -350,19 +377,15 @@ class MachineFunction { const DataLayout &getDataLayout() const; /// getFunction - Return the LLVM function that this machine code represents - /// const Function *getFunction() const { return Fn; } /// getName - Return the name of the corresponding LLVM function. - /// StringRef getName() const; /// getFunctionNumber - Return a unique ID for the current function. - /// unsigned getFunctionNumber() const { return FunctionNumber; } /// getTarget - Return the target machine this machine code is compiled with - /// const TargetMachine &getTarget() const { return Target; } /// getSubtarget - Return the subtarget for which this machine code is being @@ -378,14 +401,12 @@ class MachineFunction { } /// getRegInfo - Return information about the registers currently in use. - /// MachineRegisterInfo &getRegInfo() { return *RegInfo; } const MachineRegisterInfo &getRegInfo() const { return *RegInfo; } /// getFrameInfo - Return the frame info object for the current function. /// This object contains information about objects allocated on the stack /// frame of the current function in an abstract way. - /// MachineFrameInfo &getFrameInfo() { return *FrameInfo; } const MachineFrameInfo &getFrameInfo() const { return *FrameInfo; } @@ -402,7 +423,6 @@ class MachineFunction { /// getConstantPool - Return the constant pool object for the current /// function. - /// MachineConstantPool *getConstantPool() { return ConstantPool; } const MachineConstantPool *getConstantPool() const { return ConstantPool; } @@ -413,11 +433,9 @@ class MachineFunction { WinEHFuncInfo *getWinEHFuncInfo() { return WinEHInfo; } /// getAlignment - Return the alignment (log2, not bytes) of the function. - /// unsigned getAlignment() const { return Alignment; } /// setAlignment - Set the alignment (log2, not bytes) of the function. - /// void setAlignment(unsigned A) { Alignment = A; } /// ensureAlignment - Make sure the function is at least 1 << A bytes aligned. @@ -487,7 +505,6 @@ class MachineFunction { bool shouldSplitStack() const; /// getNumBlockIDs - Return the number of MBB ID's allocated. - /// unsigned getNumBlockIDs() const { return (unsigned)MBBNumbering.size(); } /// RenumberBlocks - This discards all of the MachineBasicBlock numbers and @@ -499,7 +516,6 @@ class MachineFunction { /// print - Print out the MachineFunction in a format suitable for debugging /// to the specified stream. - /// void print(raw_ostream &OS, const SlotIndexes* = nullptr) const; /// viewCFG - This function is meant for use from the debugger. You can just @@ -507,7 +523,6 @@ class MachineFunction { /// program, displaying the CFG of the current function with the code for each /// basic block inside. This depends on there being a 'dot' and 'gv' program /// in your path. - /// void viewCFG() const; /// viewCFGOnly - This function is meant for use from the debugger. It works @@ -518,7 +533,6 @@ class MachineFunction { void viewCFGOnly() const; /// dump - Print the current MachineFunction to cerr, useful for debugger use. - /// void dump() const; /// Run the current MachineFunction through the machine code verifier, useful @@ -528,10 +542,10 @@ class MachineFunction { bool AbortOnError = true) const; // Provide accessors for the MachineBasicBlock list... - typedef BasicBlockListType::iterator iterator; - typedef BasicBlockListType::const_iterator const_iterator; - typedef BasicBlockListType::const_reverse_iterator const_reverse_iterator; - typedef BasicBlockListType::reverse_iterator reverse_iterator; + using iterator = BasicBlockListType::iterator; + using const_iterator = BasicBlockListType::const_iterator; + using const_reverse_iterator = BasicBlockListType::const_reverse_iterator; + using reverse_iterator = BasicBlockListType::reverse_iterator; /// Support for MachineBasicBlock::getNextNode(). static BasicBlockListType MachineFunction::* @@ -590,11 +604,9 @@ class MachineFunction { //===--------------------------------------------------------------------===// // Internal functions used to automatically number MachineBasicBlocks - // /// \brief Adds the MBB to the internal numbering. Returns the unique number /// assigned to the MBB. - /// unsigned addToMBBNumbering(MachineBasicBlock *MBB) { MBBNumbering.push_back(MBB); return (unsigned)MBBNumbering.size()-1; @@ -610,7 +622,6 @@ class MachineFunction { /// CreateMachineInstr - Allocate a new MachineInstr. Use this instead /// of `new MachineInstr'. - /// MachineInstr *CreateMachineInstr(const MCInstrDesc &MCID, const DebugLoc &DL, bool NoImp = false); @@ -623,16 +634,13 @@ class MachineFunction { MachineInstr *CloneMachineInstr(const MachineInstr *Orig); /// DeleteMachineInstr - Delete the given MachineInstr. - /// void DeleteMachineInstr(MachineInstr *MI); /// CreateMachineBasicBlock - Allocate a new MachineBasicBlock. Use this /// instead of `new MachineBasicBlock'. - /// MachineBasicBlock *CreateMachineBasicBlock(const BasicBlock *bb = nullptr); /// DeleteMachineBasicBlock - Delete the given MachineBasicBlock. - /// void DeleteMachineBasicBlock(MachineBasicBlock *MBB); /// getMachineMemOperand - Allocate a new MachineMemOperand. @@ -653,7 +661,7 @@ class MachineFunction { MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO, int64_t Offset, uint64_t Size); - typedef ArrayRecycler::Capacity OperandCapacity; + using OperandCapacity = ArrayRecycler::Capacity; /// Allocate an array of MachineOperands. This is only intended for use by /// internal MachineInstr functions. @@ -700,7 +708,6 @@ class MachineFunction { //===--------------------------------------------------------------------===// // Label Manipulation. - // /// getJTISymbol - Return the MCSymbol for the specified non-empty jump table. /// If isLinkerPrivate is specified, an 'l' label is returned, otherwise a @@ -858,13 +865,16 @@ template <> struct GraphTraits : static NodeRef getEntryNode(MachineFunction *F) { return &F->front(); } // nodes_iterator/begin/end - Allow iteration over all nodes in the graph - typedef pointer_iterator nodes_iterator; + using nodes_iterator = pointer_iterator; + static nodes_iterator nodes_begin(MachineFunction *F) { return nodes_iterator(F->begin()); } + static nodes_iterator nodes_end(MachineFunction *F) { return nodes_iterator(F->end()); } + static unsigned size (MachineFunction *F) { return F->size(); } }; template <> struct GraphTraits : @@ -872,37 +882,39 @@ template <> struct GraphTraits static NodeRef getEntryNode(const MachineFunction *F) { return &F->front(); } // nodes_iterator/begin/end - Allow iteration over all nodes in the graph - typedef pointer_iterator nodes_iterator; + using nodes_iterator = pointer_iterator; + static nodes_iterator nodes_begin(const MachineFunction *F) { return nodes_iterator(F->begin()); } + static nodes_iterator nodes_end (const MachineFunction *F) { return nodes_iterator(F->end()); } + static unsigned size (const MachineFunction *F) { return F->size(); } }; - // Provide specializations of GraphTraits to be able to treat a function as a // graph of basic blocks... and to walk it in inverse order. Inverse order for // a function is considered to be when traversing the predecessor edges of a BB // instead of the successor edges. // -template <> struct GraphTraits > : - public GraphTraits > { +template <> struct GraphTraits> : + public GraphTraits> { static NodeRef getEntryNode(Inverse G) { return &G.Graph->front(); } }; -template <> struct GraphTraits > : - public GraphTraits > { +template <> struct GraphTraits> : + public GraphTraits> { static NodeRef getEntryNode(Inverse G) { return &G.Graph->front(); } }; -} // End llvm namespace +} // end namespace llvm -#endif +#endif // LLVM_CODEGEN_MACHINEFUNCTION_H Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineFunctionInitializer.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineFunctionInitializer.h Thu Jun 1 20:46:43 2017 (r319460) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineFunctionInitializer.h Thu Jun 1 20:58:36 2017 (r319461) @@ -1,4 +1,4 @@ -//===- MachineFunctionInitializer.h - machine function initializer ---------===// +//=- MachineFunctionInitializer.h - machine function initializer --*- C++ -*-=// // // The LLVM Compiler Infrastructure // @@ -25,7 +25,7 @@ class MachineFunctionInitializer { virtual void anchor(); public: - virtual ~MachineFunctionInitializer() {} + virtual ~MachineFunctionInitializer() = default; /// Initialize the machine function. /// @@ -35,4 +35,4 @@ class MachineFunctionInitializer { } // end namespace llvm -#endif +#endif // LLVM_CODEGEN_MACHINEFUNCTIONINITIALIZER_H Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h Thu Jun 1 20:46:43 2017 (r319460) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h Thu Jun 1 20:58:36 2017 (r319461) @@ -1,4 +1,4 @@ -//===-- llvm/CodeGen/MachineInstr.h - MachineInstr class --------*- C++ -*-===// +//===- llvm/CodeGen/MachineInstr.h - MachineInstr class ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -17,7 +17,6 @@ #define LLVM_CODEGEN_MACHINEINSTR_H #include "llvm/ADT/DenseMapInfo.h" -#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/ilist.h" #include "llvm/ADT/ilist_node.h" #include "llvm/ADT/iterator_range.h" @@ -28,19 +27,27 @@ #include "llvm/MC/MCInstrDesc.h" #include "llvm/Support/ArrayRecycler.h" #include "llvm/Target/TargetOpcodes.h" +#include +#include +#include +#include namespace llvm { -class StringRef; template class ArrayRef; -template class SmallVectorImpl; -class DILocalVariable; class DIExpression; +class DILocalVariable; +class MachineBasicBlock; +class MachineFunction; +class MachineMemOperand; +class MachineRegisterInfo; +class ModuleSlotTracker; +class raw_ostream; +template class SmallVectorImpl; +class StringRef; class TargetInstrInfo; class TargetRegisterClass; class TargetRegisterInfo; -class MachineFunction; -class MachineMemOperand; //===----------------------------------------------------------------------===// /// Representation of each machine instruction. @@ -53,7 +60,7 @@ class MachineInstr : public ilist_node_with_parent> { public: - typedef MachineMemOperand **mmo_iterator; + using mmo_iterator = MachineMemOperand **; /// Flags to specify different kinds of comments to output in /// assembly code. These flags carry semantic information not @@ -72,43 +79,39 @@ class MachineInstr BundledPred = 1 << 2, // Instruction has bundled predecessors. BundledSucc = 1 << 3 // Instruction has bundled successors. }; + private: const MCInstrDesc *MCID; // Instruction descriptor. - MachineBasicBlock *Parent; // Pointer to the owning basic block. + MachineBasicBlock *Parent = nullptr; // Pointer to the owning basic block. // Operands are allocated by an ArrayRecycler. - MachineOperand *Operands; // Pointer to the first operand. - unsigned NumOperands; // Number of operands on instruction. - typedef ArrayRecycler::Capacity OperandCapacity; + MachineOperand *Operands = nullptr; // Pointer to the first operand. + unsigned NumOperands = 0; // Number of operands on instruction. + using OperandCapacity = ArrayRecycler::Capacity; OperandCapacity CapOperands; // Capacity of the Operands array. - uint8_t Flags; // Various bits of additional + uint8_t Flags = 0; // Various bits of additional // information about machine // instruction. - uint8_t AsmPrinterFlags; // Various bits of information used by + uint8_t AsmPrinterFlags = 0; // Various bits of information used by // the AsmPrinter to emit helpful // comments. This is *not* semantic // information. Do not use this for // anything other than to convey comment // information to AsmPrinter. - uint8_t NumMemRefs; // Information on memory references. + uint8_t NumMemRefs = 0; // Information on memory references. // Note that MemRefs == nullptr, means 'don't know', not 'no memory access'. // Calling code must treat missing information conservatively. If the number // of memory operands required to be precise exceeds the maximum value of // NumMemRefs - currently 256 - we remove the operands entirely. Note also // that this is a non-owning reference to a shared copy on write buffer owned // by the MachineFunction and created via MF.allocateMemRefsArray. - mmo_iterator MemRefs; + mmo_iterator MemRefs = nullptr; DebugLoc debugLoc; // Source line information. - MachineInstr(const MachineInstr&) = delete; - void operator=(const MachineInstr&) = delete; - // Use MachineFunction::DeleteMachineInstr() instead. - ~MachineInstr() = delete; - // Intrusive list support friend struct ilist_traits; friend struct ilist_callback_traits; @@ -128,6 +131,11 @@ class MachineInstr friend class MachineFunction; public: + MachineInstr(const MachineInstr &) = delete; + MachineInstr &operator=(const MachineInstr &) = delete; + // Use MachineFunction::DeleteMachineInstr() instead. + ~MachineInstr() = delete; + const MachineBasicBlock* getParent() const { return Parent; } MachineBasicBlock* getParent() { return Parent; } @@ -178,7 +186,6 @@ class MachineInstr Flags &= ~((uint8_t)Flag); } - /// Return true if MI is in a bundle (but not the first MI in a bundle). /// /// A bundle looks like this before it's finalized: @@ -263,7 +270,6 @@ class MachineInstr /// earlier. /// /// If this method returns, the caller should try to recover from the error. - /// void emitError(StringRef Msg) const; /// Returns the target instruction descriptor of this MachineInstr. @@ -273,7 +279,6 @@ class MachineInstr unsigned getOpcode() const { return MCID->Opcode; } /// Access to explicit operands of the instruction. - /// unsigned getNumOperands() const { return NumOperands; } const MachineOperand& getOperand(unsigned i) const { @@ -289,8 +294,8 @@ class MachineInstr unsigned getNumExplicitOperands() const; /// iterator/begin/end - Iterate over all operands of a machine instruction. - typedef MachineOperand *mop_iterator; - typedef const MachineOperand *const_mop_iterator; + using mop_iterator = MachineOperand *; + using const_mop_iterator = const MachineOperand *; mop_iterator operands_begin() { return Operands; } mop_iterator operands_end() { return Operands + NumOperands; } @@ -713,7 +718,6 @@ class MachineInstr return hasProperty(MCID::ExtraDefRegAllocReq, Type); } - enum MICheckType { CheckDefs, // Check all operands for equality CheckKillDead, // Check all operands including kill / dead markers @@ -767,6 +771,7 @@ class MachineInstr /// Returns true if the MachineInstr represents a label. bool isLabel() const { return isEHLabel() || isGCLabel(); } + bool isCFIInstruction() const { return getOpcode() == TargetOpcode::CFI_INSTRUCTION; } @@ -775,6 +780,7 @@ class MachineInstr bool isPosition() const { return isLabel() || isCFIInstruction(); } bool isDebugValue() const { return getOpcode() == TargetOpcode::DBG_VALUE; } + /// A DBG_VALUE is indirect iff the first operand is a register and /// the second operand is an immediate. bool isIndirectDebugValue() const { @@ -787,29 +793,38 @@ class MachineInstr bool isKill() const { return getOpcode() == TargetOpcode::KILL; } bool isImplicitDef() const { return getOpcode()==TargetOpcode::IMPLICIT_DEF; } bool isInlineAsm() const { return getOpcode() == TargetOpcode::INLINEASM; } + bool isMSInlineAsm() const { return getOpcode() == TargetOpcode::INLINEASM && getInlineAsmDialect(); } + bool isStackAligningInlineAsm() const; InlineAsm::AsmDialect getInlineAsmDialect() const; + bool isInsertSubreg() const { return getOpcode() == TargetOpcode::INSERT_SUBREG; } + bool isSubregToReg() const { return getOpcode() == TargetOpcode::SUBREG_TO_REG; } + bool isRegSequence() const { return getOpcode() == TargetOpcode::REG_SEQUENCE; } + bool isBundle() const { return getOpcode() == TargetOpcode::BUNDLE; } + bool isCopy() const { return getOpcode() == TargetOpcode::COPY; } + bool isFullCopy() const { return isCopy() && !getOperand(0).getSubReg() && !getOperand(1).getSubReg(); } + bool isExtractSubreg() const { return getOpcode() == TargetOpcode::EXTRACT_SUBREG; } @@ -978,7 +993,6 @@ class MachineInstr /// /// The flag operand is an immediate that can be decoded with methods like /// InlineAsm::hasRegClassConstraint(). - /// int findInlineAsmFlagIdx(unsigned OpIdx, unsigned *GroupNo = nullptr) const; /// Compute the static register class constraint for operand OpIdx. @@ -987,7 +1001,6 @@ class MachineInstr /// /// Returns NULL if the static register class constraint cannot be /// determined. - /// const TargetRegisterClass* getRegClassConstraint(unsigned OpIdx, const TargetInstrInfo *TII, @@ -1328,6 +1341,6 @@ inline raw_ostream& operator<<(raw_ostream &OS, const return OS; } -} // End llvm namespace +} // end namespace llvm -#endif +#endif // LLVM_CODEGEN_MACHINEINSTR_H Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineInstrBundleIterator.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineInstrBundleIterator.h Thu Jun 1 20:46:43 2017 (r319460) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineInstrBundleIterator.h Thu Jun 1 20:58:36 2017 (r319461) @@ -15,34 +15,37 @@ #define LLVM_CODEGEN_MACHINEINSTRBUNDLEITERATOR_H #include "llvm/ADT/ilist.h" +#include "llvm/ADT/simple_ilist.h" +#include #include +#include namespace llvm { template struct MachineInstrBundleIteratorTraits; template struct MachineInstrBundleIteratorTraits { - typedef simple_ilist> list_type; - typedef typename list_type::iterator instr_iterator; - typedef typename list_type::iterator nonconst_instr_iterator; - typedef typename list_type::const_iterator const_instr_iterator; + using list_type = simple_ilist>; + using instr_iterator = typename list_type::iterator; + using nonconst_instr_iterator = typename list_type::iterator; + using const_instr_iterator = typename list_type::const_iterator; }; template struct MachineInstrBundleIteratorTraits { - typedef simple_ilist> list_type; - typedef typename list_type::reverse_iterator instr_iterator; - typedef typename list_type::reverse_iterator nonconst_instr_iterator; - typedef typename list_type::const_reverse_iterator const_instr_iterator; + using list_type = simple_ilist>; + using instr_iterator = typename list_type::reverse_iterator; + using nonconst_instr_iterator = typename list_type::reverse_iterator; + using const_instr_iterator = typename list_type::const_reverse_iterator; }; template struct MachineInstrBundleIteratorTraits { - typedef simple_ilist> list_type; - typedef typename list_type::const_iterator instr_iterator; - typedef typename list_type::iterator nonconst_instr_iterator; - typedef typename list_type::const_iterator const_instr_iterator; + using list_type = simple_ilist>; + using instr_iterator = typename list_type::const_iterator; + using nonconst_instr_iterator = typename list_type::iterator; + using const_instr_iterator = typename list_type::const_iterator; }; template struct MachineInstrBundleIteratorTraits { - typedef simple_ilist> list_type; - typedef typename list_type::const_reverse_iterator instr_iterator; - typedef typename list_type::reverse_iterator nonconst_instr_iterator; - typedef typename list_type::const_reverse_iterator const_instr_iterator; + using list_type = simple_ilist>; + using instr_iterator = typename list_type::const_reverse_iterator; + using nonconst_instr_iterator = typename list_type::reverse_iterator; + using const_instr_iterator = typename list_type::const_reverse_iterator; }; template struct MachineInstrBundleIteratorHelper; @@ -104,27 +107,27 @@ template <> struct MachineInstrBundleIteratorHelper class MachineInstrBundleIterator : MachineInstrBundleIteratorHelper { - typedef MachineInstrBundleIteratorTraits Traits; - typedef typename Traits::instr_iterator instr_iterator; + using Traits = MachineInstrBundleIteratorTraits; + using instr_iterator = typename Traits::instr_iterator; + instr_iterator MII; public: - typedef typename instr_iterator::value_type value_type; - typedef typename instr_iterator::difference_type difference_type; - typedef typename instr_iterator::pointer pointer; - typedef typename instr_iterator::reference reference; - typedef std::bidirectional_iterator_tag iterator_category; + using value_type = typename instr_iterator::value_type; + using difference_type = typename instr_iterator::difference_type; + using pointer = typename instr_iterator::pointer; + using reference = typename instr_iterator::reference; + using const_pointer = typename instr_iterator::const_pointer; + using const_reference = typename instr_iterator::const_reference; + using iterator_category = std::bidirectional_iterator_tag; - typedef typename instr_iterator::const_pointer const_pointer; - typedef typename instr_iterator::const_reference const_reference; - private: - typedef typename Traits::nonconst_instr_iterator nonconst_instr_iterator; - typedef typename Traits::const_instr_iterator const_instr_iterator; - typedef MachineInstrBundleIterator< - typename nonconst_instr_iterator::value_type, IsReverse> - nonconst_iterator; - typedef MachineInstrBundleIterator reverse_iterator; + using nonconst_instr_iterator = typename Traits::nonconst_instr_iterator; + using const_instr_iterator = typename Traits::const_instr_iterator; + using nonconst_iterator = + MachineInstrBundleIterator; + using reverse_iterator = MachineInstrBundleIterator; public: MachineInstrBundleIterator(instr_iterator MI) : MII(MI) { @@ -138,12 +141,14 @@ class MachineInstrBundleIterator : MachineInstrBundleI "MachineInstrBundleIterator with a " "bundled MI"); } + MachineInstrBundleIterator(pointer MI) : MII(MI) { // FIXME: This conversion should be explicit. assert((!MI || !MI->isBundledWithPred()) && "It's not legal to initialize " "MachineInstrBundleIterator " "with a bundled MI"); } + // Template allows conversion from const to nonconst. template MachineInstrBundleIterator( @@ -151,6 +156,7 @@ class MachineInstrBundleIterator : MachineInstrBundleI typename std::enable_if::value, void *>::type = nullptr) : MII(I.getInstrIterator()) {} + MachineInstrBundleIterator() : MII(nullptr) {} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Thu Jun 1 20:58:44 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 7358CB7EA5D; Thu, 1 Jun 2017 20:58:44 +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 28CCD67C41; Thu, 1 Jun 2017 20:58:44 +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 v51KwhBp035020; Thu, 1 Jun 2017 20:58:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51Kwh79035019; Thu, 1 Jun 2017 20:58:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012058.v51Kwh79035019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 20:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319462 - vendor/llvm/llvm-trunk-r304460 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:58:44 -0000 Author: dim Date: Thu Jun 1 20:58:42 2017 New Revision: 319462 URL: https://svnweb.freebsd.org/changeset/base/319462 Log: Tag llvm trunk r304460. Added: vendor/llvm/llvm-trunk-r304460/ - copied from r319461, vendor/llvm/dist/ From owner-svn-src-vendor@freebsd.org Thu Jun 1 20:58:58 2017 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AB8AB7EAD6; Thu, 1 Jun 2017 20:58:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 267E867D10; Thu, 1 Jun 2017 20:58:58 +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 v51KwvuL035144; Thu, 1 Jun 2017 20:58:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51Kwvl5035143; Thu, 1 Jun 2017 20:58:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012058.v51Kwvl5035143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 20:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319464 - vendor/clang/clang-trunk-r304460 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:58:58 -0000 Author: dim Date: Thu Jun 1 20:58:56 2017 New Revision: 319464 URL: https://svnweb.freebsd.org/changeset/base/319464 Log: Tag clang trunk r304460. Added: vendor/clang/clang-trunk-r304460/ - copied from r319463, vendor/clang/dist/ From owner-svn-src-vendor@freebsd.org Thu Jun 1 20:58:54 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 2C4BBB7EAC2; Thu, 1 Jun 2017 20:58:54 +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 B1A6167CBF; Thu, 1 Jun 2017 20:58:53 +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 v51KwqLY035097; Thu, 1 Jun 2017 20:58:52 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51KwnaF035068; Thu, 1 Jun 2017 20:58:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012058.v51KwnaF035068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 20:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319463 - in vendor/clang/dist: docs include/clang/AST include/clang/Basic include/clang/Driver include/clang/Lex lib/AST lib/Basic lib/CodeGen lib/Driver/ToolChains lib/Format lib/Fron... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:58:54 -0000 Author: dim Date: Thu Jun 1 20:58:49 2017 New Revision: 319463 URL: https://svnweb.freebsd.org/changeset/base/319463 Log: Vendor import of clang trunk r304460: https://llvm.org/svn/llvm-project/cfe/trunk@304460 Added: vendor/clang/dist/test/CodeGen/ubsan-pointer-overflow.m vendor/clang/dist/test/CodeGenCoroutines/coro-await-domination.cpp (contents, props changed) vendor/clang/dist/test/CodeGenOpenCL/kernels-have-spir-cc-by-default.cl vendor/clang/dist/test/Driver/cl-cc-flags.c (contents, props changed) vendor/clang/dist/test/Driver/cl-diagnostics.c (contents, props changed) vendor/clang/dist/test/Driver/cl-include.c (contents, props changed) vendor/clang/dist/test/SemaCXX/coroutine-uninitialized-warning-crash.cpp (contents, props changed) Modified: vendor/clang/dist/docs/Modules.rst vendor/clang/dist/docs/ThinLTO.rst vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst vendor/clang/dist/include/clang/AST/VTableBuilder.h 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/Module.h vendor/clang/dist/include/clang/Basic/Sanitizers.def vendor/clang/dist/include/clang/Basic/TokenKinds.def vendor/clang/dist/include/clang/Basic/TypeTraits.h vendor/clang/dist/include/clang/Driver/CLCompatOptions.td vendor/clang/dist/include/clang/Driver/Options.td vendor/clang/dist/include/clang/Lex/HeaderSearch.h vendor/clang/dist/lib/AST/ODRHash.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/ABIInfo.h vendor/clang/dist/lib/CodeGen/CGCall.cpp vendor/clang/dist/lib/CodeGen/CGCleanup.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp vendor/clang/dist/lib/CodeGen/CGObjCRuntime.cpp vendor/clang/dist/lib/CodeGen/CGVTables.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/CodeGenModule.h vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp vendor/clang/dist/lib/CodeGen/MicrosoftCXXABI.cpp vendor/clang/dist/lib/CodeGen/TargetInfo.cpp vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist/lib/Driver/ToolChains/Gnu.cpp vendor/clang/dist/lib/Format/UnwrappedLineParser.cpp vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/lib/Frontend/FrontendAction.cpp vendor/clang/dist/lib/Lex/HeaderSearch.cpp vendor/clang/dist/lib/Sema/SemaCoroutine.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclObjC.cpp vendor/clang/dist/lib/Sema/SemaExprCXX.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaType.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/test/CodeGen/arm_neon_intrinsics.c vendor/clang/dist/test/CodeGenCXX/stmtexpr.cpp vendor/clang/dist/test/CodeGenCXX/strict-vtable-pointers.cpp vendor/clang/dist/test/CodeGenCXX/vtable-available-externally.cpp vendor/clang/dist/test/CodeGenCXX/vtable-linkage.cpp vendor/clang/dist/test/CodeGenObjC/parameterized_classes.m vendor/clang/dist/test/CodeGenOpenCL/bool_cast.cl vendor/clang/dist/test/CodeGenOpenCL/kernel-attributes.cl vendor/clang/dist/test/CodeGenOpenCL/kernel-metadata.cl vendor/clang/dist/test/CodeGenOpenCL/pipe_types.cl vendor/clang/dist/test/CodeGenOpenCL/ptx-calls.cl vendor/clang/dist/test/CodeGenOpenCL/ptx-kernels.cl vendor/clang/dist/test/Driver/arm-cortex-cpus.c vendor/clang/dist/test/Driver/cl-zc.cpp vendor/clang/dist/test/Driver/fsanitize.c vendor/clang/dist/test/Driver/gold-lto.c vendor/clang/dist/test/Driver/nacl-direct.c vendor/clang/dist/test/Driver/openmp-offload.c vendor/clang/dist/test/Misc/diag-mapping2.c vendor/clang/dist/test/Modules/odr_hash.cpp vendor/clang/dist/test/Modules/preprocess-module.cpp vendor/clang/dist/test/Modules/preprocess-nested.cpp vendor/clang/dist/test/Modules/preprocess-unavailable.cpp vendor/clang/dist/test/SemaCXX/attr-require-constant-initialization.cpp vendor/clang/dist/test/SemaCXX/coreturn.cpp vendor/clang/dist/test/SemaCXX/coroutines.cpp vendor/clang/dist/test/SemaCXX/type-traits.cpp vendor/clang/dist/test/SemaObjC/attr-deprecated.m vendor/clang/dist/test/SemaObjC/class-unavail-warning.m vendor/clang/dist/test/SemaObjC/warn-deprecated-implementations.m vendor/clang/dist/unittests/Format/FormatTestJS.cpp vendor/clang/dist/utils/TableGen/ClangAttrEmitter.cpp vendor/clang/dist/utils/TableGen/ClangDiagnosticsEmitter.cpp vendor/clang/dist/utils/TableGen/ClangOptionDocEmitter.cpp vendor/clang/dist/utils/TableGen/ClangSACheckersEmitter.cpp Modified: vendor/clang/dist/docs/Modules.rst ============================================================================== --- vendor/clang/dist/docs/Modules.rst Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/docs/Modules.rst Thu Jun 1 20:58:49 2017 (r319463) @@ -403,7 +403,7 @@ A *requires-declaration* specifies the requirements th *feature*: ``!``:sub:`opt` *identifier* -The requirements clause allows specific modules or submodules to specify that they are only accessible with certain language dialects or on certain platforms. The feature list is a set of identifiers, defined below. If any of the features is not available in a given translation unit, that translation unit shall not import the module. The optional ``!`` indicates that a feature is incompatible with the module. +The requirements clause allows specific modules or submodules to specify that they are only accessible with certain language dialects or on certain platforms. The feature list is a set of identifiers, defined below. If any of the features is not available in a given translation unit, that translation unit shall not import the module. When building a module for use by a compilation, submodules requiring unavailable features are ignored. The optional ``!`` indicates that a feature is incompatible with the module. The following features are defined: Modified: vendor/clang/dist/docs/ThinLTO.rst ============================================================================== --- vendor/clang/dist/docs/ThinLTO.rst Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/docs/ThinLTO.rst Thu Jun 1 20:58:49 2017 (r319463) @@ -123,6 +123,8 @@ which currently must be enabled through a linker optio ``-Wl,-plugin-opt,cache-dir=/path/to/cache`` - ld64 (support in clang 3.9 and Xcode 8): ``-Wl,-cache_path_lto,/path/to/cache`` +- lld (as of LLVM r296702): + ``-Wl,--thinlto-cache-dir=/path/to/cache`` Clang Bootstrap --------------- Modified: vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst ============================================================================== --- vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/docs/UndefinedBehaviorSanitizer.rst Thu Jun 1 20:58:49 2017 (r319463) @@ -106,6 +106,8 @@ Available checks are: invalid pointers. These checks are made in terms of ``__builtin_object_size``, and consequently may be able to detect more problems at higher optimization levels. + - ``-fsanitize=pointer-overflow``: Performing pointer arithmetic which + overflows. - ``-fsanitize=return``: In C++, reaching the end of a value-returning function without returning a value. - ``-fsanitize=returns-nonnull-attribute``: Returning null pointer Modified: vendor/clang/dist/include/clang/AST/VTableBuilder.h ============================================================================== --- vendor/clang/dist/include/clang/AST/VTableBuilder.h Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/include/clang/AST/VTableBuilder.h Thu Jun 1 20:58:49 2017 (r319463) @@ -154,6 +154,28 @@ class VTableComponent { (public) bool isRTTIKind() const { return isRTTIKind(getKind()); } + GlobalDecl getGlobalDecl() const { + assert(isUsedFunctionPointerKind() && + "GlobalDecl can be created only from virtual function"); + + auto *DtorDecl = dyn_cast(getFunctionDecl()); + switch (getKind()) { + case CK_FunctionPointer: + return GlobalDecl(getFunctionDecl()); + case CK_CompleteDtorPointer: + return GlobalDecl(DtorDecl, CXXDtorType::Dtor_Complete); + case CK_DeletingDtorPointer: + return GlobalDecl(DtorDecl, CXXDtorType::Dtor_Deleting); + case CK_VCallOffset: + case CK_VBaseOffset: + case CK_OffsetToTop: + case CK_RTTI: + case CK_UnusedFunctionPointer: + llvm_unreachable("Only function pointers kinds"); + } + llvm_unreachable("Should already return"); + } + private: static bool isFunctionPointerKind(Kind ComponentKind) { return isUsedFunctionPointerKind(ComponentKind) || Modified: vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Thu Jun 1 20:58:49 2017 (r319463) @@ -733,6 +733,7 @@ def Pedantic : DiagGroup<"pedantic">; // Aliases. def : DiagGroup<"", [Extra]>; // -W = -Wextra def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wextra-tokens +def : DiagGroup<"cpp", [PoundWarning]>; // -Wcpp = -W#warnings def : DiagGroup<"comments", [Comment]>; // -Wcomments = -Wcomment def : DiagGroup<"conversion-null", [NullConversion]>; // -Wconversion-null = -Wnull-conversion Modified: vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/include/clang/Basic/DiagnosticIDs.h Thu Jun 1 20:58:49 2017 (r319463) @@ -32,7 +32,7 @@ namespace clang { DIAG_START_FRONTEND = DIAG_START_DRIVER + 200, DIAG_START_SERIALIZATION = DIAG_START_FRONTEND + 100, DIAG_START_LEX = DIAG_START_SERIALIZATION + 120, - DIAG_START_PARSE = DIAG_START_LEX + 300, + DIAG_START_PARSE = DIAG_START_LEX + 400, DIAG_START_AST = DIAG_START_PARSE + 500, DIAG_START_COMMENT = DIAG_START_AST + 110, DIAG_START_SEMA = DIAG_START_COMMENT + 100, Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Thu Jun 1 20:58:49 2017 (r319463) @@ -8979,10 +8979,10 @@ def err_coroutine_promise_new_requires_nothrow : Error def note_coroutine_promise_call_implicitly_required : Note< "call to %0 implicitly required by coroutine function here">; def err_await_suspend_invalid_return_type : Error< - "the return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)" + "return type of 'await_suspend' is required to be 'void' or 'bool' (have %0)" >; def note_await_ready_no_bool_conversion : Note< - "the return type of 'await_ready' is required to be contextually convertible to 'bool'" + "return type of 'await_ready' is required to be contextually convertible to 'bool'" >; } Modified: vendor/clang/dist/include/clang/Basic/Module.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/Module.h Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/include/clang/Basic/Module.h Thu Jun 1 20:58:49 2017 (r319463) @@ -83,6 +83,10 @@ class Module { (public) /// are found. const DirectoryEntry *Directory; + /// \brief The presumed file name for the module map defining this module. + /// Only non-empty when building from preprocessed source. + std::string PresumedModuleMapFile; + /// \brief The umbrella header or directory. llvm::PointerUnion Umbrella; Modified: vendor/clang/dist/include/clang/Basic/Sanitizers.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/Sanitizers.def Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/include/clang/Basic/Sanitizers.def Thu Jun 1 20:58:49 2017 (r319463) @@ -73,6 +73,7 @@ SANITIZER("nullability-return", NullabilityReturn) SANITIZER_GROUP("nullability", Nullability, NullabilityArg | NullabilityAssign | NullabilityReturn) SANITIZER("object-size", ObjectSize) +SANITIZER("pointer-overflow", PointerOverflow) SANITIZER("return", Return) SANITIZER("returns-nonnull-attribute", ReturnsNonnullAttribute) SANITIZER("shift-base", ShiftBase) @@ -108,9 +109,9 @@ SANITIZER("safe-stack", SafeStack) SANITIZER_GROUP("undefined", Undefined, Alignment | Bool | ArrayBounds | Enum | FloatCastOverflow | FloatDivideByZero | IntegerDivideByZero | NonnullAttribute | - Null | ObjectSize | Return | ReturnsNonnullAttribute | - Shift | SignedIntegerOverflow | Unreachable | VLABound | - Function | Vptr) + Null | ObjectSize | PointerOverflow | Return | + ReturnsNonnullAttribute | Shift | SignedIntegerOverflow | + Unreachable | VLABound | Function | Vptr) // -fsanitize=undefined-trap is an alias for -fsanitize=undefined. SANITIZER_GROUP("undefined-trap", UndefinedTrap, Undefined) Modified: vendor/clang/dist/include/clang/Basic/TokenKinds.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/TokenKinds.def Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/include/clang/Basic/TokenKinds.def Thu Jun 1 20:58:49 2017 (r319463) @@ -411,6 +411,7 @@ TYPE_TRAIT_1(__is_sealed, IsSealed, KEYMS) // MSVC12.0 / VS2013 Type Traits TYPE_TRAIT_1(__is_destructible, IsDestructible, KEYMS) +TYPE_TRAIT_1(__is_trivially_destructible, IsTriviallyDestructible, KEYCXX) TYPE_TRAIT_1(__is_nothrow_destructible, IsNothrowDestructible, KEYMS) TYPE_TRAIT_2(__is_nothrow_assignable, IsNothrowAssignable, KEYCXX) TYPE_TRAIT_N(__is_constructible, IsConstructible, KEYCXX) @@ -439,7 +440,6 @@ TYPE_TRAIT_2(__is_convertible_to, IsConvertibleTo, KEY TYPE_TRAIT_1(__is_empty, IsEmpty, KEYCXX) TYPE_TRAIT_1(__is_enum, IsEnum, KEYCXX) TYPE_TRAIT_1(__is_final, IsFinal, KEYCXX) -// Tentative name - there's no implementation of std::is_literal_type yet. TYPE_TRAIT_1(__is_literal, IsLiteral, KEYCXX) // Name for GCC 4.6 compatibility - people have already written libraries using // this name unfortunately. Modified: vendor/clang/dist/include/clang/Basic/TypeTraits.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/TypeTraits.h Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/include/clang/Basic/TypeTraits.h Thu Jun 1 20:58:49 2017 (r319463) @@ -65,6 +65,7 @@ namespace clang { UTT_IsStandardLayout, UTT_IsTrivial, UTT_IsTriviallyCopyable, + UTT_IsTriviallyDestructible, UTT_IsUnion, UTT_IsUnsigned, UTT_IsVoid, Modified: vendor/clang/dist/include/clang/Driver/CLCompatOptions.td ============================================================================== --- vendor/clang/dist/include/clang/Driver/CLCompatOptions.td Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/include/clang/Driver/CLCompatOptions.td Thu Jun 1 20:58:49 2017 (r319463) @@ -63,6 +63,12 @@ def _SLASH_C : CLFlag<"C">, def _SLASH_c : CLFlag<"c">, HelpText<"Compile only">, Alias; def _SLASH_d1reportAllClassLayout : CLFlag<"d1reportAllClassLayout">, HelpText<"Dump record layout information">, Alias; +def _SLASH_diagnostics_caret : CLFlag<"diagnostics:caret">, + HelpText<"Enable caret and column diagnostics (on by default)">; +def _SLASH_diagnostics_column : CLFlag<"diagnostics:column">, + HelpText<"Disable caret diagnostics but keep column info">; +def _SLASH_diagnostics_classic : CLFlag<"diagnostics:classic">, + HelpText<"Disable column and caret diagnostics">; def _SLASH_D : CLJoinedOrSeparate<"D">, HelpText<"Define macro">, MetaVarName<"">, Alias; def _SLASH_E : CLFlag<"E">, HelpText<"Preprocess to stdout">, Alias; @@ -324,6 +330,7 @@ def _SLASH_Zc_forScope : CLIgnoredFlag<"Zc:forScope">; def _SLASH_Zc_inline : CLIgnoredFlag<"Zc:inline">; def _SLASH_Zc_rvalueCast : CLIgnoredFlag<"Zc:rvalueCast">; def _SLASH_Zc_wchar_t : CLIgnoredFlag<"Zc:wchar_t">; +def _SLASH_Zc_ternary : CLIgnoredFlag<"Zc:ternary">; def _SLASH_Zm : CLIgnoredJoined<"Zm">; def _SLASH_Zo : CLIgnoredFlag<"Zo">; def _SLASH_Zo_ : CLIgnoredFlag<"Zo-">; Modified: vendor/clang/dist/include/clang/Driver/Options.td ============================================================================== --- vendor/clang/dist/include/clang/Driver/Options.td Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/include/clang/Driver/Options.td Thu Jun 1 20:58:49 2017 (r319463) @@ -2084,7 +2084,7 @@ def no_cpp_precomp : Flag<["-"], "no-cpp-precomp">, Gr def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">, Flags<[DriverOption]>; def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group; def no__dead__strip__inits__and__terms : Flag<["-"], "no_dead_strip_inits_and_terms">; -def nobuiltininc : Flag<["-"], "nobuiltininc">, Flags<[CC1Option]>, +def nobuiltininc : Flag<["-"], "nobuiltininc">, Flags<[CC1Option, CoreOption]>, HelpText<"Disable builtin #include directories">; def nocudainc : Flag<["-"], "nocudainc">; def nocudalib : Flag<["-"], "nocudalib">; @@ -2096,7 +2096,7 @@ def nopie : Flag<["-"], "nopie">; def noprebind : Flag<["-"], "noprebind">; def noseglinkedit : Flag<["-"], "noseglinkedit">; def nostartfiles : Flag<["-"], "nostartfiles">; -def nostdinc : Flag<["-"], "nostdinc">; +def nostdinc : Flag<["-"], "nostdinc">, Flags<[CoreOption]>; def nostdlibinc : Flag<["-"], "nostdlibinc">; def nostdincxx : Flag<["-"], "nostdinc++">, Flags<[CC1Option]>, HelpText<"Disable standard #include directories for the C++ standard library">; Modified: vendor/clang/dist/include/clang/Lex/HeaderSearch.h ============================================================================== --- vendor/clang/dist/include/clang/Lex/HeaderSearch.h Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/include/clang/Lex/HeaderSearch.h Thu Jun 1 20:58:49 2017 (r319463) @@ -543,10 +543,13 @@ class HeaderSearch { (public) /// \param Offset [inout] An offset within ID to start parsing. On exit, /// filled by the end of the parsed contents (either EOF or the /// location of an end-of-module-map pragma). - /// + /// \param OriginalModuleMapFile The original path to the module map file, + /// used to resolve paths within the module (this is required when + /// building the module from preprocessed source). /// \returns true if an error occurred, false otherwise. bool loadModuleMapFile(const FileEntry *File, bool IsSystem, - FileID ID = FileID(), unsigned *Offset = nullptr); + FileID ID = FileID(), unsigned *Offset = nullptr, + StringRef OriginalModuleMapFile = StringRef()); /// \brief Collect the set of all known, top-level modules. /// Modified: vendor/clang/dist/lib/AST/ODRHash.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ODRHash.cpp Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/lib/AST/ODRHash.cpp Thu Jun 1 20:58:49 2017 (r319463) @@ -110,7 +110,24 @@ void ODRHash::AddNestedNameSpecifier(const NestedNameS } } -void ODRHash::AddTemplateName(TemplateName Name) {} +void ODRHash::AddTemplateName(TemplateName Name) { + auto Kind = Name.getKind(); + ID.AddInteger(Kind); + + switch (Kind) { + case TemplateName::Template: + AddDecl(Name.getAsTemplateDecl()); + break; + // TODO: Support these cases. + case TemplateName::OverloadedTemplate: + case TemplateName::QualifiedTemplate: + case TemplateName::DependentTemplate: + case TemplateName::SubstTemplateTemplateParm: + case TemplateName::SubstTemplateTemplateParmPack: + break; + } +} + void ODRHash::AddTemplateArgument(TemplateArgument TA) {} void ODRHash::AddTemplateParameterList(const TemplateParameterList *TPL) {} @@ -491,6 +508,15 @@ class ODRTypeVisitor : public TypeVisitorgetQualifier()); AddQualType(T->getNamedType()); VisitTypeWithKeyword(T); + } + + void VisitTemplateSpecializationType(const TemplateSpecializationType *T) { + ID.AddInteger(T->getNumArgs()); + for (const auto &TA : T->template_arguments()) { + Hash.AddTemplateArgument(TA); + } + Hash.AddTemplateName(T->getTemplateName()); + VisitType(T); } }; Modified: vendor/clang/dist/lib/Basic/Targets.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/Targets.cpp Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/lib/Basic/Targets.cpp Thu Jun 1 20:58:49 2017 (r319463) @@ -3123,6 +3123,7 @@ class X86TargetInfo : public TargetInfo { (public) case CC_Swift: case CC_X86Pascal: case CC_IntelOclBicc: + case CC_OpenCLKernel: return CCCR_OK; default: return CCCR_Warning; @@ -4834,6 +4835,7 @@ class X86_64TargetInfo : public X86TargetInfo { (publi case CC_PreserveMost: case CC_PreserveAll: case CC_X86RegCall: + case CC_OpenCLKernel: return CCCR_OK; default: return CCCR_Warning; @@ -4907,6 +4909,7 @@ class WindowsX86_64TargetInfo : public WindowsTargetIn case CC_X86_64SysV: case CC_Swift: case CC_X86RegCall: + case CC_OpenCLKernel: return CCCR_OK; default: return CCCR_Warning; @@ -5860,6 +5863,7 @@ class ARMTargetInfo : public TargetInfo { (public) case CC_AAPCS: case CC_AAPCS_VFP: case CC_Swift: + case CC_OpenCLKernel: return CCCR_OK; default: return CCCR_Warning; @@ -6019,6 +6023,7 @@ class WindowsARMTargetInfo : public WindowsTargetInfo< case CC_X86VectorCall: return CCCR_Ignore; case CC_C: + case CC_OpenCLKernel: return CCCR_OK; default: return CCCR_Warning; @@ -6329,6 +6334,7 @@ class AArch64TargetInfo : public TargetInfo { (public) case CC_Swift: case CC_PreserveMost: case CC_PreserveAll: + case CC_OpenCLKernel: return CCCR_OK; default: return CCCR_Warning; @@ -7380,6 +7386,7 @@ class SystemZTargetInfo : public TargetInfo { (public) switch (CC) { case CC_C: case CC_Swift: + case CC_OpenCLKernel: return CCCR_OK; default: return CCCR_Warning; @@ -7662,6 +7669,15 @@ class BPFTargetInfo : public TargetInfo { (public) } ArrayRef getGCCRegAliases() const override { return None; + } + CallingConvCheckResult checkCallingConvention(CallingConv CC) const override { + switch (CC) { + default: + return CCCR_Warning; + case CC_C: + case CC_OpenCLKernel: + return CCCR_OK; + } } }; Modified: vendor/clang/dist/lib/CodeGen/ABIInfo.h ============================================================================== --- vendor/clang/dist/lib/CodeGen/ABIInfo.h Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/lib/CodeGen/ABIInfo.h Thu Jun 1 20:58:49 2017 (r319463) @@ -149,7 +149,6 @@ namespace swiftcall { return info->supportsSwift(); } }; - } // end namespace CodeGen } // end namespace clang Modified: vendor/clang/dist/lib/CodeGen/CGCall.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGCall.cpp Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/lib/CodeGen/CGCall.cpp Thu Jun 1 20:58:49 2017 (r319463) @@ -707,6 +707,12 @@ CodeGenTypes::arrangeCall(const CGFunctionInfo &signat signature.getRequiredArgs()); } +namespace clang { +namespace CodeGen { +void computeSPIRKernelABIInfo(CodeGenModule &CGM, CGFunctionInfo &FI); +} +} + /// Arrange the argument and result information for an abstract value /// of a given function type. This is the method which all of the /// above functions ultimately defer to. @@ -741,12 +747,16 @@ CodeGenTypes::arrangeLLVMFunctionInfo(CanQualType resu bool inserted = FunctionsBeingProcessed.insert(FI).second; (void)inserted; assert(inserted && "Recursively being processed?"); - + // Compute ABI information. - if (info.getCC() != CC_Swift) { - getABIInfo().computeInfo(*FI); - } else { + if (CC == llvm::CallingConv::SPIR_KERNEL) { + // Force target independent argument handling for the host visible + // kernel functions. + computeSPIRKernelABIInfo(CGM, *FI); + } else if (info.getCC() == CC_Swift) { swiftcall::computeABIInfo(CGM, *FI); + } else { + getABIInfo().computeInfo(*FI); } // Loop over all of the computed argument and return value info. If any of Modified: vendor/clang/dist/lib/CodeGen/CGCleanup.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGCleanup.cpp Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/lib/CodeGen/CGCleanup.cpp Thu Jun 1 20:58:49 2017 (r319463) @@ -448,6 +448,13 @@ void CodeGenFunction::PopCleanupBlocks( auto *Inst = dyn_cast_or_null(*ReloadedValue); if (!Inst) continue; + + // Don't spill static allocas, they dominate all cleanups. These are created + // by binding a reference to a local variable or temporary. + auto *AI = dyn_cast(Inst); + if (AI && AI->isStaticAlloca()) + continue; + Address Tmp = CreateDefaultAlignTempAlloca(Inst->getType(), "tmp.exprcleanup"); Modified: vendor/clang/dist/lib/CodeGen/CGExpr.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGExpr.cpp Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/lib/CodeGen/CGExpr.cpp Thu Jun 1 20:58:49 2017 (r319463) @@ -3002,9 +3002,10 @@ static llvm::Value *emitArraySubscriptGEP(CodeGenFunct llvm::Value *ptr, ArrayRef indices, bool inbounds, + SourceLocation loc, const llvm::Twine &name = "arrayidx") { if (inbounds) { - return CGF.Builder.CreateInBoundsGEP(ptr, indices, name); + return CGF.EmitCheckedInBoundsGEP(ptr, indices, loc, name); } else { return CGF.Builder.CreateGEP(ptr, indices, name); } @@ -3035,8 +3036,9 @@ static QualType getFixedSizeElementType(const ASTConte } static Address emitArraySubscriptGEP(CodeGenFunction &CGF, Address addr, - ArrayRef indices, + ArrayRef indices, QualType eltType, bool inbounds, + SourceLocation loc, const llvm::Twine &name = "arrayidx") { // All the indices except that last must be zero. #ifndef NDEBUG @@ -3057,7 +3059,7 @@ static Address emitArraySubscriptGEP(CodeGenFunction & getArrayElementAlign(addr.getAlignment(), indices.back(), eltSize); llvm::Value *eltPtr = - emitArraySubscriptGEP(CGF, addr.getPointer(), indices, inbounds, name); + emitArraySubscriptGEP(CGF, addr.getPointer(), indices, inbounds, loc, name); return Address(eltPtr, eltAlign); } @@ -3110,7 +3112,8 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const A Address Addr = EmitExtVectorElementLValue(LV); QualType EltType = LV.getType()->castAs()->getElementType(); - Addr = emitArraySubscriptGEP(*this, Addr, Idx, EltType, /*inbounds*/ true); + Addr = emitArraySubscriptGEP(*this, Addr, Idx, EltType, /*inbounds*/ true, + E->getExprLoc()); return MakeAddrLValue(Addr, EltType, LV.getBaseInfo()); } @@ -3138,7 +3141,8 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const A } Addr = emitArraySubscriptGEP(*this, Addr, Idx, vla->getElementType(), - !getLangOpts().isSignedOverflowDefined()); + !getLangOpts().isSignedOverflowDefined(), + E->getExprLoc()); } else if (const ObjCObjectType *OIT = E->getType()->getAs()){ // Indexing over an interface, as in "NSString *P; P[4];" @@ -3163,8 +3167,8 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const A // Do the GEP. CharUnits EltAlign = getArrayElementAlign(Addr.getAlignment(), Idx, InterfaceSize); - llvm::Value *EltPtr = - emitArraySubscriptGEP(*this, Addr.getPointer(), ScaledIdx, false); + llvm::Value *EltPtr = emitArraySubscriptGEP( + *this, Addr.getPointer(), ScaledIdx, false, E->getExprLoc()); Addr = Address(EltPtr, EltAlign); // Cast back. @@ -3189,14 +3193,16 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const A Addr = emitArraySubscriptGEP(*this, ArrayLV.getAddress(), {CGM.getSize(CharUnits::Zero()), Idx}, E->getType(), - !getLangOpts().isSignedOverflowDefined()); + !getLangOpts().isSignedOverflowDefined(), + E->getExprLoc()); BaseInfo = ArrayLV.getBaseInfo(); } else { // The base must be a pointer; emit it with an estimate of its alignment. Addr = EmitPointerWithAlignment(E->getBase(), &BaseInfo); auto *Idx = EmitIdxAfterBase(/*Promote*/true); Addr = emitArraySubscriptGEP(*this, Addr, Idx, E->getType(), - !getLangOpts().isSignedOverflowDefined()); + !getLangOpts().isSignedOverflowDefined(), + E->getExprLoc()); } LValue LV = MakeAddrLValue(Addr, E->getType(), BaseInfo); @@ -3368,7 +3374,8 @@ LValue CodeGenFunction::EmitOMPArraySectionExpr(const else Idx = Builder.CreateNSWMul(Idx, NumElements); EltPtr = emitArraySubscriptGEP(*this, Base, Idx, VLA->getElementType(), - !getLangOpts().isSignedOverflowDefined()); + !getLangOpts().isSignedOverflowDefined(), + E->getExprLoc()); } else if (const Expr *Array = isSimpleArrayDecayOperand(E->getBase())) { // If this is A[i] where A is an array, the frontend will have decayed the // base to be a ArrayToPointerDecay implicit cast. While correct, it is @@ -3387,13 +3394,15 @@ LValue CodeGenFunction::EmitOMPArraySectionExpr(const // Propagate the alignment from the array itself to the result. EltPtr = emitArraySubscriptGEP( *this, ArrayLV.getAddress(), {CGM.getSize(CharUnits::Zero()), Idx}, - ResultExprTy, !getLangOpts().isSignedOverflowDefined()); + ResultExprTy, !getLangOpts().isSignedOverflowDefined(), + E->getExprLoc()); BaseInfo = ArrayLV.getBaseInfo(); } else { Address Base = emitOMPArraySectionBase(*this, E->getBase(), BaseInfo, BaseTy, ResultExprTy, IsLowerBound); EltPtr = emitArraySubscriptGEP(*this, Base, Idx, ResultExprTy, - !getLangOpts().isSignedOverflowDefined()); + !getLangOpts().isSignedOverflowDefined(), + E->getExprLoc()); } return MakeAddrLValue(EltPtr, ResultExprTy, BaseInfo); @@ -3530,6 +3539,25 @@ static Address emitAddrOfFieldStorage(CodeGenFunction return CGF.Builder.CreateStructGEP(base, idx, offset, field->getName()); } +static bool hasAnyVptr(const QualType Type, const ASTContext &Context) { + const auto *RD = Type.getTypePtr()->getAsCXXRecordDecl(); + if (!RD) + return false; + + if (RD->isDynamicClass()) + return true; + + for (const auto &Base : RD->bases()) + if (hasAnyVptr(Base.getType(), Context)) + return true; + + for (const FieldDecl *Field : RD->fields()) + if (hasAnyVptr(Field->getType(), Context)) + return true; + + return false; +} + LValue CodeGenFunction::EmitLValueForField(LValue base, const FieldDecl *field) { LValueBaseInfo BaseInfo = base.getBaseInfo(); @@ -3572,6 +3600,14 @@ LValue CodeGenFunction::EmitLValueForField(LValue base assert(!type->isReferenceType() && "union has reference member"); // TODO: handle path-aware TBAA for union. TBAAPath = false; + + const auto FieldType = field->getType(); + if (CGM.getCodeGenOpts().StrictVTablePointers && + hasAnyVptr(FieldType, getContext())) + // Because unions can easily skip invariant.barriers, we need to add + // a barrier every time CXXRecord field with vptr is referenced. + addr = Address(Builder.CreateInvariantGroupBarrier(addr.getPointer()), + addr.getAlignment()); } else { // For structs, we GEP to the field that the record layout suggests. addr = emitAddrOfFieldStorage(*this, addr, field); Modified: vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp Thu Jun 1 20:58:49 2017 (r319463) @@ -30,6 +30,7 @@ #include "llvm/IR/Constants.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/Function.h" +#include "llvm/IR/GetElementPtrTypeIterator.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/Intrinsics.h" #include "llvm/IR/Module.h" @@ -44,6 +45,43 @@ using llvm::Value; //===----------------------------------------------------------------------===// namespace { + +/// Determine whether the given binary operation may overflow. +/// Sets \p Result to the value of the operation for BO_Add, BO_Sub, BO_Mul, +/// and signed BO_{Div,Rem}. For these opcodes, and for unsigned BO_{Div,Rem}, +/// the returned overflow check is precise. The returned value is 'true' for +/// all other opcodes, to be conservative. +bool mayHaveIntegerOverflow(llvm::ConstantInt *LHS, llvm::ConstantInt *RHS, + BinaryOperator::Opcode Opcode, bool Signed, + llvm::APInt &Result) { + // Assume overflow is possible, unless we can prove otherwise. + bool Overflow = true; + const auto &LHSAP = LHS->getValue(); + const auto &RHSAP = RHS->getValue(); + if (Opcode == BO_Add) { + if (Signed) + Result = LHSAP.sadd_ov(RHSAP, Overflow); + else + Result = LHSAP.uadd_ov(RHSAP, Overflow); + } else if (Opcode == BO_Sub) { + if (Signed) + Result = LHSAP.ssub_ov(RHSAP, Overflow); + else + Result = LHSAP.usub_ov(RHSAP, Overflow); + } else if (Opcode == BO_Mul) { + if (Signed) + Result = LHSAP.smul_ov(RHSAP, Overflow); + else + Result = LHSAP.umul_ov(RHSAP, Overflow); + } else if (Opcode == BO_Div || Opcode == BO_Rem) { + if (Signed && !RHS->isZero()) + Result = LHSAP.sdiv_ov(RHSAP, Overflow); + else + return false; + } + return Overflow; +} + struct BinOpInfo { Value *LHS; Value *RHS; @@ -55,37 +93,14 @@ struct BinOpInfo { /// Check if the binop can result in integer overflow. bool mayHaveIntegerOverflow() const { // Without constant input, we can't rule out overflow. - const auto *LHSCI = dyn_cast(LHS); - const auto *RHSCI = dyn_cast(RHS); + auto *LHSCI = dyn_cast(LHS); + auto *RHSCI = dyn_cast(RHS); if (!LHSCI || !RHSCI) return true; - // Assume overflow is possible, unless we can prove otherwise. - bool Overflow = true; - const auto &LHSAP = LHSCI->getValue(); - const auto &RHSAP = RHSCI->getValue(); - if (Opcode == BO_Add) { - if (Ty->hasSignedIntegerRepresentation()) - (void)LHSAP.sadd_ov(RHSAP, Overflow); - else - (void)LHSAP.uadd_ov(RHSAP, Overflow); - } else if (Opcode == BO_Sub) { - if (Ty->hasSignedIntegerRepresentation()) - (void)LHSAP.ssub_ov(RHSAP, Overflow); - else - (void)LHSAP.usub_ov(RHSAP, Overflow); - } else if (Opcode == BO_Mul) { - if (Ty->hasSignedIntegerRepresentation()) - (void)LHSAP.smul_ov(RHSAP, Overflow); - else - (void)LHSAP.umul_ov(RHSAP, Overflow); - } else if (Opcode == BO_Div || Opcode == BO_Rem) { - if (Ty->hasSignedIntegerRepresentation() && !RHSCI->isZero()) - (void)LHSAP.sdiv_ov(RHSAP, Overflow); - else - return false; - } - return Overflow; + llvm::APInt Result; + return ::mayHaveIntegerOverflow( + LHSCI, RHSCI, Opcode, Ty->hasSignedIntegerRepresentation(), Result); } /// Check if the binop computes a division or a remainder. @@ -1925,7 +1940,8 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const Unary if (CGF.getLangOpts().isSignedOverflowDefined()) value = Builder.CreateGEP(value, numElts, "vla.inc"); else - value = Builder.CreateInBoundsGEP(value, numElts, "vla.inc"); + value = CGF.EmitCheckedInBoundsGEP(value, numElts, E->getExprLoc(), + "vla.inc"); // Arithmetic on function pointers (!) is just +-1. } else if (type->isFunctionType()) { @@ -1935,7 +1951,8 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const Unary if (CGF.getLangOpts().isSignedOverflowDefined()) value = Builder.CreateGEP(value, amt, "incdec.funcptr"); else - value = Builder.CreateInBoundsGEP(value, amt, "incdec.funcptr"); + value = CGF.EmitCheckedInBoundsGEP(value, amt, E->getExprLoc(), + "incdec.funcptr"); value = Builder.CreateBitCast(value, input->getType()); // For everything else, we can just do a simple increment. @@ -1944,7 +1961,8 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const Unary if (CGF.getLangOpts().isSignedOverflowDefined()) value = Builder.CreateGEP(value, amt, "incdec.ptr"); else - value = Builder.CreateInBoundsGEP(value, amt, "incdec.ptr"); + value = CGF.EmitCheckedInBoundsGEP(value, amt, E->getExprLoc(), + "incdec.ptr"); } // Vector increment/decrement. @@ -2025,7 +2043,8 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const Unary if (CGF.getLangOpts().isSignedOverflowDefined()) value = Builder.CreateGEP(value, sizeValue, "incdec.objptr"); else - value = Builder.CreateInBoundsGEP(value, sizeValue, "incdec.objptr"); + value = CGF.EmitCheckedInBoundsGEP(value, sizeValue, E->getExprLoc(), + "incdec.objptr"); value = Builder.CreateBitCast(value, input->getType()); } @@ -2692,7 +2711,8 @@ static Value *emitPointerArithmetic(CodeGenFunction &C pointer = CGF.Builder.CreateGEP(pointer, index, "add.ptr"); } else { index = CGF.Builder.CreateNSWMul(index, numElements, "vla.index"); - pointer = CGF.Builder.CreateInBoundsGEP(pointer, index, "add.ptr"); + pointer = CGF.EmitCheckedInBoundsGEP(pointer, index, op.E->getExprLoc(), + "add.ptr"); } return pointer; } @@ -2709,7 +2729,8 @@ static Value *emitPointerArithmetic(CodeGenFunction &C if (CGF.getLangOpts().isSignedOverflowDefined()) return CGF.Builder.CreateGEP(pointer, index, "add.ptr"); - return CGF.Builder.CreateInBoundsGEP(pointer, index, "add.ptr"); + return CGF.EmitCheckedInBoundsGEP(pointer, index, op.E->getExprLoc(), + "add.ptr"); } // Construct an fmuladd intrinsic to represent a fused mul-add of MulOp and @@ -3823,4 +3844,125 @@ LValue CodeGenFunction::EmitCompoundAssignmentLValue( } llvm_unreachable("Unhandled compound assignment operator"); +} + +Value *CodeGenFunction::EmitCheckedInBoundsGEP(Value *Ptr, + ArrayRef IdxList, + SourceLocation Loc, + const Twine &Name) { + Value *GEPVal = Builder.CreateInBoundsGEP(Ptr, IdxList, Name); + + // If the pointer overflow sanitizer isn't enabled, do nothing. + if (!SanOpts.has(SanitizerKind::PointerOverflow)) + return GEPVal; + + // If the GEP has already been reduced to a constant, leave it be. + if (isa(GEPVal)) + return GEPVal; + + // Only check for overflows in the default address space. + if (GEPVal->getType()->getPointerAddressSpace()) + return GEPVal; + + auto *GEP = cast(GEPVal); + assert(GEP->isInBounds() && "Expected inbounds GEP"); + + SanitizerScope SanScope(this); + auto &VMContext = getLLVMContext(); + const auto &DL = CGM.getDataLayout(); + auto *IntPtrTy = DL.getIntPtrType(GEP->getPointerOperandType()); + + // Grab references to the signed add/mul overflow intrinsics for intptr_t. + auto *Zero = llvm::ConstantInt::getNullValue(IntPtrTy); + auto *SAddIntrinsic = + CGM.getIntrinsic(llvm::Intrinsic::sadd_with_overflow, IntPtrTy); + auto *SMulIntrinsic = + CGM.getIntrinsic(llvm::Intrinsic::smul_with_overflow, IntPtrTy); + + // The total (signed) byte offset for the GEP. + llvm::Value *TotalOffset = nullptr; + // The offset overflow flag - true if the total offset overflows. + llvm::Value *OffsetOverflows = Builder.getFalse(); + + /// Return the result of the given binary operation. + auto eval = [&](BinaryOperator::Opcode Opcode, llvm::Value *LHS, + llvm::Value *RHS) -> llvm::Value * { + assert(Opcode == BO_Add || Opcode == BO_Mul && "Can't eval binop"); + + // If the operands are constants, return a constant result. + if (auto *LHSCI = dyn_cast(LHS)) { + if (auto *RHSCI = dyn_cast(RHS)) { + llvm::APInt N; + bool HasOverflow = mayHaveIntegerOverflow(LHSCI, RHSCI, Opcode, + /*Signed=*/true, N); + if (HasOverflow) + OffsetOverflows = Builder.getTrue(); + return llvm::ConstantInt::get(VMContext, N); + } + } + + // Otherwise, compute the result with checked arithmetic. + auto *ResultAndOverflow = Builder.CreateCall( + (Opcode == BO_Add) ? SAddIntrinsic : SMulIntrinsic, {LHS, RHS}); + OffsetOverflows = Builder.CreateOr( + OffsetOverflows, Builder.CreateExtractValue(ResultAndOverflow, 1)); + return Builder.CreateExtractValue(ResultAndOverflow, 0); + }; + + // Determine the total byte offset by looking at each GEP operand. + for (auto GTI = llvm::gep_type_begin(GEP), GTE = llvm::gep_type_end(GEP); + GTI != GTE; ++GTI) { + llvm::Value *LocalOffset; + auto *Index = GTI.getOperand(); + // Compute the local offset contributed by this indexing step: + if (auto *STy = GTI.getStructTypeOrNull()) { + // For struct indexing, the local offset is the byte position of the + // specified field. + unsigned FieldNo = cast(Index)->getZExtValue(); + LocalOffset = llvm::ConstantInt::get( + IntPtrTy, DL.getStructLayout(STy)->getElementOffset(FieldNo)); + } else { + // Otherwise this is array-like indexing. The local offset is the index + // multiplied by the element size. + auto *ElementSize = llvm::ConstantInt::get( + IntPtrTy, DL.getTypeAllocSize(GTI.getIndexedType())); + auto *IndexS = Builder.CreateIntCast(Index, IntPtrTy, /*isSigned=*/true); + LocalOffset = eval(BO_Mul, ElementSize, IndexS); + } + + // If this is the first offset, set it as the total offset. Otherwise, add + // the local offset into the running total. + if (!TotalOffset || TotalOffset == Zero) + TotalOffset = LocalOffset; + else + TotalOffset = eval(BO_Add, TotalOffset, LocalOffset); + } + + // Common case: if the total offset is zero, don't emit a check. + if (TotalOffset == Zero) + return GEPVal; + + // Now that we've computed the total offset, add it to the base pointer (with + // wrapping semantics). + auto *IntPtr = Builder.CreatePtrToInt(GEP->getPointerOperand(), IntPtrTy); + auto *ComputedGEP = Builder.CreateAdd(IntPtr, TotalOffset); + + // The GEP is valid if: + // 1) The total offset doesn't overflow, and + // 2) The sign of the difference between the computed address and the base + // pointer matches the sign of the total offset. + llvm::Value *PosOrZeroValid = Builder.CreateICmpUGE(ComputedGEP, IntPtr); + llvm::Value *NegValid = Builder.CreateICmpULT(ComputedGEP, IntPtr); + auto *PosOrZeroOffset = Builder.CreateICmpSGE(TotalOffset, Zero); + llvm::Value *ValidGEP = Builder.CreateAnd( + Builder.CreateNot(OffsetOverflows), + Builder.CreateSelect(PosOrZeroOffset, PosOrZeroValid, NegValid)); + + llvm::Constant *StaticArgs[] = {EmitCheckSourceLocation(Loc)}; + // Pass the computed GEP to the runtime to avoid emitting poisoned arguments. + llvm::Value *DynamicArgs[] = {IntPtr, ComputedGEP}; + EmitCheck(std::make_pair(ValidGEP, SanitizerKind::PointerOverflow), + SanitizerHandler::PointerOverflow, StaticArgs, DynamicArgs); + + return GEPVal; } Modified: vendor/clang/dist/lib/CodeGen/CGObjCRuntime.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGObjCRuntime.cpp Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/lib/CodeGen/CGObjCRuntime.cpp Thu Jun 1 20:58:49 2017 (r319463) @@ -90,7 +90,11 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen unsigned CVRQualifiers, llvm::Value *Offset) { // Compute (type*) ( (char *) BaseValue + Offset) - QualType IvarTy = Ivar->getType().withCVRQualifiers(CVRQualifiers); + QualType InterfaceTy{OID->getTypeForDecl(), 0}; + QualType ObjectPtrTy = + CGF.CGM.getContext().getObjCObjectPointerType(InterfaceTy); + QualType IvarTy = + Ivar->getUsageType(ObjectPtrTy).withCVRQualifiers(CVRQualifiers); llvm::Type *LTy = CGF.CGM.getTypes().ConvertTypeForMem(IvarTy); llvm::Value *V = CGF.Builder.CreateBitCast(BaseValue, CGF.Int8PtrTy); V = CGF.Builder.CreateInBoundsGEP(V, Offset, "add.ptr"); Modified: vendor/clang/dist/lib/CodeGen/CGVTables.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGVTables.cpp Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/lib/CodeGen/CGVTables.cpp Thu Jun 1 20:58:49 2017 (r319463) @@ -901,6 +901,8 @@ void CodeGenModule::EmitDeferredVTables() { for (const CXXRecordDecl *RD : DeferredVTables) if (shouldEmitVTableAtEndOfTranslationUnit(*this, RD)) VTables.GenerateClassData(RD); + else if (shouldOpportunisticallyEmitVTables()) + OpportunisticVTables.push_back(RD); assert(savedSize == DeferredVTables.size() && "deferred extra vtables during vtable emission?"); Modified: vendor/clang/dist/lib/CodeGen/CodeGenFunction.h ============================================================================== --- vendor/clang/dist/lib/CodeGen/CodeGenFunction.h Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/lib/CodeGen/CodeGenFunction.h Thu Jun 1 20:58:49 2017 (r319463) @@ -120,6 +120,7 @@ enum TypeEvaluationKind { SANITIZER_CHECK(NonnullArg, nonnull_arg, 0) \ SANITIZER_CHECK(NonnullReturn, nonnull_return, 0) \ SANITIZER_CHECK(OutOfBounds, out_of_bounds, 0) \ + SANITIZER_CHECK(PointerOverflow, pointer_overflow, 0) \ SANITIZER_CHECK(ShiftOutOfBounds, shift_out_of_bounds, 0) \ SANITIZER_CHECK(SubOverflow, sub_overflow, 0) \ SANITIZER_CHECK(TypeMismatch, type_mismatch, 1) \ @@ -3550,6 +3551,13 @@ class CodeGenFunction : public CodeGenTypeCache { (pub /// Given an assignment `*LHS = RHS`, emit a test that checks if \p RHS is /// nonnull, if \p LHS is marked _Nonnull. void EmitNullabilityCheck(LValue LHS, llvm::Value *RHS, SourceLocation Loc); + + /// Same as IRBuilder::CreateInBoundsGEP, but additionally emits a check to + /// detect undefined behavior when the pointer overflow sanitizer is enabled. + llvm::Value *EmitCheckedInBoundsGEP(llvm::Value *Ptr, + ArrayRef IdxList, + SourceLocation Loc, + const Twine &Name = ""); /// \brief Emit a description of a type in a format suitable for passing to /// a runtime sanitizer handler. Modified: vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp Thu Jun 1 20:58:49 2017 (r319463) @@ -382,6 +382,7 @@ void InstrProfStats::reportDiagnostics(DiagnosticsEngi void CodeGenModule::Release() { EmitDeferred(); + EmitVTablesOpportunistically(); applyGlobalValReplacements(); applyReplacements(); checkAliases(); @@ -472,10 +473,10 @@ void CodeGenModule::Release() { // Width of wchar_t in bytes uint64_t WCharWidth = Context.getTypeSizeInChars(Context.getWideCharType()).getQuantity(); - assert(LangOpts.ShortWChar || - llvm::TargetLibraryInfoImpl::getTargetWCharSize(Target.getTriple()) == - Target.getWCharWidth() / 8 && - "LLVM wchar_t size out of sync"); + assert((LangOpts.ShortWChar || + llvm::TargetLibraryInfoImpl::getTargetWCharSize(Target.getTriple()) == + Target.getWCharWidth() / 8) && + "LLVM wchar_t size out of sync"); // We need to record the widths of enums and wchar_t, so that we can generate // the correct build attributes in the ARM backend. wchar_size is also used by @@ -1386,6 +1387,24 @@ void CodeGenModule::EmitDeferred() { } } +void CodeGenModule::EmitVTablesOpportunistically() { + // Try to emit external vtables as available_externally if they have emitted + // all inlined virtual functions. It runs after EmitDeferred() and therefore + // is not allowed to create new references to things that need to be emitted + // lazily. Note that it also uses fact that we eagerly emitting RTTI. + + assert((OpportunisticVTables.empty() || shouldOpportunisticallyEmitVTables()) + && "Only emit opportunistic vtables with optimizations"); + + for (const CXXRecordDecl *RD : OpportunisticVTables) { + assert(getVTables().isVTableExternal(RD) && + "This queue should only contain external vtables"); + if (getCXXABI().canSpeculativelyEmitVTable(RD)) + VTables.GenerateClassData(RD); + } + OpportunisticVTables.clear(); +} + void CodeGenModule::EmitGlobalAnnotations() { if (Annotations.empty()) return; @@ -1904,6 +1923,10 @@ bool CodeGenModule::shouldEmitFunction(GlobalDecl GD) // implementation. // This happens in glibc's btowc and in some configure checks. return !isTriviallyRecursive(F); +} + +bool CodeGenModule::shouldOpportunisticallyEmitVTables() { + return CodeGenOpts.OptimizationLevel > 0; } void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD, llvm::GlobalValue *GV) { Modified: vendor/clang/dist/lib/CodeGen/CodeGenModule.h ============================================================================== --- vendor/clang/dist/lib/CodeGen/CodeGenModule.h Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/lib/CodeGen/CodeGenModule.h Thu Jun 1 20:58:49 2017 (r319463) @@ -341,6 +341,9 @@ class CodeGenModule : public CodeGenTypeCache { (priva /// A queue of (optional) vtables to consider emitting. std::vector DeferredVTables; + /// A queue of (optional) vtables that may be emitted opportunistically. + std::vector OpportunisticVTables; + /// List of global values which are required to be present in the object file; /// bitcast to i8*. This is used for forcing visibility of symbols which may /// otherwise be optimized out. @@ -450,7 +453,7 @@ class CodeGenModule : public CodeGenTypeCache { (priva bool isTriviallyRecursive(const FunctionDecl *F); bool shouldEmitFunction(GlobalDecl GD); - + bool shouldOpportunisticallyEmitVTables(); /// Map used to be sure we don't emit the same CompoundLiteral twice. llvm::DenseMap EmittedCompoundLiterals; @@ -1277,6 +1280,12 @@ class CodeGenModule : public CodeGenTypeCache { (priva /// Emit any needed decls for which code generation was deferred. void EmitDeferred(); + + /// Try to emit external vtables as available_externally if they have emitted + /// all inlined virtual functions. It runs after EmitDeferred() and therefore + /// is not allowed to create new references to things that need to be emitted + /// lazily. + void EmitVTablesOpportunistically(); /// Call replaceAllUsesWith on all pairs in Replacements. void applyReplacements(); Modified: vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp Thu Jun 1 20:58:42 2017 (r319462) +++ vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp Thu Jun 1 20:58:49 2017 (r319463) @@ -366,20 +366,30 @@ class ItaniumCXXABI : public CodeGen::CGCXXABI { (publ void emitCXXStructor(const CXXMethodDecl *MD, StructorType Type) override; private: - bool hasAnyVirtualInlineFunction(const CXXRecordDecl *RD) const { - const auto &VtableLayout = - CGM.getItaniumVTableContext().getVTableLayout(RD); + bool hasAnyUnusedVirtualInlineFunction(const CXXRecordDecl *RD) const { + const auto &VtableLayout = + CGM.getItaniumVTableContext().getVTableLayout(RD); - for (const auto &VtableComponent : VtableLayout.vtable_components()) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Thu Jun 1 20:59:04 2017 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7027BB7EB09; Thu, 1 Jun 2017 20:59:04 +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 D86CB67D79; Thu, 1 Jun 2017 20:59:03 +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 v51Kx21W035227; Thu, 1 Jun 2017 20:59:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51KwxYD035192; Thu, 1 Jun 2017 20:58:59 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012058.v51KwxYD035192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 20:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319465 - in vendor/compiler-rt/dist: include/sanitizer lib/asan lib/asan/tests lib/dfsan lib/lsan lib/msan lib/msan/tests lib/sanitizer_common lib/sanitizer_common/scripts lib/sanitize... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:59:04 -0000 Author: dim Date: Thu Jun 1 20:58:59 2017 New Revision: 319465 URL: https://svnweb.freebsd.org/changeset/base/319465 Log: Vendor import of compiler-rt trunk r304460: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304460 Added: vendor/compiler-rt/dist/test/asan/TestCases/Posix/strndup_oob_test.cc (contents, props changed) vendor/compiler-rt/dist/test/asan/TestCases/Posix/strndup_oob_test2.cc (contents, props changed) vendor/compiler-rt/dist/test/msan/strndup.cc (contents, props changed) vendor/compiler-rt/dist/test/sanitizer_common/TestCases/Linux/allocator_fork_no_hang.cc (contents, props changed) vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/PR33221.cpp (contents, props changed) Deleted: vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-sandboxing.cc vendor/compiler-rt/dist/test/asan/TestCases/coverage-order-pcs.cc Modified: vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h vendor/compiler-rt/dist/lib/asan/asan_allocator.cc vendor/compiler-rt/dist/lib/asan/asan_allocator.h vendor/compiler-rt/dist/lib/asan/asan_flags.cc vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc vendor/compiler-rt/dist/lib/asan/tests/asan_str_test.cc vendor/compiler-rt/dist/lib/dfsan/done_abilist.txt vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc vendor/compiler-rt/dist/lib/msan/msan_allocator.cc vendor/compiler-rt/dist/lib/msan/msan_allocator.h vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc vendor/compiler-rt/dist/lib/msan/tests/msan_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_interface.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h vendor/compiler-rt/dist/lib/sanitizer_common/scripts/sancov.py vendor/compiler-rt/dist/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_test_utils.h vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash_itanium.cc vendor/compiler-rt/dist/test/asan/TestCases/Linux/coverage-missing.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-fork.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-module-unloaded.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage.cc vendor/compiler-rt/dist/test/asan/TestCases/coverage-and-lsan.cc vendor/compiler-rt/dist/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cc vendor/compiler-rt/dist/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cc vendor/compiler-rt/dist/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc Modified: vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h Thu Jun 1 20:58:59 2017 (r319465) @@ -32,9 +32,6 @@ extern "C" { // descriptor. Returns -1 on failure, or if coverage dumping is disabled. // This is intended for use by sandboxing code. intptr_t __sanitizer_maybe_open_cov_file(const char *name); - // Get the number of unique covered blocks (or edges). - // This can be useful for coverage-directed in-process fuzzers. - uintptr_t __sanitizer_get_total_unique_coverage(); #ifdef __cplusplus } // extern "C" #endif Modified: vendor/compiler-rt/dist/lib/asan/asan_allocator.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_allocator.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/asan/asan_allocator.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -47,8 +47,6 @@ static u32 RZSize2Log(u32 rz_size) { return res; } -static AsanAllocator &get_allocator(); - // The memory chunk allocated from the underlying allocator looks like this: // L L L L L L H H U U U U U U R R // L -- left redzone words (0 or more bytes) @@ -719,7 +717,7 @@ struct Allocator { static Allocator instance(LINKER_INITIALIZED); -static AsanAllocator &get_allocator() { +AsanAllocator &get_allocator() { return instance.allocator; } Modified: vendor/compiler-rt/dist/lib/asan/asan_allocator.h ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_allocator.h Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/asan/asan_allocator.h Thu Jun 1 20:58:59 2017 (r319465) @@ -213,5 +213,7 @@ void asan_mz_force_unlock(); void PrintInternalAllocatorStats(); void AsanSoftRssLimitExceededCallback(bool exceeded); +AsanAllocator &get_allocator(); + } // namespace __asan #endif // ASAN_ALLOCATOR_H Modified: vendor/compiler-rt/dist/lib/asan/asan_flags.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_flags.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/asan/asan_flags.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -194,6 +194,10 @@ void InitializeFlags() { Report("WARNING: strchr* interceptors are enabled even though " "replace_str=0. Use intercept_strchr=0 to disable them."); } + if (!f->replace_str && common_flags()->intercept_strndup) { + Report("WARNING: strndup* interceptors are enabled even though " + "replace_str=0. Use intercept_strndup=0 to disable them."); + } } } // namespace __asan Modified: vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -22,6 +22,7 @@ #include "asan_stats.h" #include "asan_suppressions.h" #include "lsan/lsan_common.h" +#include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_libc.h" #if SANITIZER_POSIX @@ -705,11 +706,27 @@ INTERCEPTOR(int, __cxa_atexit, void (*func)(void *), v #endif // ASAN_INTERCEPT___CXA_ATEXIT #if ASAN_INTERCEPT_FORK +static void BeforeFork() { + if (SANITIZER_LINUX) { + get_allocator().ForceLock(); + StackDepotLockAll(); + } +} + +static void AfterFork() { + if (SANITIZER_LINUX) { + StackDepotUnlockAll(); + get_allocator().ForceUnlock(); + } +} + INTERCEPTOR(int, fork, void) { ENSURE_ASAN_INITED(); + BeforeFork(); if (common_flags()->coverage) CovBeforeFork(); int pid = REAL(fork)(); if (common_flags()->coverage) CovAfterFork(pid); + AfterFork(); return pid; } #endif // ASAN_INTERCEPT_FORK Modified: vendor/compiler-rt/dist/lib/asan/tests/asan_str_test.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/tests/asan_str_test.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/asan/tests/asan_str_test.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -154,6 +154,33 @@ TEST(AddressSanitizer, MAYBE_StrDupOOBTest) { free(str); } +#if SANITIZER_TEST_HAS_STRNDUP +TEST(AddressSanitizer, MAYBE_StrNDupOOBTest) { + size_t size = Ident(42); + char *str = MallocAndMemsetString(size); + char *new_str; + // Normal strndup calls. + str[size - 1] = '\0'; + new_str = strndup(str, size - 13); + free(new_str); + new_str = strndup(str + size - 1, 13); + free(new_str); + // Argument points to not allocated memory. + EXPECT_DEATH(Ident(strndup(str - 1, 13)), LeftOOBReadMessage(1)); + EXPECT_DEATH(Ident(strndup(str + size, 13)), RightOOBReadMessage(0)); + // Overwrite the terminating '\0' and hit unallocated memory. + str[size - 1] = 'z'; + EXPECT_DEATH(Ident(strndup(str, size + 13)), RightOOBReadMessage(0)); + // Check handling of non 0 terminated strings. + Ident(new_str = strndup(str + size - 1, 0)); + free(new_str); + Ident(new_str = strndup(str + size - 1, 1)); + free(new_str); + EXPECT_DEATH(Ident(strndup(str + size - 1, 2)), RightOOBReadMessage(0)); + free(str); +} +#endif // SANITIZER_TEST_HAS_STRNDUP + TEST(AddressSanitizer, StrCpyOOBTest) { size_t to_size = Ident(30); size_t from_size = Ident(6); // less than to_size Modified: vendor/compiler-rt/dist/lib/dfsan/done_abilist.txt ============================================================================== --- vendor/compiler-rt/dist/lib/dfsan/done_abilist.txt Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/dfsan/done_abilist.txt Thu Jun 1 20:58:59 2017 (r319465) @@ -287,8 +287,6 @@ fun:__sanitizer_cov_with_check=uninstrumented fun:__sanitizer_cov_with_check=discard fun:__sanitizer_set_death_callback=uninstrumented fun:__sanitizer_set_death_callback=discard -fun:__sanitizer_get_total_unique_coverage=uninstrumented -fun:__sanitizer_get_total_unique_coverage=discard fun:__sanitizer_update_counter_bitset_and_clear_counters=uninstrumented fun:__sanitizer_update_counter_bitset_and_clear_counters=discard Modified: vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -22,6 +22,7 @@ #include "sanitizer_common/sanitizer_platform_interceptors.h" #include "sanitizer_common/sanitizer_platform_limits_posix.h" #include "sanitizer_common/sanitizer_posix.h" +#include "sanitizer_common/sanitizer_stackdepot.h" #include "sanitizer_common/sanitizer_tls_get_addr.h" #include "lsan.h" #include "lsan_allocator.h" @@ -97,6 +98,28 @@ INTERCEPTOR(void*, valloc, uptr size) { } #endif +static void BeforeFork() { + if (SANITIZER_LINUX) { + LockAllocator(); + StackDepotLockAll(); + } +} + +static void AfterFork() { + if (SANITIZER_LINUX) { + StackDepotUnlockAll(); + UnlockAllocator(); + } +} + +INTERCEPTOR(int, fork, void) { + ENSURE_LSAN_INITED; + BeforeFork(); + int pid = REAL(fork)(); + AfterFork(); + return pid; +} + #if SANITIZER_INTERCEPT_MEMALIGN INTERCEPTOR(void*, memalign, uptr alignment, uptr size) { ENSURE_LSAN_INITED; @@ -336,6 +359,7 @@ void InitializeInterceptors() { LSAN_MAYBE_INTERCEPT_MALLOPT; INTERCEPT_FUNCTION(pthread_create); INTERCEPT_FUNCTION(pthread_join); + INTERCEPT_FUNCTION(fork); 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_allocator.cc ============================================================================== --- vendor/compiler-rt/dist/lib/msan/msan_allocator.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/msan/msan_allocator.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -12,8 +12,6 @@ // MemorySanitizer allocator. //===----------------------------------------------------------------------===// -#include "sanitizer_common/sanitizer_allocator.h" -#include "sanitizer_common/sanitizer_allocator_interface.h" #include "msan.h" #include "msan_allocator.h" #include "msan_origin.h" @@ -22,101 +20,11 @@ namespace __msan { -struct Metadata { - uptr requested_size; -}; - -struct MsanMapUnmapCallback { - void OnMap(uptr p, uptr size) const {} - void OnUnmap(uptr p, uptr size) const { - __msan_unpoison((void *)p, size); - - // We are about to unmap a chunk of user memory. - // Mark the corresponding shadow memory as not needed. - uptr shadow_p = MEM_TO_SHADOW(p); - ReleaseMemoryPagesToOS(shadow_p, shadow_p + size); - if (__msan_get_track_origins()) { - uptr origin_p = MEM_TO_ORIGIN(p); - ReleaseMemoryPagesToOS(origin_p, origin_p + size); - } - } -}; - -#if defined(__mips64) - static const uptr kMaxAllowedMallocSize = 2UL << 30; - static const uptr kRegionSizeLog = 20; - static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog; - typedef TwoLevelByteMap<(kNumRegions >> 12), 1 << 12> ByteMap; - - struct AP32 { - static const uptr kSpaceBeg = 0; - static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE; - static const uptr kMetadataSize = sizeof(Metadata); - typedef __sanitizer::CompactSizeClassMap SizeClassMap; - static const uptr kRegionSizeLog = __msan::kRegionSizeLog; - typedef __msan::ByteMap ByteMap; - typedef MsanMapUnmapCallback MapUnmapCallback; - static const uptr kFlags = 0; - }; - typedef SizeClassAllocator32 PrimaryAllocator; -#elif defined(__x86_64__) -#if SANITIZER_LINUX && !defined(MSAN_LINUX_X86_64_OLD_MAPPING) - static const uptr kAllocatorSpace = 0x700000000000ULL; -#else - static const uptr kAllocatorSpace = 0x600000000000ULL; -#endif - static const uptr kMaxAllowedMallocSize = 8UL << 30; - - struct AP64 { // Allocator64 parameters. Deliberately using a short name. - static const uptr kSpaceBeg = kAllocatorSpace; - static const uptr kSpaceSize = 0x40000000000; // 4T. - static const uptr kMetadataSize = sizeof(Metadata); - typedef DefaultSizeClassMap SizeClassMap; - typedef MsanMapUnmapCallback MapUnmapCallback; - static const uptr kFlags = 0; - }; - - typedef SizeClassAllocator64 PrimaryAllocator; - -#elif defined(__powerpc64__) - static const uptr kMaxAllowedMallocSize = 2UL << 30; // 2G - - struct AP64 { // Allocator64 parameters. Deliberately using a short name. - static const uptr kSpaceBeg = 0x300000000000; - static const uptr kSpaceSize = 0x020000000000; // 2T. - static const uptr kMetadataSize = sizeof(Metadata); - typedef DefaultSizeClassMap SizeClassMap; - typedef MsanMapUnmapCallback MapUnmapCallback; - static const uptr kFlags = 0; - }; - - typedef SizeClassAllocator64 PrimaryAllocator; -#elif defined(__aarch64__) - static const uptr kMaxAllowedMallocSize = 2UL << 30; // 2G - static const uptr kRegionSizeLog = 20; - static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog; - typedef TwoLevelByteMap<(kNumRegions >> 12), 1 << 12> ByteMap; - - struct AP32 { - static const uptr kSpaceBeg = 0; - static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE; - static const uptr kMetadataSize = sizeof(Metadata); - typedef __sanitizer::CompactSizeClassMap SizeClassMap; - static const uptr kRegionSizeLog = __msan::kRegionSizeLog; - typedef __msan::ByteMap ByteMap; - typedef MsanMapUnmapCallback MapUnmapCallback; - static const uptr kFlags = 0; - }; - typedef SizeClassAllocator32 PrimaryAllocator; -#endif -typedef SizeClassAllocatorLocalCache AllocatorCache; -typedef LargeMmapAllocator SecondaryAllocator; -typedef CombinedAllocator Allocator; - static Allocator allocator; static AllocatorCache fallback_allocator_cache; static SpinMutex fallback_mutex; + +Allocator &get_allocator() { return allocator; } void MsanAllocatorInit() { allocator.Init( Modified: vendor/compiler-rt/dist/lib/msan/msan_allocator.h ============================================================================== --- vendor/compiler-rt/dist/lib/msan/msan_allocator.h Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/msan/msan_allocator.h Thu Jun 1 20:58:59 2017 (r319465) @@ -15,8 +15,105 @@ #define MSAN_ALLOCATOR_H #include "sanitizer_common/sanitizer_common.h" +#include "sanitizer_common/sanitizer_allocator.h" +#include "sanitizer_common/sanitizer_allocator_interface.h" namespace __msan { + +struct Metadata { + uptr requested_size; +}; + +struct MsanMapUnmapCallback { + void OnMap(uptr p, uptr size) const {} + void OnUnmap(uptr p, uptr size) const { + __msan_unpoison((void *)p, size); + + // We are about to unmap a chunk of user memory. + // Mark the corresponding shadow memory as not needed. + uptr shadow_p = MEM_TO_SHADOW(p); + ReleaseMemoryPagesToOS(shadow_p, shadow_p + size); + if (__msan_get_track_origins()) { + uptr origin_p = MEM_TO_ORIGIN(p); + ReleaseMemoryPagesToOS(origin_p, origin_p + size); + } + } +}; + +#if defined(__mips64) + static const uptr kMaxAllowedMallocSize = 2UL << 30; + static const uptr kRegionSizeLog = 20; + static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog; + typedef TwoLevelByteMap<(kNumRegions >> 12), 1 << 12> ByteMap; + + struct AP32 { + static const uptr kSpaceBeg = 0; + static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE; + static const uptr kMetadataSize = sizeof(Metadata); + typedef __sanitizer::CompactSizeClassMap SizeClassMap; + static const uptr kRegionSizeLog = __msan::kRegionSizeLog; + typedef __msan::ByteMap ByteMap; + typedef MsanMapUnmapCallback MapUnmapCallback; + static const uptr kFlags = 0; + }; + typedef SizeClassAllocator32 PrimaryAllocator; +#elif defined(__x86_64__) +#if SANITIZER_LINUX && !defined(MSAN_LINUX_X86_64_OLD_MAPPING) + static const uptr kAllocatorSpace = 0x700000000000ULL; +#else + static const uptr kAllocatorSpace = 0x600000000000ULL; +#endif + static const uptr kMaxAllowedMallocSize = 8UL << 30; + + struct AP64 { // Allocator64 parameters. Deliberately using a short name. + static const uptr kSpaceBeg = kAllocatorSpace; + static const uptr kSpaceSize = 0x40000000000; // 4T. + static const uptr kMetadataSize = sizeof(Metadata); + typedef DefaultSizeClassMap SizeClassMap; + typedef MsanMapUnmapCallback MapUnmapCallback; + static const uptr kFlags = 0; + }; + + typedef SizeClassAllocator64 PrimaryAllocator; + +#elif defined(__powerpc64__) + static const uptr kMaxAllowedMallocSize = 2UL << 30; // 2G + + struct AP64 { // Allocator64 parameters. Deliberately using a short name. + static const uptr kSpaceBeg = 0x300000000000; + static const uptr kSpaceSize = 0x020000000000; // 2T. + static const uptr kMetadataSize = sizeof(Metadata); + typedef DefaultSizeClassMap SizeClassMap; + typedef MsanMapUnmapCallback MapUnmapCallback; + static const uptr kFlags = 0; + }; + + typedef SizeClassAllocator64 PrimaryAllocator; +#elif defined(__aarch64__) + static const uptr kMaxAllowedMallocSize = 2UL << 30; // 2G + static const uptr kRegionSizeLog = 20; + static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog; + typedef TwoLevelByteMap<(kNumRegions >> 12), 1 << 12> ByteMap; + + struct AP32 { + static const uptr kSpaceBeg = 0; + static const u64 kSpaceSize = SANITIZER_MMAP_RANGE_SIZE; + static const uptr kMetadataSize = sizeof(Metadata); + typedef __sanitizer::CompactSizeClassMap SizeClassMap; + static const uptr kRegionSizeLog = __msan::kRegionSizeLog; + typedef __msan::ByteMap ByteMap; + typedef MsanMapUnmapCallback MapUnmapCallback; + static const uptr kFlags = 0; + }; + typedef SizeClassAllocator32 PrimaryAllocator; +#endif +typedef SizeClassAllocatorLocalCache AllocatorCache; +typedef LargeMmapAllocator SecondaryAllocator; +typedef CombinedAllocator Allocator; + + +Allocator &get_allocator(); struct MsanThreadLocalMallocStorage { uptr quarantine_cache[16]; Modified: vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc ============================================================================== --- vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -341,33 +341,6 @@ INTERCEPTOR(char *, __strdup, char *src) { #define MSAN_MAYBE_INTERCEPT___STRDUP #endif -INTERCEPTOR(char *, strndup, char *src, SIZE_T n) { - ENSURE_MSAN_INITED(); - GET_STORE_STACK_TRACE; - // On FreeBSD strndup() leverages strnlen(). - InterceptorScope interceptor_scope; - SIZE_T copy_size = REAL(strnlen)(src, n); - char *res = REAL(strndup)(src, n); - CopyShadowAndOrigin(res, src, copy_size, &stack); - __msan_unpoison(res + copy_size, 1); // \0 - return res; -} - -#if !SANITIZER_FREEBSD -INTERCEPTOR(char *, __strndup, char *src, SIZE_T n) { - ENSURE_MSAN_INITED(); - GET_STORE_STACK_TRACE; - SIZE_T copy_size = REAL(strnlen)(src, n); - char *res = REAL(__strndup)(src, n); - CopyShadowAndOrigin(res, src, copy_size, &stack); - __msan_unpoison(res + copy_size, 1); // \0 - return res; -} -#define MSAN_MAYBE_INTERCEPT___STRNDUP INTERCEPT_FUNCTION(__strndup) -#else -#define MSAN_MAYBE_INTERCEPT___STRNDUP -#endif - INTERCEPTOR(char *, gcvt, double number, SIZE_T ndigit, char *buf) { ENSURE_MSAN_INITED(); char *res = REAL(gcvt)(number, ndigit, buf); @@ -1228,6 +1201,7 @@ INTERCEPTOR(void *, shmat, int shmid, const void *shma } static void BeforeFork() { + get_allocator().ForceLock(); StackDepotLockAll(); ChainedOriginDepotLockAll(); } @@ -1235,6 +1209,7 @@ static void BeforeFork() { static void AfterFork() { ChainedOriginDepotUnlockAll(); StackDepotUnlockAll(); + get_allocator().ForceUnlock(); } INTERCEPTOR(int, fork, void) { @@ -1371,6 +1346,13 @@ int OnExit() { return __msan_memcpy(to, from, size); \ } +#define COMMON_INTERCEPTOR_COPY_STRING(ctx, to, from, size) \ + do { \ + GET_STORE_STACK_TRACE; \ + CopyShadowAndOrigin(to, from, size, &stack); \ + __msan_unpoison(to + size, 1); \ + } while (false) + #include "sanitizer_common/sanitizer_platform_interceptors.h" #include "sanitizer_common/sanitizer_common_interceptors.inc" @@ -1538,8 +1520,6 @@ void InitializeInterceptors() { INTERCEPT_FUNCTION(stpcpy); // NOLINT INTERCEPT_FUNCTION(strdup); MSAN_MAYBE_INTERCEPT___STRDUP; - INTERCEPT_FUNCTION(strndup); - MSAN_MAYBE_INTERCEPT___STRNDUP; INTERCEPT_FUNCTION(strncpy); // NOLINT INTERCEPT_FUNCTION(gcvt); INTERCEPT_FUNCTION(strcat); // NOLINT Modified: vendor/compiler-rt/dist/lib/msan/tests/msan_test.cc ============================================================================== --- vendor/compiler-rt/dist/lib/msan/tests/msan_test.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/msan/tests/msan_test.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -1581,19 +1581,28 @@ TEST(MemorySanitizer, strdup) { TEST(MemorySanitizer, strndup) { char buf[4] = "abc"; __msan_poison(buf + 2, sizeof(*buf)); - char *x = strndup(buf, 3); + char *x; + EXPECT_UMR(x = strndup(buf, 3)); EXPECT_NOT_POISONED(x[0]); EXPECT_NOT_POISONED(x[1]); EXPECT_POISONED(x[2]); EXPECT_NOT_POISONED(x[3]); free(x); + // Check handling of non 0 terminated strings. + buf[3] = 'z'; + __msan_poison(buf + 3, sizeof(*buf)); + EXPECT_UMR(x = strndup(buf + 3, 1)); + EXPECT_POISONED(x[0]); + EXPECT_NOT_POISONED(x[1]); + free(x); } TEST(MemorySanitizer, strndup_short) { char buf[4] = "abc"; __msan_poison(buf + 1, sizeof(*buf)); __msan_poison(buf + 2, sizeof(*buf)); - char *x = strndup(buf, 2); + char *x; + EXPECT_UMR(x = strndup(buf, 2)); EXPECT_NOT_POISONED(x[0]); EXPECT_POISONED(x[1]); EXPECT_NOT_POISONED(x[2]); Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors.inc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors.inc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors.inc Thu Jun 1 20:58:59 2017 (r319465) @@ -34,6 +34,8 @@ // COMMON_INTERCEPTOR_MEMSET_IMPL // COMMON_INTERCEPTOR_MEMMOVE_IMPL // COMMON_INTERCEPTOR_MEMCPY_IMPL +// COMMON_INTERCEPTOR_COPY_STRING +// COMMON_INTERCEPTOR_STRNDUP_IMPL //===----------------------------------------------------------------------===// #include "interception/interception.h" @@ -217,6 +219,24 @@ bool PlatformHasDifferentMemcpyAndMemmove(); } #endif +#ifndef COMMON_INTERCEPTOR_COPY_STRING +#define COMMON_INTERCEPTOR_COPY_STRING(ctx, to, from, size) {} +#endif + +#ifndef COMMON_INTERCEPTOR_STRNDUP_IMPL +#define COMMON_INTERCEPTOR_STRNDUP_IMPL(ctx, s, size) \ + COMMON_INTERCEPTOR_ENTER(ctx, strndup, s, size); \ + uptr copy_length = internal_strnlen(s, size); \ + char *new_mem = (char *)WRAP(malloc)(copy_length + 1); \ + if (common_flags()->intercept_strndup) { \ + COMMON_INTERCEPTOR_READ_STRING(ctx, s, Min(size, copy_length + 1)); \ + } \ + COMMON_INTERCEPTOR_COPY_STRING(ctx, new_mem, s, copy_length); \ + internal_memcpy(new_mem, s, copy_length); \ + new_mem[copy_length] = '\0'; \ + return new_mem; +#endif + struct FileMetadata { // For open_memstream(). char **addr; @@ -300,6 +320,26 @@ INTERCEPTOR(SIZE_T, strnlen, const char *s, SIZE_T max #define INIT_STRNLEN #endif +#if SANITIZER_INTERCEPT_STRNDUP +INTERCEPTOR(char*, strndup, const char *s, uptr size) { + void *ctx; + COMMON_INTERCEPTOR_STRNDUP_IMPL(ctx, s, size); +} +#define INIT_STRNDUP COMMON_INTERCEPT_FUNCTION(strndup) +#else +#define INIT_STRNDUP +#endif // SANITIZER_INTERCEPT_STRNDUP + +#if SANITIZER_INTERCEPT___STRNDUP +INTERCEPTOR(char*, __strndup, const char *s, uptr size) { + void *ctx; + COMMON_INTERCEPTOR_STRNDUP_IMPL(ctx, s, size); +} +#define INIT___STRNDUP COMMON_INTERCEPT_FUNCTION(__strndup) +#else +#define INIT___STRNDUP +#endif // SANITIZER_INTERCEPT___STRNDUP + #if SANITIZER_INTERCEPT_TEXTDOMAIN INTERCEPTOR(char*, textdomain, const char *domainname) { void *ctx; @@ -6163,6 +6203,8 @@ static void InitializeCommonInterceptors() { INIT_TEXTDOMAIN; INIT_STRLEN; INIT_STRNLEN; + INIT_STRNDUP; + INIT___STRNDUP; INIT_STRCMP; INIT_STRNCMP; INIT_STRCASECMP; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_interface.inc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_interface.inc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_interface.inc Thu Jun 1 20:58:59 2017 (r319465) @@ -8,14 +8,9 @@ //===----------------------------------------------------------------------===// // Sanitizer Coverage interface list. //===----------------------------------------------------------------------===// -INTERFACE_FUNCTION(__sanitizer_cov) INTERFACE_FUNCTION(__sanitizer_cov_dump) -INTERFACE_FUNCTION(__sanitizer_cov_init) -INTERFACE_FUNCTION(__sanitizer_cov_module_init) -INTERFACE_FUNCTION(__sanitizer_cov_with_check) INTERFACE_FUNCTION(__sanitizer_dump_coverage) INTERFACE_FUNCTION(__sanitizer_dump_trace_pc_guard_coverage) -INTERFACE_FUNCTION(__sanitizer_get_total_unique_coverage) INTERFACE_FUNCTION(__sanitizer_maybe_open_cov_file) INTERFACE_WEAK_FUNCTION(__sancov_default_options) INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_cmp) Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -155,13 +155,6 @@ void CoverageData::DirectOpen() { void CoverageData::Init() { pc_fd = kInvalidFd; - - if (!common_flags()->coverage) return; - Printf("**\n***\n***\n"); - Printf("**WARNING: this implementation of SanitizerCoverage is deprecated\n"); - Printf("**WARNING: and will be removed in future versions\n"); - Printf("**WARNING: See https://clang.llvm.org/docs/SanitizerCoverage.html\n"); - Printf("**\n***\n***\n"); } void CoverageData::Enable() { @@ -495,6 +488,12 @@ static void GenerateHtmlReport(const InternalMmapVecto void CoverageData::DumpOffsets() { auto sym = Symbolizer::GetOrInit(); if (!common_flags()->coverage_pcs) return; + Printf("**\n***\n***\n"); + Printf("**WARNING: this implementation of SanitizerCoverage is deprecated\n"); + Printf("**WARNING: and will be removed in future versions\n"); + Printf("**WARNING: See https://clang.llvm.org/docs/SanitizerCoverage.html\n"); + Printf("**\n***\n***\n"); + CHECK_NE(sym, nullptr); InternalMmapVector offsets(0); InternalScopedString path(kMaxPathLength); @@ -607,47 +606,13 @@ void CoverageUpdateMapping() { } // namespace __sanitizer extern "C" { -SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov(u32 *guard) { - coverage_data.Add(StackTrace::GetPreviousInstructionPc(GET_CALLER_PC()), - guard); -} -SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_with_check(u32 *guard) { - atomic_uint32_t *atomic_guard = reinterpret_cast(guard); - if (static_cast( - __sanitizer::atomic_load(atomic_guard, memory_order_relaxed)) < 0) - coverage_data.Add(StackTrace::GetPreviousInstructionPc(GET_CALLER_PC()), - guard); -} -SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_init() { - coverage_enabled = true; - coverage_dir = common_flags()->coverage_dir; - coverage_data.Init(); -} SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_dump() { - coverage_data.DumpAll(); __sanitizer_dump_trace_pc_guard_coverage(); } -SANITIZER_INTERFACE_ATTRIBUTE void -__sanitizer_cov_module_init(s32 *guards, uptr npcs, u8 *counters, - const char *comp_unit_name) { - coverage_data.InitializeGuards(guards, npcs, comp_unit_name, GET_CALLER_PC()); - if (!common_flags()->coverage_direct) return; - if (SANITIZER_ANDROID && coverage_enabled) { - // dlopen/dlclose interceptors do not work on Android, so we rely on - // Extend() calls to update .sancov.map. - CovUpdateMapping(coverage_dir, GET_CALLER_PC()); - } - coverage_data.Extend(npcs); -} SANITIZER_INTERFACE_ATTRIBUTE sptr __sanitizer_maybe_open_cov_file(const char *name) { return (sptr)MaybeOpenCovFile(name); } -SANITIZER_INTERFACE_ATTRIBUTE -uptr __sanitizer_get_total_unique_coverage() { - return atomic_load(&coverage_counter, memory_order_relaxed); -} - // Default empty implementations (weak). Users should redefine them. SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_cmp, void) {} SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_cmp1, void) {} Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -49,7 +49,7 @@ static void WriteModuleCoverage(char* file_path, const WriteToFile(fd, &Magic, sizeof(Magic)); WriteToFile(fd, pcs, len * sizeof(*pcs)); CloseFile(fd); - Printf("SanitizerCoverage: %s %zd PCs written\n", file_path, len); + Printf("SanitizerCoverage: %s: %zd PCs written\n", file_path, len); } static void SanitizerDumpCoverage(const uptr* unsorted_pcs, uptr len) { @@ -71,7 +71,7 @@ static void SanitizerDumpCoverage(const uptr* unsorted if (!pc) continue; if (!__sanitizer_get_module_and_offset_for_pc(pc, nullptr, 0, &pcs[i])) { - Printf("ERROR: bad pc %x\n", pc); + Printf("ERROR: unknown pc 0x%x (may happen if dlclose is used)\n", pc); continue; } uptr module_base = pc - pcs[i]; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc Thu Jun 1 20:58:59 2017 (r319465) @@ -197,6 +197,9 @@ COMMON_FLAG(bool, intercept_strpbrk, true, COMMON_FLAG(bool, intercept_strlen, true, "If set, uses custom wrappers for strlen and strnlen functions " "to find more errors.") +COMMON_FLAG(bool, intercept_strndup, true, + "If set, uses custom wrappers for strndup functions " + "to find more errors.") COMMON_FLAG(bool, intercept_strchr, true, "If set, uses custom wrappers for strchr, strchrnul, and strrchr " "functions to find more errors.") Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h Thu Jun 1 20:58:59 2017 (r319465) @@ -25,6 +25,12 @@ # define SI_NOT_WINDOWS 0 #endif +#if SANITIZER_POSIX +# define SI_POSIX 1 +#else +# define SI_POSIX 0 +#endif + #if SANITIZER_LINUX && !SANITIZER_ANDROID # define SI_LINUX_NOT_ANDROID 1 #else @@ -69,6 +75,12 @@ # define SI_UNIX_NOT_MAC 0 #endif +#if SANITIZER_LINUX && !SANITIZER_FREEBSD +# define SI_LINUX_NOT_FREEBSD 1 +# else +# define SI_LINUX_NOT_FREEBSD 0 +#endif + #define SANITIZER_INTERCEPT_STRLEN 1 #define SANITIZER_INTERCEPT_STRNLEN SI_NOT_MAC #define SANITIZER_INTERCEPT_STRCMP 1 @@ -86,6 +98,8 @@ #define SANITIZER_INTERCEPT_MEMMOVE 1 #define SANITIZER_INTERCEPT_MEMCPY 1 #define SANITIZER_INTERCEPT_MEMCMP 1 +#define SANITIZER_INTERCEPT_STRNDUP SI_POSIX +#define SANITIZER_INTERCEPT___STRNDUP SI_LINUX_NOT_FREEBSD #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070 # define SI_MAC_DEPLOYMENT_BELOW_10_7 1 Modified: vendor/compiler-rt/dist/lib/sanitizer_common/scripts/sancov.py ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/scripts/sancov.py Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/sanitizer_common/scripts/sancov.py Thu Jun 1 20:58:59 2017 (r319465) @@ -194,7 +194,7 @@ def GetInstrumentedPCs(binary): # - with call or callq, # - directly or via PLT. cmd = "objdump -d %s | " \ - "grep '^\s\+[0-9a-f]\+:.*\scall\(q\|\)\s\+[0-9a-f]\+ <__sanitizer_cov\(_with_check\|\)\(@plt\|\)>' | " \ + "grep '^\s\+[0-9a-f]\+:.*\scall\(q\|\)\s\+[0-9a-f]\+ <__sanitizer_cov\(_with_check\|\|_trace_pc_guard\)\(@plt\|\)>' | " \ "grep '^\s\+[0-9a-f]\+' -o" % binary proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True) Modified: vendor/compiler-rt/dist/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt Thu Jun 1 20:58:59 2017 (r319465) @@ -59,6 +59,7 @@ getpagesize U getpid U gettimeofday U ioctl U +isalpha U isatty U isprint U isupper U Modified: vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_test_utils.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_test_utils.h Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_test_utils.h Thu Jun 1 20:58:59 2017 (r319465) @@ -124,4 +124,10 @@ static inline uint32_t my_rand() { # define SANITIZER_TEST_HAS_PRINTF_L 0 #endif +#if !defined(_MSC_VER) +# define SANITIZER_TEST_HAS_STRNDUP 1 +#else +# define SANITIZER_TEST_HAS_STRNDUP 0 +#endif + #endif // SANITIZER_TEST_UTILS_H Modified: vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash_itanium.cc ============================================================================== --- vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash_itanium.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash_itanium.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -197,7 +197,7 @@ struct VtablePrefix { }; VtablePrefix *getVtablePrefix(void *Vtable) { VtablePrefix *Vptr = reinterpret_cast(Vtable); - if (!Vptr) + if (!IsAccessibleMemoryRange((uptr)Vptr, sizeof(VtablePrefix))) return nullptr; VtablePrefix *Prefix = Vptr - 1; if (!Prefix->TypeInfo) Modified: vendor/compiler-rt/dist/test/asan/TestCases/Linux/coverage-missing.cc ============================================================================== --- vendor/compiler-rt/dist/test/asan/TestCases/Linux/coverage-missing.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/test/asan/TestCases/Linux/coverage-missing.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -1,7 +1,7 @@ // Test for "sancov.py missing ...". // First case: coverage from executable. main() is called on every code path. -// RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t -DFOOBAR -DMAIN +// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s -o %t -DFOOBAR -DMAIN // RUN: rm -rf %T/coverage-missing // RUN: mkdir -p %T/coverage-missing // RUN: cd %T/coverage-missing @@ -27,8 +27,8 @@ // Second case: coverage from DSO. // cd %T -// RUN: %clangxx_asan -fsanitize-coverage=func %s -o %dynamiclib -DFOOBAR -shared -fPIC -// RUN: %clangxx_asan -fsanitize-coverage=func %s %dynamiclib -o %t -DMAIN +// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s -o %dynamiclib -DFOOBAR -shared -fPIC +// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s %dynamiclib -o %t -DMAIN // RUN: cd .. // RUN: rm -rf %T/coverage-missing // RUN: mkdir -p %T/coverage-missing Modified: vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-fork.cc ============================================================================== --- vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-fork.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-fork.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -1,9 +1,13 @@ -// RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t +// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s -o %t // RUN: rm -rf %T/coverage-fork // RUN: mkdir -p %T/coverage-fork && cd %T/coverage-fork -// RUN: %env_asan_opts=coverage=1:coverage_direct=0:verbosity=1 %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 2>&1 | FileCheck %s // // UNSUPPORTED: android +// +// Ideally a forked-subprocess should only report it's own coverage, +// not parent's one. But trace-pc-guard currently does nothing special for fork, +// and thus this test is relaxed. #include #include @@ -32,6 +36,6 @@ int main(int argc, char **argv) { } // CHECK-DAG: Child PID: [[ChildPID:[0-9]+]] -// CHECK-DAG: [[ChildPID]].sancov: 1 PCs written +// CHECK-DAG: [[ChildPID]].sancov: {{.*}} PCs written // CHECK-DAG: Parent PID: [[ParentPID:[0-9]+]] // CHECK-DAG: [[ParentPID]].sancov: 3 PCs written Modified: vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-module-unloaded.cc ============================================================================== --- vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-module-unloaded.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-module-unloaded.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -1,12 +1,11 @@ // Check that unloading a module doesn't break coverage dumping for remaining // modules. -// RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib1 -fPIC -// RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib2 -fPIC -// RUN: %clangxx_asan -fsanitize-coverage=func %s %libdl -o %t -// RUN: mkdir -p %T/coverage-module-unloaded && cd %T/coverage-module-unloaded -// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t %dynamiclib1 %dynamiclib2 2>&1 | FileCheck %s -// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t %dynamiclib1 %dynamiclib2 foo 2>&1 | FileCheck %s -// RUN: rm -r %T/coverage-module-unloaded +// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard -DSHARED %s -shared -o %dynamiclib1 -fPIC +// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard -DSHARED %s -shared -o %dynamiclib2 -fPIC +// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s %libdl -o %t.exe +// RUN: mkdir -p %t.tmp/coverage-module-unloaded && cd %t.tmp/coverage-module-unloaded +// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t.exe %dynamiclib1 %dynamiclib2 2>&1 | FileCheck %s +// RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t.exe %dynamiclib1 %dynamiclib2 foo 2>&1 | FileCheck %s // // https://code.google.com/p/address-sanitizer/issues/detail?id=263 // XFAIL: android @@ -48,8 +47,5 @@ int main(int argc, char **argv) { #endif // CHECK: PID: [[PID:[0-9]+]] -// CHECK: [[PID]].sancov: 1 PCs written -// CHECK: coverage-module-unloaded{{.*}}1.[[PID]] -// CHECK: coverage-module-unloaded{{.*}}2.[[PID]] -// Even though we've unloaded one of the libs we still dump the coverage file -// for that lib (although the data will be inaccurate, if at all useful) +// CHECK-DAG: exe{{.*}}[[PID]].sancov: {{.*}}PCs written +// CHECK-DAG: dynamic{{.*}}[[PID]].sancov: {{.*}}PCs written Modified: vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage.cc ============================================================================== --- vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -1,5 +1,5 @@ -// RUN: %clangxx_asan -fsanitize-coverage=func -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so -// RUN: %clangxx_asan -fsanitize-coverage=func %s %ld_flags_rpath_exe -o %t +// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard -DSHARED %s -shared -o %dynamiclib -fPIC %ld_flags_rpath_so +// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s %ld_flags_rpath_exe -o %t // RUN: rm -rf %T/coverage && mkdir -p %T/coverage && cd %T/coverage // RUN: %env_asan_opts=coverage=1:verbosity=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-main // RUN: %sancov print coverage.*sancov 2>&1 | FileCheck %s --check-prefix=CHECK-SANCOV1 @@ -20,7 +20,6 @@ // XFAIL: android // UNSUPPORTED: ios -#include #include #include #include @@ -38,12 +37,8 @@ int G[4]; int main(int argc, char **argv) { fprintf(stderr, "PID: %d\n", getpid()); for (int i = 1; i < argc; i++) { - if (!strcmp(argv[i], "foo")) { - uintptr_t old_coverage = __sanitizer_get_total_unique_coverage(); + if (!strcmp(argv[i], "foo")) foo(); - uintptr_t new_coverage = __sanitizer_get_total_unique_coverage(); - assert(new_coverage > old_coverage); - } if (!strcmp(argv[i], "bar")) bar(); } @@ -64,12 +59,12 @@ int main(int argc, char **argv) { // CHECK-foo-NOT: .so.[[PID]] // // CHECK-bar: PID: [[PID:[0-9]+]] -// CHECK-bar: .so.[[PID]].sancov: 1 PCs written -// CHECK-bar: [[PID]].sancov: 1 PCs written +// CHECK-bar-DAG: .so.[[PID]].sancov: 1 PCs written +// CHECK-bar-DAG: [[PID]].sancov: 1 PCs written // // CHECK-foo-bar: PID: [[PID:[0-9]+]] -// CHECK-foo-bar: so.[[PID]].sancov: 1 PCs written -// CHECK-foo-bar: [[PID]].sancov: 2 PCs written +// CHECK-foo-bar-DAG: so.[[PID]].sancov: 1 PCs written +// CHECK-foo-bar-DAG: [[PID]].sancov: 2 PCs written // // CHECK-report: AddressSanitizer: global-buffer-overflow // CHECK-report: PCs written Added: vendor/compiler-rt/dist/test/asan/TestCases/Posix/strndup_oob_test.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/test/asan/TestCases/Posix/strndup_oob_test.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -0,0 +1,27 @@ +// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s + +// When built as C on Linux, strndup is transformed to __strndup. +// RUN: %clangxx_asan -O3 -xc %s -o %t && not %run %t 2>&1 | FileCheck %s + +// Unwind problem on arm: "main" is missing from the allocation stack trace. +// UNSUPPORTED: win32,s390,armv7l-unknown-linux-gnueabihf + +#include + +char kString[] = "foo"; + +int main(int argc, char **argv) { + char *copy = strndup(kString, 2); + int x = copy[2 + argc]; // BOOM + // CHECK: AddressSanitizer: heap-buffer-overflow + // CHECK: #0 {{.*}}main {{.*}}strndup_oob_test.cc:[[@LINE-2]] + // CHECK-LABEL: allocated by thread T{{.*}} here: + // CHECK: #{{[01]}} {{.*}}strndup + // CHECK: #{{.*}}main {{.*}}strndup_oob_test.cc:[[@LINE-6]] + // CHECK-LABEL: SUMMARY + // CHECK: strndup_oob_test.cc:[[@LINE-7]] + return x; +} Added: vendor/compiler-rt/dist/test/asan/TestCases/Posix/strndup_oob_test2.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/test/asan/TestCases/Posix/strndup_oob_test2.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -0,0 +1,22 @@ +// RUN: %clang_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s + +// When built as C on Linux, strndup is transformed to __strndup. +// RUN: %clang_asan -O3 -xc %s -o %t && not %run %t 2>&1 | FileCheck %s + +// Unwind problem on arm: "main" is missing from the allocation stack trace. +// UNSUPPORTED: win32,s390,armv7l-unknown-linux-gnueabihf + +#include + +char kChars[] = { 'f', 'o', 'o' }; + +int main(int argc, char **argv) { + char *copy = strndup(kChars, 3); + copy = strndup(kChars, 10); + // CHECK: AddressSanitizer: global-buffer-overflow + // CHECK: {{.*}}main {{.*}}.cc:[[@LINE-2]] + return *copy; +} \ No newline at end of file Modified: vendor/compiler-rt/dist/test/asan/TestCases/coverage-and-lsan.cc ============================================================================== --- vendor/compiler-rt/dist/test/asan/TestCases/coverage-and-lsan.cc Thu Jun 1 20:58:56 2017 (r319464) +++ vendor/compiler-rt/dist/test/asan/TestCases/coverage-and-lsan.cc Thu Jun 1 20:58:59 2017 (r319465) @@ -1,6 +1,6 @@ // Make sure coverage is dumped even if there are reported leaks. // -// RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t +// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s -o %t // // RUN: rm -rf %T/coverage-and-lsan // @@ -17,4 +17,4 @@ int main(int argc, char **argv) { } // CHECK: LeakSanitizer: detected memory leaks -// CHECK: CovDump: +// CHECK: SanitizerCoverage: {{.*}}PCs written Added: vendor/compiler-rt/dist/test/msan/strndup.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Thu Jun 1 20:59:07 2017 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC1CFB7EB34; Thu, 1 Jun 2017 20:59:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 612BB67DBC; Thu, 1 Jun 2017 20:59:07 +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 v51Kx6eE035274; Thu, 1 Jun 2017 20:59:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51Kx6Kc035273; Thu, 1 Jun 2017 20:59:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012059.v51Kx6Kc035273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 20:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319466 - vendor/compiler-rt/compiler-rt-trunk-r304460 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:59:07 -0000 Author: dim Date: Thu Jun 1 20:59:06 2017 New Revision: 319466 URL: https://svnweb.freebsd.org/changeset/base/319466 Log: Tag compiler-rt trunk r304460. Added: vendor/compiler-rt/compiler-rt-trunk-r304460/ - copied from r319465, vendor/compiler-rt/dist/ From owner-svn-src-vendor@freebsd.org Thu Jun 1 20:59: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 6DA7CB7EBA7; Thu, 1 Jun 2017 20:59: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 08C5967EA4; Thu, 1 Jun 2017 20:59:14 +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 v51KxEi7035355; Thu, 1 Jun 2017 20:59:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51KxAjX035322; Thu, 1 Jun 2017 20:59:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012059.v51KxAjX035322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 20:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319467 - in vendor/libc++/dist: . include include/experimental include/support/win32 src src/support/win32 test/libcxx test/libcxx/utilities/tuple/tuple.tuple test/std/experimental/lan... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:59:15 -0000 Author: dim Date: Thu Jun 1 20:59:10 2017 New Revision: 319467 URL: https://svnweb.freebsd.org/changeset/base/319467 Log: Vendor import of libc++ trunk r304460: https://llvm.org/svn/llvm-project/libcxx/trunk@304460 Added: vendor/libc++/dist/include/__undef_macros vendor/libc++/dist/test/libcxx/min_max_macros.sh.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/assign.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/construct.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/address.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/void_handle.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.traits/promise_type.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/fullexpr-dtor.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/generator.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/go.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp (contents, props changed) vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/includes.pass.cpp (contents, props changed) Deleted: vendor/libc++/dist/include/__undef_min_max vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/assign.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/construct.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/address.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/void_handle.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.traits/promise_type.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/expected.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/fullexpr-dtor.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/generator.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/go.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/multishot_func.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.sh.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/includes.sh.cpp Modified: vendor/libc++/dist/appveyor-reqs-install.cmd vendor/libc++/dist/include/__bit_reference vendor/libc++/dist/include/__config vendor/libc++/dist/include/__hash_table vendor/libc++/dist/include/__locale vendor/libc++/dist/include/__mutex_base vendor/libc++/dist/include/__split_buffer vendor/libc++/dist/include/__std_stream vendor/libc++/dist/include/__string vendor/libc++/dist/include/__threading_support vendor/libc++/dist/include/__tree vendor/libc++/dist/include/algorithm vendor/libc++/dist/include/array vendor/libc++/dist/include/bitset vendor/libc++/dist/include/chrono vendor/libc++/dist/include/deque vendor/libc++/dist/include/experimental/algorithm vendor/libc++/dist/include/experimental/dynarray vendor/libc++/dist/include/experimental/functional vendor/libc++/dist/include/experimental/memory_resource vendor/libc++/dist/include/experimental/numeric vendor/libc++/dist/include/experimental/optional vendor/libc++/dist/include/experimental/string_view vendor/libc++/dist/include/forward_list vendor/libc++/dist/include/fstream vendor/libc++/dist/include/istream vendor/libc++/dist/include/limits vendor/libc++/dist/include/list vendor/libc++/dist/include/locale vendor/libc++/dist/include/memory vendor/libc++/dist/include/module.modulemap vendor/libc++/dist/include/mutex vendor/libc++/dist/include/numeric vendor/libc++/dist/include/optional vendor/libc++/dist/include/random vendor/libc++/dist/include/ratio vendor/libc++/dist/include/regex vendor/libc++/dist/include/shared_mutex vendor/libc++/dist/include/sstream vendor/libc++/dist/include/stdexcept vendor/libc++/dist/include/stdio.h vendor/libc++/dist/include/streambuf vendor/libc++/dist/include/string vendor/libc++/dist/include/string_view vendor/libc++/dist/include/support/win32/locale_win32.h vendor/libc++/dist/include/thread vendor/libc++/dist/include/tuple vendor/libc++/dist/include/valarray vendor/libc++/dist/include/vector vendor/libc++/dist/include/wchar.h vendor/libc++/dist/src/chrono.cpp vendor/libc++/dist/src/condition_variable.cpp vendor/libc++/dist/src/ios.cpp vendor/libc++/dist/src/locale.cpp vendor/libc++/dist/src/mutex.cpp vendor/libc++/dist/src/new.cpp vendor/libc++/dist/src/strstream.cpp vendor/libc++/dist/src/support/win32/locale_win32.cpp vendor/libc++/dist/src/support/win32/support.cpp vendor/libc++/dist/src/system_error.cpp vendor/libc++/dist/src/thread.cpp vendor/libc++/dist/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp vendor/libc++/dist/test/support/nasty_macros.hpp vendor/libc++/dist/test/support/test_macros.h vendor/libc++/dist/utils/libcxx/test/config.py Modified: vendor/libc++/dist/appveyor-reqs-install.cmd ============================================================================== --- vendor/libc++/dist/appveyor-reqs-install.cmd Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/appveyor-reqs-install.cmd Thu Jun 1 20:59:10 2017 (r319467) @@ -9,7 +9,7 @@ cd C:\projects\deps :: Setup Compiler ::########################################################################### if NOT EXIST llvm-installer.exe ( - appveyor DownloadFile http://llvm.org/pre-releases/win-snapshots/LLVM-5.0.0-r301646-win32.exe -FileName llvm-installer.exe + appveyor DownloadFile http://llvm.org/pre-releases/win-snapshots/LLVM-5.0.0-r303050-win32.exe -FileName llvm-installer.exe ) if "%CLANG_VERSION%"=="ToT" ( START /WAIT llvm-installer.exe /S /D=C:\"Program Files\LLVM" Modified: vendor/libc++/dist/include/__bit_reference ============================================================================== --- vendor/libc++/dist/include/__bit_reference Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/__bit_reference Thu Jun 1 20:59:10 2017 (r319467) @@ -14,12 +14,14 @@ #include <__config> #include -#include <__undef_min_max> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD template class __bit_iterator; @@ -1272,5 +1274,7 @@ class __bit_iterator (private) }; _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP___BIT_REFERENCE Modified: vendor/libc++/dist/include/__config ============================================================================== --- vendor/libc++/dist/include/__config Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/__config Thu Jun 1 20:59:10 2017 (r319467) @@ -220,10 +220,12 @@ #endif // __NetBSD__ #if defined(_WIN32) -# define _LIBCPP_WIN32API 1 +# define _LIBCPP_WIN32API # define _LIBCPP_LITTLE_ENDIAN 1 # define _LIBCPP_BIG_ENDIAN 0 # 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__ # define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library @@ -1204,5 +1206,35 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_ __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ <= 70000)) #define _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE #endif + +#if defined(_LIBCPP_COMPILER_IBM) +#define _LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO +#endif + +#if defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# define _LIBCPP_PUSH_MACROS +# define _LIBCPP_POP_MACROS +#else + // Don't warn about macro conflicts when we can restore them at the + // end of the header. +# ifndef _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS +# define _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS +# endif +# if defined(_LIBCPP_COMPILER_MSVC) +# define _LIBCPP_PUSH_MACROS \ + __pragma(push_macro("min")) \ + __pragma(push_macro("max")) +# define _LIBCPP_POP_MACROS \ + __pragma(pop_macro("min")) \ + __pragma(pop_macro("max")) +# else +# define _LIBCPP_PUSH_MACROS \ + _Pragma("push_macro(\"min\")") \ + _Pragma("push_macro(\"max\")") +# define _LIBCPP_POP_MACROS \ + _Pragma("pop_macro(\"min\")") \ + _Pragma("pop_macro(\"max\")") +# endif +#endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) #endif // _LIBCPP_CONFIG Modified: vendor/libc++/dist/include/__hash_table ============================================================================== --- vendor/libc++/dist/include/__hash_table Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/__hash_table Thu Jun 1 20:59:10 2017 (r319467) @@ -20,17 +20,18 @@ #include #include -#include <__undef_min_max> - #include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -_LIBCPP_BEGIN_NAMESPACE_STD +_LIBCPP_PUSH_MACROS +#include <__undef_macros> +_LIBCPP_BEGIN_NAMESPACE_STD + #ifndef _LIBCPP_CXX03_LANG template union __hash_value_type; @@ -2667,6 +2668,9 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__subscripta } #endif // _LIBCPP_DEBUG_LEVEL >= 2 + _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP__HASH_TABLE Modified: vendor/libc++/dist/include/__locale ============================================================================== --- vendor/libc++/dist/include/__locale Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/__locale Thu Jun 1 20:59:10 2017 (r319467) @@ -19,7 +19,7 @@ #include #include #include -#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) +#if defined(_LIBCPP_MSVCRT_LIKE) # include #elif defined(_AIX) # include @@ -367,7 +367,7 @@ class _LIBCPP_TYPE_VIS ctype_base (public) static const mask punct = _ISpunct; static const mask xdigit = _ISxdigit; static const mask blank = _ISblank; -#elif defined(_LIBCPP_MSVCRT) +#elif defined(_LIBCPP_MSVCRT_LIKE) typedef unsigned short mask; static const mask space = _SPACE; static const mask print = _BLANK|_PUNCT|_ALPHA|_DIGIT; Modified: vendor/libc++/dist/include/__mutex_base ============================================================================== --- vendor/libc++/dist/include/__mutex_base Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/__mutex_base Thu Jun 1 20:59:10 2017 (r319467) @@ -15,12 +15,16 @@ #include #include #include <__threading_support> -#include <__undef_min_max> + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD #ifndef _LIBCPP_HAS_NO_THREADS @@ -427,5 +431,7 @@ condition_variable::wait_for(unique_lock& __lk, #endif // !_LIBCPP_HAS_NO_THREADS _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP___MUTEX_BASE Modified: vendor/libc++/dist/include/__split_buffer ============================================================================== --- vendor/libc++/dist/include/__split_buffer Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/__split_buffer Thu Jun 1 20:59:10 2017 (r319467) @@ -6,12 +6,14 @@ #include #include -#include <__undef_min_max> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -628,7 +630,8 @@ swap(__split_buffer<_Tp, _Allocator>& __x, __split_buf __x.swap(__y); } - _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP_SPLIT_BUFFER Modified: vendor/libc++/dist/include/__std_stream ============================================================================== --- vendor/libc++/dist/include/__std_stream Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/__std_stream Thu Jun 1 20:59:10 2017 (r319467) @@ -17,12 +17,14 @@ #include <__locale> #include -#include <__undef_min_max> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD static const int __limit = 8; @@ -354,5 +356,7 @@ __stdoutbuf<_CharT>::imbue(const locale& __loc) } _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP___STD_STREAM Modified: vendor/libc++/dist/include/__string ============================================================================== --- vendor/libc++/dist/include/__string Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/__string Thu Jun 1 20:59:10 2017 (r319467) @@ -57,14 +57,16 @@ template <> struct char_traits; #include // For EOF. #include // for __murmur2_or_cityhash -#include <__undef_min_max> - #include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD // char_traits @@ -869,5 +871,7 @@ struct __quoted_output_proxy }; _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP___STRING Modified: vendor/libc++/dist/include/__threading_support ============================================================================== --- vendor/libc++/dist/include/__threading_support Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/__threading_support Thu Jun 1 20:59:10 2017 (r319467) @@ -30,9 +30,12 @@ #include #include #include -#include <__undef_min_max> #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + #if defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \ defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL) #define _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_FUNC_VIS @@ -628,6 +631,8 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void *__p #endif // !_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL || _LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // !_LIBCPP_HAS_NO_THREADS Modified: vendor/libc++/dist/include/__tree ============================================================================== --- vendor/libc++/dist/include/__tree Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/__tree Thu Jun 1 20:59:10 2017 (r319467) @@ -17,12 +17,14 @@ #include #include -#include <__undef_min_max> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD template class __tree; @@ -2684,5 +2686,7 @@ swap(__tree<_Tp, _Compare, _Allocator>& __x, } _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP___TREE Added: vendor/libc++/dist/include/__undef_macros ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/include/__undef_macros Thu Jun 1 20:59:10 2017 (r319467) @@ -0,0 +1,34 @@ +// -*- C++ -*- +//===------------------------ __undef_macros ------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +#ifdef min +#if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) +#if defined(_LIBCPP_WARNING) +_LIBCPP_WARNING("macro min is incompatible with C++. Try #define NOMINMAX " + "before any Windows header. #undefing min") +#else +#warning: macro min is incompatible with C++. #undefing min +#endif +#endif +#undef min +#endif + +#ifdef max +#if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) +#if defined(_LIBCPP_WARNING) +_LIBCPP_WARNING("macro max is incompatible with C++. Try #define NOMINMAX " + "before any Windows header. #undefing max") +#else +#warning: macro max is incompatible with C++. #undefing max +#endif +#endif +#undef max +#endif Modified: vendor/libc++/dist/include/algorithm ============================================================================== --- vendor/libc++/dist/include/algorithm Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/algorithm Thu Jun 1 20:59:10 2017 (r319467) @@ -651,14 +651,16 @@ template #include #endif -#include <__undef_min_max> - #include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD // I'd like to replace these with _VSTD::equal_to, but can't because: @@ -2908,11 +2910,11 @@ struct __log2_imp<0, _Rp> static const size_t value = _Rp + 1; }; -template +template struct __log2 { static const size_t value = __log2_imp<_Xp, - sizeof(_UI) * __CHAR_BIT__ - 1>::value; + sizeof(_UIntType) * __CHAR_BIT__ - 1>::value; }; template @@ -5903,5 +5905,7 @@ prev_permutation(_BidirectionalIterator __first, _Bidi } _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP_ALGORITHM Modified: vendor/libc++/dist/include/array ============================================================================== --- vendor/libc++/dist/include/array Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/array Thu Jun 1 20:59:10 2017 (r319467) @@ -113,6 +113,8 @@ template const T&& get(c #pragma GCC system_header #endif + + _LIBCPP_BEGIN_NAMESPACE_STD template Modified: vendor/libc++/dist/include/bitset ============================================================================== --- vendor/libc++/dist/include/bitset Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/bitset Thu Jun 1 20:59:10 2017 (r319467) @@ -113,10 +113,6 @@ template struct hash>; */ -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - #include <__config> #include <__bit_reference> #include @@ -126,8 +122,14 @@ template struct hash>; #include #include <__functional_base> -#include <__undef_min_max> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -1089,5 +1091,7 @@ basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x); _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP_BITSET Modified: vendor/libc++/dist/include/chrono ============================================================================== --- vendor/libc++/dist/include/chrono Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/chrono Thu Jun 1 20:59:10 2017 (r319467) @@ -305,12 +305,14 @@ constexpr chrono::duration #include #include -#include <__undef_min_max> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD namespace chrono @@ -1159,5 +1161,7 @@ namespace chrono { // hoist the literals into namespac #endif _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP_CHRONO Modified: vendor/libc++/dist/include/deque ============================================================================== --- vendor/libc++/dist/include/deque Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/deque Thu Jun 1 20:59:10 2017 (r319467) @@ -150,10 +150,6 @@ template */ -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - #include <__config> #include <__split_buffer> #include @@ -162,8 +158,14 @@ template #include #include -#include <__undef_min_max> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD template class __deque_base; @@ -2899,5 +2901,7 @@ swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocato } _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP_DEQUE Modified: vendor/libc++/dist/include/experimental/algorithm ============================================================================== --- vendor/libc++/dist/include/experimental/algorithm Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/experimental/algorithm Thu Jun 1 20:59:10 2017 (r319467) @@ -39,17 +39,18 @@ SampleIterator sample(PopulationIterator first, Popula #include #include -#include <__undef_min_max> - #include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -_LIBCPP_BEGIN_NAMESPACE_LFTS +_LIBCPP_PUSH_MACROS +#include <__undef_macros> +_LIBCPP_BEGIN_NAMESPACE_LFTS + template _LIBCPP_INLINE_VISIBILITY _ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s) @@ -66,5 +67,7 @@ _SampleIterator sample(_PopulationIterator __first, _P } _LIBCPP_END_NAMESPACE_LFTS + +_LIBCPP_POP_MACROS #endif /* _LIBCPP_EXPERIMENTAL_ALGORITHM */ Modified: vendor/libc++/dist/include/experimental/dynarray ============================================================================== --- vendor/libc++/dist/include/experimental/dynarray Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/experimental/dynarray Thu Jun 1 20:59:10 2017 (r319467) @@ -107,6 +107,9 @@ class dynarray (public) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + namespace std { namespace experimental { inline namespace __array_extensions_v1 { template @@ -294,6 +297,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD template struct _LIBCPP_TEMPLATE_VIS uses_allocator, _Alloc> : true_type {}; _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // if _LIBCPP_STD_VER > 11 #endif // _LIBCPP_DYNARRAY Modified: vendor/libc++/dist/include/experimental/functional ============================================================================== --- vendor/libc++/dist/include/experimental/functional Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/experimental/functional Thu Jun 1 20:59:10 2017 (r319467) @@ -89,21 +89,22 @@ inline namespace fundamentals_v1 { #include #include - #include #include #include #include #include -#include <__undef_min_max> - #include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_LFTS #if _LIBCPP_STD_VER > 11 @@ -455,5 +456,7 @@ make_boyer_moore_horspool_searcher( _RandomAccessItera #endif // _LIBCPP_STD_VER > 11 _LIBCPP_END_NAMESPACE_LFTS + +_LIBCPP_POP_MACROS #endif /* _LIBCPP_EXPERIMENTAL_FUNCTIONAL */ Modified: vendor/libc++/dist/include/experimental/memory_resource ============================================================================== --- vendor/libc++/dist/include/experimental/memory_resource Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/experimental/memory_resource Thu Jun 1 20:59:10 2017 (r319467) @@ -82,6 +82,9 @@ namespace pmr { #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_LFTS_PMR // Round __s up to next multiple of __a. @@ -418,5 +421,7 @@ using resource_adaptor = __resource_adaptor_imp< >; _LIBCPP_END_NAMESPACE_LFTS_PMR + +_LIBCPP_POP_MACROS #endif /* _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE */ Modified: vendor/libc++/dist/include/experimental/numeric ============================================================================== --- vendor/libc++/dist/include/experimental/numeric Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/experimental/numeric Thu Jun 1 20:59:10 2017 (r319467) @@ -41,6 +41,9 @@ inline namespace fundamentals_v2 { #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + #if _LIBCPP_STD_VER > 11 _LIBCPP_BEGIN_NAMESPACE_LFTS_V2 @@ -110,4 +113,7 @@ lcm(_Tp __m, _Up __n) _LIBCPP_END_NAMESPACE_LFTS_V2 #endif /* _LIBCPP_STD_VER > 11 */ + +_LIBCPP_POP_MACROS + #endif /* _LIBCPP_EXPERIMENTAL_NUMERIC */ Modified: vendor/libc++/dist/include/experimental/optional ============================================================================== --- vendor/libc++/dist/include/experimental/optional Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/experimental/optional Thu Jun 1 20:59:10 2017 (r319467) @@ -143,7 +143,22 @@ namespace std { namespace experimental { inline namesp #include #include #include +#if _LIBCPP_STD_VER > 11 +#include +#include +#include +#include <__functional_base> +#include <__debug> +#endif +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access : public std::logic_error @@ -160,17 +175,6 @@ _LIBCPP_END_NAMESPACE_EXPERIMENTAL #if _LIBCPP_STD_VER > 11 -#include -#include -#include -#include <__functional_base> -#include <__undef_min_max> -#include <__debug> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - _LIBCPP_BEGIN_NAMESPACE_LFTS struct in_place_t {}; @@ -912,5 +916,7 @@ struct _LIBCPP_TEMPLATE_VIS hash 11 + +_LIBCPP_POP_MACROS #endif // _LIBCPP_EXPERIMENTAL_OPTIONAL Modified: vendor/libc++/dist/include/experimental/string_view ============================================================================== --- vendor/libc++/dist/include/experimental/string_view Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/experimental/string_view Thu Jun 1 20:59:10 2017 (r319467) @@ -189,6 +189,9 @@ namespace std { #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_LFTS template > @@ -809,5 +812,7 @@ quoted ( std::experimental::basic_string_view <_CharT, #endif _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP_LFTS_STRING_VIEW Modified: vendor/libc++/dist/include/forward_list ============================================================================== --- vendor/libc++/dist/include/forward_list Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/forward_list Thu Jun 1 20:59:10 2017 (r319467) @@ -167,19 +167,20 @@ template */ #include <__config> - #include #include #include #include #include -#include <__undef_min_max> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD template struct __forward_list_node; @@ -1718,5 +1719,7 @@ swap(forward_list<_Tp, _Alloc>& __x, forward_list<_Tp, } _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP_FORWARD_LIST Modified: vendor/libc++/dist/include/fstream ============================================================================== --- vendor/libc++/dist/include/fstream Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/fstream Thu Jun 1 20:59:10 2017 (r319467) @@ -171,12 +171,14 @@ typedef basic_fstream wfstream; #include <__locale> #include -#include <__undef_min_max> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -1475,5 +1477,7 @@ basic_fstream<_CharT, _Traits>::close() } _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP_FSTREAM Modified: vendor/libc++/dist/include/istream ============================================================================== --- vendor/libc++/dist/include/istream Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/istream Thu Jun 1 20:59:10 2017 (r319467) @@ -162,12 +162,14 @@ template #include <__config> #include -#include <__undef_min_max> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -1682,5 +1684,7 @@ _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_ #endif _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP_ISTREAM Modified: vendor/libc++/dist/include/limits ============================================================================== --- vendor/libc++/dist/include/limits Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/limits Thu Jun 1 20:59:10 2017 (r319467) @@ -102,15 +102,8 @@ template<> class numeric_limits; */ #include <__config> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - #include -#include <__undef_min_max> - #if defined(_LIBCPP_COMPILER_MSVC) #include "support/win32/limits_msvc_win32.h" #endif // _LIBCPP_MSVCRT @@ -119,6 +112,14 @@ template<> class numeric_limits; #include "support/ibm/limits.h" #endif // __IBMCPP__ +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD enum float_round_style @@ -182,14 +183,14 @@ class __libcpp_numeric_limits (protected) static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero; }; -template +template struct __libcpp_compute_min { - static _LIBCPP_CONSTEXPR const _Tp value = _Tp(_Tp(1) << digits); + static _LIBCPP_CONSTEXPR const _Tp value = _Tp(_Tp(1) << __digits); }; -template -struct __libcpp_compute_min<_Tp, digits, false> +template +struct __libcpp_compute_min<_Tp, __digits, false> { static _LIBCPP_CONSTEXPR const _Tp value = _Tp(0); }; @@ -810,5 +811,7 @@ template _LIBCPP_CONSTEXPR const float_round_style numeric_limits::round_style; _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP_LIMITS Modified: vendor/libc++/dist/include/list ============================================================================== --- vendor/libc++/dist/include/list Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/list Thu Jun 1 20:59:10 2017 (r319467) @@ -177,14 +177,16 @@ template #include #include -#include <__undef_min_max> - #include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD template struct __list_node; @@ -2414,5 +2416,7 @@ swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y) } _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP_LIST Modified: vendor/libc++/dist/include/locale ============================================================================== --- vendor/libc++/dist/include/locale Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/locale Thu Jun 1 20:59:10 2017 (r319467) @@ -192,14 +192,7 @@ template class messages_byname; #endif #include #include -#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) -#include -#elif defined(_NEWLIB_VERSION) -// FIXME: replace all the uses of _NEWLIB_VERSION with __NEWLIB__ preceded by an -// include of once https://sourceware.org/ml/newlib-cvs/2014-q3/msg00038.html -// has had a chance to bake for a bit -#include -#endif +#include #ifdef _LIBCPP_HAS_CATOPEN #include #endif @@ -208,18 +201,20 @@ template class messages_byname; #include #endif -#include <__undef_min_max> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - #ifdef _LIBCPP_LOCALE__L_EXTENSIONS #include <__bsd_locale_defaults.h> #else #include <__bsd_locale_fallbacks.h> #endif +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD #if defined(__APPLE__) || defined(__FreeBSD__) @@ -4273,5 +4268,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::__close() } _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP_LOCALE Modified: vendor/libc++/dist/include/memory ============================================================================== --- vendor/libc++/dist/include/memory Thu Jun 1 20:59:06 2017 (r319466) +++ vendor/libc++/dist/include/memory Thu Jun 1 20:59:10 2017 (r319467) @@ -658,12 +658,14 @@ void* align(size_t alignment, size_t size, void*& ptr, # include #endif -#include <__undef_min_max> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -1541,7 +1543,7 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits {return __a.allocate(__n);} _LIBCPP_INLINE_VISIBILITY static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint) - {return allocate(__a, __n, __hint, + {return __allocate(__a, __n, __hint, __has_allocate_hint());} _LIBCPP_INLINE_VISIBILITY @@ -1595,7 +1597,7 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits _LIBCPP_INLINE_VISIBILITY static allocator_type select_on_container_copy_construction(const allocator_type& __a) - {return select_on_container_copy_construction( + {return __select_on_container_copy_construction( __has_select_on_container_copy_construction(), __a);} @@ -1694,11 +1696,11 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits private: _LIBCPP_INLINE_VISIBILITY - static pointer allocate(allocator_type& __a, size_type __n, + static pointer __allocate(allocator_type& __a, size_type __n, const_void_pointer __hint, true_type) {return __a.allocate(__n, __hint);} _LIBCPP_INLINE_VISIBILITY - static pointer allocate(allocator_type& __a, size_type __n, + static pointer __allocate(allocator_type& __a, size_type __n, const_void_pointer, false_type) {return __a.allocate(__n);} @@ -1735,11 +1737,11 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits _LIBCPP_INLINE_VISIBILITY static allocator_type - select_on_container_copy_construction(true_type, const allocator_type& __a) + __select_on_container_copy_construction(true_type, const allocator_type& __a) {return __a.select_on_container_copy_construction();} _LIBCPP_INLINE_VISIBILITY static allocator_type - select_on_container_copy_construction(false_type, const allocator_type& __a) + __select_on_container_copy_construction(false_type, const allocator_type& __a) {return __a;} }; @@ -3101,28 +3103,28 @@ struct _LIBCPP_TEMPLATE_VIS hash<__enable_hash_helper< struct __destruct_n { private: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Thu Jun 1 20:59:19 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 B4BEBB7EBD2; Thu, 1 Jun 2017 20:59:19 +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 6A60168033; Thu, 1 Jun 2017 20:59: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 v51KxIEV035403; Thu, 1 Jun 2017 20:59:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51KxISg035402; Thu, 1 Jun 2017 20:59:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012059.v51KxISg035402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 20:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319468 - vendor/libc++/libc++-trunk-r304460 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:59:19 -0000 Author: dim Date: Thu Jun 1 20:59:18 2017 New Revision: 319468 URL: https://svnweb.freebsd.org/changeset/base/319468 Log: Tag libc++ trunk r304460. Added: vendor/libc++/libc++-trunk-r304460/ - copied from r319467, vendor/libc++/dist/ From owner-svn-src-vendor@freebsd.org Thu Jun 1 20:59:23 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 61AC1B7EC18; Thu, 1 Jun 2017 20:59:23 +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 E3D8C68098; Thu, 1 Jun 2017 20:59:22 +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 v51KxMOv035464; Thu, 1 Jun 2017 20:59:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51KxKEH035450; Thu, 1 Jun 2017 20:59:20 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012059.v51KxKEH035450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 20:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319469 - in vendor/lld/dist: ELF test/ELF X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:59:23 -0000 Author: dim Date: Thu Jun 1 20:59:20 2017 New Revision: 319469 URL: https://svnweb.freebsd.org/changeset/base/319469 Log: Vendor import of lld trunk r304460: https://llvm.org/svn/llvm-project/lld/trunk@304460 Added: vendor/lld/dist/test/ELF/gc-absolute.s (contents, props changed) vendor/lld/dist/test/ELF/i386-gotpc-dynamic.s (contents, props changed) vendor/lld/dist/test/ELF/mips64-eh-abs-reloc.s (contents, props changed) vendor/lld/dist/test/ELF/section-metadata-err.s (contents, props changed) Modified: vendor/lld/dist/ELF/InputSection.cpp vendor/lld/dist/ELF/InputSection.h vendor/lld/dist/ELF/LinkerScript.cpp vendor/lld/dist/ELF/LinkerScript.h vendor/lld/dist/ELF/MarkLive.cpp vendor/lld/dist/ELF/OutputSections.cpp vendor/lld/dist/ELF/OutputSections.h vendor/lld/dist/ELF/Relocations.cpp vendor/lld/dist/ELF/ScriptParser.cpp vendor/lld/dist/ELF/Symbols.cpp vendor/lld/dist/ELF/SyntheticSections.cpp vendor/lld/dist/ELF/SyntheticSections.h vendor/lld/dist/ELF/Target.cpp vendor/lld/dist/ELF/Writer.cpp Modified: vendor/lld/dist/ELF/InputSection.cpp ============================================================================== --- vendor/lld/dist/ELF/InputSection.cpp Thu Jun 1 20:59:18 2017 (r319468) +++ vendor/lld/dist/ELF/InputSection.cpp Thu Jun 1 20:59:20 2017 (r319469) @@ -139,21 +139,24 @@ uint64_t SectionBase::getOffset(uint64_t Offset) const return Offset; case Merge: const MergeInputSection *MS = cast(this); - if (MS->MergeSec) - return MS->MergeSec->OutSecOff + MS->getOffset(Offset); + if (InputSection *IS = MS->getParent()) + return IS->OutSecOff + MS->getOffset(Offset); return MS->getOffset(Offset); } llvm_unreachable("invalid section kind"); } OutputSection *SectionBase::getOutputSection() { + InputSection *Sec; if (auto *IS = dyn_cast(this)) - return IS->OutSec; - if (auto *MS = dyn_cast(this)) - return MS->MergeSec ? MS->MergeSec->OutSec : nullptr; - if (auto *EH = dyn_cast(this)) - return EH->EHSec->OutSec; - return cast(this); + Sec = IS; + else if (auto *MS = dyn_cast(this)) + Sec = MS->getParent(); + else if (auto *EH = dyn_cast(this)) + Sec = EH->getParent(); + else + return cast(this); + return Sec ? Sec->getParent() : nullptr; } // Uncompress section contents. Note that this function is called @@ -181,9 +184,15 @@ uint64_t SectionBase::getOffset(const DefinedRegular & return getOffset(Sym.Value); } -InputSectionBase *InputSectionBase::getLinkOrderDep() const { - if ((Flags & SHF_LINK_ORDER) && Link != 0) - return File->getSections()[Link]; +InputSection *InputSectionBase::getLinkOrderDep() const { + if ((Flags & SHF_LINK_ORDER) && Link != 0) { + InputSectionBase *L = File->getSections()[Link]; + if (auto *IS = dyn_cast(L)) + return IS; + error( + "Merge and .eh_frame sections are not supported with SHF_LINK_ORDER " + + toString(L)); + } return nullptr; } @@ -295,6 +304,10 @@ bool InputSectionBase::classof(const SectionBase *S) { return S->kind() != Output; } +OutputSection *InputSection::getParent() const { + return cast_or_null(Parent); +} + void InputSection::copyShtGroup(uint8_t *Buf) { assert(this->Type == SHT_GROUP); @@ -309,7 +322,8 @@ void InputSection::copyShtGroup(uint8_t *Buf) { ArrayRef Sections = this->File->getSections(); for (uint32_t Val : From.slice(1)) { uint32_t Index = read32(&Val, Config->Endianness); - write32(To++, Sections[Index]->OutSec->SectionIndex, Config->Endianness); + write32(To++, Sections[Index]->getOutputSection()->SectionIndex, + Config->Endianness); } } @@ -342,7 +356,7 @@ void InputSection::copyRelocations(uint8_t *Buf, Array // Output section VA is zero for -r, so r_offset is an offset within the // section, but for --emit-relocs it is an virtual address. - P->r_offset = RelocatedSection->OutSec->Addr + + P->r_offset = RelocatedSection->getOutputSection()->Addr + RelocatedSection->getOffset(Rel.r_offset); P->setSymbolAndType(InX::SymTab->getSymbolIndex(&Body), Type, Config->IsMips64EL); @@ -596,7 +610,7 @@ void InputSection::relocateNonAlloc(uint8_t *Buf, Arra return; } - uint64_t AddrLoc = this->OutSec->Addr + Offset; + uint64_t AddrLoc = getParent()->Addr + Offset; uint64_t SymVA = 0; if (!Sym.isTls() || Out::TlsPhdr) SymVA = SignExtend64( @@ -729,6 +743,10 @@ EhInputSection::EhInputSection(elf::ObjectFile * this->Live = true; } +SyntheticSection *EhInputSection::getParent() const { + return cast_or_null(Parent); +} + bool EhInputSection::classof(const SectionBase *S) { return S->kind() == InputSectionBase::EHFrame; } @@ -795,6 +813,10 @@ static size_t findNull(ArrayRef A, size_t Ent return I; } return StringRef::npos; +} + +SyntheticSection *MergeInputSection::getParent() const { + return cast_or_null(Parent); } // Split SHF_STRINGS section. Such section is a sequence of Modified: vendor/lld/dist/ELF/InputSection.h ============================================================================== --- vendor/lld/dist/ELF/InputSection.h Thu Jun 1 20:59:18 2017 (r319468) +++ vendor/lld/dist/ELF/InputSection.h Thu Jun 1 20:59:20 2017 (r319469) @@ -120,8 +120,13 @@ class InputSectionBase : public SectionBase { (public) uint64_t Entsize, uint32_t Link, uint32_t Info, uint32_t Alignment, ArrayRef Data, StringRef Name, Kind SectionKind); - OutputSection *OutSec = nullptr; + // Input sections are part of an output section. Special sections + // like .eh_frame and merge sections are first combined into a + // synthetic section that is then added to an output section. In all + // cases this points one level up. + SectionBase *Parent = nullptr; + // Relocations that refer to this section. const void *FirstRelocation = nullptr; unsigned NumRelocations : 31; @@ -158,7 +163,7 @@ class InputSectionBase : public SectionBase { (public) return getFile()->getObj(); } - InputSectionBase *getLinkOrderDep() const; + InputSection *getLinkOrderDep() const; void uncompress(); @@ -237,10 +242,7 @@ class MergeInputSection : public InputSectionBase { (p SectionPiece *getSectionPiece(uint64_t Offset); const SectionPiece *getSectionPiece(uint64_t Offset) const; - // MergeInputSections are aggregated to a synthetic input sections, - // and then added to an OutputSection. This pointer points to a - // synthetic MergeSyntheticSection which this section belongs to. - MergeSyntheticSection *MergeSec = nullptr; + SyntheticSection *getParent() const; private: void splitStrings(ArrayRef A, size_t Size); @@ -280,7 +282,8 @@ class EhInputSection : public InputSectionBase { (publ // Splittable sections are handled as a sequence of data // rather than a single large blob of data. std::vector Pieces; - SyntheticSection *EHSec = nullptr; + + SyntheticSection *getParent() const; }; // This is a section that is added directly to an output section @@ -298,6 +301,8 @@ class InputSection : public InputSectionBase { (public // Write this section to a mmap'ed file, assuming Buf is pointing to // beginning of the output section. template void writeTo(uint8_t *Buf); + + OutputSection *getParent() const; // The offset from beginning of the output sections this section was assigned // to. The writer sets a value. Modified: vendor/lld/dist/ELF/LinkerScript.cpp ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.cpp Thu Jun 1 20:59:18 2017 (r319468) +++ vendor/lld/dist/ELF/LinkerScript.cpp Thu Jun 1 20:59:20 2017 (r319469) @@ -26,6 +26,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Casting.h" +#include "llvm/Support/Compression.h" #include "llvm/Support/ELF.h" #include "llvm/Support/Endian.h" #include "llvm/Support/ErrorHandling.h" @@ -51,9 +52,8 @@ LinkerScript *elf::Script; uint64_t ExprValue::getValue() const { if (Sec) { - if (Sec->getOutputSection()) - return alignTo(Sec->getOffset(Val) + Sec->getOutputSection()->Addr, - Alignment); + if (OutputSection *OS = Sec->getOutputSection()) + return alignTo(Sec->getOffset(Val) + OS->Addr, Alignment); error("unable to evaluate expression: input section " + Sec->Name + " has no output section assigned"); } @@ -85,29 +85,28 @@ template static SymbolBody *addRegular(Sy return Sym->body(); } -OutputSection *LinkerScript::getOutputSection(const Twine &Loc, - StringRef Name) { - for (OutputSection *Sec : *OutputSections) - if (Sec->Name == Name) - return Sec; - - static OutputSection Dummy("", 0, 0); - if (ErrorOnMissingSection) - error(Loc + ": undefined section " + Name); - return &Dummy; +OutputSectionCommand * +LinkerScript::createOutputSectionCommand(StringRef Name, StringRef Location) { + OutputSectionCommand *&CmdRef = NameToOutputSectionCommand[Name]; + OutputSectionCommand *Cmd; + if (CmdRef && CmdRef->Location.empty()) { + // There was a forward reference. + Cmd = CmdRef; + } else { + Cmd = make(Name); + if (!CmdRef) + CmdRef = Cmd; + } + Cmd->Location = Location; + return Cmd; } -// This function is essentially the same as getOutputSection(Name)->Size, -// but it won't print out an error message if a given section is not found. -// -// Linker script does not create an output section if its content is empty. -// We want to allow SIZEOF(.foo) where .foo is a section which happened to -// be empty. That is why this function is different from getOutputSection(). -uint64_t LinkerScript::getOutputSectionSize(StringRef Name) { - for (OutputSection *Sec : *OutputSections) - if (Sec->Name == Name) - return Sec->Size; - return 0; +OutputSectionCommand * +LinkerScript::getOrCreateOutputSectionCommand(StringRef Name) { + OutputSectionCommand *&CmdRef = NameToOutputSectionCommand[Name]; + if (!CmdRef) + CmdRef = make(Name); + return CmdRef; } void LinkerScript::setDot(Expr E, const Twine &Loc, bool InSec) { @@ -291,11 +290,13 @@ LinkerScript::computeInputSections(const InputSectionD size_t SizeBefore = Ret.size(); for (InputSectionBase *Sec : InputSections) { - if (!isa(Sec)) + if (Sec->Assigned) continue; - if (Sec->Assigned) + if (!Sec->Live) { + reportDiscarded(Sec); continue; + } // For -emit-relocs we have to ignore entries like // .rela.dyn : { *(.rela.data) } @@ -455,7 +456,7 @@ void LinkerScript::fabricateDefaultCommands() { // For each OutputSection that needs a VA fabricate an OutputSectionCommand // with an InputSectionDescription describing the InputSections for (OutputSection *Sec : *OutputSections) { - auto *OSCmd = make(Sec->Name); + auto *OSCmd = createOutputSectionCommand(Sec->Name, ""); OSCmd->Sec = Sec; SecToCommand[Sec] = OSCmd; @@ -487,7 +488,7 @@ void LinkerScript::fabricateDefaultCommands() { // Add sections that didn't match any sections command. void LinkerScript::addOrphanSections(OutputSectionFactory &Factory) { for (InputSectionBase *S : InputSections) { - if (!S->Live || S->OutSec) + if (!S->Live || S->Parent) continue; StringRef Name = getOutputSectionName(S->Name); auto I = std::find_if( @@ -590,7 +591,7 @@ void LinkerScript::process(BaseCommand &Base) { // It calculates and assigns the offsets for each section and also // updates the output section size. auto &Cmd = cast(Base); - for (InputSectionBase *Sec : Cmd.Sections) { + for (InputSection *Sec : Cmd.Sections) { // We tentatively added all synthetic sections at the beginning and removed // empty ones afterwards (because there is no way to know whether they were // going be empty or not other than actually running linker scripts.) @@ -601,8 +602,8 @@ void LinkerScript::process(BaseCommand &Base) { if (!Sec->Live) continue; - assert(CurOutSec == Sec->OutSec); - output(cast(Sec)); + assert(CurOutSec == Sec->getParent()); + output(Sec); } } @@ -842,7 +843,7 @@ void LinkerScript::placeOrphanSections() { // representations agree on which input sections to use. OutputSectionCommand *Cmd = getCmd(Sec); if (!Cmd) { - Cmd = make(Name); + Cmd = createOutputSectionCommand(Name, ""); Opt.Commands.insert(CmdIter, Cmd); ++CmdIndex; @@ -919,9 +920,10 @@ void LinkerScript::synchronize() { } } -static bool allocateHeaders(std::vector &Phdrs, - ArrayRef OutputSections, - uint64_t Min) { +static bool +allocateHeaders(std::vector &Phdrs, + ArrayRef OutputSectionCommands, + uint64_t Min) { auto FirstPTLoad = std::find_if(Phdrs.begin(), Phdrs.end(), [](const PhdrEntry &E) { return E.p_type == PT_LOAD; }); @@ -938,16 +940,19 @@ static bool allocateHeaders(std::vector &Ph assert(FirstPTLoad->First == Out::ElfHeader); OutputSection *ActualFirst = nullptr; - for (OutputSection *Sec : OutputSections) { + for (OutputSectionCommand *Cmd : OutputSectionCommands) { + OutputSection *Sec = Cmd->Sec; if (Sec->FirstInPtLoad == Out::ElfHeader) { ActualFirst = Sec; break; } } if (ActualFirst) { - for (OutputSection *Sec : OutputSections) + for (OutputSectionCommand *Cmd : OutputSectionCommands) { + OutputSection *Sec = Cmd->Sec; if (Sec->FirstInPtLoad == Out::ElfHeader) Sec->FirstInPtLoad = ActualFirst; + } FirstPTLoad->First = ActualFirst; } else { Phdrs.erase(FirstPTLoad); @@ -961,7 +966,9 @@ static bool allocateHeaders(std::vector &Ph return false; } -void LinkerScript::assignAddresses(std::vector &Phdrs) { +void LinkerScript::assignAddresses( + std::vector &Phdrs, + ArrayRef OutputSectionCommands) { // Assign addresses as instructed by linker script SECTIONS sub-commands. Dot = 0; ErrorOnMissingSection = true; @@ -983,14 +990,15 @@ void LinkerScript::assignAddresses(std::vector::max(); - for (OutputSection *Sec : *OutputSections) { + for (OutputSectionCommand *Cmd : OutputSectionCommands) { + OutputSection *Sec = Cmd->Sec; if (Sec->Flags & SHF_ALLOC) MinVA = std::min(MinVA, Sec->Addr); else Sec->Addr = 0; } - allocateHeaders(Phdrs, *OutputSections, MinVA); + allocateHeaders(Phdrs, OutputSectionCommands, MinVA); } // Creates program headers as instructed by PHDRS linker script command. @@ -1068,6 +1076,33 @@ static void writeInt(uint8_t *Buf, uint64_t Data, uint llvm_unreachable("unsupported Size argument"); } +// Compress section contents if this section contains debug info. +template void OutputSectionCommand::maybeCompress() { + typedef typename ELFT::Chdr Elf_Chdr; + + // Compress only DWARF debug sections. + if (!Config->CompressDebugSections || (Sec->Flags & SHF_ALLOC) || + !Name.startswith(".debug_")) + return; + + // Create a section header. + Sec->ZDebugHeader.resize(sizeof(Elf_Chdr)); + auto *Hdr = reinterpret_cast(Sec->ZDebugHeader.data()); + Hdr->ch_type = ELFCOMPRESS_ZLIB; + Hdr->ch_size = Sec->Size; + Hdr->ch_addralign = Sec->Alignment; + + // Write section contents to a temporary buffer and compress it. + std::vector Buf(Sec->Size); + writeTo(Buf.data()); + if (Error E = zlib::compress(toStringRef(Buf), Sec->CompressedData)) + fatal("compress failed: " + llvm::toString(std::move(E))); + + // Update section headers. + Sec->Size = sizeof(Elf_Chdr) + Sec->CompressedData.size(); + Sec->Flags |= SHF_COMPRESSED; +} + template void OutputSectionCommand::writeTo(uint8_t *Buf) { Sec->Loc = Buf; @@ -1084,7 +1119,12 @@ template void OutputSectionCommand::write return; // Write leading padding. - ArrayRef Sections = Sec->Sections; + std::vector Sections; + for (BaseCommand *Cmd : Commands) + if (auto *ISD = dyn_cast(Cmd)) + for (InputSection *IS : ISD->Sections) + if (IS->Live) + Sections.push_back(IS); uint32_t Filler = getFiller(); if (Filler) fill(Buf, Sections.empty() ? Sec->Size : Sections[0]->OutSecOff, Filler); @@ -1161,3 +1201,8 @@ template void OutputSectionCommand::writeTo(u template void OutputSectionCommand::writeTo(uint8_t *Buf); template void OutputSectionCommand::writeTo(uint8_t *Buf); template void OutputSectionCommand::writeTo(uint8_t *Buf); + +template void OutputSectionCommand::maybeCompress(); +template void OutputSectionCommand::maybeCompress(); +template void OutputSectionCommand::maybeCompress(); +template void OutputSectionCommand::maybeCompress(); Modified: vendor/lld/dist/ELF/LinkerScript.h ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.h Thu Jun 1 20:59:18 2017 (r319468) +++ vendor/lld/dist/ELF/LinkerScript.h Thu Jun 1 20:59:20 2017 (r319469) @@ -137,6 +137,7 @@ struct OutputSectionCommand : BaseCommand { std::string MemoryRegionName; template void writeTo(uint8_t *Buf); + template void maybeCompress(); uint32_t getFiller(); }; @@ -221,6 +222,8 @@ struct ScriptConfiguration { class LinkerScript final { llvm::DenseMap SecToCommand; + llvm::DenseMap NameToOutputSectionCommand; + void assignSymbol(SymbolAssignment *Cmd, bool InSec); void setDot(Expr E, const Twine &Loc, bool InSec); @@ -241,7 +244,6 @@ class LinkerScript final { void process(BaseCommand &Base); OutputSection *Aether; - bool ErrorOnMissingSection = false; uint64_t Dot; uint64_t ThreadBssOffset = 0; @@ -251,11 +253,14 @@ class LinkerScript final { MemoryRegion *CurMemRegion = nullptr; public: + bool ErrorOnMissingSection = false; + OutputSectionCommand *createOutputSectionCommand(StringRef Name, + StringRef Location); + OutputSectionCommand *getOrCreateOutputSectionCommand(StringRef Name); + OutputSectionCommand *getCmd(OutputSection *Sec) const; bool hasPhdrsCommands() { return !Opt.PhdrsCommands.empty(); } uint64_t getDot() { return Dot; } - OutputSection *getOutputSection(const Twine &Loc, StringRef S); - uint64_t getOutputSectionSize(StringRef S); void discard(ArrayRef V); ExprValue getSymbolValue(const Twine &Loc, StringRef S); @@ -277,7 +282,8 @@ class LinkerScript final { void placeOrphanSections(); void processNonSectionCommands(); void synchronize(); - void assignAddresses(std::vector &Phdrs); + void assignAddresses(std::vector &Phdrs, + ArrayRef OutputSectionCommands); void addSymbol(SymbolAssignment *Cmd); void processCommands(OutputSectionFactory &Factory); Modified: vendor/lld/dist/ELF/MarkLive.cpp ============================================================================== --- vendor/lld/dist/ELF/MarkLive.cpp Thu Jun 1 20:59:18 2017 (r319468) +++ vendor/lld/dist/ELF/MarkLive.cpp Thu Jun 1 20:59:20 2017 (r319469) @@ -220,7 +220,8 @@ template void elf::markLive() { auto MarkSymbol = [&](const SymbolBody *Sym) { if (auto *D = dyn_cast_or_null(Sym)) - Enqueue({cast(D->Section), D->Value}); + if (auto *IS = cast_or_null(D->Section)) + Enqueue({IS, D->Value}); }; // Add GC root symbols. Modified: vendor/lld/dist/ELF/OutputSections.cpp ============================================================================== --- vendor/lld/dist/ELF/OutputSections.cpp Thu Jun 1 20:59:18 2017 (r319468) +++ vendor/lld/dist/ELF/OutputSections.cpp Thu Jun 1 20:59:20 2017 (r319469) @@ -16,7 +16,6 @@ #include "SyntheticSections.h" #include "Target.h" #include "Threads.h" -#include "llvm/Support/Compression.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/MD5.h" #include "llvm/Support/MathExtras.h" @@ -76,46 +75,19 @@ static bool compareByFilePosition(InputSection *A, Inp if (A->kind() == InputSectionBase::Synthetic || B->kind() == InputSectionBase::Synthetic) return false; - auto *LA = cast(A->getLinkOrderDep()); - auto *LB = cast(B->getLinkOrderDep()); - OutputSection *AOut = LA->OutSec; - OutputSection *BOut = LB->OutSec; + InputSection *LA = A->getLinkOrderDep(); + InputSection *LB = B->getLinkOrderDep(); + OutputSection *AOut = LA->getParent(); + OutputSection *BOut = LB->getParent(); if (AOut != BOut) return AOut->SectionIndex < BOut->SectionIndex; return LA->OutSecOff < LB->OutSecOff; } -// Compress section contents if this section contains debug info. -template void OutputSection::maybeCompress() { - typedef typename ELFT::Chdr Elf_Chdr; - - // Compress only DWARF debug sections. - if (!Config->CompressDebugSections || (Flags & SHF_ALLOC) || - !Name.startswith(".debug_")) - return; - - // Create a section header. - ZDebugHeader.resize(sizeof(Elf_Chdr)); - auto *Hdr = reinterpret_cast(ZDebugHeader.data()); - Hdr->ch_type = ELFCOMPRESS_ZLIB; - Hdr->ch_size = Size; - Hdr->ch_addralign = Alignment; - - // Write section contents to a temporary buffer and compress it. - std::vector Buf(Size); - Script->getCmd(this)->writeTo(Buf.data()); - if (Error E = zlib::compress(toStringRef(Buf), CompressedData)) - fatal("compress failed: " + llvm::toString(std::move(E))); - - // Update section headers. - Size = sizeof(Elf_Chdr) + CompressedData.size(); - Flags |= SHF_COMPRESSED; -} - template static void finalizeShtGroup(OutputSection *Sec) { // sh_link field for SHT_GROUP sections should contain the section index of // the symbol table. - Sec->Link = InX::SymTab->OutSec->SectionIndex; + Sec->Link = InX::SymTab->getParent()->SectionIndex; // sh_info then contain index of an entry in symbol table section which // provides signature of the section group. @@ -135,7 +107,7 @@ template void OutputSection::finalize() { // need to translate the InputSection sh_link to the OutputSection sh_link, // all InputSections in the OutputSection have the same dependency. if (auto *D = this->Sections.front()->getLinkOrderDep()) - this->Link = D->OutSec->SectionIndex; + this->Link = D->getParent()->SectionIndex; } uint32_t Type = this->Type; @@ -151,11 +123,11 @@ template void OutputSection::finalize() { if (isa(First)) return; - this->Link = InX::SymTab->OutSec->SectionIndex; + this->Link = InX::SymTab->getParent()->SectionIndex; // sh_info for SHT_REL[A] sections should contain the section header index of // the section to which the relocation applies. InputSectionBase *S = First->getRelocatedSection(); - this->Info = S->OutSec->SectionIndex; + Info = S->getOutputSection()->SectionIndex; } static uint64_t updateOffset(uint64_t Off, InputSection *S) { @@ -167,7 +139,7 @@ static uint64_t updateOffset(uint64_t Off, InputSectio void OutputSection::addSection(InputSection *S) { assert(S->Live); Sections.push_back(S); - S->OutSec = this; + S->Parent = this; this->updateAlignment(S->Alignment); // The actual offsets will be computed by assignAddresses. For now, use @@ -351,7 +323,7 @@ static bool canMergeToProgbits(unsigned Type) { Type == SHT_NOTE; } -static void reportDiscarded(InputSectionBase *IS) { +void elf::reportDiscarded(InputSectionBase *IS) { if (!Config->PrintGcSections) return; message("removing unused section from '" + IS->Name + "' in file '" + @@ -437,8 +409,3 @@ template void OutputSection::finalize(); template void OutputSection::finalize(); template void OutputSection::finalize(); template void OutputSection::finalize(); - -template void OutputSection::maybeCompress(); -template void OutputSection::maybeCompress(); -template void OutputSection::maybeCompress(); -template void OutputSection::maybeCompress(); Modified: vendor/lld/dist/ELF/OutputSections.h ============================================================================== --- vendor/lld/dist/ELF/OutputSections.h Thu Jun 1 20:59:18 2017 (r319468) +++ vendor/lld/dist/ELF/OutputSections.h Thu Jun 1 20:59:20 2017 (r319469) @@ -83,7 +83,6 @@ class OutputSection final : public SectionBase { (publ void sortInitFini(); void sortCtorsDtors(); template void finalize(); - template void maybeCompress(); void assignOffsets(); std::vector Sections; @@ -149,6 +148,7 @@ class OutputSectionFactory { (private) }; uint64_t getHeaderSize(); +void reportDiscarded(InputSectionBase *IS); } // namespace elf } // namespace lld Modified: vendor/lld/dist/ELF/Relocations.cpp ============================================================================== --- vendor/lld/dist/ELF/Relocations.cpp Thu Jun 1 20:59:18 2017 (r319468) +++ vendor/lld/dist/ELF/Relocations.cpp Thu Jun 1 20:59:20 2017 (r319469) @@ -360,9 +360,9 @@ static bool isStaticLinkTimeConstant(RelExpr E, uint32 // These expressions always compute a constant if (isRelExprOneOf(E)) + R_MIPS_TLSGD, R_GOT_PAGE_PC, R_GOT_PC, + R_GOTONLY_PC_FROM_END, R_PLT_PC, R_TLSGD_PC, R_TLSGD, + R_PPC_PLT_OPD, R_TLSDESC_CALL, R_TLSDESC_PAGE, R_HINT>(E)) return true; // These never do, except if the entire file is position dependent or if @@ -1015,7 +1015,7 @@ ThunkSection *ThunkCreator::getISThunkSec(InputSection ThunkSection *TS = ThunkedSections.lookup(IS); if (TS) return TS; - auto *TOS = cast(IS->OutSec); + auto *TOS = IS->getParent(); TS = make(TOS, IS->OutSecOff); ThunkSections[TOS].push_back(TS); ThunkedSections[IS] = TS; Modified: vendor/lld/dist/ELF/ScriptParser.cpp ============================================================================== --- vendor/lld/dist/ELF/ScriptParser.cpp Thu Jun 1 20:59:18 2017 (r319468) +++ vendor/lld/dist/ELF/ScriptParser.cpp Thu Jun 1 20:59:20 2017 (r319469) @@ -55,6 +55,7 @@ class ScriptParser final : ScriptLexer { (public) private: void addFile(StringRef Path); + OutputSection *checkSection(OutputSectionCommand *Cmd, StringRef Loccation); void readAsNeeded(); void readEntry(); @@ -564,8 +565,8 @@ uint32_t ScriptParser::readFill() { OutputSectionCommand * ScriptParser::readOutputSectionDescription(StringRef OutSec) { - OutputSectionCommand *Cmd = make(OutSec); - Cmd->Location = getCurrentLocation(); + OutputSectionCommand *Cmd = + Script->createOutputSectionCommand(OutSec, getCurrentLocation()); // Read an address expression. // https://sourceware.org/binutils/docs/ld/Output-Section-Address.html @@ -819,6 +820,16 @@ StringRef ScriptParser::readParenLiteral() { return Tok; } +OutputSection *ScriptParser::checkSection(OutputSectionCommand *Cmd, + StringRef Location) { + if (Cmd->Location.empty() && Script->ErrorOnMissingSection) + error(Location + ": undefined section " + Cmd->Name); + if (Cmd->Sec) + return Cmd->Sec; + static OutputSection Dummy("", 0, 0); + return &Dummy; +} + Expr ScriptParser::readPrimary() { if (peek() == "(") return readParenExpr(); @@ -847,9 +858,8 @@ Expr ScriptParser::readPrimary() { } if (Tok == "ADDR") { StringRef Name = readParenLiteral(); - return [=]() -> ExprValue { - return {Script->getOutputSection(Location, Name), 0}; - }; + OutputSectionCommand *Cmd = Script->getOrCreateOutputSectionCommand(Name); + return [=]() -> ExprValue { return {checkSection(Cmd, Location), 0}; }; } if (Tok == "ALIGN") { expect("("); @@ -867,7 +877,8 @@ Expr ScriptParser::readPrimary() { } if (Tok == "ALIGNOF") { StringRef Name = readParenLiteral(); - return [=] { return Script->getOutputSection(Location, Name)->Alignment; }; + OutputSectionCommand *Cmd = Script->getOrCreateOutputSectionCommand(Name); + return [=] { return checkSection(Cmd, Location)->Alignment; }; } if (Tok == "ASSERT") return readAssertExpr(); @@ -912,7 +923,8 @@ Expr ScriptParser::readPrimary() { } if (Tok == "LOADADDR") { StringRef Name = readParenLiteral(); - return [=] { return Script->getOutputSection(Location, Name)->getLMA(); }; + OutputSectionCommand *Cmd = Script->getOrCreateOutputSectionCommand(Name); + return [=] { return checkSection(Cmd, Location)->getLMA(); }; } if (Tok == "ORIGIN") { StringRef Name = readParenLiteral(); @@ -930,7 +942,11 @@ Expr ScriptParser::readPrimary() { } if (Tok == "SIZEOF") { StringRef Name = readParenLiteral(); - return [=] { return Script->getOutputSectionSize(Name); }; + OutputSectionCommand *Cmd = Script->getOrCreateOutputSectionCommand(Name); + // Linker script does not create an output section if its content is empty. + // We want to allow SIZEOF(.foo) where .foo is a section which happened to + // be empty. + return [=] { return Cmd->Sec ? Cmd->Sec->Size : 0; }; } if (Tok == "SIZEOF_HEADERS") return [=] { return elf::getHeaderSize(); }; Modified: vendor/lld/dist/ELF/Symbols.cpp ============================================================================== --- vendor/lld/dist/ELF/Symbols.cpp Thu Jun 1 20:59:18 2017 (r319468) +++ vendor/lld/dist/ELF/Symbols.cpp Thu Jun 1 20:59:20 2017 (r319469) @@ -101,12 +101,12 @@ static uint64_t getSymVA(const SymbolBody &Body, int64 case SymbolBody::DefinedCommonKind: if (!Config->DefineCommon) return 0; - return InX::Common->OutSec->Addr + InX::Common->OutSecOff + + return InX::Common->getParent()->Addr + InX::Common->OutSecOff + cast(Body).Offset; case SymbolBody::SharedKind: { auto &SS = cast(Body); if (SS.NeedsCopy) - return SS.CopyRelSec->OutSec->Addr + SS.CopyRelSec->OutSecOff + + return SS.CopyRelSec->getParent()->Addr + SS.CopyRelSec->OutSecOff + SS.CopyRelSecOff; if (SS.NeedsPltAddr) return Body.getPltVA(); @@ -207,13 +207,13 @@ OutputSection *SymbolBody::getOutputSection() const { if (auto *S = dyn_cast(this)) { if (S->NeedsCopy) - return S->CopyRelSec->OutSec; + return S->CopyRelSec->getParent(); return nullptr; } if (isa(this)) { if (Config->DefineCommon) - return InX::Common->OutSec; + return InX::Common->getParent(); return nullptr; } Modified: vendor/lld/dist/ELF/SyntheticSections.cpp ============================================================================== --- vendor/lld/dist/ELF/SyntheticSections.cpp Thu Jun 1 20:59:18 2017 (r319468) +++ vendor/lld/dist/ELF/SyntheticSections.cpp Thu Jun 1 20:59:20 2017 (r319469) @@ -48,8 +48,8 @@ using namespace lld; using namespace lld::elf; uint64_t SyntheticSection::getVA() const { - if (this->OutSec) - return this->OutSec->Addr + this->OutSecOff; + if (OutputSection *Sec = getParent()) + return Sec->Addr + OutSecOff; return 0; } @@ -367,8 +367,8 @@ BssSection::BssSection(StringRef Name) : SyntheticSection(SHF_ALLOC | SHF_WRITE, SHT_NOBITS, 0, Name) {} size_t BssSection::reserveSpace(uint64_t Size, uint32_t Alignment) { - if (OutSec) - OutSec->updateAlignment(Alignment); + if (OutputSection *Sec = getParent()) + Sec->updateAlignment(Alignment); this->Size = alignTo(this->Size, Alignment) + Size; this->Alignment = std::max(this->Alignment, Alignment); return this->Size - Size; @@ -494,7 +494,7 @@ void EhFrameSection::addSectionAux(EhInputSectio template void EhFrameSection::addSection(InputSectionBase *C) { auto *Sec = cast(C); - Sec->EHSec = this; + Sec->Parent = this; updateAlignment(Sec->Alignment); Sections.push_back(Sec); for (auto *DS : Sec->DependentSections) @@ -579,7 +579,7 @@ uint64_t EhFrameSection::getFdePc(uint8_t *Buf, if ((Enc & 0x70) == DW_EH_PE_absptr) return Addr; if ((Enc & 0x70) == DW_EH_PE_pcrel) - return Addr + this->OutSec->Addr + Off; + return Addr + getParent()->Addr + Off; fatal("unknown FDE size relative encoding"); } @@ -610,7 +610,7 @@ template void EhFrameSection::write uint8_t Enc = getFdeEncoding(Cie->Piece); for (SectionPiece *Fde : Cie->FdePieces) { uint64_t Pc = getFdePc(Buf, Fde->OutputOff, Enc); - uint64_t FdeVA = this->OutSec->Addr + Fde->OutputOff; + uint64_t FdeVA = getParent()->Addr + Fde->OutputOff; In::EhFrameHdr->addFde(Pc, FdeVA); } } @@ -698,8 +698,7 @@ void MipsGotSection::addEntry(SymbolBody &Sym, int64_t // sections referenced by GOT relocations. Then later in the `finalize` // method calculate number of "pages" required to cover all saved output // section and allocate appropriate number of GOT entries. - auto *DefSym = cast(&Sym); - PageIndexMap.insert({DefSym->Section->getOutputSection(), 0}); + PageIndexMap.insert({Sym.getOutputSection(), 0}); return; } if (Sym.isTls()) { @@ -766,8 +765,7 @@ static uint64_t getMipsPageCount(uint64_t Size) { uint64_t MipsGotSection::getPageEntryOffset(const SymbolBody &B, int64_t Addend) const { - const OutputSection *OutSec = - cast(&B)->Section->getOutputSection(); + const OutputSection *OutSec = B.getOutputSection(); uint64_t SecAddr = getMipsPageAddr(OutSec->Addr); uint64_t SymAddr = getMipsPageAddr(B.getVA(Addend)); uint64_t Index = PageIndexMap.lookup(OutSec) + (SymAddr - SecAddr) / 0xffff; @@ -1071,11 +1069,11 @@ template void DynamicSection::final if (this->Size) return; // Already finalized. - this->Link = InX::DynStrTab->OutSec->SectionIndex; - if (In::RelaDyn->OutSec->Size > 0) { + this->Link = InX::DynStrTab->getParent()->SectionIndex; + if (In::RelaDyn->getParent()->Size > 0) { bool IsRela = Config->IsRela; add({IsRela ? DT_RELA : DT_REL, In::RelaDyn}); - add({IsRela ? DT_RELASZ : DT_RELSZ, In::RelaDyn->OutSec->Size}); + add({IsRela ? DT_RELASZ : DT_RELSZ, In::RelaDyn->getParent()->Size}); add({IsRela ? DT_RELAENT : DT_RELENT, uint64_t(IsRela ? sizeof(Elf_Rela) : sizeof(Elf_Rel))}); @@ -1088,9 +1086,9 @@ template void DynamicSection::final add({IsRela ? DT_RELACOUNT : DT_RELCOUNT, NumRelativeRels}); } } - if (In::RelaPlt->OutSec->Size > 0) { + if (In::RelaPlt->getParent()->Size > 0) { add({DT_JMPREL, In::RelaPlt}); - add({DT_PLTRELSZ, In::RelaPlt->OutSec->Size}); + add({DT_PLTRELSZ, In::RelaPlt->getParent()->Size}); add({Config->EMachine == EM_MIPS ? DT_MIPS_PLTGOT : DT_PLTGOT, InX::GotPlt}); add({DT_PLTREL, uint64_t(Config->IsRela ? DT_RELA : DT_REL)}); @@ -1152,7 +1150,7 @@ template void DynamicSection::final add({DT_MIPS_RLD_MAP, InX::MipsRldMap}); } - this->OutSec->Link = this->Link; + getParent()->Link = this->Link; // +1 for DT_NULL this->Size = (Entries.size() + 1) * this->Entsize; @@ -1168,7 +1166,7 @@ template void DynamicSection::write P->d_un.d_ptr = E.OutSec->Addr; break; case Entry::InSecAddr: - P->d_un.d_ptr = E.InSec->OutSec->Addr + E.InSec->OutSecOff; + P->d_un.d_ptr = E.InSec->getParent()->Addr + E.InSec->OutSecOff; break; case Entry::SecSize: P->d_un.d_val = E.OutSec->Size; @@ -1185,7 +1183,7 @@ template void DynamicSection::write } uint64_t DynamicReloc::getOffset() const { - return InputSec->OutSec->Addr + InputSec->getOffset(OffsetInSec); + return InputSec->getOutputSection()->Addr + InputSec->getOffset(OffsetInSec); } int64_t DynamicReloc::getAddend() const { @@ -1258,11 +1256,11 @@ template unsigned RelocationSection } template void RelocationSection::finalizeContents() { - this->Link = InX::DynSymTab ? InX::DynSymTab->OutSec->SectionIndex - : InX::SymTab->OutSec->SectionIndex; + this->Link = InX::DynSymTab ? InX::DynSymTab->getParent()->SectionIndex + : InX::SymTab->getParent()->SectionIndex; // Set required output section properties. - this->OutSec->Link = this->Link; + getParent()->Link = this->Link; } SymbolTableBaseSection::SymbolTableBaseSection(StringTableSection &StrTabSec) @@ -1293,14 +1291,14 @@ static bool sortMipsSymbols(const SymbolTableEntry &L, // function. (For .dynsym, we don't do that because symbols for // dynamic linking are inherently all globals.) void SymbolTableBaseSection::finalizeContents() { - this->OutSec->Link = StrTabSec.OutSec->SectionIndex; + getParent()->Link = StrTabSec.getParent()->SectionIndex; // If it is a .dynsym, there should be no local symbols, but we need // to do a few things for the dynamic linker. if (this->Type == SHT_DYNSYM) { // Section's Info field has the index of the first non-local symbol. // Because the first symbol entry is a null entry, 1 is the first. - this->OutSec->Info = 1; + getParent()->Info = 1; if (InX::GnuHashTab) { // NB: It also sorts Symbols to meet the GNU hash table requirements. @@ -1326,7 +1324,7 @@ void SymbolTableBaseSection::postThunkContents() { S.Symbol->symbol()->computeBinding() == STB_LOCAL; }); size_t NumLocals = It - Symbols.begin(); - this->OutSec->Info = NumLocals + 1; + getParent()->Info = NumLocals + 1; } void SymbolTableBaseSection::addSymbol(SymbolBody *B) { @@ -1344,8 +1342,7 @@ size_t SymbolTableBaseSection::getSymbolIndex(SymbolBo // This is used for -r, so we have to handle multiple section // symbols being combined. if (Body->Type == STT_SECTION && E.Symbol->Type == STT_SECTION) - return cast(Body)->Section->getOutputSection() == - cast(E.Symbol)->Section->getOutputSection(); + return Body->getOutputSection() == E.Symbol->getOutputSection(); return false; }); if (I == Symbols.end()) @@ -1456,7 +1453,7 @@ GnuHashTableSection::GnuHashTableSection() } void GnuHashTableSection::finalizeContents() { - this->OutSec->Link = InX::DynSymTab->OutSec->SectionIndex; + getParent()->Link = InX::DynSymTab->getParent()->SectionIndex; // Computes bloom filter size in word size. We want to allocate 8 // bits for each symbol. It must be a power of two. @@ -1590,7 +1587,7 @@ HashTableSection::HashTableSection() } template void HashTableSection::finalizeContents() { - this->OutSec->Link = InX::DynSymTab->OutSec->SectionIndex; + getParent()->Link = InX::DynSymTab->getParent()->SectionIndex; unsigned NumEntries = 2; // nbucket and nchain. NumEntries += InX::DynSymTab->getNumSymbols(); // The chain entries. @@ -1801,7 +1798,7 @@ void GdbIndexSection::finalizeContents() { for (InputSectionBase *S : InputSections) if (InputSection *IS = dyn_cast(S)) - if (IS->OutSec && IS->Name == ".debug_info") + if (IS->getParent() && IS->Name == ".debug_info") readDwarf(IS); SymbolTable.finalizeContents(); @@ -1846,7 +1843,7 @@ void GdbIndexSection::writeTo(uint8_t *Buf) { // Write the address area. for (AddressEntry &E : AddressArea) { - uint64_t BaseAddr = E.Section->OutSec->Addr + E.Section->getOffset(0); + uint64_t BaseAddr = E.Section->getParent()->Addr + E.Section->getOffset(0); write64le(Buf, BaseAddr + E.LowAddress); write64le(Buf + 8, BaseAddr + E.HighAddress); write32le(Buf + 16, E.CuIndex); @@ -1906,7 +1903,7 @@ template void EhFrameHeader::writeT Buf[1] = DW_EH_PE_pcrel | DW_EH_PE_sdata4; Buf[2] = DW_EH_PE_udata4; Buf[3] = DW_EH_PE_datarel | DW_EH_PE_sdata4; - write32(Buf + 4, In::EhFrame->OutSec->Addr - this->getVA() - 4); + write32(Buf + 4, In::EhFrame->getParent()->Addr - this->getVA() - 4); write32(Buf + 8, Fdes.size()); Buf += 12; @@ -1948,12 +1945,12 @@ template void VersionDefinitionSectionVersionDefinitions) V.NameOff = InX::DynStrTab->addString(V.Name); - this->OutSec->Link = InX::DynStrTab->OutSec->SectionIndex; + getParent()->Link = InX::DynStrTab->getParent()->SectionIndex; // sh_info should be set to the number of definitions. This fact is missed in // documentation, but confirmed by binutils community: // https://sourceware.org/ml/binutils/2014-11/msg00355.html - this->OutSec->Info = getVerDefNum(); + getParent()->Info = getVerDefNum(); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Thu Jun 1 20:59:27 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 4EB1EB7EC50; Thu, 1 Jun 2017 20:59:27 +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 024CC68119; Thu, 1 Jun 2017 20:59:26 +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 v51KxQO3035512; Thu, 1 Jun 2017 20:59:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51KxQXs035511; Thu, 1 Jun 2017 20:59:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012059.v51KxQXs035511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 20:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319470 - vendor/lld/lld-trunk-r304460 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:59:27 -0000 Author: dim Date: Thu Jun 1 20:59:25 2017 New Revision: 319470 URL: https://svnweb.freebsd.org/changeset/base/319470 Log: Tag lld trunk r304460. Added: vendor/lld/lld-trunk-r304460/ - copied from r319469, vendor/lld/dist/ From owner-svn-src-vendor@freebsd.org Thu Jun 1 20:59:30 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 EE400B7EC96; Thu, 1 Jun 2017 20:59:30 +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 C619E68177; Thu, 1 Jun 2017 20:59:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51KxTv1035566; Thu, 1 Jun 2017 20:59:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51KxTQo035560; Thu, 1 Jun 2017 20:59:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012059.v51KxTQo035560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 20:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319471 - in vendor/lldb/dist: cmake/modules packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts tools/lldb-mi www X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:59:31 -0000 Author: dim Date: Thu Jun 1 20:59:29 2017 New Revision: 319471 URL: https://svnweb.freebsd.org/changeset/base/319471 Log: Vendor import of lldb trunk r304460: https://llvm.org/svn/llvm-project/lldb/trunk@304460 Added: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/Makefile (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/TestNamespaceConflicts.py (contents, props changed) vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/main.cpp (contents, props changed) Modified: vendor/lldb/dist/cmake/modules/LLDBConfig.cmake vendor/lldb/dist/tools/lldb-mi/MICmdCmdVar.cpp vendor/lldb/dist/www/projects.html Modified: vendor/lldb/dist/cmake/modules/LLDBConfig.cmake ============================================================================== --- vendor/lldb/dist/cmake/modules/LLDBConfig.cmake Thu Jun 1 20:59:25 2017 (r319470) +++ vendor/lldb/dist/cmake/modules/LLDBConfig.cmake Thu Jun 1 20:59:29 2017 (r319471) @@ -334,28 +334,26 @@ if (HAVE_LIBDL) list(APPEND system_libs ${CMAKE_DL_LIBS}) endif() -if (CMAKE_SYSTEM_NAME MATCHES "Linux") - # Check for syscall used by lldb-server on linux. - # If these are not found, it will fall back to ptrace (slow) for memory reads. - check_cxx_source_compiles(" - #include - int main() { process_vm_readv(0, nullptr, 0, nullptr, 0, 0); return 0; }" - HAVE_PROCESS_VM_READV) +# Check for syscall used by lldb-server on linux. +# If these are not found, it will fall back to ptrace (slow) for memory reads. +check_cxx_source_compiles(" + #include + int main() { process_vm_readv(0, nullptr, 0, nullptr, 0, 0); return 0; }" + HAVE_PROCESS_VM_READV) - if (HAVE_PROCESS_VM_READV) - add_definitions(-DHAVE_PROCESS_VM_READV) - else() - # If we don't have the syscall wrapper function, but we know the syscall number, we can - # still issue the syscall manually - check_cxx_source_compiles(" - #include - int main() { return __NR_process_vm_readv; }" - HAVE_NR_PROCESS_VM_READV) +if (HAVE_PROCESS_VM_READV) + add_definitions(-DHAVE_PROCESS_VM_READV) +else() + # If we don't have the syscall wrapper function, but we know the syscall number, we can + # still issue the syscall manually + check_cxx_source_compiles(" + #include + int main() { return __NR_process_vm_readv; }" + HAVE_NR_PROCESS_VM_READV) - if (HAVE_NR_PROCESS_VM_READV) - add_definitions(-DHAVE_NR_PROCESS_VM_READV) - endif() - endif() + if (HAVE_NR_PROCESS_VM_READV) + add_definitions(-DHAVE_NR_PROCESS_VM_READV) + endif() endif() # Figure out if lldb could use lldb-server. If so, then we'll Added: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/Makefile Thu Jun 1 20:59:29 2017 (r319471) @@ -0,0 +1,3 @@ +LEVEL = ../../../make +CXX_SOURCES := main.cpp +include $(LEVEL)/Makefile.rules Added: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/TestNamespaceConflicts.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/TestNamespaceConflicts.py Thu Jun 1 20:59:29 2017 (r319471) @@ -0,0 +1,7 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest( + __file__, globals(), [ + decorators.expectedFailureAll( + oslist=["windows"], bugnumber="llvm.org/pr24764")]) Added: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/main.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/main.cpp Thu Jun 1 20:59:29 2017 (r319471) @@ -0,0 +1,29 @@ +//===-- main.cpp ------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +namespace n { + struct D { + int i; + static int anInt() { return 2; } + int dump() { return i; } + }; +} + +using namespace n; + +int foo(D* D) { + return D->dump(); //% self.expect("expression -- D->dump()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "2"]) +} + +int main (int argc, char const *argv[]) +{ + D myD { D::anInt() }; + foo(&myD); + return 0; +} Modified: vendor/lldb/dist/tools/lldb-mi/MICmdCmdVar.cpp ============================================================================== --- vendor/lldb/dist/tools/lldb-mi/MICmdCmdVar.cpp Thu Jun 1 20:59:25 2017 (r319470) +++ vendor/lldb/dist/tools/lldb-mi/MICmdCmdVar.cpp Thu Jun 1 20:59:29 2017 (r319471) @@ -510,22 +510,20 @@ bool CMICmdCmdVarUpdate::ExamineSBValueForChange(lldb: } lldb::SBType valueType = vrwValue.GetType(); - if (!valueType.IsPointerType() && !valueType.IsReferenceType()) { - const MIuint nChildren = vrwValue.GetNumChildren(); - for (MIuint i = 0; i < nChildren; ++i) { - lldb::SBValue member = vrwValue.GetChildAtIndex(i); - if (!member.IsValid()) - continue; - if (member.GetValueDidChange()) { - vrwbChanged = true; - return MIstatus::success; - } else if (ExamineSBValueForChange(member, vrwbChanged) && vrwbChanged) - // Handle composite types (i.e. struct or arrays) - return MIstatus::success; - } - } + const MIuint nChildren = vrwValue.GetNumChildren(); + for (MIuint i = 0; i < nChildren; ++i) { + lldb::SBValue member = vrwValue.GetChildAtIndex(i); + if (!member.IsValid()) + continue; + if (member.GetValueDidChange()) { + vrwbChanged = true; + return MIstatus::success; + } else if (ExamineSBValueForChange(member, vrwbChanged) && vrwbChanged) + // Handle composite types (i.e. struct or arrays) + return MIstatus::success; + } vrwbChanged = false; return MIstatus::success; } Modified: vendor/lldb/dist/www/projects.html ============================================================================== --- vendor/lldb/dist/www/projects.html Thu Jun 1 20:59:25 2017 (r319470) +++ vendor/lldb/dist/www/projects.html Thu Jun 1 20:59:29 2017 (r319471) @@ -244,6 +244,25 @@
  • + Reimplement the command interpreter commands using the SB API +

    + Currently, all the CommandObject::DoExecute methods are implemented + using the lldb_private API's. That generally means that there's code + that gets duplicated between the CommandObject and the SB API that does + roughly the same thing. We would reduce this code duplication, present a + single coherent face to the users of lldb, and keep + ourselves more honest about what we need in the SB API's if we implemented + the CommandObjects::DoExecute methods using the SB API's. +

    +

    + BTW, it is only the way it was much easier to develop lldb if it had a functioning + command-line early on. So we did that first, and developed the SB API's when lldb + was more mature. There's no good technical reason to have the commands use the + lldb_private API's. +

    +
  • + +
  • Documentation and better examples

    From owner-svn-src-vendor@freebsd.org Thu Jun 1 20:59: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 9DC4FB7ECDC; Thu, 1 Jun 2017 20:59: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 54BA0681E0; Thu, 1 Jun 2017 20:59: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 v51KxXYw035614; Thu, 1 Jun 2017 20:59:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51KxXp0035613; Thu, 1 Jun 2017 20:59:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706012059.v51KxXp0035613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 1 Jun 2017 20:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319472 - vendor/lldb/lldb-trunk-r304460 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 20:59:34 -0000 Author: dim Date: Thu Jun 1 20:59:33 2017 New Revision: 319472 URL: https://svnweb.freebsd.org/changeset/base/319472 Log: Tag lldb trunk r304460. Added: vendor/lldb/lldb-trunk-r304460/ - copied from r319471, vendor/lldb/dist/ From owner-svn-src-vendor@freebsd.org Sat Jun 3 15:20:39 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 4C9EFBF387E; Sat, 3 Jun 2017 15:20:39 +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 CCBE2732D8; Sat, 3 Jun 2017 15:20: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 v53FKbY5079616; Sat, 3 Jun 2017 15:20:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FKbEg079606; Sat, 3 Jun 2017 15:20:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706031520.v53FKbEg079606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Jun 2017 15:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319523 - in vendor/llvm/dist: include/llvm include/llvm/ADT include/llvm/Analysis include/llvm/CodeGen include/llvm/CodeGen/PBQP include/llvm/DebugInfo/CodeView include/llvm/DebugInfo/... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:20:39 -0000 Author: dim Date: Sat Jun 3 15:20:36 2017 New Revision: 319523 URL: https://svnweb.freebsd.org/changeset/base/319523 Log: Vendor import of llvm trunk r304659: https://llvm.org/svn/llvm-project/llvm/trunk@304659 Added: vendor/llvm/dist/lib/Target/ARM/ARMScheduleA57.td vendor/llvm/dist/lib/Target/ARM/ARMScheduleA57WriteRes.td vendor/llvm/dist/test/CodeGen/AMDGPU/not-scalarize-volatile-load.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-alu.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-basic.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-ldm-wrback.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-ldm.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-stm-wrback.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-stm.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vfma.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vldm-wrback.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vldm.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vstm-wrback.ll vendor/llvm/dist/test/CodeGen/ARM/cortex-a57-misched-vstm.ll vendor/llvm/dist/test/CodeGen/Hexagon/newify-crash.ll vendor/llvm/dist/test/CodeGen/Mips/micromips-sizereduction/micromips-lbu16-lhu16-sb16-sh16.ll vendor/llvm/dist/test/CodeGen/PowerPC/scavenging.mir vendor/llvm/dist/test/CodeGen/SystemZ/RAbasic-invalid-LR-update.mir vendor/llvm/dist/test/CodeGen/X86/scavenger.mir vendor/llvm/dist/test/CodeGen/X86/vector-unsigned-cmp.ll vendor/llvm/dist/test/DebugInfo/MIR/AArch64/ vendor/llvm/dist/test/DebugInfo/MIR/AArch64/clobber-sp.mir vendor/llvm/dist/test/DebugInfo/MIR/AArch64/lit.local.cfg vendor/llvm/dist/test/Instrumentation/SanitizerCoverage/inline-8bit-counters.ll vendor/llvm/dist/test/MC/WebAssembly/external-data.ll vendor/llvm/dist/test/Transforms/CodeExtractor/cost.ll vendor/llvm/dist/test/Transforms/CodeExtractor/cost_meta.ll vendor/llvm/dist/test/Transforms/LowerExpectIntrinsic/phi_merge.ll vendor/llvm/dist/test/Transforms/LowerExpectIntrinsic/phi_or.ll vendor/llvm/dist/test/Transforms/LowerExpectIntrinsic/phi_tern.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/Inputs/use-typeid1-dead.yaml vendor/llvm/dist/test/Transforms/LowerTypeTests/export-dead.ll vendor/llvm/dist/test/Transforms/Util/PredicateInfo/condprop2.ll vendor/llvm/dist/test/Transforms/Util/PredicateInfo/testandor2.ll vendor/llvm/dist/unittests/Analysis/OrderedBasicBlockTest.cpp (contents, props changed) Modified: vendor/llvm/dist/include/llvm/ADT/SmallVector.h vendor/llvm/dist/include/llvm/Analysis/OrderedBasicBlock.h vendor/llvm/dist/include/llvm/Analysis/RegionPass.h vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h vendor/llvm/dist/include/llvm/CodeGen/MachineRegionInfo.h vendor/llvm/dist/include/llvm/CodeGen/MachineRegisterInfo.h vendor/llvm/dist/include/llvm/CodeGen/MachineScheduler.h vendor/llvm/dist/include/llvm/CodeGen/PBQP/CostAllocator.h vendor/llvm/dist/include/llvm/CodeGen/PBQP/Graph.h vendor/llvm/dist/include/llvm/CodeGen/PBQP/Math.h vendor/llvm/dist/include/llvm/CodeGen/PBQP/ReductionRules.h vendor/llvm/dist/include/llvm/CodeGen/PBQP/Solution.h vendor/llvm/dist/include/llvm/CodeGen/PBQPRAConstraint.h vendor/llvm/dist/include/llvm/CodeGen/Passes.h vendor/llvm/dist/include/llvm/CodeGen/RegAllocPBQP.h vendor/llvm/dist/include/llvm/CodeGen/RegisterScavenging.h vendor/llvm/dist/include/llvm/CodeGen/ScheduleDAGInstrs.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAG.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h vendor/llvm/dist/include/llvm/CodeGen/SlotIndexes.h vendor/llvm/dist/include/llvm/CodeGen/StackMaps.h vendor/llvm/dist/include/llvm/CodeGen/TargetSchedule.h vendor/llvm/dist/include/llvm/CodeGen/WinEHFuncInfo.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeView.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolDumper.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/SymbolSerializer.h vendor/llvm/dist/include/llvm/DebugInfo/MSF/MappedBlockStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/TpiStream.h vendor/llvm/dist/include/llvm/IR/DIBuilder.h vendor/llvm/dist/include/llvm/IR/DebugLoc.h vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndex.h vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndexYAML.h vendor/llvm/dist/include/llvm/IR/Statepoint.h vendor/llvm/dist/include/llvm/InitializePasses.h vendor/llvm/dist/include/llvm/LTO/Config.h vendor/llvm/dist/include/llvm/ObjectYAML/CodeViewYAMLDebugSections.h vendor/llvm/dist/include/llvm/ObjectYAML/CodeViewYAMLSymbols.h vendor/llvm/dist/include/llvm/TableGen/Record.h vendor/llvm/dist/include/llvm/Transforms/IPO/FunctionImport.h vendor/llvm/dist/include/llvm/Transforms/Instrumentation.h vendor/llvm/dist/include/llvm/Transforms/Utils/Cloning.h vendor/llvm/dist/lib/Analysis/ConstantFolding.cpp vendor/llvm/dist/lib/Analysis/IndirectCallPromotionAnalysis.cpp vendor/llvm/dist/lib/Analysis/InlineCost.cpp vendor/llvm/dist/lib/Analysis/LazyValueInfo.cpp vendor/llvm/dist/lib/Analysis/ModuleSummaryAnalysis.cpp vendor/llvm/dist/lib/Analysis/OrderedBasicBlock.cpp vendor/llvm/dist/lib/Analysis/RegionPass.cpp vendor/llvm/dist/lib/Bitcode/Reader/BitcodeReader.cpp vendor/llvm/dist/lib/Bitcode/Writer/BitcodeWriter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp vendor/llvm/dist/lib/CodeGen/CodeGen.cpp vendor/llvm/dist/lib/CodeGen/GlobalMerge.cpp vendor/llvm/dist/lib/CodeGen/LivePhysRegs.cpp vendor/llvm/dist/lib/CodeGen/LiveRegUnits.cpp vendor/llvm/dist/lib/CodeGen/MachineRegionInfo.cpp vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp vendor/llvm/dist/lib/CodeGen/PrologEpilogInserter.cpp vendor/llvm/dist/lib/CodeGen/RegAllocBasic.cpp vendor/llvm/dist/lib/CodeGen/RegAllocPBQP.cpp vendor/llvm/dist/lib/CodeGen/RegisterScavenging.cpp vendor/llvm/dist/lib/CodeGen/ScheduleDAGInstrs.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/StatepointLowering.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm/dist/lib/CodeGen/TargetLoweringBase.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/DebugSubsectionRecord.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/SymbolDumper.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/SymbolSerializer.cpp vendor/llvm/dist/lib/DebugInfo/MSF/MappedBlockStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/InfoStreamBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBFile.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBStringTable.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/TpiStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp vendor/llvm/dist/lib/IR/DIBuilder.cpp vendor/llvm/dist/lib/IR/DebugLoc.cpp vendor/llvm/dist/lib/IR/OptBisect.cpp vendor/llvm/dist/lib/LTO/LTO.cpp vendor/llvm/dist/lib/LTO/LTOBackend.cpp vendor/llvm/dist/lib/LTO/ThinLTOCodeGenerator.cpp vendor/llvm/dist/lib/MC/WasmObjectWriter.cpp vendor/llvm/dist/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp vendor/llvm/dist/lib/ObjectYAML/CodeViewYAMLSymbols.cpp vendor/llvm/dist/lib/Passes/PassBuilder.cpp vendor/llvm/dist/lib/Support/Triple.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64PBQPRegAlloc.h vendor/llvm/dist/lib/Target/AArch64/AArch64SchedFalkorDetails.td vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.td vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIFoldOperands.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInsertWaitcnts.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInsertWaits.cpp vendor/llvm/dist/lib/Target/AMDGPU/SMInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/VOP3Instructions.td vendor/llvm/dist/lib/Target/ARM/ARM.td vendor/llvm/dist/lib/Target/ARM/ARMBaseInstrInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMBaseInstrInfo.h vendor/llvm/dist/lib/Target/ARM/ARMCallLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMSchedule.td vendor/llvm/dist/lib/Target/ARM/ARMSubtarget.h vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrInfo.cpp vendor/llvm/dist/lib/Target/Mips/MicroMipsSizeReduction.cpp vendor/llvm/dist/lib/Target/WebAssembly/known_gcc_test_failures.txt vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Transforms/Coroutines/CoroSplit.cpp vendor/llvm/dist/lib/Transforms/Coroutines/Coroutines.cpp vendor/llvm/dist/lib/Transforms/IPO/FunctionAttrs.cpp vendor/llvm/dist/lib/Transforms/IPO/FunctionImport.cpp vendor/llvm/dist/lib/Transforms/IPO/LowerTypeTests.cpp vendor/llvm/dist/lib/Transforms/IPO/PartialInlining.cpp vendor/llvm/dist/lib/Transforms/IPO/PassManagerBuilder.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/MemorySanitizer.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/SanitizerCoverage.cpp vendor/llvm/dist/lib/Transforms/Scalar/IndVarSimplify.cpp vendor/llvm/dist/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp vendor/llvm/dist/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp vendor/llvm/dist/lib/Transforms/Scalar/SROA.cpp vendor/llvm/dist/lib/Transforms/Utils/CloneFunction.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/CodeGen/AMDGPU/GlobalISel/legalize-constant.mir vendor/llvm/dist/test/CodeGen/AMDGPU/basic-branch.ll vendor/llvm/dist/test/CodeGen/AMDGPU/branch-condition-and.ll vendor/llvm/dist/test/CodeGen/AMDGPU/branch-relaxation.ll vendor/llvm/dist/test/CodeGen/AMDGPU/commute-compares.ll vendor/llvm/dist/test/CodeGen/AMDGPU/control-flow-fastregalloc.ll vendor/llvm/dist/test/CodeGen/AMDGPU/indirect-addressing-si.ll vendor/llvm/dist/test/CodeGen/AMDGPU/infinite-loop.ll vendor/llvm/dist/test/CodeGen/AMDGPU/insert_vector_elt.v2i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.buffer.store.format.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.buffer.store.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.ds.swizzle.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.image.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.kernarg.segment.ptr.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.s.barrier.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.s.dcache.inv.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.s.dcache.inv.vol.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.s.dcache.wb.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.s.dcache.wb.vol.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.s.waitcnt.ll vendor/llvm/dist/test/CodeGen/AMDGPU/multi-divergent-exit-region.ll vendor/llvm/dist/test/CodeGen/AMDGPU/ret_jump.ll vendor/llvm/dist/test/CodeGen/AMDGPU/si-lower-control-flow-unreachable-block.ll vendor/llvm/dist/test/CodeGen/AMDGPU/smrd-vccz-bug.ll vendor/llvm/dist/test/CodeGen/AMDGPU/spill-m0.ll vendor/llvm/dist/test/CodeGen/AMDGPU/sub.i16.ll vendor/llvm/dist/test/CodeGen/AMDGPU/valu-i1.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll vendor/llvm/dist/test/CodeGen/ARM/global-merge-external.ll vendor/llvm/dist/test/CodeGen/MIR/Generic/runPass.mir vendor/llvm/dist/test/CodeGen/X86/and-sink.ll vendor/llvm/dist/test/CodeGen/X86/avx512-cvt.ll vendor/llvm/dist/test/CodeGen/X86/broadcast-elm-cross-splat-vec.ll vendor/llvm/dist/test/CodeGen/X86/clear_upper_vector_element_bits.ll vendor/llvm/dist/test/CodeGen/X86/select.ll vendor/llvm/dist/test/CodeGen/X86/shrink-compare.ll vendor/llvm/dist/test/CodeGen/X86/sse3.ll vendor/llvm/dist/test/CodeGen/X86/stack-folding-fp-avx1.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-allocas.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-call-lowering.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-far-call.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-forward.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-gctransition-call-lowering.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-invoke.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-live-in.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-stack-usage.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-stackmap-format.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-uniqueing.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-vector-bad-spill.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-vector.ll vendor/llvm/dist/test/CodeGen/X86/wide-fma-contraction.ll vendor/llvm/dist/test/CodeGen/X86/xor-icmp.ll vendor/llvm/dist/test/DebugInfo/PDB/Inputs/simple-line-info.yaml vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-write.test vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-yaml-lineinfo.test vendor/llvm/dist/test/ThinLTO/X86/deadstrip.ll vendor/llvm/dist/test/ThinLTO/X86/newpm-basic.ll vendor/llvm/dist/test/Transforms/Coroutines/coro-split-02.ll vendor/llvm/dist/test/Transforms/Inline/AArch64/switch.ll vendor/llvm/dist/test/Transforms/InstCombine/not.ll vendor/llvm/dist/test/Transforms/InstSimplify/compare.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/Inputs/import-unsat.yaml vendor/llvm/dist/test/Transforms/LowerTypeTests/Inputs/use-typeid1-typeid2.yaml vendor/llvm/dist/test/Transforms/LowerTypeTests/export-nothing.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/import-unsat.ll vendor/llvm/dist/test/Transforms/SROA/address-spaces.ll vendor/llvm/dist/test/Transforms/Util/PredicateInfo/condprop.ll vendor/llvm/dist/test/Transforms/Util/PredicateInfo/testandor.ll vendor/llvm/dist/test/Transforms/WholeProgramDevirt/Inputs/export.yaml vendor/llvm/dist/test/Transforms/WholeProgramDevirt/Inputs/import-indir.yaml vendor/llvm/dist/test/Transforms/WholeProgramDevirt/export-nothing.ll vendor/llvm/dist/test/Transforms/WholeProgramDevirt/export-single-impl.ll vendor/llvm/dist/test/Transforms/WholeProgramDevirt/export-uniform-ret-val.ll vendor/llvm/dist/test/Transforms/WholeProgramDevirt/export-unique-ret-val.ll vendor/llvm/dist/test/Transforms/WholeProgramDevirt/export-unsuccessful-checked.ll vendor/llvm/dist/test/Transforms/WholeProgramDevirt/import-indir.ll vendor/llvm/dist/test/tools/llvm-lto2/X86/pipeline.ll vendor/llvm/dist/tools/llc/llc.cpp vendor/llvm/dist/tools/llvm-config/llvm-config.cpp vendor/llvm/dist/tools/llvm-lto2/llvm-lto2.cpp vendor/llvm/dist/tools/llvm-pdbdump/LLVMOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbdump/PdbYaml.cpp vendor/llvm/dist/tools/llvm-pdbdump/PdbYaml.h vendor/llvm/dist/tools/llvm-pdbdump/YAMLOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbdump/YAMLOutputStyle.h vendor/llvm/dist/tools/llvm-pdbdump/fuzzer/llvm-pdbdump-fuzzer.cpp vendor/llvm/dist/tools/llvm-pdbdump/llvm-pdbdump.cpp vendor/llvm/dist/tools/llvm-readobj/COFFDumper.cpp vendor/llvm/dist/unittests/ADT/SmallVectorTest.cpp vendor/llvm/dist/unittests/Analysis/CMakeLists.txt vendor/llvm/dist/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp vendor/llvm/dist/unittests/Transforms/Utils/Cloning.cpp vendor/llvm/dist/utils/TableGen/X86FoldTablesEmitter.cpp vendor/llvm/dist/utils/lit/lit/util.py Modified: vendor/llvm/dist/include/llvm/ADT/SmallVector.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/SmallVector.h Sat Jun 3 14:45:46 2017 (r319522) +++ vendor/llvm/dist/include/llvm/ADT/SmallVector.h Sat Jun 3 15:20:36 2017 (r319523) @@ -415,12 +415,20 @@ class SmallVectorImpl : public SmallVectorTemplateBase append(IL.begin(), IL.end()); } + // FIXME: Consider assigning over existing elements, rather than clearing & + // re-initializing them - for all assign(...) variants. + void assign(size_type NumElts, const T &Elt) { clear(); if (this->capacity() < NumElts) this->grow(NumElts); this->setEnd(this->begin()+NumElts); std::uninitialized_fill(this->begin(), this->end(), Elt); + } + + template void assign(in_iter in_start, in_iter in_end) { + clear(); + append(in_start, in_end); } void assign(std::initializer_list IL) { Modified: vendor/llvm/dist/include/llvm/Analysis/OrderedBasicBlock.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/OrderedBasicBlock.h Sat Jun 3 14:45:46 2017 (r319522) +++ vendor/llvm/dist/include/llvm/Analysis/OrderedBasicBlock.h Sat Jun 3 15:20:36 2017 (r319523) @@ -58,6 +58,7 @@ class OrderedBasicBlock { (public) /// comes before \p B in \p BB. This is a simplification that considers /// cached instruction positions and ignores other basic blocks, being /// only relevant to compare relative instructions positions inside \p BB. + /// Returns false for A == B. bool dominates(const Instruction *A, const Instruction *B); }; Modified: vendor/llvm/dist/include/llvm/Analysis/RegionPass.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/RegionPass.h Sat Jun 3 14:45:46 2017 (r319522) +++ vendor/llvm/dist/include/llvm/Analysis/RegionPass.h Sat Jun 3 15:20:36 2017 (r319523) @@ -78,6 +78,11 @@ class RegionPass : public Pass { (public) return PMT_RegionPassManager; } //@} + +protected: + /// Optional passes call this function to check whether the pass should be + /// skipped. This is the case when optimization bisect is over the limit. + bool skipRegion(Region &R) const; }; /// @brief The pass manager to schedule RegionPasses. Modified: vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Sat Jun 3 14:45:46 2017 (r319522) +++ vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h Sat Jun 3 15:20:36 2017 (r319523) @@ -636,7 +636,7 @@ class ScalarEvolution { (private) /// @} public: - BackedgeTakenInfo() : MaxAndComplete(nullptr, 0) {} + BackedgeTakenInfo() : MaxAndComplete(nullptr, 0), MaxOrZero(false) {} BackedgeTakenInfo(BackedgeTakenInfo &&) = default; BackedgeTakenInfo &operator=(BackedgeTakenInfo &&) = default; Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineRegionInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineRegionInfo.h Sat Jun 3 14:45:46 2017 (r319522) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineRegionInfo.h Sat Jun 3 15:20:36 2017 (r319523) @@ -10,83 +10,77 @@ #ifndef LLVM_CODEGEN_MACHINEREGIONINFO_H #define LLVM_CODEGEN_MACHINEREGIONINFO_H +#include "llvm/ADT/DepthFirstIterator.h" #include "llvm/Analysis/RegionInfo.h" #include "llvm/Analysis/RegionIterator.h" +#include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineDominanceFrontier.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineLoopInfo.h" +#include - namespace llvm { -class MachineDominatorTree; struct MachinePostDominatorTree; class MachineRegion; class MachineRegionNode; class MachineRegionInfo; -template<> -struct RegionTraits { - typedef MachineFunction FuncT; - typedef MachineBasicBlock BlockT; - typedef MachineRegion RegionT; - typedef MachineRegionNode RegionNodeT; - typedef MachineRegionInfo RegionInfoT; - typedef MachineDominatorTree DomTreeT; - typedef MachineDomTreeNode DomTreeNodeT; - typedef MachinePostDominatorTree PostDomTreeT; - typedef MachineDominanceFrontier DomFrontierT; - typedef MachineInstr InstT; - typedef MachineLoop LoopT; - typedef MachineLoopInfo LoopInfoT; +template <> struct RegionTraits { + using FuncT = MachineFunction; + using BlockT = MachineBasicBlock; + using RegionT = MachineRegion; + using RegionNodeT = MachineRegionNode; + using RegionInfoT = MachineRegionInfo; + using DomTreeT = MachineDominatorTree; + using DomTreeNodeT = MachineDomTreeNode; + using PostDomTreeT = MachinePostDominatorTree; + using DomFrontierT = MachineDominanceFrontier; + using InstT = MachineInstr; + using LoopT = MachineLoop; + using LoopInfoT = MachineLoopInfo; static unsigned getNumSuccessors(MachineBasicBlock *BB) { return BB->succ_size(); } }; - class MachineRegionNode : public RegionNodeBase> { public: - inline MachineRegionNode(MachineRegion *Parent, - MachineBasicBlock *Entry, + inline MachineRegionNode(MachineRegion *Parent, MachineBasicBlock *Entry, bool isSubRegion = false) - : RegionNodeBase>(Parent, Entry, isSubRegion) { + : RegionNodeBase>(Parent, Entry, + isSubRegion) {} - } - bool operator==(const MachineRegion &RN) const { - return this == reinterpret_cast(&RN); + return this == reinterpret_cast(&RN); } }; class MachineRegion : public RegionBase> { public: MachineRegion(MachineBasicBlock *Entry, MachineBasicBlock *Exit, - MachineRegionInfo* RI, - MachineDominatorTree *DT, MachineRegion *Parent = nullptr); + MachineRegionInfo *RI, MachineDominatorTree *DT, + MachineRegion *Parent = nullptr); ~MachineRegion(); bool operator==(const MachineRegionNode &RN) const { - return &RN == reinterpret_cast(this); + return &RN == reinterpret_cast(this); } }; class MachineRegionInfo : public RegionInfoBase> { public: explicit MachineRegionInfo(); - ~MachineRegionInfo() override; // updateStatistics - Update statistic about created regions. void updateStatistics(MachineRegion *R) final; - void recalculate(MachineFunction &F, - MachineDominatorTree *DT, - MachinePostDominatorTree *PDT, - MachineDominanceFrontier *DF); + void recalculate(MachineFunction &F, MachineDominatorTree *DT, + MachinePostDominatorTree *PDT, MachineDominanceFrontier *DF); }; class MachineRegionInfoPass : public MachineFunctionPass { @@ -94,17 +88,13 @@ class MachineRegionInfoPass : public MachineFunctionPa public: static char ID; - explicit MachineRegionInfoPass(); + explicit MachineRegionInfoPass(); ~MachineRegionInfoPass() override; - MachineRegionInfo &getRegionInfo() { - return RI; - } + MachineRegionInfo &getRegionInfo() { return RI; } - const MachineRegionInfo &getRegionInfo() const { - return RI; - } + const MachineRegionInfo &getRegionInfo() const { return RI; } /// @name MachineFunctionPass interface //@{ @@ -117,66 +107,76 @@ class MachineRegionInfoPass : public MachineFunctionPa //@} }; - template <> template <> -inline MachineBasicBlock* RegionNodeBase>::getNodeAs() const { +inline MachineBasicBlock * +RegionNodeBase>::getNodeAs() + const { assert(!isSubRegion() && "This is not a MachineBasicBlock RegionNode!"); return getEntry(); } -template<> -template<> -inline MachineRegion* RegionNodeBase>::getNodeAs() const { +template <> +template <> +inline MachineRegion * +RegionNodeBase>::getNodeAs() + const { assert(isSubRegion() && "This is not a subregion RegionNode!"); - auto Unconst = const_cast>*>(this); - return reinterpret_cast(Unconst); + auto Unconst = + const_cast> *>(this); + return reinterpret_cast(Unconst); } - RegionNodeGraphTraits(MachineRegionNode, MachineBasicBlock, MachineRegion); -RegionNodeGraphTraits(const MachineRegionNode, MachineBasicBlock, MachineRegion); +RegionNodeGraphTraits(const MachineRegionNode, MachineBasicBlock, + MachineRegion); RegionGraphTraits(MachineRegion, MachineRegionNode); RegionGraphTraits(const MachineRegion, const MachineRegionNode); -template <> struct GraphTraits - : public GraphTraits > { - typedef df_iterator, false, - GraphTraits>> - nodes_iterator; +template <> +struct GraphTraits + : public GraphTraits> { + using nodes_iterator = df_iterator, + false, GraphTraits>>; static NodeRef getEntryNode(MachineRegionInfo *RI) { - return GraphTraits >::getEntryNode(RI->getTopLevelRegion()); + return GraphTraits>::getEntryNode( + RI->getTopLevelRegion()); } - static nodes_iterator nodes_begin(MachineRegionInfo* RI) { + + static nodes_iterator nodes_begin(MachineRegionInfo *RI) { return nodes_iterator::begin(getEntryNode(RI)); } + static nodes_iterator nodes_end(MachineRegionInfo *RI) { return nodes_iterator::end(getEntryNode(RI)); } }; -template <> struct GraphTraits - : public GraphTraits { - typedef df_iterator, false, - GraphTraits>> - nodes_iterator; +template <> +struct GraphTraits + : public GraphTraits { + using nodes_iterator = df_iterator, + false, GraphTraits>>; static NodeRef getEntryNode(MachineRegionInfoPass *RI) { - return GraphTraits::getEntryNode(&RI->getRegionInfo()); + return GraphTraits::getEntryNode(&RI->getRegionInfo()); } - static nodes_iterator nodes_begin(MachineRegionInfoPass* RI) { - return GraphTraits::nodes_begin(&RI->getRegionInfo()); + + static nodes_iterator nodes_begin(MachineRegionInfoPass *RI) { + return GraphTraits::nodes_begin(&RI->getRegionInfo()); } + static nodes_iterator nodes_end(MachineRegionInfoPass *RI) { - return GraphTraits::nodes_end(&RI->getRegionInfo()); + return GraphTraits::nodes_end(&RI->getRegionInfo()); } }; extern template class RegionBase>; extern template class RegionNodeBase>; extern template class RegionInfoBase>; -} -#endif +} // end namespace llvm + +#endif // LLVM_CODEGEN_MACHINEREGIONINFO_H Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineRegisterInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineRegisterInfo.h Sat Jun 3 14:45:46 2017 (r319522) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineRegisterInfo.h Sat Jun 3 15:20:36 2017 (r319523) @@ -14,11 +14,13 @@ #ifndef LLVM_CODEGEN_MACHINEREGISTERINFO_H #define LLVM_CODEGEN_MACHINEREGISTERINFO_H +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/BitVector.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/IndexedMap.h" #include "llvm/ADT/iterator_range.h" #include "llvm/ADT/PointerUnion.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/GlobalISel/RegisterBank.h" #include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/MachineBasicBlock.h" @@ -41,8 +43,8 @@ namespace llvm { class PSetIterator; /// Convenient type to represent either a register class or a register bank. -typedef PointerUnion - RegClassOrRegBank; +using RegClassOrRegBank = + PointerUnion; /// MachineRegisterInfo - Keep track of information for virtual and physical /// registers, including vreg register classes, use/def chains for registers, @@ -125,7 +127,7 @@ class MachineRegisterInfo { (private) /// started. BitVector ReservedRegs; - typedef DenseMap VRegToTypeMap; + using VRegToTypeMap = DenseMap; /// Map generic virtual registers to their actual size. mutable std::unique_ptr VRegToType; @@ -266,8 +268,8 @@ class MachineRegisterInfo { (private) /// reg_iterator/reg_begin/reg_end - Walk all defs and uses of the specified /// register. - typedef defusechain_iterator - reg_iterator; + using reg_iterator = + defusechain_iterator; reg_iterator reg_begin(unsigned RegNo) const { return reg_iterator(getRegUseDefListHead(RegNo)); } @@ -279,8 +281,8 @@ class MachineRegisterInfo { (private) /// reg_instr_iterator/reg_instr_begin/reg_instr_end - Walk all defs and uses /// of the specified register, stepping by MachineInstr. - typedef defusechain_instr_iterator - reg_instr_iterator; + using reg_instr_iterator = + defusechain_instr_iterator; reg_instr_iterator reg_instr_begin(unsigned RegNo) const { return reg_instr_iterator(getRegUseDefListHead(RegNo)); } @@ -295,8 +297,8 @@ class MachineRegisterInfo { (private) /// reg_bundle_iterator/reg_bundle_begin/reg_bundle_end - Walk all defs and uses /// of the specified register, stepping by bundle. - typedef defusechain_instr_iterator - reg_bundle_iterator; + using reg_bundle_iterator = + defusechain_instr_iterator; reg_bundle_iterator reg_bundle_begin(unsigned RegNo) const { return reg_bundle_iterator(getRegUseDefListHead(RegNo)); } @@ -314,8 +316,8 @@ class MachineRegisterInfo { (private) /// reg_nodbg_iterator/reg_nodbg_begin/reg_nodbg_end - Walk all defs and uses /// of the specified register, skipping those marked as Debug. - typedef defusechain_iterator - reg_nodbg_iterator; + using reg_nodbg_iterator = + defusechain_iterator; reg_nodbg_iterator reg_nodbg_begin(unsigned RegNo) const { return reg_nodbg_iterator(getRegUseDefListHead(RegNo)); } @@ -331,8 +333,8 @@ class MachineRegisterInfo { (private) /// reg_instr_nodbg_iterator/reg_instr_nodbg_begin/reg_instr_nodbg_end - Walk /// all defs and uses of the specified register, stepping by MachineInstr, /// skipping those marked as Debug. - typedef defusechain_instr_iterator - reg_instr_nodbg_iterator; + using reg_instr_nodbg_iterator = + defusechain_instr_iterator; reg_instr_nodbg_iterator reg_instr_nodbg_begin(unsigned RegNo) const { return reg_instr_nodbg_iterator(getRegUseDefListHead(RegNo)); } @@ -348,8 +350,8 @@ class MachineRegisterInfo { (private) /// reg_bundle_nodbg_iterator/reg_bundle_nodbg_begin/reg_bundle_nodbg_end - Walk /// all defs and uses of the specified register, stepping by bundle, /// skipping those marked as Debug. - typedef defusechain_instr_iterator - reg_bundle_nodbg_iterator; + using reg_bundle_nodbg_iterator = + defusechain_instr_iterator; reg_bundle_nodbg_iterator reg_bundle_nodbg_begin(unsigned RegNo) const { return reg_bundle_nodbg_iterator(getRegUseDefListHead(RegNo)); } @@ -369,8 +371,8 @@ class MachineRegisterInfo { (private) } /// def_iterator/def_begin/def_end - Walk all defs of the specified register. - typedef defusechain_iterator - def_iterator; + using def_iterator = + defusechain_iterator; def_iterator def_begin(unsigned RegNo) const { return def_iterator(getRegUseDefListHead(RegNo)); } @@ -382,8 +384,8 @@ class MachineRegisterInfo { (private) /// def_instr_iterator/def_instr_begin/def_instr_end - Walk all defs of the /// specified register, stepping by MachineInst. - typedef defusechain_instr_iterator - def_instr_iterator; + using def_instr_iterator = + defusechain_instr_iterator; def_instr_iterator def_instr_begin(unsigned RegNo) const { return def_instr_iterator(getRegUseDefListHead(RegNo)); } @@ -398,8 +400,8 @@ class MachineRegisterInfo { (private) /// def_bundle_iterator/def_bundle_begin/def_bundle_end - Walk all defs of the /// specified register, stepping by bundle. - typedef defusechain_instr_iterator - def_bundle_iterator; + using def_bundle_iterator = + defusechain_instr_iterator; def_bundle_iterator def_bundle_begin(unsigned RegNo) const { return def_bundle_iterator(getRegUseDefListHead(RegNo)); } @@ -425,8 +427,8 @@ class MachineRegisterInfo { (private) } /// use_iterator/use_begin/use_end - Walk all uses of the specified register. - typedef defusechain_iterator - use_iterator; + using use_iterator = + defusechain_iterator; use_iterator use_begin(unsigned RegNo) const { return use_iterator(getRegUseDefListHead(RegNo)); } @@ -438,8 +440,8 @@ class MachineRegisterInfo { (private) /// use_instr_iterator/use_instr_begin/use_instr_end - Walk all uses of the /// specified register, stepping by MachineInstr. - typedef defusechain_instr_iterator - use_instr_iterator; + using use_instr_iterator = + defusechain_instr_iterator; use_instr_iterator use_instr_begin(unsigned RegNo) const { return use_instr_iterator(getRegUseDefListHead(RegNo)); } @@ -454,8 +456,8 @@ class MachineRegisterInfo { (private) /// use_bundle_iterator/use_bundle_begin/use_bundle_end - Walk all uses of the /// specified register, stepping by bundle. - typedef defusechain_instr_iterator - use_bundle_iterator; + using use_bundle_iterator = + defusechain_instr_iterator; use_bundle_iterator use_bundle_begin(unsigned RegNo) const { return use_bundle_iterator(getRegUseDefListHead(RegNo)); } @@ -482,8 +484,8 @@ class MachineRegisterInfo { (private) /// use_nodbg_iterator/use_nodbg_begin/use_nodbg_end - Walk all uses of the /// specified register, skipping those marked as Debug. - typedef defusechain_iterator - use_nodbg_iterator; + using use_nodbg_iterator = + defusechain_iterator; use_nodbg_iterator use_nodbg_begin(unsigned RegNo) const { return use_nodbg_iterator(getRegUseDefListHead(RegNo)); } @@ -499,8 +501,8 @@ class MachineRegisterInfo { (private) /// use_instr_nodbg_iterator/use_instr_nodbg_begin/use_instr_nodbg_end - Walk /// all uses of the specified register, stepping by MachineInstr, skipping /// those marked as Debug. - typedef defusechain_instr_iterator - use_instr_nodbg_iterator; + using use_instr_nodbg_iterator = + defusechain_instr_iterator; use_instr_nodbg_iterator use_instr_nodbg_begin(unsigned RegNo) const { return use_instr_nodbg_iterator(getRegUseDefListHead(RegNo)); } @@ -516,8 +518,8 @@ class MachineRegisterInfo { (private) /// use_bundle_nodbg_iterator/use_bundle_nodbg_begin/use_bundle_nodbg_end - Walk /// all uses of the specified register, stepping by bundle, skipping /// those marked as Debug. - typedef defusechain_instr_iterator - use_bundle_nodbg_iterator; + using use_bundle_nodbg_iterator = + defusechain_instr_iterator; use_bundle_nodbg_iterator use_bundle_nodbg_begin(unsigned RegNo) const { return use_bundle_nodbg_iterator(getRegUseDefListHead(RegNo)); } @@ -593,7 +595,6 @@ class MachineRegisterInfo { (private) /// Return the register class of the specified virtual register. /// This shouldn't be used directly unless \p Reg has a register class. /// \see getRegClassOrNull when this might happen. - /// const TargetRegisterClass *getRegClass(unsigned Reg) const { assert(VRegInfo[Reg].first.is() && "Register class not set, wrong accessor"); @@ -620,7 +621,6 @@ class MachineRegisterInfo { (private) /// a register bank or has been assigned a register class. /// \note It is possible to get the register bank from the register class via /// RegisterBankInfo::getRegBankFromRegClass. - /// const RegisterBank *getRegBankOrNull(unsigned Reg) const { const RegClassOrRegBank &Val = VRegInfo[Reg].first; return Val.dyn_cast(); @@ -629,17 +629,14 @@ class MachineRegisterInfo { (private) /// Return the register bank or register class of \p Reg. /// \note Before the register bank gets assigned (i.e., before the /// RegBankSelect pass) \p Reg may not have either. - /// const RegClassOrRegBank &getRegClassOrRegBank(unsigned Reg) const { return VRegInfo[Reg].first; } /// setRegClass - Set the register class of the specified virtual register. - /// void setRegClass(unsigned Reg, const TargetRegisterClass *RC); /// Set the register bank to \p RegBank for \p Reg. - /// void setRegBank(unsigned Reg, const RegisterBank &RegBank); void setRegClassOrRegBank(unsigned Reg, @@ -653,7 +650,6 @@ class MachineRegisterInfo { (private) /// new register class, or NULL if no such class exists. /// This should only be used when the constraint is known to be trivial, like /// GR32 -> GR32_NOSP. Beware of increasing register pressure. - /// const TargetRegisterClass *constrainRegClass(unsigned Reg, const TargetRegisterClass *RC, unsigned MinNumRegs = 0); @@ -665,12 +661,10 @@ class MachineRegisterInfo { (private) /// This method can be used after constraints have been removed from a /// virtual register, for example after removing instructions or splitting /// the live range. - /// bool recomputeRegClass(unsigned Reg); /// createVirtualRegister - Create and return a new virtual register in the /// function with the specified register class. - /// unsigned createVirtualRegister(const TargetRegisterClass *RegClass); /// Accessor for VRegToType. This accessor should only be used @@ -704,7 +698,6 @@ class MachineRegisterInfo { (private) unsigned createIncompleteVirtualRegister(); /// getNumVirtRegs - Return the number of virtual registers created. - /// unsigned getNumVirtRegs() const { return VRegInfo.size(); } /// clearVirtRegs - Remove all virtual registers (after physreg assignment). @@ -810,7 +803,6 @@ class MachineRegisterInfo { (private) /// /// Reserved registers may belong to an allocatable register class, but the /// target has explicitly requested that they are not used. - /// bool isReserved(unsigned PhysReg) const { return getReservedRegs().test(PhysReg); } @@ -838,8 +830,8 @@ class MachineRegisterInfo { (private) // Iteration support for the live-ins set. It's kept in sorted order // by register number. - typedef std::vector>::const_iterator - livein_iterator; + using livein_iterator = + std::vector>::const_iterator; livein_iterator livein_begin() const { return LiveIns.begin(); } livein_iterator livein_end() const { return LiveIns.end(); } bool livein_empty() const { return LiveIns.empty(); } @@ -910,10 +902,10 @@ class MachineRegisterInfo { (private) } public: - typedef std::iterator::reference reference; - typedef std::iterator::pointer pointer; + using reference = std::iterator::reference; + using pointer = std::iterator::pointer; defusechain_iterator() = default; @@ -1016,10 +1008,10 @@ class MachineRegisterInfo { (private) } public: - typedef std::iterator::reference reference; - typedef std::iterator::pointer pointer; + using reference = std::iterator::reference; + using pointer = std::iterator::pointer; defusechain_instr_iterator() = default; Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineScheduler.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineScheduler.h Sat Jun 3 14:45:46 2017 (r319522) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineScheduler.h Sat Jun 3 15:20:36 2017 (r319523) @@ -104,10 +104,15 @@ extern cl::opt ForceBottomUp; class LiveIntervals; class MachineDominatorTree; +class MachineFunction; +class MachineInstr; class MachineLoopInfo; class RegisterClassInfo; class SchedDFSResult; class ScheduleHazardRecognizer; +class TargetInstrInfo; +class TargetPassConfig; +class TargetRegisterInfo; /// MachineSchedContext provides enough context from the MachineScheduler pass /// for the target to instantiate a scheduler. @@ -129,10 +134,10 @@ struct MachineSchedContext { /// schedulers. class MachineSchedRegistry : public MachinePassRegistryNode { public: - typedef ScheduleDAGInstrs *(*ScheduleDAGCtor)(MachineSchedContext *); + using ScheduleDAGCtor = ScheduleDAGInstrs *(*)(MachineSchedContext *); // RegisterPassParser requires a (misnamed) FunctionPassCtor type. - typedef ScheduleDAGCtor FunctionPassCtor; + using FunctionPassCtor = ScheduleDAGCtor; static MachinePassRegistry Registry; @@ -527,7 +532,7 @@ class ReadyQueue { (public) unsigned size() const { return Queue.size(); } - typedef std::vector::iterator iterator; + using iterator = std::vector::iterator; iterator begin() { return Queue.begin(); } Modified: vendor/llvm/dist/include/llvm/CodeGen/PBQP/CostAllocator.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/PBQP/CostAllocator.h Sat Jun 3 14:45:46 2017 (r319522) +++ vendor/llvm/dist/include/llvm/CodeGen/PBQP/CostAllocator.h Sat Jun 3 15:20:36 2017 (r319523) @@ -1,4 +1,4 @@ -//===---------- CostAllocator.h - PBQP Cost Allocator -----------*- C++ -*-===// +//===- CostAllocator.h - PBQP Cost Allocator --------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -19,26 +19,28 @@ #define LLVM_CODEGEN_PBQP_COSTALLOCATOR_H #include "llvm/ADT/DenseSet.h" +#include +#include #include -#include namespace llvm { namespace PBQP { -template -class ValuePool { +template class ValuePool { public: - typedef std::shared_ptr PoolRef; + using PoolRef = std::shared_ptr; private: - class PoolEntry : public std::enable_shared_from_this { public: template PoolEntry(ValuePool &Pool, ValueKeyT Value) : Pool(Pool), Value(std::move(Value)) {} + ~PoolEntry() { Pool.removeEntry(this); } - const ValueT& getValue() const { return Value; } + + const ValueT &getValue() const { return Value; } + private: ValuePool &Pool; ValueT Value; @@ -46,10 +48,10 @@ class ValuePool { (private) class PoolEntryDSInfo { public: - static inline PoolEntry* getEmptyKey() { return nullptr; } + static inline PoolEntry *getEmptyKey() { return nullptr; } - static inline PoolEntry* getTombstoneKey() { - return reinterpret_cast(static_cast(1)); + static inline PoolEntry *getTombstoneKey() { + return reinterpret_cast(static_cast(1)); } template @@ -66,8 +68,7 @@ class ValuePool { (private) } template - static - bool isEqual(const ValueKeyT1 &C1, const ValueKeyT2 &C2) { + static bool isEqual(const ValueKeyT1 &C1, const ValueKeyT2 &C2) { return C1 == C2; } @@ -83,10 +84,9 @@ class ValuePool { (private) return P1 == P2; return isEqual(P1->getValue(), P2); } - }; - typedef DenseSet EntrySetT; + using EntrySetT = DenseSet; EntrySetT EntrySet; @@ -105,28 +105,31 @@ class ValuePool { (private) } }; -template -class PoolCostAllocator { +template class PoolCostAllocator { private: - typedef ValuePool VectorCostPool; - typedef ValuePool MatrixCostPool; + using VectorCostPool = ValuePool; + using MatrixCostPool = ValuePool; + public: - typedef VectorT Vector; - typedef MatrixT Matrix; - typedef typename VectorCostPool::PoolRef VectorPtr; - typedef typename MatrixCostPool::PoolRef MatrixPtr; + using Vector = VectorT; + using Matrix = MatrixT; + using VectorPtr = typename VectorCostPool::PoolRef; + using MatrixPtr = typename MatrixCostPool::PoolRef; - template - VectorPtr getVector(VectorKeyT v) { return VectorPool.getValue(std::move(v)); } + template VectorPtr getVector(VectorKeyT v) { + return VectorPool.getValue(std::move(v)); + } - template - MatrixPtr getMatrix(MatrixKeyT m) { return MatrixPool.getValue(std::move(m)); } + template MatrixPtr getMatrix(MatrixKeyT m) { + return MatrixPool.getValue(std::move(m)); + } + private: VectorCostPool VectorPool; MatrixCostPool MatrixPool; }; -} // namespace PBQP -} // namespace llvm +} // end namespace PBQP +} // end namespace llvm -#endif +#endif // LLVM_CODEGEN_PBQP_COSTALLOCATOR_H Modified: vendor/llvm/dist/include/llvm/CodeGen/PBQP/Graph.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/PBQP/Graph.h Sat Jun 3 14:45:46 2017 (r319522) +++ vendor/llvm/dist/include/llvm/CodeGen/PBQP/Graph.h Sat Jun 3 15:20:36 2017 (r319523) @@ -1,4 +1,4 @@ -//===-------------------- Graph.h - PBQP Graph ------------------*- C++ -*-===// +//===- Graph.h - PBQP Graph -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -11,16 +11,14 @@ // //===----------------------------------------------------------------------===// - #ifndef LLVM_CODEGEN_PBQP_GRAPH_H #define LLVM_CODEGEN_PBQP_GRAPH_H #include "llvm/ADT/STLExtras.h" -#include "llvm/Support/Debug.h" #include #include +#include #include -#include #include namespace llvm { @@ -28,8 +26,8 @@ namespace PBQP { class GraphBase { public: - typedef unsigned NodeId; - typedef unsigned EdgeId; + using NodeId = unsigned; + using EdgeId = unsigned; /// @brief Returns a value representing an invalid (non-existent) node. static NodeId invalidNodeId() { @@ -48,32 +46,32 @@ namespace PBQP { template class Graph : public GraphBase { private: - typedef typename SolverT::CostAllocator CostAllocator; + using CostAllocator = typename SolverT::CostAllocator; + public: - typedef typename SolverT::RawVector RawVector; - typedef typename SolverT::RawMatrix RawMatrix; - typedef typename SolverT::Vector Vector; - typedef typename SolverT::Matrix Matrix; - typedef typename CostAllocator::VectorPtr VectorPtr; - typedef typename CostAllocator::MatrixPtr MatrixPtr; - typedef typename SolverT::NodeMetadata NodeMetadata; - typedef typename SolverT::EdgeMetadata EdgeMetadata; - typedef typename SolverT::GraphMetadata GraphMetadata; + using RawVector = typename SolverT::RawVector; + using RawMatrix = typename SolverT::RawMatrix; + using Vector = typename SolverT::Vector; + using Matrix = typename SolverT::Matrix; + using VectorPtr = typename CostAllocator::VectorPtr; + using MatrixPtr = typename CostAllocator::MatrixPtr; + using NodeMetadata = typename SolverT::NodeMetadata; + using EdgeMetadata = typename SolverT::EdgeMetadata; + using GraphMetadata = typename SolverT::GraphMetadata; private: - class NodeEntry { public: - typedef std::vector AdjEdgeList; - typedef AdjEdgeList::size_type AdjEdgeIdx; - typedef AdjEdgeList::const_iterator AdjEdgeItr; + using AdjEdgeList = std::vector; + using AdjEdgeIdx = AdjEdgeList::size_type; + using AdjEdgeItr = AdjEdgeList::const_iterator; + NodeEntry(VectorPtr Costs) : Costs(std::move(Costs)) {} + static AdjEdgeIdx getInvalidAdjEdgeIdx() { return std::numeric_limits::max(); } - NodeEntry(VectorPtr Costs) : Costs(std::move(Costs)) {} - AdjEdgeIdx addAdjEdgeId(EdgeId EId) { AdjEdgeIdx Idx = AdjEdgeIds.size(); AdjEdgeIds.push_back(EId); @@ -96,6 +94,7 @@ namespace PBQP { VectorPtr Costs; NodeMetadata Metadata; + private: AdjEdgeList AdjEdgeIds; }; @@ -150,8 +149,10 @@ namespace PBQP { NodeId getN1Id() const { return NIds[0]; } NodeId getN2Id() const { return NIds[1]; } + MatrixPtr Costs; EdgeMetadata Metadata; + private: NodeId NIds[2]; typename NodeEntry::AdjEdgeIdx ThisEdgeAdjIdxs[2]; @@ -161,18 +162,20 @@ namespace PBQP { GraphMetadata Metadata; CostAllocator CostAlloc; - SolverT *Solver; + SolverT *Solver = nullptr; - typedef std::vector NodeVector; - typedef std::vector FreeNodeVector; + using NodeVector = std::vector; + using FreeNodeVector = std::vector; NodeVector Nodes; FreeNodeVector FreeNodeIds; - typedef std::vector EdgeVector; - typedef std::vector FreeEdgeVector; + using EdgeVector = std::vector; + using FreeEdgeVector = std::vector; EdgeVector Edges; FreeEdgeVector FreeEdgeIds; + Graph(const Graph &Other) {} + // ----- INTERNAL METHODS ----- NodeEntry &getNode(NodeId NId) { @@ -220,20 +223,18 @@ namespace PBQP { return EId; } - Graph(const Graph &Other) {} void operator=(const Graph &Other) {} public: + using AdjEdgeItr = typename NodeEntry::AdjEdgeItr; - typedef typename NodeEntry::AdjEdgeItr AdjEdgeItr; - class NodeItr { public: - typedef std::forward_iterator_tag iterator_category; - typedef NodeId value_type; - typedef int difference_type; - typedef NodeId* pointer; - typedef NodeId& reference; + using iterator_category = std::forward_iterator_tag; + using value_type = NodeId; + using difference_type = int; + using pointer = NodeId *; + using reference = NodeId &; NodeItr(NodeId CurNId, const Graph &G) : CurNId(CurNId), EndNId(G.Nodes.size()), FreeNodeIds(G.FreeNodeIds) { @@ -283,53 +284,65 @@ namespace PBQP { class NodeIdSet { public: - NodeIdSet(const Graph &G) : G(G) { } + NodeIdSet(const Graph &G) : G(G) {} + NodeItr begin() const { return NodeItr(0, G); } NodeItr end() const { return NodeItr(G.Nodes.size(), G); } + bool empty() const { return G.Nodes.empty(); } + typename NodeVector::size_type size() const { return G.Nodes.size() - G.FreeNodeIds.size(); } + private: const Graph& G; }; class EdgeIdSet { public: - EdgeIdSet(const Graph &G) : G(G) { } + EdgeIdSet(const Graph &G) : G(G) {} + EdgeItr begin() const { return EdgeItr(0, G); } EdgeItr end() const { return EdgeItr(G.Edges.size(), G); } + bool empty() const { return G.Edges.empty(); } + typename NodeVector::size_type size() const { return G.Edges.size() - G.FreeEdgeIds.size(); } + private: const Graph& G; }; class AdjEdgeIdSet { public: - AdjEdgeIdSet(const NodeEntry &NE) : NE(NE) { } + AdjEdgeIdSet(const NodeEntry &NE) : NE(NE) {} + typename NodeEntry::AdjEdgeItr begin() const { return NE.getAdjEdgeIds().begin(); } + typename NodeEntry::AdjEdgeItr end() const { return NE.getAdjEdgeIds().end(); } + bool empty() const { return NE.getAdjEdgeIds().empty(); } + typename NodeEntry::AdjEdgeList::size_type size() const { return NE.getAdjEdgeIds().size(); } + private: const NodeEntry &NE; }; /// @brief Construct an empty PBQP graph. - Graph() : Solver(nullptr) {} + Graph() = default; /// @brief Construct an empty PBQP graph with the given graph metadata. - Graph(GraphMetadata Metadata) - : Metadata(std::move(Metadata)), Solver(nullptr) {} + Graph(GraphMetadata Metadata) : Metadata(std::move(Metadata)) {} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Sat Jun 3 15:20: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 42164BF388B; Sat, 3 Jun 2017 15:20: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 E75EF732E4; Sat, 3 Jun 2017 15:20:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53FKgcE079663; Sat, 3 Jun 2017 15:20:42 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FKgOY079662; Sat, 3 Jun 2017 15:20:42 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706031520.v53FKgOY079662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Jun 2017 15:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319524 - vendor/llvm/llvm-trunk-r304659 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:20:43 -0000 Author: dim Date: Sat Jun 3 15:20:41 2017 New Revision: 319524 URL: https://svnweb.freebsd.org/changeset/base/319524 Log: Tag llvm trunk r304659. Added: vendor/llvm/llvm-trunk-r304659/ - copied from r319523, vendor/llvm/dist/ From owner-svn-src-vendor@freebsd.org Sat Jun 3 15:20: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 3861EBF38E1; Sat, 3 Jun 2017 15:20: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 BA81F733B7; Sat, 3 Jun 2017 15:20: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 v53FKrLS082706; Sat, 3 Jun 2017 15:20:53 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FKmSG079711; Sat, 3 Jun 2017 15:20:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706031520.v53FKmSG079711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Jun 2017 15:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319525 - in vendor/clang/dist: docs include/clang/Basic include/clang/Driver include/clang/Frontend include/clang/Lex lib/ARCMigrate lib/AST lib/Analysis lib/Basic lib/CodeGen lib/Driv... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:20:55 -0000 Author: dim Date: Sat Jun 3 15:20:48 2017 New Revision: 319525 URL: https://svnweb.freebsd.org/changeset/base/319525 Log: Vendor import of clang trunk r304659: https://llvm.org/svn/llvm-project/cfe/trunk@304659 Added: vendor/clang/dist/test/CodeGen/pr26099.c (contents, props changed) vendor/clang/dist/test/CodeGenCXX/pr33080.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCXX/unaligned-member-qualifier.cpp (contents, props changed) vendor/clang/dist/test/Frontend/rewrite-includes-filenotfound.c (contents, props changed) vendor/clang/dist/test/Modules/Inputs/check-for-sanitizer-feature/ vendor/clang/dist/test/Modules/Inputs/check-for-sanitizer-feature/check.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/check-for-sanitizer-feature/map vendor/clang/dist/test/Modules/Inputs/header-attribs/ vendor/clang/dist/test/Modules/Inputs/header-attribs/bar.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/header-attribs/baz.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/header-attribs/foo.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/header-attribs/modular.modulemap vendor/clang/dist/test/Modules/Inputs/header-attribs/textual.modulemap vendor/clang/dist/test/Modules/check-for-sanitizer-feature.cpp (contents, props changed) vendor/clang/dist/test/Modules/header-attribs.cpp (contents, props changed) vendor/clang/dist/test/Modules/preprocess-missing.modulemap Deleted: vendor/clang/dist/test/CodeGenCXX/unaligned-duplicated-mangle-name.cpp Modified: vendor/clang/dist/docs/Modules.rst vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td vendor/clang/dist/include/clang/Basic/Module.h vendor/clang/dist/include/clang/Basic/Sanitizers.h vendor/clang/dist/include/clang/Driver/CC1Options.td vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def vendor/clang/dist/include/clang/Lex/ModuleMap.h vendor/clang/dist/lib/ARCMigrate/TransRetainReleaseDealloc.cpp vendor/clang/dist/lib/ARCMigrate/TransformActions.cpp vendor/clang/dist/lib/AST/ASTContext.cpp vendor/clang/dist/lib/AST/ASTDiagnostic.cpp vendor/clang/dist/lib/AST/ASTStructuralEquivalence.cpp vendor/clang/dist/lib/AST/DeclPrinter.cpp vendor/clang/dist/lib/AST/Expr.cpp vendor/clang/dist/lib/AST/ExprConstant.cpp vendor/clang/dist/lib/AST/ItaniumMangle.cpp vendor/clang/dist/lib/AST/NestedNameSpecifier.cpp vendor/clang/dist/lib/Analysis/PrintfFormatString.cpp vendor/clang/dist/lib/Analysis/PseudoConstantAnalysis.cpp vendor/clang/dist/lib/Analysis/ScanfFormatString.cpp vendor/clang/dist/lib/Basic/IdentifierTable.cpp vendor/clang/dist/lib/Basic/LangOptions.cpp vendor/clang/dist/lib/Basic/Module.cpp vendor/clang/dist/lib/Basic/TargetInfo.cpp vendor/clang/dist/lib/CodeGen/BackendUtil.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGCall.cpp vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.h vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/Driver/SanitizerArgs.cpp vendor/clang/dist/lib/Edit/RewriteObjCFoundationAPI.cpp vendor/clang/dist/lib/Frontend/CompilerInstance.cpp vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/lib/Frontend/FrontendAction.cpp vendor/clang/dist/lib/Frontend/FrontendActions.cpp vendor/clang/dist/lib/Frontend/InitHeaderSearch.cpp vendor/clang/dist/lib/Frontend/Rewrite/FrontendActions.cpp vendor/clang/dist/lib/Frontend/Rewrite/InclusionRewriter.cpp vendor/clang/dist/lib/Frontend/SerializedDiagnosticReader.cpp vendor/clang/dist/lib/Lex/HeaderSearch.cpp vendor/clang/dist/lib/Lex/Lexer.cpp vendor/clang/dist/lib/Lex/LiteralSupport.cpp vendor/clang/dist/lib/Lex/ModuleMap.cpp vendor/clang/dist/lib/Lex/PPDirectives.cpp vendor/clang/dist/lib/Parse/ParseDecl.cpp vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp vendor/clang/dist/lib/Parse/ParseExpr.cpp vendor/clang/dist/lib/Parse/ParseInit.cpp vendor/clang/dist/lib/Parse/ParseOpenMP.cpp vendor/clang/dist/lib/Parse/ParseStmt.cpp vendor/clang/dist/lib/Parse/ParseTentative.cpp vendor/clang/dist/lib/Parse/Parser.cpp vendor/clang/dist/lib/Rewrite/HTMLRewrite.cpp vendor/clang/dist/lib/Sema/CoroutineStmtBuilder.h vendor/clang/dist/lib/Sema/SemaCodeComplete.cpp vendor/clang/dist/lib/Sema/SemaCoroutine.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaLambda.cpp vendor/clang/dist/lib/Sema/SemaLookup.cpp vendor/clang/dist/lib/Sema/SemaStmt.cpp vendor/clang/dist/lib/Sema/SemaStmtAsm.cpp vendor/clang/dist/lib/Sema/SemaTemplateDeduction.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/ASTWriter.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/ExprEngine.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/SValBuilder.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp vendor/clang/dist/test/CodeGen/thin_link_bitcode.c vendor/clang/dist/test/CodeGen/ubsan-pointer-overflow.m vendor/clang/dist/test/CodeGenCoroutines/coro-params.cpp vendor/clang/dist/test/CodeGenObjCXX/arc-mangle.mm vendor/clang/dist/test/Driver/fsanitize-coverage.c vendor/clang/dist/test/Integration/carbon.c vendor/clang/dist/test/Integration/cocoa-pch.m vendor/clang/dist/test/Integration/cocoa.m vendor/clang/dist/test/Misc/ast-print-objectivec.m vendor/clang/dist/test/Modules/diagnostics.modulemap vendor/clang/dist/test/Modules/lookup.m vendor/clang/dist/test/Modules/preprocess-module.cpp vendor/clang/dist/test/Sema/warn-strict-prototypes.m vendor/clang/dist/test/SemaCXX/coroutines.cpp vendor/clang/dist/test/SemaOpenCL/func.cl vendor/clang/dist/test/SemaTemplate/deduction-crash.cpp vendor/clang/dist/test/lit.cfg vendor/clang/dist/unittests/AST/DeclPrinterTest.cpp Modified: vendor/clang/dist/docs/Modules.rst ============================================================================== --- vendor/clang/dist/docs/Modules.rst Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/docs/Modules.rst Sat Jun 3 15:20:48 2017 (r319525) @@ -469,10 +469,17 @@ A header declaration specifies that a particular heade .. parsed-literal:: *header-declaration*: - ``private``:sub:`opt` ``textual``:sub:`opt` ``header`` *string-literal* - ``umbrella`` ``header`` *string-literal* - ``exclude`` ``header`` *string-literal* + ``private``:sub:`opt` ``textual``:sub:`opt` ``header`` *string-literal* *header-attrs*:sub:`opt` + ``umbrella`` ``header`` *string-literal* *header-attrs*:sub:`opt` + ``exclude`` ``header`` *string-literal* *header-attrs*:sub:`opt` + *header-attrs*: + '{' *header-attr** '}' + + *header-attr*: + ``size`` *integer-literal* + ``mtime`` *integer-literal* + A header declaration that does not contain ``exclude`` nor ``textual`` specifies a header that contributes to the enclosing module. Specifically, when the module is built, the named header will be parsed and its declarations will be (logically) placed into the enclosing submodule. A header with the ``umbrella`` specifier is called an umbrella header. An umbrella header includes all of the headers within its directory (and any subdirectories), and is typically used (in the ``#include`` world) to easily access the full API provided by a particular library. With modules, an umbrella header is a convenient shortcut that eliminates the need to write out ``header`` declarations for every library header. A given directory can only contain a single umbrella header. @@ -503,6 +510,18 @@ A header with the ``exclude`` specifier is excluded fr } A given header shall not be referenced by more than one *header-declaration*. + +Two *header-declaration*\s, or a *header-declaration* and a ``#include``, are +considered to refer to the same file if the paths resolve to the same file +and the specified *header-attr*\s (if any) match the attributes of that file, +even if the file is named differently (for instance, by a relative path or +via symlinks). + +.. note:: + The use of *header-attr*\s avoids the need for Clang to speculatively + ``stat`` every header referenced by a module map. It is recommended that + *header-attr*\s only be used in machine-generated module maps, to avoid + mismatches between attribute values and the corresponding files. Umbrella directory declaration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Modified: vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td Sat Jun 3 15:20:48 2017 (r319525) @@ -664,6 +664,12 @@ def warn_mmap_mismatched_top_level_private : Warning< InGroup; def note_mmap_rename_top_level_private_as_submodule : Note< "make '%0' a submodule of '%1' to ensure it can be found by name">; +def err_mmap_duplicate_header_attribute : Error< + "header attribute '%0' specified multiple times">; +def err_mmap_invalid_header_attribute_value : Error< + "expected integer literal as value for header attribute '%0'">; +def err_mmap_expected_header_attribute : Error< + "expected a header attribute name ('size' or 'mtime')">; def warn_auto_module_import : Warning< "treating #%select{include|import|include_next|__include_macros}0 as an " Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Sat Jun 3 15:20:48 2017 (r319525) @@ -4584,7 +4584,7 @@ def warn_missing_prototype : Warning< def note_declaration_not_a_prototype : Note< "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">; def warn_strict_prototypes : Warning< - "this %select{function declaration is not|" + "this %select{function declaration is not|block declaration is not|" "old-style function definition is not preceded by}0 a prototype">, InGroup>, DefaultIgnore; def warn_missing_variable_declarations : Warning< @@ -7268,7 +7268,7 @@ def err_invalid_conversion_between_vector_and_integer "invalid conversion between vector type %0 and integer type %1 " "of different size">; -def err_opencl_function_pointer_variable : Error< +def err_opencl_function_pointer : Error< "pointers to functions are not allowed">; def err_opencl_taking_function_address : Error< Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Sat Jun 3 15:20:48 2017 (r319525) @@ -174,10 +174,6 @@ def note_module_odr_violation_mismatch_decl_diff : Not "method %2 with %ordinal3 parameter of type %4%select{| decayed from %6}5|" "method %2 with %ordinal3 parameter named %4}1">; -def warn_module_uses_date_time : Warning< - "%select{precompiled header|module}0 uses __DATE__ or __TIME__">, - InGroup>; - def warn_duplicate_module_file_extension : Warning< "duplicate module file extension block name '%0'">, InGroup; @@ -186,7 +182,15 @@ def warn_module_system_bit_conflict : Warning< "module file '%0' was validated as a system module and is now being imported " "as a non-system module; any difference in diagnostic options will be ignored">, InGroup; +} // let CategoryName +let CategoryName = "AST Serialization Issue" in { +def warn_module_uses_date_time : Warning< + "%select{precompiled header|module}0 uses __DATE__ or __TIME__">, + InGroup>; +def err_module_no_size_mtime_for_header : Error< + "cannot emit module %0: %select{size|mtime}1 must be explicitly specified " + "for missing header file \"%2\"">; } // let CategoryName } // let Component Modified: vendor/clang/dist/include/clang/Basic/Module.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/Module.h Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/include/clang/Basic/Module.h Sat Jun 3 15:20:48 2017 (r319525) @@ -154,10 +154,18 @@ class Module { (public) /// \brief Stored information about a header directive that was found in the /// module map file but has not been resolved to a file. struct UnresolvedHeaderDirective { + HeaderKind Kind = HK_Normal; SourceLocation FileNameLoc; std::string FileName; - bool IsUmbrella; + bool IsUmbrella = false; + bool HasBuiltinHeader = false; + Optional Size; + Optional ModTime; }; + + /// Headers that are mentioned in the module map file but that we have not + /// yet attempted to resolve to a file on the file system. + SmallVector UnresolvedHeaders; /// \brief Headers that are mentioned in the module map file but could not be /// found on the file system. Modified: vendor/clang/dist/include/clang/Basic/Sanitizers.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/Sanitizers.h Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/include/clang/Basic/Sanitizers.h Sat Jun 3 15:20:48 2017 (r319525) @@ -61,8 +61,8 @@ struct SanitizerSet { Mask = Value ? (Mask | K) : (Mask & ~K); } - /// \brief Disable all sanitizers. - void clear() { Mask = 0; } + /// Disable the sanitizers specified in \p K. + void clear(SanitizerMask K = SanitizerKind::All) { Mask &= ~K; } /// \brief Returns true if at least one sanitizer is enabled. bool empty() const { return Mask == 0; } @@ -78,6 +78,12 @@ SanitizerMask parseSanitizerValue(StringRef Value, boo /// For each sanitizer group bit set in \p Kinds, set the bits for sanitizers /// this group enables. SanitizerMask expandSanitizerGroups(SanitizerMask Kinds); + +/// Return the sanitizers which do not affect preprocessing. +static inline SanitizerMask getPPTransparentSanitizers() { + return SanitizerKind::CFI | SanitizerKind::Integer | + SanitizerKind::Nullability | SanitizerKind::Undefined; +} } // end namespace clang Modified: vendor/clang/dist/include/clang/Driver/CC1Options.td ============================================================================== --- vendor/clang/dist/include/clang/Driver/CC1Options.td Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/include/clang/Driver/CC1Options.td Sat Jun 3 15:20:48 2017 (r319525) @@ -293,6 +293,9 @@ def fsanitize_coverage_trace_gep def fsanitize_coverage_8bit_counters : Flag<["-"], "fsanitize-coverage-8bit-counters">, HelpText<"Enable frequency counters in sanitizer coverage">; +def fsanitize_coverage_inline_8bit_counters + : Flag<["-"], "fsanitize-coverage-inline-8bit-counters">, + HelpText<"Enable inline 8-bit counters in sanitizer coverage">; def fsanitize_coverage_trace_pc : Flag<["-"], "fsanitize-coverage-trace-pc">, HelpText<"Enable PC tracing in sanitizer coverage">; Modified: vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def ============================================================================== --- vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def Sat Jun 3 15:20:48 2017 (r319525) @@ -163,6 +163,7 @@ CODEGENOPT(SanitizeCoverageTracePC, 1, 0) ///< Enable ///< in sanitizer coverage. CODEGENOPT(SanitizeCoverageTracePCGuard, 1, 0) ///< Enable PC tracing with guard ///< in sanitizer coverage. +CODEGENOPT(SanitizeCoverageInline8bitCounters, 1, 0) ///< Use inline 8bit counters. CODEGENOPT(SanitizeCoverageNoPrune, 1, 0) ///< Disable coverage pruning. CODEGENOPT(SanitizeStats , 1, 0) ///< Collect statistics for sanitizers. CODEGENOPT(SimplifyLibCalls , 1, 1) ///< Set when -fbuiltin is enabled. Modified: vendor/clang/dist/include/clang/Lex/ModuleMap.h ============================================================================== --- vendor/clang/dist/include/clang/Lex/ModuleMap.h Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/include/clang/Lex/ModuleMap.h Sat Jun 3 15:20:48 2017 (r319525) @@ -26,6 +26,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" +#include "llvm/ADT/TinyPtrVector.h" #include "llvm/ADT/Twine.h" #include #include @@ -116,6 +117,11 @@ class ModuleMap { (public) // Adjust ModuleMap::addHeader. }; + /// Convert a header kind to a role. Requires Kind to not be HK_Excluded. + static ModuleHeaderRole headerKindToRole(Module::HeaderKind Kind); + /// Convert a header role to a kind. + static Module::HeaderKind headerRoleToKind(ModuleHeaderRole Role); + /// \brief A header that is known to reside within a given module, /// whether it was included or excluded. class KnownHeader { @@ -165,7 +171,13 @@ class ModuleMap { (public) /// \brief Mapping from each header to the module that owns the contents of /// that header. HeadersMap Headers; - + + /// Map from file sizes to modules with lazy header directives of that size. + mutable llvm::DenseMap> LazyHeadersBySize; + /// Map from mtimes to modules with lazy header directives with those mtimes. + mutable llvm::DenseMap> + LazyHeadersByModTime; + /// \brief Mapping from directories with umbrella headers to the module /// that is generated from the umbrella header. /// @@ -257,22 +269,30 @@ class ModuleMap { (public) /// resolved. Module *resolveModuleId(const ModuleId &Id, Module *Mod, bool Complain) const; - /// Resolve the given header directive to an actual header file. + /// Add an unresolved header to a module. + void addUnresolvedHeader(Module *Mod, + Module::UnresolvedHeaderDirective Header); + + /// Look up the given header directive to find an actual header file. /// /// \param M The module in which we're resolving the header directive. /// \param Header The header directive to resolve. /// \param RelativePathName Filled in with the relative path name from the /// module to the resolved header. /// \return The resolved file, if any. - const FileEntry *resolveHeader(Module *M, - Module::UnresolvedHeaderDirective Header, - SmallVectorImpl &RelativePathName); + const FileEntry *findHeader(Module *M, + const Module::UnresolvedHeaderDirective &Header, + SmallVectorImpl &RelativePathName); + /// Resolve the given header directive. + void resolveHeader(Module *M, + const Module::UnresolvedHeaderDirective &Header); + /// Attempt to resolve the specified header directive as naming a builtin /// header. - const FileEntry * - resolveAsBuiltinHeader(Module *M, Module::UnresolvedHeaderDirective Header, - SmallVectorImpl &BuiltinPathName); + /// \return \c true if a corresponding builtin header was found. + bool resolveAsBuiltinHeader(Module *M, + const Module::UnresolvedHeaderDirective &Header); /// \brief Looks up the modules that \p File corresponds to. /// @@ -367,6 +387,15 @@ class ModuleMap { (public) /// Typically, \ref findModuleForHeader should be used instead, as it picks /// the preferred module for the header. ArrayRef findAllModulesForHeader(const FileEntry *File) const; + + /// Resolve all lazy header directives for the specified file. + /// + /// This ensures that the HeaderFileInfo on HeaderSearch is up to date. This + /// is effectively internal, but is exposed so HeaderSearch can call it. + void resolveHeaderDirectives(const FileEntry *File) const; + + /// Resolve all lazy header directives for the specified module. + void resolveHeaderDirectives(Module *Mod) const; /// \brief Reports errors if a module must not include a specific file. /// Modified: vendor/clang/dist/lib/ARCMigrate/TransRetainReleaseDealloc.cpp ============================================================================== --- vendor/clang/dist/lib/ARCMigrate/TransRetainReleaseDealloc.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/ARCMigrate/TransRetainReleaseDealloc.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -78,6 +78,7 @@ class RetainReleaseDeallocRemover : (public) } } // Pass through. + LLVM_FALLTHROUGH; case OMF_retain: case OMF_release: if (E->getReceiverKind() == ObjCMessageExpr::Instance) Modified: vendor/clang/dist/lib/ARCMigrate/TransformActions.cpp ============================================================================== --- vendor/clang/dist/lib/ARCMigrate/TransformActions.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/ARCMigrate/TransformActions.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -539,6 +539,7 @@ void TransformActionsImpl::addRemoval(CharSourceRange return; case Range_Contains: RI->End = newRange.End; + LLVM_FALLTHROUGH; case Range_ExtendsBegin: newRange.End = RI->End; Removals.erase(RI); Modified: vendor/clang/dist/lib/AST/ASTContext.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ASTContext.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/AST/ASTContext.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -6240,6 +6240,8 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T S += "{objc_class=}"; return; } + // TODO: Double check to make sure this intentially falls through. + LLVM_FALLTHROUGH; } case Type::ObjCInterface: { Modified: vendor/clang/dist/lib/AST/ASTDiagnostic.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ASTDiagnostic.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/AST/ASTDiagnostic.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -360,6 +360,7 @@ void clang::FormatASTNodeDiagnosticArgument( Modifier = StringRef(); Argument = StringRef(); // Fall through + LLVM_FALLTHROUGH; } case DiagnosticsEngine::ak_qualtype: { assert(Modifier.empty() && Argument.empty() && Modified: vendor/clang/dist/lib/AST/ASTStructuralEquivalence.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ASTStructuralEquivalence.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/AST/ASTStructuralEquivalence.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -424,6 +424,7 @@ static bool IsStructurallyEquivalent(StructuralEquival return false; // Fall through to check the bits common with FunctionNoProtoType. + LLVM_FALLTHROUGH; } case Type::FunctionNoProto: { Modified: vendor/clang/dist/lib/AST/DeclPrinter.cpp ============================================================================== --- vendor/clang/dist/lib/AST/DeclPrinter.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/AST/DeclPrinter.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -1189,7 +1189,9 @@ void DeclPrinter::VisitObjCMethodDecl(ObjCMethodDecl * for (const auto *PI : OMD->parameters()) { // FIXME: selector is missing here! pos = name.find_first_of(':', lastPos); - Out << " " << name.substr(lastPos, pos - lastPos) << ':'; + if (lastPos != 0) + Out << " "; + Out << name.substr(lastPos, pos - lastPos) << ':'; PrintObjCMethodType(OMD->getASTContext(), PI->getObjCDeclQualifier(), PI->getType()); @@ -1198,7 +1200,7 @@ void DeclPrinter::VisitObjCMethodDecl(ObjCMethodDecl * } if (OMD->param_begin() == OMD->param_end()) - Out << " " << name; + Out << name; if (OMD->isVariadic()) Out << ", ..."; Modified: vendor/clang/dist/lib/AST/Expr.cpp ============================================================================== --- vendor/clang/dist/lib/AST/Expr.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/AST/Expr.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -1576,6 +1576,7 @@ bool CastExpr::CastConsistency() const { getSubExpr()->getType()->isBlockPointerType()); assert(getType()->getPointeeType().getAddressSpace() != getSubExpr()->getType()->getPointeeType().getAddressSpace()); + LLVM_FALLTHROUGH; // These should not have an inheritance path. case CK_Dynamic: case CK_ToUnion: @@ -2102,6 +2103,7 @@ bool Expr::isUnusedResultAWarning(const Expr *&WarnE, } // Fallthrough for generic call handling. + LLVM_FALLTHROUGH; } case CallExprClass: case CXXMemberCallExprClass: Modified: vendor/clang/dist/lib/AST/ExprConstant.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ExprConstant.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/AST/ExprConstant.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -736,6 +736,7 @@ namespace { if (!HasFoldFailureDiagnostic) break; // We've already failed to fold something. Keep that diagnostic. + LLVM_FALLTHROUGH; case EM_ConstantExpression: case EM_PotentialConstantExpression: case EM_ConstantExpressionUnevaluated: @@ -10374,6 +10375,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContex } // OffsetOf falls through here. + LLVM_FALLTHROUGH; } case Expr::OffsetOfExprClass: { // Note that per C99, offsetof must be an ICE. And AFAIK, using @@ -10476,6 +10478,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContex return Worst(LHSResult, RHSResult); } } + LLVM_FALLTHROUGH; } case Expr::ImplicitCastExprClass: case Expr::CStyleCastExprClass: Modified: vendor/clang/dist/lib/AST/ItaniumMangle.cpp ============================================================================== --- vendor/clang/dist/lib/AST/ItaniumMangle.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/AST/ItaniumMangle.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -1459,8 +1459,6 @@ void CXXNameMangler::mangleNestedName(const NamedDecl // We do not consider restrict a distinguishing attribute for overloading // purposes so we must not mangle it. MethodQuals.removeRestrict(); - // __unaligned is not currently mangled in any way, so remove it. - MethodQuals.removeUnaligned(); mangleQualifiers(MethodQuals); mangleRefQualifier(Method->getRefQualifier()); } @@ -2140,7 +2138,8 @@ CXXNameMangler::mangleOperatorName(OverloadedOperatorK } void CXXNameMangler::mangleQualifiers(Qualifiers Quals) { - // Vendor qualifiers come first. + // Vendor qualifiers come first and if they are order-insensitive they must + // be emitted in reversed alphabetical order, see Itanium ABI 5.1.5. // Address space qualifiers start with an ordinary letter. if (Quals.hasAddressSpace()) { @@ -2176,17 +2175,28 @@ void CXXNameMangler::mangleQualifiers(Qualifiers Quals } // The ARC ownership qualifiers start with underscores. - switch (Quals.getObjCLifetime()) { // Objective-C ARC Extension: // // ::= U "__strong" // ::= U "__weak" // ::= U "__autoreleasing" + // + // Note: we emit __weak first to preserve the order as + // required by the Itanium ABI. + if (Quals.getObjCLifetime() == Qualifiers::OCL_Weak) + mangleVendorQualifier("__weak"); + + // __unaligned (from -fms-extensions) + if (Quals.hasUnaligned()) + mangleVendorQualifier("__unaligned"); + + // Remaining ARC ownership qualifiers. + switch (Quals.getObjCLifetime()) { case Qualifiers::OCL_None: break; case Qualifiers::OCL_Weak: - mangleVendorQualifier("__weak"); + // Do nothing as we already handled this case above. break; case Qualifiers::OCL_Strong: @@ -3775,6 +3785,7 @@ recurse: Out << "v1U" << Kind.size() << Kind; } // Fall through to mangle the cast itself. + LLVM_FALLTHROUGH; case Expr::CStyleCastExprClass: mangleCastExpression(E, "cv"); @@ -4327,7 +4338,7 @@ bool CXXNameMangler::mangleSubstitution(const NamedDec /// substitutions. static bool hasMangledSubstitutionQualifiers(QualType T) { Qualifiers Qs = T.getQualifiers(); - return Qs.getCVRQualifiers() || Qs.hasAddressSpace(); + return Qs.getCVRQualifiers() || Qs.hasAddressSpace() || Qs.hasUnaligned(); } bool CXXNameMangler::mangleSubstitution(QualType T) { Modified: vendor/clang/dist/lib/AST/NestedNameSpecifier.cpp ============================================================================== --- vendor/clang/dist/lib/AST/NestedNameSpecifier.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/AST/NestedNameSpecifier.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -290,6 +290,7 @@ NestedNameSpecifier::print(raw_ostream &OS, case TypeSpecWithTemplate: OS << "template "; // Fall through to print the type. + LLVM_FALLTHROUGH; case TypeSpec: { const Type *T = getAsType(); Modified: vendor/clang/dist/lib/Analysis/PrintfFormatString.cpp ============================================================================== --- vendor/clang/dist/lib/Analysis/PrintfFormatString.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Analysis/PrintfFormatString.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -441,6 +441,7 @@ ArgType PrintfSpecifier::getArgType(ASTContext &Ctx, case LengthModifier::AsShort: if (Ctx.getTargetInfo().getTriple().isOSMSVCRT()) return Ctx.IntTy; + LLVM_FALLTHROUGH; default: return ArgType::Invalid(); } Modified: vendor/clang/dist/lib/Analysis/PseudoConstantAnalysis.cpp ============================================================================== --- vendor/clang/dist/lib/Analysis/PseudoConstantAnalysis.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Analysis/PseudoConstantAnalysis.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -109,6 +109,7 @@ void PseudoConstantAnalysis::RunAnalysis() { // Do not visit the children continue; + LLVM_FALLTHROUGH; } case BO_AddAssign: case BO_SubAssign: Modified: vendor/clang/dist/lib/Analysis/ScanfFormatString.cpp ============================================================================== --- vendor/clang/dist/lib/Analysis/ScanfFormatString.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Analysis/ScanfFormatString.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -341,6 +341,7 @@ ArgType ScanfSpecifier::getArgType(ASTContext &Ctx) co case LengthModifier::AsShort: if (Ctx.getTargetInfo().getTriple().isOSMSVCRT()) return ArgType::PtrTo(ArgType::AnyCharTy); + LLVM_FALLTHROUGH; default: return ArgType::Invalid(); } @@ -357,6 +358,7 @@ ArgType ScanfSpecifier::getArgType(ASTContext &Ctx) co case LengthModifier::AsShort: if (Ctx.getTargetInfo().getTriple().isOSMSVCRT()) return ArgType::PtrTo(ArgType::AnyCharTy); + LLVM_FALLTHROUGH; default: return ArgType::Invalid(); } Modified: vendor/clang/dist/lib/Basic/IdentifierTable.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/IdentifierTable.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Basic/IdentifierTable.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -551,6 +551,7 @@ ObjCInstanceTypeFamily Selector::getInstTypeMethodFami case 's': if (startsWithWord(name, "shared")) return OIT_ReturnsSelf; if (startsWithWord(name, "standard")) return OIT_Singleton; + break; case 'i': if (startsWithWord(name, "init")) return OIT_Init; default: Modified: vendor/clang/dist/lib/Basic/LangOptions.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/LangOptions.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Basic/LangOptions.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -29,9 +29,7 @@ void LangOptions::resetNonModularOptions() { Name = Default; #include "clang/Basic/LangOptions.def" - // FIXME: This should not be reset; modules can be different with different - // sanitizer options (this affects __has_feature(address_sanitizer) etc). - Sanitize.clear(); + // These options do not affect AST generation. SanitizerBlacklistFiles.clear(); XRayAlwaysInstrumentFiles.clear(); XRayNeverInstrumentFiles.clear(); Modified: vendor/clang/dist/lib/Basic/Module.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/Module.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Basic/Module.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -394,11 +394,30 @@ void Module::print(raw_ostream &OS, unsigned Indent) c {"exclude ", HK_Excluded}}; for (auto &K : Kinds) { + assert(&K == &Kinds[K.Kind] && "kinds in wrong order"); for (auto &H : Headers[K.Kind]) { OS.indent(Indent + 2); OS << K.Prefix << "header \""; OS.write_escaped(H.NameAsWritten); - OS << "\"\n"; + OS << "\" { size " << H.Entry->getSize() + << " mtime " << H.Entry->getModificationTime() << " }\n"; + } + } + for (auto *Unresolved : {&UnresolvedHeaders, &MissingHeaders}) { + for (auto &U : *Unresolved) { + OS.indent(Indent + 2); + OS << Kinds[U.Kind].Prefix << "header \""; + OS.write_escaped(U.FileName); + OS << "\""; + if (U.Size || U.ModTime) { + OS << " {"; + if (U.Size) + OS << " size " << *U.Size; + if (U.ModTime) + OS << " mtime " << *U.ModTime; + OS << " }"; + } + OS << "\n"; } } Modified: vendor/clang/dist/lib/Basic/TargetInfo.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/TargetInfo.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Basic/TargetInfo.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -143,9 +143,11 @@ const char *TargetInfo::getTypeConstantSuffix(IntType case UnsignedChar: if (getCharWidth() < getIntWidth()) return ""; + LLVM_FALLTHROUGH; case UnsignedShort: if (getShortWidth() < getIntWidth()) return ""; + LLVM_FALLTHROUGH; case UnsignedInt: return "U"; case UnsignedLong: return "UL"; case UnsignedLongLong: return "ULL"; Modified: vendor/clang/dist/lib/CodeGen/BackendUtil.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/BackendUtil.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/CodeGen/BackendUtil.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -49,6 +49,7 @@ #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/IPO/AlwaysInliner.h" #include "llvm/Transforms/IPO/PassManagerBuilder.h" +#include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h" #include "llvm/Transforms/Instrumentation.h" #include "llvm/Transforms/ObjCARC.h" #include "llvm/Transforms/Scalar.h" @@ -186,6 +187,7 @@ static void addSanitizerCoveragePass(const PassManager Opts.TracePC = CGOpts.SanitizeCoverageTracePC; Opts.TracePCGuard = CGOpts.SanitizeCoverageTracePCGuard; Opts.NoPrune = CGOpts.SanitizeCoverageNoPrune; + Opts.Inline8bitCounters = CGOpts.SanitizeCoverageInline8bitCounters; PM.add(createSanitizerCoverageModulePass(Opts)); } @@ -897,6 +899,7 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManage // create that pass manager here and use it as needed below. legacy::PassManager CodeGenPasses; bool NeedCodeGen = false; + Optional ThinLinkOS; // Append any output we need to the pass manager. switch (Action) { @@ -904,9 +907,24 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManage break; case Backend_EmitBC: - MPM.addPass(BitcodeWriterPass(*OS, CodeGenOpts.EmitLLVMUseLists, - CodeGenOpts.EmitSummaryIndex, - CodeGenOpts.EmitSummaryIndex)); + if (CodeGenOpts.EmitSummaryIndex) { + if (!CodeGenOpts.ThinLinkBitcodeFile.empty()) { + std::error_code EC; + ThinLinkOS.emplace(CodeGenOpts.ThinLinkBitcodeFile, EC, + llvm::sys::fs::F_None); + if (EC) { + Diags.Report(diag::err_fe_unable_to_open_output) + << CodeGenOpts.ThinLinkBitcodeFile << EC.message(); + return; + } + } + MPM.addPass( + ThinLTOBitcodeWriterPass(*OS, ThinLinkOS ? &*ThinLinkOS : nullptr)); + } else { + MPM.addPass(BitcodeWriterPass(*OS, CodeGenOpts.EmitLLVMUseLists, + CodeGenOpts.EmitSummaryIndex, + CodeGenOpts.EmitSummaryIndex)); + } break; case Backend_EmitLL: @@ -1029,6 +1047,7 @@ static void runThinLTOBackend(ModuleSummaryIndex *Comb Conf.CGOptLevel = getCGOptLevel(CGOpts); initTargetOptions(Conf.Options, CGOpts, TOpts, LOpts, HeaderOpts); Conf.SampleProfile = std::move(SampleProfile); + Conf.UseNewPM = CGOpts.ExperimentalNewPassManager; switch (Action) { case Backend_EmitNothing: Conf.PreCodeGenModuleHook = [](size_t Task, const Module &Mod) { Modified: vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -2659,6 +2659,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const Function Builder.CreateCall(CGM.CreateRuntimeFunction(FTy, Name), llvm::ArrayRef(Args))); } + LLVM_FALLTHROUGH; } // OpenCL v2.0 s6.13.17.6 - Kernel query functions need bitcast of block // parameter. @@ -3813,6 +3814,7 @@ Value *CodeGenFunction::EmitCommonNeonBuiltinExpr( case NEON::BI__builtin_neon_vcalt_v: case NEON::BI__builtin_neon_vcaltq_v: std::swap(Ops[0], Ops[1]); + LLVM_FALLTHROUGH; case NEON::BI__builtin_neon_vcage_v: case NEON::BI__builtin_neon_vcageq_v: case NEON::BI__builtin_neon_vcagt_v: @@ -5056,6 +5058,7 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned Bu case NEON::BI__builtin_neon_vsri_n_v: case NEON::BI__builtin_neon_vsriq_n_v: rightShift = true; + LLVM_FALLTHROUGH; case NEON::BI__builtin_neon_vsli_n_v: case NEON::BI__builtin_neon_vsliq_n_v: Ops[2] = EmitNeonShiftVector(Ops[2], Ty, rightShift); Modified: vendor/clang/dist/lib/CodeGen/CGCall.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGCall.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/CodeGen/CGCall.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -4259,6 +4259,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo Builder.CreateStore(elt, eltAddr); } // FALLTHROUGH + LLVM_FALLTHROUGH; } case ABIArgInfo::InAlloca: Modified: vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/CodeGen/CGCoroutine.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -625,6 +625,7 @@ RValue CodeGenFunction::EmitCoroutineIntrinsic(const C CGM.Error(E->getLocStart(), "this builtin expect that __builtin_coro_id has" " been used earlier in this function"); // Fallthrough to the next case to add TokenNone as the first argument. + LLVM_FALLTHROUGH; } // @llvm.coro.suspend takes a token parameter. Add token 'none' as the first // argument. Modified: vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -2781,6 +2781,7 @@ llvm::DICompositeType *CGDebugInfo::CreateLimitedType( // them distinct if they are ODR-uniqued. if (FullName.empty()) break; + LLVM_FALLTHROUGH; case llvm::dwarf::DW_TAG_structure_type: case llvm::dwarf::DW_TAG_union_type: @@ -3263,7 +3264,7 @@ void CGDebugInfo::EmitInlineFunctionStart(CGBuilderTy void CGDebugInfo::EmitInlineFunctionEnd(CGBuilderTy &Builder) { assert(CurInlinedAt && "unbalanced inline scope stack"); - EmitFunctionEnd(Builder); + EmitFunctionEnd(Builder, nullptr); setInlinedAt(llvm::DebugLoc(CurInlinedAt).getInlinedAt()); } @@ -3332,7 +3333,7 @@ void CGDebugInfo::EmitLexicalBlockEnd(CGBuilderTy &Bui LexicalBlockStack.pop_back(); } -void CGDebugInfo::EmitFunctionEnd(CGBuilderTy &Builder) { +void CGDebugInfo::EmitFunctionEnd(CGBuilderTy &Builder, llvm::Function *Fn) { assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!"); unsigned RCount = FnBeginRegionCount.back(); assert(RCount <= LexicalBlockStack.size() && "Region stack mismatch"); @@ -3344,6 +3345,9 @@ void CGDebugInfo::EmitFunctionEnd(CGBuilderTy &Builder LexicalBlockStack.pop_back(); } FnBeginRegionCount.pop_back(); + + if (Fn && Fn->getSubprogram()) + DBuilder.finalizeSubprogram(Fn->getSubprogram()); } llvm::DIType *CGDebugInfo::EmitTypeForVarWithBlocksAttr(const VarDecl *VD, Modified: vendor/clang/dist/lib/CodeGen/CGDebugInfo.h ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGDebugInfo.h Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/CodeGen/CGDebugInfo.h Sat Jun 3 15:20:48 2017 (r319525) @@ -367,7 +367,7 @@ class CGDebugInfo { (public) void EmitFunctionDecl(GlobalDecl GD, SourceLocation Loc, QualType FnType); /// Constructs the debug code for exiting a function. - void EmitFunctionEnd(CGBuilderTy &Builder); + void EmitFunctionEnd(CGBuilderTy &Builder, llvm::Function *Fn); /// Emit metadata to indicate the beginning of a new lexical block /// and push the block onto the stack. Modified: vendor/clang/dist/lib/CodeGen/CGExpr.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGExpr.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/CodeGen/CGExpr.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -1487,9 +1487,9 @@ void CodeGenFunction::EmitStoreOfScalar(llvm::Value *V // Handle vectors differently to get better performance. if (Ty->isVectorType()) { llvm::Type *SrcTy = Value->getType(); - auto *VecTy = cast(SrcTy); + auto *VecTy = dyn_cast(SrcTy); // Handle vec3 special. - if (VecTy->getNumElements() == 3) { + if (VecTy && VecTy->getNumElements() == 3) { // Our source is a vec3, do a shuffle vector to make it a vec4. llvm::Constant *Mask[] = {Builder.getInt32(0), Builder.getInt32(1), Builder.getInt32(2), Modified: vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -3887,7 +3887,7 @@ Value *CodeGenFunction::EmitCheckedInBoundsGEP(Value * /// Return the result of the given binary operation. auto eval = [&](BinaryOperator::Opcode Opcode, llvm::Value *LHS, llvm::Value *RHS) -> llvm::Value * { - assert(Opcode == BO_Add || Opcode == BO_Mul && "Can't eval binop"); + assert((Opcode == BO_Add || Opcode == BO_Mul) && "Can't eval binop"); // If the operands are constants, return a constant result. if (auto *LHSCI = dyn_cast(LHS)) { Modified: vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -348,7 +348,7 @@ void CodeGenFunction::FinishFunction(SourceLocation En // Emit debug descriptor for function end. if (CGDebugInfo *DI = getDebugInfo()) - DI->EmitFunctionEnd(Builder); + DI->EmitFunctionEnd(Builder, CurFn); // Reset the debug location to that of the simple 'return' expression, if any // rather than that of the end of the function's scope '}'. Modified: vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -3841,6 +3841,7 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { // Skip variable templates if (cast(D)->getDescribedVarTemplate()) return; + LLVM_FALLTHROUGH; case Decl::VarTemplateSpecialization: EmitGlobal(cast(D)); if (auto *DD = dyn_cast(D)) Modified: vendor/clang/dist/lib/Driver/SanitizerArgs.cpp ============================================================================== --- vendor/clang/dist/lib/Driver/SanitizerArgs.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Driver/SanitizerArgs.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -48,13 +48,14 @@ enum CoverageFeature { CoverageBB = 1 << 1, CoverageEdge = 1 << 2, CoverageIndirCall = 1 << 3, - CoverageTraceBB = 1 << 4, + CoverageTraceBB = 1 << 4, // Deprecated. CoverageTraceCmp = 1 << 5, CoverageTraceDiv = 1 << 6, CoverageTraceGep = 1 << 7, - Coverage8bitCounters = 1 << 8, + Coverage8bitCounters = 1 << 8, // Deprecated. CoverageTracePC = 1 << 9, CoverageTracePCGuard = 1 << 10, + CoverageInline8bitCounters = 1 << 12, CoverageNoPrune = 1 << 11, }; @@ -530,7 +531,8 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC, } // trace-pc w/o func/bb/edge implies edge. - if ((CoverageFeatures & (CoverageTracePC | CoverageTracePCGuard)) && + if ((CoverageFeatures & + (CoverageTracePC | CoverageTracePCGuard | CoverageInline8bitCounters)) && !(CoverageFeatures & InsertionPointTypes)) CoverageFeatures |= CoverageEdge; @@ -637,6 +639,7 @@ void SanitizerArgs::addArgs(const ToolChain &TC, const std::make_pair(Coverage8bitCounters, "-fsanitize-coverage-8bit-counters"), std::make_pair(CoverageTracePC, "-fsanitize-coverage-trace-pc"), std::make_pair(CoverageTracePCGuard, "-fsanitize-coverage-trace-pc-guard"), + std::make_pair(CoverageInline8bitCounters, "-fsanitize-coverage-inline-8bit-counters"), std::make_pair(CoverageNoPrune, "-fsanitize-coverage-no-prune")}; for (auto F : CoverageFlags) { if (CoverageFeatures & F.first) @@ -798,6 +801,7 @@ int parseCoverageFeatures(const Driver &D, const llvm: .Case("trace-pc", CoverageTracePC) .Case("trace-pc-guard", CoverageTracePCGuard) .Case("no-prune", CoverageNoPrune) + .Case("inline-8bit-counters", CoverageInline8bitCounters) .Default(0); if (F == 0) D.Diag(clang::diag::err_drv_unsupported_option_argument) Modified: vendor/clang/dist/lib/Edit/RewriteObjCFoundationAPI.cpp ============================================================================== --- vendor/clang/dist/lib/Edit/RewriteObjCFoundationAPI.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Edit/RewriteObjCFoundationAPI.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -798,24 +798,28 @@ static bool rewriteToNumberLiteral(const ObjCMessageEx case NSAPI::NSNumberWithUnsignedInt: case NSAPI::NSNumberWithUnsignedInteger: CallIsUnsigned = true; + LLVM_FALLTHROUGH; case NSAPI::NSNumberWithInt: case NSAPI::NSNumberWithInteger: break; case NSAPI::NSNumberWithUnsignedLong: CallIsUnsigned = true; + LLVM_FALLTHROUGH; case NSAPI::NSNumberWithLong: CallIsLong = true; break; case NSAPI::NSNumberWithUnsignedLongLong: CallIsUnsigned = true; + LLVM_FALLTHROUGH; case NSAPI::NSNumberWithLongLong: CallIsLongLong = true; break; case NSAPI::NSNumberWithDouble: CallIsDouble = true; + LLVM_FALLTHROUGH; case NSAPI::NSNumberWithFloat: CallIsFloating = true; break; Modified: vendor/clang/dist/lib/Frontend/CompilerInstance.cpp ============================================================================== --- vendor/clang/dist/lib/Frontend/CompilerInstance.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Frontend/CompilerInstance.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -1727,6 +1727,7 @@ CompilerInstance::loadModule(SourceLocation ImportLoc, diag::warn_module_config_mismatch) << ModuleFileName; // Fall through to error out. + LLVM_FALLTHROUGH; case ASTReader::VersionMismatch: case ASTReader::HadErrors: ModuleLoader::HadFatalFailure = true; Modified: vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp ============================================================================== --- vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -768,6 +768,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, Arg Opts.SanitizeCoverageTracePCGuard = Args.hasArg(OPT_fsanitize_coverage_trace_pc_guard); Opts.SanitizeCoverageNoPrune = Args.hasArg(OPT_fsanitize_coverage_no_prune); + Opts.SanitizeCoverageInline8bitCounters = + Args.hasArg(OPT_fsanitize_coverage_inline_8bit_counters); Opts.SanitizeMemoryTrackOrigins = getLastArgIntValue(Args, OPT_fsanitize_memory_track_origins_EQ, 0, Diags); Opts.SanitizeMemoryUseAfterDtor = @@ -2699,6 +2701,13 @@ std::string CompilerInvocation::getModuleHash() const for (const auto &ext : frontendOpts.ModuleFileExtensions) { code = ext->hashExtension(code); } + + // Extend the signature with the enabled sanitizers, if at least one is + // enabled. Sanitizers which cannot affect AST generation aren't hashed. + SanitizerSet SanHash = LangOpts->Sanitize; + SanHash.clear(getPPTransparentSanitizers()); + if (!SanHash.empty()) + code = hash_combine(code, SanHash.Mask); return llvm::APInt(64, code).toString(36, /*Signed=*/false); } Modified: vendor/clang/dist/lib/Frontend/FrontendAction.cpp ============================================================================== --- vendor/clang/dist/lib/Frontend/FrontendAction.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Frontend/FrontendAction.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -289,14 +289,28 @@ static void addHeaderInclude(StringRef HeaderName, /// /// \param Includes Will be augmented with the set of \#includes or \#imports /// needed to load all of the named headers. -static std::error_code -collectModuleHeaderIncludes(const LangOptions &LangOpts, FileManager &FileMgr, - ModuleMap &ModMap, clang::Module *Module, - SmallVectorImpl &Includes) { +static std::error_code collectModuleHeaderIncludes( + const LangOptions &LangOpts, FileManager &FileMgr, DiagnosticsEngine &Diag, + ModuleMap &ModMap, clang::Module *Module, SmallVectorImpl &Includes) { // Don't collect any headers for unavailable modules. if (!Module->isAvailable()) return std::error_code(); + // Resolve all lazy header directives to header files. + ModMap.resolveHeaderDirectives(Module); + + // If any headers are missing, we can't build this module. In most cases, + // diagnostics for this should have already been produced; we only get here + // if explicit stat information was provided. + // FIXME: If the name resolves to a file with different stat information, + // produce a better diagnostic. + if (!Module->MissingHeaders.empty()) { + auto &MissingHeader = Module->MissingHeaders.front(); + Diag.Report(MissingHeader.FileNameLoc, diag::err_module_header_missing) + << MissingHeader.IsUmbrella << MissingHeader.FileName; + return std::error_code(); + } + // Add includes for each of these headers. for (auto HK : {Module::HK_Normal, Module::HK_Private}) { for (Module::Header &H : Module->Headers[HK]) { @@ -367,7 +381,7 @@ collectModuleHeaderIncludes(const LangOptions &LangOpt SubEnd = Module->submodule_end(); Sub != SubEnd; ++Sub) if (std::error_code Err = collectModuleHeaderIncludes( - LangOpts, FileMgr, ModMap, *Sub, Includes)) + LangOpts, FileMgr, Diag, ModMap, *Sub, Includes)) return Err; return std::error_code(); @@ -494,7 +508,7 @@ getInputBufferForModule(CompilerInstance &CI, Module * addHeaderInclude(UmbrellaHeader.NameAsWritten, HeaderContents, CI.getLangOpts(), M->IsExternC); Err = collectModuleHeaderIncludes( - CI.getLangOpts(), FileMgr, + CI.getLangOpts(), FileMgr, CI.getDiagnostics(), CI.getPreprocessor().getHeaderSearchInfo().getModuleMap(), M, HeaderContents); Modified: vendor/clang/dist/lib/Frontend/FrontendActions.cpp ============================================================================== --- vendor/clang/dist/lib/Frontend/FrontendActions.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Frontend/FrontendActions.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -546,8 +546,11 @@ void PrintPreprocessedAction::ExecuteAction() { // module itself before switching to the input buffer. auto &Input = getCurrentInput(); if (Input.getKind().getFormat() == InputKind::ModuleMap) { - if (Input.isFile()) - (*OS) << "# 1 \"" << Input.getFile() << "\"\n"; + if (Input.isFile()) { + (*OS) << "# 1 \""; + OS->write_escaped(Input.getFile()); + (*OS) << "\"\n"; + } // FIXME: Include additional information here so that we don't need the // original source files to exist on disk. getCurrentModule()->print(*OS); Modified: vendor/clang/dist/lib/Frontend/InitHeaderSearch.cpp ============================================================================== --- vendor/clang/dist/lib/Frontend/InitHeaderSearch.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Frontend/InitHeaderSearch.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -221,6 +221,7 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const l case llvm::Triple::Win32: if (triple.getEnvironment() != llvm::Triple::Cygnus) break; + LLVM_FALLTHROUGH; default: // FIXME: temporary hack: hard-coded paths. AddPath("/usr/local/include", System, false); @@ -343,6 +344,7 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const l AddPath(BaseSDKPath + "/target/include", System, false); if (triple.isPS4CPU()) AddPath(BaseSDKPath + "/target/include_common", System, false); + LLVM_FALLTHROUGH; } default: AddPath("/usr/include", ExternCSystem, false); Modified: vendor/clang/dist/lib/Frontend/Rewrite/FrontendActions.cpp ============================================================================== --- vendor/clang/dist/lib/Frontend/Rewrite/FrontendActions.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Frontend/Rewrite/FrontendActions.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -200,8 +200,11 @@ void RewriteIncludesAction::ExecuteAction() { // module itself before switching to the input buffer. auto &Input = getCurrentInput(); if (Input.getKind().getFormat() == InputKind::ModuleMap) { - if (Input.isFile()) - (*OS) << "# 1 \"" << Input.getFile() << "\"\n"; + if (Input.isFile()) { + (*OS) << "# 1 \""; + OS->write_escaped(Input.getFile()); + (*OS) << "\"\n"; + } // FIXME: Include additional information here so that we don't need the // original source files to exist on disk. getCurrentModule()->print(*OS); Modified: vendor/clang/dist/lib/Frontend/Rewrite/InclusionRewriter.cpp ============================================================================== --- vendor/clang/dist/lib/Frontend/Rewrite/InclusionRewriter.cpp Sat Jun 3 15:20:41 2017 (r319524) +++ vendor/clang/dist/lib/Frontend/Rewrite/InclusionRewriter.cpp Sat Jun 3 15:20:48 2017 (r319525) @@ -177,7 +177,9 @@ void InclusionRewriter::FileSkipped(const FileEntry &/ /// directives. It does not say whether the file has been included, but it /// provides more information about the directive (hash location instead /// of location inside the included file). It is assumed that the matching -/// FileChanged() or FileSkipped() is called after this. +/// FileChanged() or FileSkipped() is called after this (or neither is +/// called if this #include results in an error or does not textually include +/// anything). void InclusionRewriter::InclusionDirective(SourceLocation HashLoc, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Sat Jun 3 15:20:59 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 348FEBF38F7; Sat, 3 Jun 2017 15:20:59 +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 D9EBB73411; Sat, 3 Jun 2017 15:20:58 +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 v53FKv4b082753; Sat, 3 Jun 2017 15:20:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FKvAM082752; Sat, 3 Jun 2017 15:20:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706031520.v53FKvAM082752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Jun 2017 15:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319526 - vendor/clang/clang-trunk-r304659 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:20:59 -0000 Author: dim Date: Sat Jun 3 15:20:57 2017 New Revision: 319526 URL: https://svnweb.freebsd.org/changeset/base/319526 Log: Tag clang trunk r304659. Added: vendor/clang/clang-trunk-r304659/ - copied from r319525, vendor/clang/dist/ From owner-svn-src-vendor@freebsd.org Sat Jun 3 15:21:12 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 E053DBF39B7; Sat, 3 Jun 2017 15:21:12 +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 B2B23735A5; Sat, 3 Jun 2017 15:21:12 +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 v53FLBGf082935; Sat, 3 Jun 2017 15:21:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FLBUL082928; Sat, 3 Jun 2017 15:21:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706031521.v53FLBUL082928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Jun 2017 15:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319529 - in vendor/libc++/dist: include test/libcxx/containers/unord test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion test/std/exp... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:21:13 -0000 Author: dim Date: Sat Jun 3 15:21:10 2017 New Revision: 319529 URL: https://svnweb.freebsd.org/changeset/base/319529 Log: Vendor import of libc++ trunk r304659: https://llvm.org/svn/llvm-project/libcxx/trunk@304659 Added: vendor/libc++/dist/test/libcxx/containers/unord/next_pow2.pass.cpp (contents, props changed) Modified: vendor/libc++/dist/include/__hash_table vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/generator.pass.cpp vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp Modified: vendor/libc++/dist/include/__hash_table ============================================================================== --- vendor/libc++/dist/include/__hash_table Sat Jun 3 15:21:07 2017 (r319528) +++ vendor/libc++/dist/include/__hash_table Sat Jun 3 15:21:10 2017 (r319529) @@ -137,7 +137,7 @@ inline _LIBCPP_INLINE_VISIBILITY size_t __next_hash_pow2(size_t __n) { - return size_t(1) << (std::numeric_limits::digits - __clz(__n-1)); + return __n < 2 ? __n : (size_t(1) << (std::numeric_limits::digits - __clz(__n-1))); } Added: vendor/libc++/dist/test/libcxx/containers/unord/next_pow2.pass.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/libcxx/containers/unord/next_pow2.pass.cpp Sat Jun 3 15:21:10 2017 (r319529) @@ -0,0 +1,88 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// REQUIRES: long_tests +// UNSUPPORTED: c++98, c++03 + +// Not a portable test + +// <__hash_table> + +// size_t __next_hash_pow2(size_t n); + +// If n <= 1, return n. If n is a power of 2, return n. +// Otherwise, return the next power of 2. + +#include <__hash_table> +#include +#include + +#include + +bool +is_power_of_two(unsigned long n) +{ + return __builtin_popcount(n) == 1; +} + +void test_next_pow2_val(size_t n) +{ + std::size_t npow2 = std::__next_hash_pow2(n); + assert(is_power_of_two(npow2) && npow2 > n); +} + +void +test_next_pow2() +{ + assert(!is_power_of_two(0)); + assert(is_power_of_two(1)); + assert(is_power_of_two(2)); + assert(!is_power_of_two(3)); + + assert(std::__next_hash_pow2(0) == 0); + assert(std::__next_hash_pow2(1) == 1); + + for (std::size_t n = 2; n < (sizeof(std::size_t) * 8 - 1); ++n) + { + std::size_t pow2 = 1ULL << n; + assert(std::__next_hash_pow2(pow2) == pow2); + } + + test_next_pow2_val(3); + test_next_pow2_val(7); + test_next_pow2_val(9); + test_next_pow2_val(15); + test_next_pow2_val(127); + test_next_pow2_val(129); +} + +// Note: this is only really useful when run with -fsanitize=undefined. +void +fuzz_unordered_map_reserve(unsigned num_inserts, + unsigned num_reserve1, + unsigned num_reserve2) +{ + std::unordered_map m; + m.reserve(num_reserve1); + for (unsigned I = 0; I < num_inserts; ++I) m[I] = 0; + m.reserve(num_reserve2); + assert(m.bucket_count() >= num_reserve2); +} + +int main() +{ + test_next_pow2(); + + for (unsigned num_inserts = 0; num_inserts <= 64; ++num_inserts) + for (unsigned num_reserve1 = 1; num_reserve1 <= 64; ++num_reserve1) + for (unsigned num_reserve2 = 1; num_reserve2 <= 64; ++num_reserve2) + fuzz_unordered_map_reserve(num_inserts, num_reserve1, num_reserve2); + + return 0; +} Modified: vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp Sat Jun 3 15:21:07 2017 (r319528) +++ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp Sat Jun 3 15:21:10 2017 (r319529) @@ -33,7 +33,7 @@ void do_test(coro::coroutine_handle const& H) // FIXME Add a runtime test { ASSERT_SAME_TYPE(decltype(H.done()), bool); - ASSERT_NOT_NOEXCEPT(H.done()); + LIBCPP_ASSERT_NOT_NOEXCEPT(H.done()); } } Modified: vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp Sat Jun 3 15:21:07 2017 (r319528) +++ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp Sat Jun 3 15:21:10 2017 (r319529) @@ -23,7 +23,7 @@ struct coro_t { } suspend_never initial_suspend() { return {}; } suspend_never final_suspend() { return {}; } - void return_void(){} + void return_void() {} static void unhandled_exception() {} }; }; @@ -37,7 +37,7 @@ struct B { struct A { - ~A(){} + ~A() {} bool await_ready() { return true; } int await_resume() { return 42; } template void await_suspend(F) {} Modified: vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp Sat Jun 3 15:21:07 2017 (r319528) +++ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp Sat Jun 3 15:21:10 2017 (r319529) @@ -10,6 +10,9 @@ // UNSUPPORTED: c++98, c++03, c++11 +// See https://bugs.llvm.org/show_bug.cgi?id=33271 +// UNSUPPORTED: ubsan + #include #include @@ -22,7 +25,7 @@ struct coro_t { } suspend_never initial_suspend() { return {}; } suspend_never final_suspend() { return {}; } - void return_void(){} + void return_void() {} void unhandled_exception() {} }; coro_t(coroutine_handle hh) : h(hh) {} Modified: vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/generator.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/generator.pass.cpp Sat Jun 3 15:21:07 2017 (r319528) +++ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/generator.pass.cpp Sat Jun 3 15:21:10 2017 (r319529) @@ -10,6 +10,9 @@ // UNSUPPORTED: c++98, c++03, c++11 +// See https://bugs.llvm.org/show_bug.cgi?id=33271 +// UNSUPPORTED: ubsan + #include #include #include Modified: vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp Sat Jun 3 15:21:07 2017 (r319528) +++ vendor/libc++/dist/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp Sat Jun 3 15:21:10 2017 (r319529) @@ -68,10 +68,10 @@ template struct func { (private) std::vector yielded_values = {}; int yield(int x) { yielded_values.push_back(x); return x + 1; } -float fyield(int x) { yielded_values.push_back(x); return x + 2; } +float fyield(int x) { yielded_values.push_back(x); return static_cast(x + 2); } void Do1(func f) { yield(f()); } -void Do2(func f) { yield(f()); } +void Do2(func f) { yield(static_cast(f())); } int main() { Do1([] { return yield(43); }); From owner-svn-src-vendor@freebsd.org Sat Jun 3 15:21:04 2017 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C5B8BF3939; Sat, 3 Jun 2017 15:21:04 +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 E44A87348F; Sat, 3 Jun 2017 15:21:03 +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 v53FL2tq082833; Sat, 3 Jun 2017 15:21:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FL0qc082806; Sat, 3 Jun 2017 15:21:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706031521.v53FL0qc082806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Jun 2017 15:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319527 - in vendor/compiler-rt/dist: include/sanitizer lib/asan lib/lsan lib/sanitizer_common lib/sanitizer_common/scripts lib/sanitizer_common/tests lib/ubsan test/asan/TestCases/Andr... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:21:04 -0000 Author: dim Date: Sat Jun 3 15:21:00 2017 New Revision: 319527 URL: https://svnweb.freebsd.org/changeset/base/319527 Log: Vendor import of compiler-rt trunk r304659: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304659 Added: vendor/compiler-rt/dist/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc (contents, props changed) vendor/compiler-rt/dist/test/ubsan/TestCases/Pointer/ vendor/compiler-rt/dist/test/ubsan/TestCases/Pointer/index-overflow.cpp (contents, props changed) Deleted: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_mapping_libcdep.cc vendor/compiler-rt/dist/test/asan/TestCases/Android/coverage-android.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-maybe-open-file.cc Modified: vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h vendor/compiler-rt/dist/lib/asan/asan_activation.cc vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc vendor/compiler-rt/dist/lib/asan/asan_thread.cc vendor/compiler-rt/dist/lib/lsan/lsan_common.cc vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc vendor/compiler-rt/dist/lib/sanitizer_common/CMakeLists.txt vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_interface.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc vendor/compiler-rt/dist/lib/sanitizer_common/scripts/check_lint.sh vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_flags_test.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_checks.inc vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.h vendor/compiler-rt/dist/lib/ubsan/ubsan_interface.inc vendor/compiler-rt/dist/test/asan/TestCases/Linux/uar_signals.cc Modified: vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/include/sanitizer/coverage_interface.h Sat Jun 3 15:21:00 2017 (r319527) @@ -19,8 +19,6 @@ extern "C" { #endif - // Initialize coverage. - void __sanitizer_cov_init(); // Record and dump coverage info. void __sanitizer_cov_dump(); @@ -28,10 +26,6 @@ extern "C" { // .sancov files. void __sanitizer_dump_coverage(const uintptr_t *pcs, uintptr_t len); - // Open .sancov.packed in the coverage directory and return the file - // descriptor. Returns -1 on failure, or if coverage dumping is disabled. - // This is intended for use by sandboxing code. - intptr_t __sanitizer_maybe_open_cov_file(const char *name); #ifdef __cplusplus } // extern "C" #endif Modified: vendor/compiler-rt/dist/lib/asan/asan_activation.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_activation.cc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/asan/asan_activation.cc Sat Jun 3 15:21:00 2017 (r319527) @@ -106,7 +106,6 @@ void AsanDeactivate() { // Deactivate the runtime. SetCanPoisonMemory(false); SetMallocContextSize(1); - ReInitializeCoverage(false, nullptr); AllocatorOptions disabled = asan_deactivated_flags.allocator_options; disabled.quarantine_size_mb = 0; @@ -130,8 +129,6 @@ void AsanActivate() { SetCanPoisonMemory(asan_deactivated_flags.poison_heap); SetMallocContextSize(asan_deactivated_flags.malloc_context_size); - ReInitializeCoverage(asan_deactivated_flags.coverage, - asan_deactivated_flags.coverage_dir); ReInitializeAllocator(asan_deactivated_flags.allocator_options); asan_is_deactivated = false; Modified: vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc Sat Jun 3 15:21:00 2017 (r319527) @@ -242,9 +242,8 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free, void *) CheckNoDeepBind(filename, flag); \ } while (false) #define COMMON_INTERCEPTOR_ON_EXIT(ctx) OnExit() -#define COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, handle) \ - CoverageUpdateMapping() -#define COMMON_INTERCEPTOR_LIBRARY_UNLOADED() CoverageUpdateMapping() +#define COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, handle) +#define COMMON_INTERCEPTOR_LIBRARY_UNLOADED() #define COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED (!asan_inited) #define COMMON_INTERCEPTOR_GET_TLS_RANGE(begin, end) \ if (AsanThread *t = GetCurrentThread()) { \ @@ -723,9 +722,7 @@ static void AfterFork() { INTERCEPTOR(int, fork, void) { ENSURE_ASAN_INITED(); BeforeFork(); - if (common_flags()->coverage) CovBeforeFork(); int pid = REAL(fork)(); - if (common_flags()->coverage) CovAfterFork(pid); AfterFork(); return pid; } Modified: vendor/compiler-rt/dist/lib/asan/asan_thread.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_thread.cc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/asan/asan_thread.cc Sat Jun 3 15:21:00 2017 (r319527) @@ -166,16 +166,19 @@ void AsanThread::FinishSwitchFiber(FakeStack *fake_sta } inline AsanThread::StackBounds AsanThread::GetStackBounds() const { - if (!atomic_load(&stack_switching_, memory_order_acquire)) - return StackBounds{stack_bottom_, stack_top_}; // NOLINT + if (!atomic_load(&stack_switching_, memory_order_acquire)) { + // Make sure the stack bounds are fully initialized. + if (stack_bottom_ >= stack_top_) return {0, 0}; + return {stack_bottom_, stack_top_}; + } char local; const uptr cur_stack = (uptr)&local; // Note: need to check next stack first, because FinishSwitchFiber // may be in process of overwriting stack_top_/bottom_. But in such case // we are already on the next stack. if (cur_stack >= next_stack_bottom_ && cur_stack < next_stack_top_) - return StackBounds{next_stack_bottom_, next_stack_top_}; // NOLINT - return StackBounds{stack_bottom_, stack_top_}; // NOLINT + return {next_stack_bottom_, next_stack_top_}; + return {stack_bottom_, stack_top_}; } uptr AsanThread::stack_top() { @@ -197,6 +200,7 @@ FakeStack *AsanThread::AsyncSignalSafeLazyInitFakeStac uptr stack_size = this->stack_size(); if (stack_size == 0) // stack_size is not yet available, don't use FakeStack. return nullptr; + CHECK_LE(stack_size, 0x10000000); uptr old_val = 0; // fake_stack_ has 3 states: // 0 -- not initialized Modified: vendor/compiler-rt/dist/lib/lsan/lsan_common.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_common.cc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/lsan/lsan_common.cc Sat Jun 3 15:21:00 2017 (r319527) @@ -408,6 +408,9 @@ static void MarkInvalidPCCb(uptr chunk, void *arg) { // On Linux, handles dynamically allocated TLS blocks by treating all chunks // allocated from ld-linux.so as reachable. +// On Linux, treats all chunks allocated from ld-linux.so as reachable, which +// covers dynamically allocated TLS blocks, internal dynamic loader's loaded +// modules accounting etc. // Dynamic TLS blocks contain the TLS variables of dynamically loaded modules. // They are allocated with a __libc_memalign() call in allocate_and_init() // (elf/dl-tls.c). Glibc won't tell us the address ranges occupied by those Modified: vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc ============================================================================== --- vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc Sat Jun 3 15:21:00 2017 (r319527) @@ -23,6 +23,10 @@ #include "sanitizer_common/sanitizer_linux.h" #include "sanitizer_common/sanitizer_stackdepot.h" +#if SANITIZER_USE_GETAUXVAL +#include +#endif // SANITIZER_USE_GETAUXVAL + namespace __lsan { static const char kLinkerName[] = "ld"; @@ -30,8 +34,12 @@ static const char kLinkerName[] = "ld"; static char linker_placeholder[sizeof(LoadedModule)] ALIGNED(64); static LoadedModule *linker = nullptr; -static bool IsLinker(const char* full_name) { - return LibraryNameIs(full_name, kLinkerName); +static bool IsLinker(const LoadedModule& module) { +#if SANITIZER_USE_GETAUXVAL + return module.base_address() == getauxval(AT_BASE); +#else + return LibraryNameIs(module.full_name(), kLinkerName); +#endif // SANITIZER_USE_GETAUXVAL } __attribute__((tls_model("initial-exec"))) @@ -49,22 +57,25 @@ void InitializePlatformSpecificModules() { ListOfModules modules; modules.init(); for (LoadedModule &module : modules) { - if (!IsLinker(module.full_name())) continue; + if (!IsLinker(module)) + continue; if (linker == nullptr) { linker = reinterpret_cast(linker_placeholder); *linker = module; module = LoadedModule(); } else { VReport(1, "LeakSanitizer: Multiple modules match \"%s\". " - "TLS will not be handled correctly.\n", kLinkerName); + "TLS and other allocations originating from linker might be " + "falsely reported as leaks.\n", kLinkerName); linker->clear(); linker = nullptr; return; } } if (linker == nullptr) { - VReport(1, "LeakSanitizer: Dynamic linker not found. " - "TLS will not be handled correctly.\n"); + VReport(1, "LeakSanitizer: Dynamic linker not found. TLS and other " + "allocations originating from linker might be falsely reported " + "as leaks.\n"); } } Modified: vendor/compiler-rt/dist/lib/sanitizer_common/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/CMakeLists.txt Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/sanitizer_common/CMakeLists.txt Sat Jun 3 15:21:00 2017 (r319527) @@ -54,9 +54,7 @@ set(SANITIZER_NOLIBC_SOURCES set(SANITIZER_LIBCDEP_SOURCES sanitizer_common_libcdep.cc sancov_flags.cc - sanitizer_coverage_libcdep.cc sanitizer_coverage_libcdep_new.cc - sanitizer_coverage_mapping_libcdep.cc sanitizer_coverage_win_sections.cc sanitizer_linux_libcdep.cc sanitizer_posix_libcdep.cc Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h Sat Jun 3 15:21:00 2017 (r319527) @@ -317,15 +317,9 @@ bool AddressSpaceIsUnlimited(); void SetAddressSpaceUnlimited(); void AdjustStackSize(void *attr); void PrepareForSandboxing(__sanitizer_sandbox_arguments *args); -void CovPrepareForSandboxing(__sanitizer_sandbox_arguments *args); void SetSandboxingCallback(void (*f)()); -void CoverageUpdateMapping(); -void CovBeforeFork(); -void CovAfterFork(int child_pid); - void InitializeCoverage(bool enabled, const char *coverage_dir); -void ReInitializeCoverage(bool enabled, const char *coverage_dir); void InitTlsSize(); uptr GetTlsSize(); Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_interface.inc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_interface.inc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_interface.inc Sat Jun 3 15:21:00 2017 (r319527) @@ -11,7 +11,6 @@ INTERFACE_FUNCTION(__sanitizer_cov_dump) INTERFACE_FUNCTION(__sanitizer_dump_coverage) INTERFACE_FUNCTION(__sanitizer_dump_trace_pc_guard_coverage) -INTERFACE_FUNCTION(__sanitizer_maybe_open_cov_file) INTERFACE_WEAK_FUNCTION(__sancov_default_options) INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_cmp) INTERFACE_WEAK_FUNCTION(__sanitizer_cov_trace_cmp1) Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc Sat Jun 3 15:21:00 2017 (r319527) @@ -146,6 +146,17 @@ static TracePcGuardController pc_guard_controller; } // namespace } // namespace __sancov +namespace __sanitizer { +void InitializeCoverage(bool enabled, const char *dir) { + static bool coverage_enabled = false; + if (coverage_enabled) + return; // May happen if two sanitizer enable coverage in the same process. + coverage_enabled = enabled; + Atexit(__sanitizer_cov_dump); + AddDieCallback(__sanitizer_cov_dump); +} +} // namespace __sanitizer + extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_dump_coverage( // NOLINT const uptr* pcs, uptr len) { @@ -166,4 +177,18 @@ SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_tra SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_dump_trace_pc_guard_coverage() { __sancov::pc_guard_controller.Dump(); } +SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov_dump() { + __sanitizer_dump_trace_pc_guard_coverage(); +} +// Default empty implementations (weak). Users should redefine them. +SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_cmp, void) {} +SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_cmp1, void) {} +SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_cmp2, void) {} +SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_cmp4, void) {} +SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_cmp8, void) {} +SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_switch, void) {} +SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_div4, void) {} +SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_div8, void) {} +SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_gep, void) {} +SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_cov_trace_pc_indir, void) {} } // extern "C" Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc Sat Jun 3 15:21:00 2017 (r319527) @@ -138,16 +138,6 @@ COMMON_FLAG( bool, coverage, false, "If set, coverage information will be dumped at program shutdown (if the " "coverage instrumentation was enabled at compile time).") -COMMON_FLAG(bool, coverage_pcs, true, - "If set (and if 'coverage' is set too), the coverage information " - "will be dumped as a set of PC offsets for every module.") -COMMON_FLAG(bool, coverage_order_pcs, false, - "If true, the PCs will be dumped in the order they've" - " appeared during the execution.") -COMMON_FLAG(bool, coverage_direct, SANITIZER_ANDROID, - "If set, coverage information will be dumped directly to a memory " - "mapped file. This way data is not lost even if the process is " - "suddenly killed.") COMMON_FLAG(const char *, coverage_dir, ".", "Target directory for coverage dumps. Defaults to the current " "directory.") Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc Sat Jun 3 15:21:00 2017 (r319527) @@ -62,8 +62,6 @@ #if SANITIZER_FREEBSD #include #include -#include -#include #include extern "C" { // must be included after and on @@ -77,16 +75,6 @@ extern char **environ; // provided by crt1 #include #endif -#ifndef __GLIBC_PREREQ -#define __GLIBC_PREREQ(x, y) 0 -#endif - -#if SANITIZER_LINUX && __GLIBC_PREREQ(2, 16) -# define SANITIZER_USE_GETAUXVAL 1 -#else -# define SANITIZER_USE_GETAUXVAL 0 -#endif - #if SANITIZER_USE_GETAUXVAL #include #endif @@ -237,7 +225,8 @@ static void kernel_stat_to_stat(struct kernel_stat *in uptr internal_stat(const char *path, void *buf) { #if SANITIZER_FREEBSD - return internal_syscall(SYSCALL(stat), path, buf); + return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path, + (uptr)buf, 0); #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0); @@ -261,7 +250,8 @@ uptr internal_stat(const char *path, void *buf) { uptr internal_lstat(const char *path, void *buf) { #if SANITIZER_FREEBSD - return internal_syscall(SYSCALL(lstat), path, buf); + return internal_syscall(SYSCALL(fstatat), AT_FDCWD, (uptr)path, + (uptr)buf, AT_SYMLINK_NOFOLLOW); #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf, AT_SYMLINK_NOFOLLOW); @@ -604,7 +594,9 @@ uptr internal_getppid() { } uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count) { -#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS +#if SANITIZER_FREEBSD + return internal_syscall(SYSCALL(getdirentries), fd, (uptr)dirp, count, NULL); +#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS return internal_syscall(SYSCALL(getdents64), fd, (uptr)dirp, count); #else return internal_syscall(SYSCALL(getdents), fd, (uptr)dirp, count); Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h Sat Jun 3 15:21:00 2017 (r319527) @@ -269,5 +269,14 @@ # define SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT 0 #endif +#ifndef __GLIBC_PREREQ +#define __GLIBC_PREREQ(x, y) 0 +#endif + +#if SANITIZER_LINUX && __GLIBC_PREREQ(2, 16) +# define SANITIZER_USE_GETAUXVAL 1 +#else +# define SANITIZER_USE_GETAUXVAL 0 +#endif #endif // SANITIZER_PLATFORM_H Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.h Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.h Sat Jun 3 15:21:00 2017 (r319527) @@ -23,6 +23,9 @@ // incorporates the map structure. # define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) \ ((link_map*)((handle) == nullptr ? nullptr : ((char*)(handle) + 544))) +// Get sys/_types.h, because that tells us whether 64-bit inodes are +// used in struct dirent below. +#include #else # define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) ((link_map*)(handle)) #endif // !SANITIZER_FREEBSD @@ -485,7 +488,12 @@ namespace __sanitizer { }; #elif SANITIZER_FREEBSD struct __sanitizer_dirent { +#if defined(__INO64) + unsigned long long d_fileno; + unsigned long long d_off; +#else unsigned int d_fileno; +#endif unsigned short d_reclen; // more fields that we don't care about }; Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix_libcdep.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix_libcdep.cc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix_libcdep.cc Sat Jun 3 15:21:00 2017 (r319527) @@ -264,7 +264,6 @@ void PrepareForSandboxing(__sanitizer_sandbox_argument // Same for /proc/self/exe in the symbolizer. #if !SANITIZER_GO Symbolizer::GetOrInit()->PrepareForSandboxing(); - CovPrepareForSandboxing(args); #endif } Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc Sat Jun 3 15:21:00 2017 (r319527) @@ -400,9 +400,6 @@ void ReExec() { } void PrepareForSandboxing(__sanitizer_sandbox_arguments *args) { -#if !SANITIZER_GO - CovPrepareForSandboxing(args); -#endif } bool StackSizeIsUnlimited() { Modified: vendor/compiler-rt/dist/lib/sanitizer_common/scripts/check_lint.sh ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/scripts/check_lint.sh Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/sanitizer_common/scripts/check_lint.sh Sat Jun 3 15:21:00 2017 (r319527) @@ -18,7 +18,7 @@ fi # Filters # TODO: remove some of these filters COMMON_LINT_FILTER=-build/include,-build/header_guard,-legal/copyright,-whitespace/comments,-readability/casting,\ --build/namespaces +-build/namespaces,-readability/braces ASAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/int ASAN_TEST_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/sizeof,-runtime/int,-runtime/printf,-runtime/threadsafe_fn ASAN_LIT_TEST_LINT_FILTER=${ASAN_TEST_LINT_FILTER},-whitespace/line_length Modified: vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_flags_test.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_flags_test.cc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_flags_test.cc Sat Jun 3 15:21:00 2017 (r319527) @@ -167,13 +167,13 @@ TEST(SanitizerCommon, CommonFlags) { cf.symbolize = false; cf.coverage = true; - cf.coverage_direct = true; + cf.heap_profile = true; cf.log_path = "path/one"; - parser.ParseString("symbolize=1:coverage_direct=false log_path='path/two'"); + parser.ParseString("symbolize=1:heap_profile=false log_path='path/two'"); EXPECT_TRUE(cf.symbolize); EXPECT_TRUE(cf.coverage); - EXPECT_FALSE(cf.coverage_direct); + EXPECT_FALSE(cf.heap_profile); EXPECT_STREQ("path/two", cf.log_path); } Modified: vendor/compiler-rt/dist/lib/ubsan/ubsan_checks.inc ============================================================================== --- vendor/compiler-rt/dist/lib/ubsan/ubsan_checks.inc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/ubsan/ubsan_checks.inc Sat Jun 3 15:21:00 2017 (r319527) @@ -19,6 +19,7 @@ UBSAN_CHECK(GenericUB, "undefined-behavior", "undefined") UBSAN_CHECK(NullPointerUse, "null-pointer-use", "null") +UBSAN_CHECK(PointerOverflow, "pointer-overflow", "pointer-overflow") UBSAN_CHECK(MisalignedPointerUse, "misaligned-pointer-use", "alignment") UBSAN_CHECK(InsufficientObjectSize, "insufficient-object-size", "object-size") UBSAN_CHECK(SignedIntegerOverflow, "signed-integer-overflow", Modified: vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc ============================================================================== --- vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc Sat Jun 3 15:21:00 2017 (r319527) @@ -554,6 +554,37 @@ void __ubsan::__ubsan_handle_nullability_arg_abort(Non Die(); } +static void handlePointerOverflowImpl(PointerOverflowData *Data, + ValueHandle Base, + ValueHandle Result, + ReportOptions Opts) { + SourceLocation Loc = Data->Loc.acquire(); + ErrorType ET = ErrorType::PointerOverflow; + + if (ignoreReport(Loc, Opts, ET)) + return; + + ScopedReport R(Opts, Loc, ET); + + Diag(Loc, DL_Error, "pointer index expression with base %0 overflowed to %1") + << (void *)Base << (void*)Result; +} + +void __ubsan::__ubsan_handle_pointer_overflow(PointerOverflowData *Data, + ValueHandle Base, + ValueHandle Result) { + GET_REPORT_OPTIONS(false); + handlePointerOverflowImpl(Data, Base, Result, Opts); +} + +void __ubsan::__ubsan_handle_pointer_overflow_abort(PointerOverflowData *Data, + ValueHandle Base, + ValueHandle Result) { + GET_REPORT_OPTIONS(true); + handlePointerOverflowImpl(Data, Base, Result, Opts); + Die(); +} + static void handleCFIBadIcall(CFICheckFailData *Data, ValueHandle Function, ReportOptions Opts) { if (Data->CheckKind != CFITCK_ICall) Modified: vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.h ============================================================================== --- vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.h Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.h Sat Jun 3 15:21:00 2017 (r319527) @@ -152,6 +152,13 @@ struct NonNullArgData { RECOVERABLE(nonnull_arg, NonNullArgData *Data) RECOVERABLE(nullability_arg, NonNullArgData *Data) +struct PointerOverflowData { + SourceLocation Loc; +}; + +RECOVERABLE(pointer_overflow, PointerOverflowData *Data, ValueHandle Base, + ValueHandle Result) + /// \brief Known CFI check kinds. /// Keep in sync with the enum of the same name in CodeGenFunction.h enum CFITypeCheckKind : unsigned char { Modified: vendor/compiler-rt/dist/lib/ubsan/ubsan_interface.inc ============================================================================== --- vendor/compiler-rt/dist/lib/ubsan/ubsan_interface.inc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/lib/ubsan/ubsan_interface.inc Sat Jun 3 15:21:00 2017 (r319527) @@ -36,6 +36,8 @@ INTERFACE_FUNCTION(__ubsan_handle_nullability_return) INTERFACE_FUNCTION(__ubsan_handle_nullability_return_abort) INTERFACE_FUNCTION(__ubsan_handle_out_of_bounds) INTERFACE_FUNCTION(__ubsan_handle_out_of_bounds_abort) +INTERFACE_FUNCTION(__ubsan_handle_pointer_overflow) +INTERFACE_FUNCTION(__ubsan_handle_pointer_overflow_abort) INTERFACE_FUNCTION(__ubsan_handle_shift_out_of_bounds) INTERFACE_FUNCTION(__ubsan_handle_shift_out_of_bounds_abort) INTERFACE_FUNCTION(__ubsan_handle_sub_overflow) Modified: vendor/compiler-rt/dist/test/asan/TestCases/Linux/uar_signals.cc ============================================================================== --- vendor/compiler-rt/dist/test/asan/TestCases/Linux/uar_signals.cc Sat Jun 3 15:20:57 2017 (r319526) +++ vendor/compiler-rt/dist/test/asan/TestCases/Linux/uar_signals.cc Sat Jun 3 15:21:00 2017 (r319527) @@ -1,12 +1,13 @@ // This test checks that the implementation of use-after-return // is async-signal-safe. -// RUN: %clangxx_asan -O1 %s -o %t -pthread && %run %t +// RUN: %clangxx_asan -std=c++11 -O1 %s -o %t -pthread && %run %t // REQUIRES: stable-runtime #include #include #include #include #include +#include int *g; int n_signals; @@ -17,7 +18,6 @@ void SignalHandler(int, siginfo_t*, void*) { int local; g = &local; n_signals++; - // printf("s: %p\n", &local); } static void EnableSigprof(Sigaction SignalHandler) { @@ -49,22 +49,29 @@ void RecursiveFunction(int depth) { RecursiveFunction(depth - 1); } -void *Thread(void *) { - RecursiveFunction(18); +void *FastThread(void *) { + RecursiveFunction(1); return NULL; } +void *SlowThread(void *) { + RecursiveFunction(1); + return NULL; +} + int main(int argc, char **argv) { EnableSigprof(SignalHandler); - for (int i = 0; i < 4; i++) { - fprintf(stderr, "."); - const int kNumThread = sizeof(void*) == 8 ? 16 : 8; - pthread_t t[kNumThread]; - for (int i = 0; i < kNumThread; i++) - pthread_create(&t[i], 0, Thread, 0); - for (int i = 0; i < kNumThread; i++) - pthread_join(t[i], 0); + for (auto Thread : {&FastThread, &SlowThread}) { + for (int i = 0; i < 1000; i++) { + fprintf(stderr, "."); + const int kNumThread = sizeof(void*) == 8 ? 32 : 8; + pthread_t t[kNumThread]; + for (int i = 0; i < kNumThread; i++) + pthread_create(&t[i], 0, Thread, 0); + for (int i = 0; i < kNumThread; i++) + pthread_join(t[i], 0); + } + fprintf(stderr, "\n"); } - fprintf(stderr, "\n"); } Added: vendor/compiler-rt/dist/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc Sat Jun 3 15:21:00 2017 (r319527) @@ -0,0 +1,23 @@ +// Tests -fsanitize-coverage=inline-8bit-counters +// +// REQUIRES: has_sancovcc,stable-runtime +// UNSUPPORTED: i386-darwin +// +// RUN: %clangxx -O0 %s -fsanitize-coverage=inline-8bit-counters 2>&1 + +#include +#include + +const char *first_counter; + +extern "C" +void __sanitizer_cov_8bit_counters_init(const char *start, const char *end) { + printf("INIT: %p %p\n", start, end); + assert(end - start > 1); + first_counter = start; +} + +int main() { + assert(first_counter); + assert(*first_counter == 1); +} Added: vendor/compiler-rt/dist/test/ubsan/TestCases/Pointer/index-overflow.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/test/ubsan/TestCases/Pointer/index-overflow.cpp Sat Jun 3 15:21:00 2017 (r319527) @@ -0,0 +1,19 @@ +// RUN: %clangxx -fsanitize=pointer-overflow %s -o %t +// RUN: %t 1 2>&1 | FileCheck %s --check-prefix=ERR +// RUN: %t 0 2>&1 | FileCheck %s --check-prefix=SAFE +// RUN: %t -1 2>&1 | FileCheck %s --check-prefix=SAFE + +#include +#include +#include + +int main(int argc, char *argv[]) { + // SAFE-NOT: runtime error + // ERR: runtime error: pointer index expression with base {{.*}} overflowed to + + char *p = (char *)(UINTPTR_MAX); + + printf("%p\n", p + atoi(argv[1])); + + return 0; +} From owner-svn-src-vendor@freebsd.org Sat Jun 3 15:21: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 1C4A8BF39F7; Sat, 3 Jun 2017 15:21: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 AE88B73624; Sat, 3 Jun 2017 15:21:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53FLF06082982; Sat, 3 Jun 2017 15:21:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FLF0G082981; Sat, 3 Jun 2017 15:21:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706031521.v53FLF0G082981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Jun 2017 15:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319530 - vendor/libc++/libc++-trunk-r304659 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:21:17 -0000 Author: dim Date: Sat Jun 3 15:21:15 2017 New Revision: 319530 URL: https://svnweb.freebsd.org/changeset/base/319530 Log: Tag libc++ trunk r304659. Added: vendor/libc++/libc++-trunk-r304659/ - copied from r319529, vendor/libc++/dist/ From owner-svn-src-vendor@freebsd.org Sat Jun 3 15:21:08 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 E4BE9BF3971; Sat, 3 Jun 2017 15:21:08 +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 943A373529; Sat, 3 Jun 2017 15:21:08 +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 v53FL7d1082880; Sat, 3 Jun 2017 15:21:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FL7aE082879; Sat, 3 Jun 2017 15:21:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706031521.v53FL7aE082879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Jun 2017 15:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319528 - vendor/compiler-rt/compiler-rt-trunk-r304659 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:21:09 -0000 Author: dim Date: Sat Jun 3 15:21:07 2017 New Revision: 319528 URL: https://svnweb.freebsd.org/changeset/base/319528 Log: Tag compiler-rt trunk r304659. Added: vendor/compiler-rt/compiler-rt-trunk-r304659/ - copied from r319527, vendor/compiler-rt/dist/ From owner-svn-src-vendor@freebsd.org Sat Jun 3 15:21:21 2017 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 043AABF3A52; Sat, 3 Jun 2017 15:21:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEF94736B0; Sat, 3 Jun 2017 15:21:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53FLJtv083043; Sat, 3 Jun 2017 15:21:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FLIbE083030; Sat, 3 Jun 2017 15:21:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706031521.v53FLIbE083030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Jun 2017 15:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319531 - in vendor/lld/dist: COFF ELF test/COFF test/ELF X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:21:21 -0000 Author: dim Date: Sat Jun 3 15:21:18 2017 New Revision: 319531 URL: https://svnweb.freebsd.org/changeset/base/319531 Log: Vendor import of lld trunk r304659: https://llvm.org/svn/llvm-project/lld/trunk@304659 Added: vendor/lld/dist/test/COFF/def-export-stdcall.s (contents, props changed) Modified: vendor/lld/dist/COFF/DLL.cpp vendor/lld/dist/COFF/DLL.h vendor/lld/dist/COFF/Driver.cpp vendor/lld/dist/COFF/PDB.cpp vendor/lld/dist/ELF/LinkerScript.cpp vendor/lld/dist/ELF/OutputSections.cpp vendor/lld/dist/ELF/OutputSections.h vendor/lld/dist/ELF/Writer.cpp vendor/lld/dist/test/COFF/armnt-imports.test vendor/lld/dist/test/COFF/hello32.test vendor/lld/dist/test/COFF/imports.test vendor/lld/dist/test/ELF/emit-relocs.s Modified: vendor/lld/dist/COFF/DLL.cpp ============================================================================== --- vendor/lld/dist/COFF/DLL.cpp Sat Jun 3 15:21:15 2017 (r319530) +++ vendor/lld/dist/COFF/DLL.cpp Sat Jun 3 15:21:18 2017 (r319531) @@ -100,17 +100,13 @@ class ImportDirectoryChunk : public Chunk { (public) void writeTo(uint8_t *Buf) const override { auto *E = (coff_import_directory_table_entry *)(Buf + OutputSectionOff); + E->ImportLookupTableRVA = LookupTab->getRVA(); E->NameRVA = DLLName->getRVA(); - - // The import descriptor table contains two pointers to - // the tables describing dllimported symbols. But the - // Windows loader actually uses only one. So we create - // only one table and set both fields to its address. - E->ImportLookupTableRVA = AddressTab->getRVA(); E->ImportAddressTableRVA = AddressTab->getRVA(); } Chunk *DLLName; + Chunk *LookupTab; Chunk *AddressTab; }; @@ -392,6 +388,7 @@ std::vector IdataContents::getChunks() { // Add each type in the correct order. std::vector V; V.insert(V.end(), Dirs.begin(), Dirs.end()); + V.insert(V.end(), Lookups.begin(), Lookups.end()); V.insert(V.end(), Addresses.begin(), Addresses.end()); V.insert(V.end(), Hints.begin(), Hints.end()); V.insert(V.end(), DLLNames.begin(), DLLNames.end()); @@ -407,18 +404,21 @@ void IdataContents::create() { // we need to create HintName chunks to store the names. // If they don't (if they are import-by-ordinals), we store only // ordinal values to the table. - size_t Base = Addresses.size(); + size_t Base = Lookups.size(); for (DefinedImportData *S : Syms) { uint16_t Ord = S->getOrdinal(); if (S->getExternalName().empty()) { + Lookups.push_back(make(Ord)); Addresses.push_back(make(Ord)); continue; } auto *C = make(S->getExternalName(), Ord); + Lookups.push_back(make(C)); Addresses.push_back(make(C)); Hints.push_back(C); } // Terminate with null values. + Lookups.push_back(make(ptrSize())); Addresses.push_back(make(ptrSize())); for (int I = 0, E = Syms.size(); I < E; ++I) @@ -427,6 +427,7 @@ void IdataContents::create() { // Create the import table header. DLLNames.push_back(make(Syms[0]->getDLLName())); auto *Dir = make(DLLNames.back()); + Dir->LookupTab = Lookups[Base]; Dir->AddressTab = Addresses[Base]; Dirs.push_back(Dir); } Modified: vendor/lld/dist/COFF/DLL.h ============================================================================== --- vendor/lld/dist/COFF/DLL.h Sat Jun 3 15:21:15 2017 (r319530) +++ vendor/lld/dist/COFF/DLL.h Sat Jun 3 15:21:18 2017 (r319531) @@ -36,6 +36,7 @@ class IdataContents { (private) std::vector Imports; std::vector Dirs; + std::vector Lookups; std::vector Addresses; std::vector Hints; std::vector DLLNames; Modified: vendor/lld/dist/COFF/Driver.cpp ============================================================================== --- vendor/lld/dist/COFF/Driver.cpp Sat Jun 3 15:21:15 2017 (r319530) +++ vendor/lld/dist/COFF/Driver.cpp Sat Jun 3 15:21:18 2017 (r319531) @@ -434,7 +434,8 @@ std::vector createCOFFShortExportFrom std::vector Exports; for (Export &E1 : Config->Exports) { COFFShortExport E2; - E2.Name = E1.Name; + // Use SymbolName, which will have any stdcall or fastcall qualifiers. + E2.Name = E1.SymbolName; E2.ExtName = E1.ExtName; E2.Ordinal = E1.Ordinal; E2.Noname = E1.Noname; Modified: vendor/lld/dist/COFF/PDB.cpp ============================================================================== --- vendor/lld/dist/COFF/PDB.cpp Sat Jun 3 15:21:15 2017 (r319530) +++ vendor/lld/dist/COFF/PDB.cpp Sat Jun 3 15:21:18 2017 (r319531) @@ -157,7 +157,8 @@ static void dumpDebugS(ScopedPrinter &W, ObjectFile *F fatal(EC, "StreamReader.readArray failed"); TypeDatabase TDB(0); - CVSymbolDumper SymbolDumper(W, TDB, nullptr, false); + CVSymbolDumper SymbolDumper(W, TDB, CodeViewContainer::ObjectFile, nullptr, + false); if (auto EC = SymbolDumper.dump(Symbols)) fatal(EC, "CVSymbolDumper::dump failed"); } Modified: vendor/lld/dist/ELF/LinkerScript.cpp ============================================================================== --- vendor/lld/dist/ELF/LinkerScript.cpp Sat Jun 3 15:21:15 2017 (r319530) +++ vendor/lld/dist/ELF/LinkerScript.cpp Sat Jun 3 15:21:18 2017 (r319531) @@ -463,12 +463,7 @@ void LinkerScript::fabricateDefaultCommands() { // Prefer user supplied address over additional alignment constraint auto I = Config->SectionStartMap.find(Sec->Name); if (I != Config->SectionStartMap.end()) - Commands.push_back( - make(".", [=] { return I->second; }, "")); - else if (Sec->PageAlign) - OSCmd->AddrExpr = [=] { - return alignTo(Script->getDot(), Config->MaxPageSize); - }; + OSCmd->AddrExpr = [=] { return I->second; }; Commands.push_back(OSCmd); if (Sec->Sections.size()) { Modified: vendor/lld/dist/ELF/OutputSections.cpp ============================================================================== --- vendor/lld/dist/ELF/OutputSections.cpp Sat Jun 3 15:21:15 2017 (r319530) +++ vendor/lld/dist/ELF/OutputSections.cpp Sat Jun 3 15:21:18 2017 (r319531) @@ -128,6 +128,7 @@ template void OutputSection::finalize() { // the section to which the relocation applies. InputSectionBase *S = First->getRelocatedSection(); Info = S->getOutputSection()->SectionIndex; + Flags |= SHF_INFO_LINK; } static uint64_t updateOffset(uint64_t Off, InputSection *S) { Modified: vendor/lld/dist/ELF/OutputSections.h ============================================================================== --- vendor/lld/dist/ELF/OutputSections.h Sat Jun 3 15:21:15 2017 (r319530) +++ vendor/lld/dist/ELF/OutputSections.h Sat Jun 3 15:21:18 2017 (r319531) @@ -59,10 +59,6 @@ class OutputSection final : public SectionBase { (publ Alignment = Val; } - // If true, this section will be page aligned on disk. - // Typically the first section of each PT_LOAD segment has this flag. - bool PageAlign = false; - // Pointer to the first section in PT_LOAD segment, which this section // also resides in. This field is used to correctly compute file offset // of a section. When two sections share the same load segment, difference Modified: vendor/lld/dist/ELF/Writer.cpp ============================================================================== --- vendor/lld/dist/ELF/Writer.cpp Sat Jun 3 15:21:15 2017 (r319530) +++ vendor/lld/dist/ELF/Writer.cpp Sat Jun 3 15:21:18 2017 (r319531) @@ -257,19 +257,20 @@ template void Writer::run() { if (ErrorCount) return; - if (!Script->Opt.HasSections) { - if (!Config->Relocatable) - fixSectionAlignments(); + if (!Script->Opt.HasSections) Script->fabricateDefaultCommands(); - } else { + else Script->synchronize(); - } for (BaseCommand *Base : Script->Opt.Commands) if (auto *Cmd = dyn_cast(Base)) OutputSectionCommands.push_back(Cmd); clearOutputSections(); + + if (!Script->Opt.HasSections &&!Config->Relocatable) + fixSectionAlignments(); + // If -compressed-debug-sections is specified, we need to compress // .debug_* sections. Do it right now because it changes the size of // output sections. @@ -1504,24 +1505,33 @@ void Writer::addPtArmExid(std::vector // first section after PT_GNU_RELRO have to be page aligned so that the dynamic // linker can set the permissions. template void Writer::fixSectionAlignments() { + auto PageAlign = [](OutputSection *Sec) { + OutputSectionCommand *Cmd = Script->getCmd(Sec); + if (Cmd && !Cmd->AddrExpr) + Cmd->AddrExpr = [=] { + return alignTo(Script->getDot(), Config->MaxPageSize); + }; + }; + for (const PhdrEntry &P : Phdrs) if (P.p_type == PT_LOAD && P.First) - P.First->PageAlign = true; + PageAlign(P.First); for (const PhdrEntry &P : Phdrs) { if (P.p_type != PT_GNU_RELRO) continue; if (P.First) - P.First->PageAlign = true; + PageAlign(P.First); // Find the first section after PT_GNU_RELRO. If it is in a PT_LOAD we // have to align it to a page. - auto End = OutputSections.end(); - auto I = std::find(OutputSections.begin(), End, P.Last); + auto End = OutputSectionCommands.end(); + auto I = + std::find(OutputSectionCommands.begin(), End, Script->getCmd(P.Last)); if (I == End || (I + 1) == End) continue; - OutputSection *Sec = *(I + 1); + OutputSection *Sec = (*(I + 1))->Sec; if (needsPtLoad(Sec)) - Sec->PageAlign = true; + PageAlign(Sec); } } Modified: vendor/lld/dist/test/COFF/armnt-imports.test ============================================================================== --- vendor/lld/dist/test/COFF/armnt-imports.test Sat Jun 3 15:21:15 2017 (r319530) +++ vendor/lld/dist/test/COFF/armnt-imports.test Sat Jun 3 15:21:18 2017 (r319531) @@ -6,7 +6,7 @@ # CHECK: Import { # CHECK: Name: library.dll # CHECK: ImportLookupTableRVA: 0x2028 -# CHECK: ImportAddressTableRVA: 0x2028 +# CHECK: ImportAddressTableRVA: 0x2030 # CHECK: Symbol: function (0) # CHECK: } Added: vendor/lld/dist/test/COFF/def-export-stdcall.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist/test/COFF/def-export-stdcall.s Sat Jun 3 15:21:18 2017 (r319531) @@ -0,0 +1,25 @@ +# RUN: llvm-mc -filetype=obj -triple=i686-windows-msvc %s -o %t.obj +# RUN: echo -e "LIBRARY foo\nEXPORTS\n stdcall" > %t.def +# RUN: lld-link -entry:dllmain -dll -def:%t.def %t.obj -out:%t.dll -implib:%t.lib +# RUN: llvm-nm %t.lib | FileCheck %s +# CHECK: __imp__stdcall@8 +# CHECK: _stdcall@8 + + .def _stdcall@8; + .scl 2; + .type 32; + .endef + .globl _stdcall@8 +_stdcall@8: + movl 8(%esp), %eax + addl 4(%esp), %eax + retl $8 + + .def _dllmain; + .scl 2; + .type 32; + .endef + .globl _dllmain +_dllmain: + retl + Modified: vendor/lld/dist/test/COFF/hello32.test ============================================================================== --- vendor/lld/dist/test/COFF/hello32.test Sat Jun 3 15:21:15 2017 (r319530) +++ vendor/lld/dist/test/COFF/hello32.test Sat Jun 3 15:21:18 2017 (r319531) @@ -78,7 +78,7 @@ HEADER-NEXT: LoadConfigTableRVA: 0x0 HEADER-NEXT: LoadConfigTableSize: 0x0 HEADER-NEXT: BoundImportRVA: 0x0 HEADER-NEXT: BoundImportSize: 0x0 -HEADER-NEXT: IATRVA: 0x3028 +HEADER-NEXT: IATRVA: 0x3034 HEADER-NEXT: IATSize: 0xC HEADER-NEXT: DelayImportDescriptorRVA: 0x0 HEADER-NEXT: DelayImportDescriptorSize: 0x0 @@ -114,7 +114,7 @@ IMPORTS: AddressSize: 32bit IMPORTS: Import { IMPORTS: Name: std32.dll IMPORTS: ImportLookupTableRVA: 0x3028 -IMPORTS: ImportAddressTableRVA: 0x3028 +IMPORTS: ImportAddressTableRVA: 0x3034 IMPORTS: Symbol: ExitProcess (0) IMPORTS: Symbol: MessageBoxA (1) IMPORTS: } Modified: vendor/lld/dist/test/COFF/imports.test ============================================================================== --- vendor/lld/dist/test/COFF/imports.test Sat Jun 3 15:21:15 2017 (r319530) +++ vendor/lld/dist/test/COFF/imports.test Sat Jun 3 15:21:18 2017 (r319531) @@ -21,14 +21,14 @@ TEXT-NEXT: callq 60 TEXT-NEXT: movl $0, %ecx TEXT-NEXT: callq 18 TEXT-NEXT: callq 29 -TEXT: jmpq *4066(%rip) -TEXT: jmpq *4058(%rip) -TEXT: jmpq *4050(%rip) +TEXT: jmpq *4098(%rip) +TEXT: jmpq *4090(%rip) +TEXT: jmpq *4082(%rip) IMPORT: Import { IMPORT-NEXT: Name: std64.dll IMPORT-NEXT: ImportLookupTableRVA: 0x3028 -IMPORT-NEXT: ImportAddressTableRVA: 0x3028 +IMPORT-NEXT: ImportAddressTableRVA: 0x3048 IMPORT-NEXT: Symbol: ExitProcess (0) IMPORT-NEXT: Symbol: (50) IMPORT-NEXT: Symbol: MessageBoxA (1) Modified: vendor/lld/dist/test/ELF/emit-relocs.s ============================================================================== --- vendor/lld/dist/test/ELF/emit-relocs.s Sat Jun 3 15:21:15 2017 (r319530) +++ vendor/lld/dist/test/ELF/emit-relocs.s Sat Jun 3 15:21:18 2017 (r319531) @@ -1,16 +1,23 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o # RUN: ld.lld --emit-relocs %t1.o -o %t -# RUN: llvm-readobj -t -r %t | FileCheck %s +# RUN: llvm-readobj -t -r -s %t | FileCheck %s ## Check single dash form. # RUN: ld.lld -emit-relocs %t1.o -o %t1 -# RUN: llvm-readobj -t -r %t1 | FileCheck %s +# RUN: llvm-readobj -t -r -s %t1 | FileCheck %s ## Check alias. # RUN: ld.lld -q %t1.o -o %t2 -# RUN: llvm-readobj -t -r %t2 | FileCheck %s +# RUN: llvm-readobj -t -r -s %t2 | FileCheck %s +# CHECK: Section { +# CHECK: Index: 2 +# CHECK-NEXT: Name: .rela.text +# CHECK-NEXT: Type: SHT_RELA +# CHECK-NEXT: Flags [ +# CHECK-NEXT: SHF_INFO_LINK +# CHECK-NEXT: ] # CHECK: Relocations [ # CHECK-NEXT: Section ({{.*}}) .rela.text { # CHECK-NEXT: 0x201002 R_X86_64_32 .text 0x1 From owner-svn-src-vendor@freebsd.org Sat Jun 3 15:21:26 2017 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62C89BF3AD1; Sat, 3 Jun 2017 15:21:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1264C73754; Sat, 3 Jun 2017 15:21:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53FLO9G083096; Sat, 3 Jun 2017 15:21:24 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FLOYe083095; Sat, 3 Jun 2017 15:21:24 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706031521.v53FLOYe083095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Jun 2017 15:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319532 - vendor/lld/lld-trunk-r304659 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:21:26 -0000 Author: dim Date: Sat Jun 3 15:21:24 2017 New Revision: 319532 URL: https://svnweb.freebsd.org/changeset/base/319532 Log: Tag lld trunk r304659. Added: vendor/lld/lld-trunk-r304659/ - copied from r319531, vendor/lld/dist/ From owner-svn-src-vendor@freebsd.org Sat Jun 3 15:21:30 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 38674BF3B3E; Sat, 3 Jun 2017 15:21:30 +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 E6CAA737C2; Sat, 3 Jun 2017 15:21:29 +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 v53FLSsT083160; Sat, 3 Jun 2017 15:21:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FLRkV083146; Sat, 3 Jun 2017 15:21:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706031521.v53FLRkV083146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Jun 2017 15:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319533 - in vendor/lldb/dist: cmake/modules include/lldb/Host include/lldb/Host/linux packages/Python/lldbsuite/test/lang/objc/objc-new-syntax source/Host/linux source/Plugins/Platform... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:21:30 -0000 Author: dim Date: Sat Jun 3 15:21:27 2017 New Revision: 319533 URL: https://svnweb.freebsd.org/changeset/base/319533 Log: Vendor import of lldb trunk r304659: https://llvm.org/svn/llvm-project/lldb/trunk@304659 Modified: vendor/lldb/dist/cmake/modules/LLDBConfig.cmake vendor/lldb/dist/cmake/modules/LLDBGenerateConfig.cmake vendor/lldb/dist/include/lldb/Host/Config.h.cmake vendor/lldb/dist/include/lldb/Host/linux/Uio.h vendor/lldb/dist/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py vendor/lldb/dist/source/Host/linux/LibcGlue.cpp vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.h vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp vendor/lldb/dist/source/Symbol/ClangASTContext.cpp vendor/lldb/dist/unittests/CMakeLists.txt Modified: vendor/lldb/dist/cmake/modules/LLDBConfig.cmake ============================================================================== --- vendor/lldb/dist/cmake/modules/LLDBConfig.cmake Sat Jun 3 15:21:24 2017 (r319532) +++ vendor/lldb/dist/cmake/modules/LLDBConfig.cmake Sat Jun 3 15:21:27 2017 (r319533) @@ -334,28 +334,6 @@ if (HAVE_LIBDL) list(APPEND system_libs ${CMAKE_DL_LIBS}) endif() -# Check for syscall used by lldb-server on linux. -# If these are not found, it will fall back to ptrace (slow) for memory reads. -check_cxx_source_compiles(" - #include - int main() { process_vm_readv(0, nullptr, 0, nullptr, 0, 0); return 0; }" - HAVE_PROCESS_VM_READV) - -if (HAVE_PROCESS_VM_READV) - add_definitions(-DHAVE_PROCESS_VM_READV) -else() - # If we don't have the syscall wrapper function, but we know the syscall number, we can - # still issue the syscall manually - check_cxx_source_compiles(" - #include - int main() { return __NR_process_vm_readv; }" - HAVE_NR_PROCESS_VM_READV) - - if (HAVE_NR_PROCESS_VM_READV) - add_definitions(-DHAVE_NR_PROCESS_VM_READV) - endif() -endif() - # Figure out if lldb could use lldb-server. If so, then we'll # ensure we build lldb-server when an lldb target is being built. if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD") Modified: vendor/lldb/dist/cmake/modules/LLDBGenerateConfig.cmake ============================================================================== --- vendor/lldb/dist/cmake/modules/LLDBGenerateConfig.cmake Sat Jun 3 15:21:24 2017 (r319532) +++ vendor/lldb/dist/cmake/modules/LLDBGenerateConfig.cmake Sat Jun 3 15:21:27 2017 (r319533) @@ -12,6 +12,15 @@ check_symbol_exists(sigaction signal.h HAVE_SIGACTION) check_include_file(termios.h HAVE_TERMIOS_H) check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H) +check_cxx_source_compiles(" + #include + int main() { process_vm_readv(0, nullptr, 0, nullptr, 0, 0); return 0; }" + HAVE_PROCESS_VM_READV) +check_cxx_source_compiles(" + #include + int main() { return __NR_process_vm_readv; }" + HAVE_NR_PROCESS_VM_READV) + # These checks exist in LLVM's configuration, so I want to match the LLVM names # so that the check isn't duplicated, but we translate them into the LLDB names # so that I don't have to change all the uses at the moment. Modified: vendor/lldb/dist/include/lldb/Host/Config.h.cmake ============================================================================== --- vendor/lldb/dist/include/lldb/Host/Config.h.cmake Sat Jun 3 15:21:24 2017 (r319532) +++ vendor/lldb/dist/include/lldb/Host/Config.h.cmake Sat Jun 3 15:21:27 2017 (r319533) @@ -20,4 +20,8 @@ #cmakedefine01 HAVE_SIGACTION +#cmakedefine01 HAVE_PROCESS_VM_READV + +#cmakedefine01 HAVE_NR_PROCESS_VM_READV + #endif // #ifndef LLDB_HOST_CONFIG_H Modified: vendor/lldb/dist/include/lldb/Host/linux/Uio.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/linux/Uio.h Sat Jun 3 15:21:24 2017 (r319532) +++ vendor/lldb/dist/include/lldb/Host/linux/Uio.h Sat Jun 3 15:21:27 2017 (r319533) @@ -10,11 +10,12 @@ #ifndef liblldb_Host_linux_Uio_h_ #define liblldb_Host_linux_Uio_h_ +#include "lldb/Host/Config.h" #include // We shall provide our own implementation of process_vm_readv if it is not // present -#ifndef HAVE_PROCESS_VM_READV +#if !HAVE_PROCESS_VM_READV ssize_t process_vm_readv(::pid_t pid, const struct iovec *local_iov, unsigned long liovcnt, const struct iovec *remote_iov, unsigned long riovcnt, unsigned long flags); Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py ============================================================================== --- vendor/lldb/dist/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Sat Jun 3 15:21:24 2017 (r319532) +++ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Sat Jun 3 15:21:27 2017 (r319533) @@ -26,16 +26,7 @@ class ObjCNewSyntaxTestCase(TestBase): # Find the line number to break inside main(). self.line = line_number('main.m', '// Set breakpoint 0 here.') - @skipUnlessDarwin - @expectedFailureAll( - oslist=['macosx'], - compiler='clang', - compiler_version=[ - '<', - '7.0.0']) - @skipIf(macos_version=["<", "10.12"]) - @expectedFailureAll(archs=["i[3-6]86"]) - def test_expr(self): + def runToBreakpoint(self): self.build() exe = os.path.join(os.getcwd(), "a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) @@ -55,6 +46,18 @@ class ObjCNewSyntaxTestCase(TestBase): self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE, substrs=[' resolved, hit count = 1']) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_read_array(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- immutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY, @@ -65,6 +68,18 @@ class ObjCNewSyntaxTestCase(TestBase): VARIABLES_DISPLAYED_CORRECTLY, substrs=["foo"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_update_array(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- mutable_array[0] = @\"bar\"", VARIABLES_DISPLAYED_CORRECTLY, @@ -75,6 +90,18 @@ class ObjCNewSyntaxTestCase(TestBase): VARIABLES_DISPLAYED_CORRECTLY, substrs=["bar"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_read_dictionary(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- immutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY, @@ -85,6 +112,18 @@ class ObjCNewSyntaxTestCase(TestBase): VARIABLES_DISPLAYED_CORRECTLY, substrs=["value"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_update_dictionary(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- mutable_dictionary[@\"key\"] = @\"object\"", VARIABLES_DISPLAYED_CORRECTLY, @@ -95,6 +134,18 @@ class ObjCNewSyntaxTestCase(TestBase): VARIABLES_DISPLAYED_CORRECTLY, substrs=["object"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_array_literal(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- @[ @\"foo\", @\"bar\" ]", VARIABLES_DISPLAYED_CORRECTLY, @@ -103,6 +154,18 @@ class ObjCNewSyntaxTestCase(TestBase): "foo", "bar"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_dictionary_literal(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- @{ @\"key\" : @\"object\" }", VARIABLES_DISPLAYED_CORRECTLY, @@ -110,9 +173,33 @@ class ObjCNewSyntaxTestCase(TestBase): "key", "object"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_char_literal(self): + self.runToBreakpoint() + self.expect("expr --object-description -- @'a'", VARIABLES_DISPLAYED_CORRECTLY, substrs=[str(ord('a'))]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_integer_literals(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- @1", VARIABLES_DISPLAYED_CORRECTLY, @@ -138,8 +225,32 @@ class ObjCNewSyntaxTestCase(TestBase): VARIABLES_DISPLAYED_CORRECTLY, substrs=["1"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_float_literal(self): + self.runToBreakpoint() + self.expect("expr -- @123.45", VARIABLES_DISPLAYED_CORRECTLY, substrs=["NSNumber", "123.45"]) + + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_expressions_in_literals(self): + self.runToBreakpoint() self.expect( "expr --object-description -- @( 1 + 3 )", Modified: vendor/lldb/dist/source/Host/linux/LibcGlue.cpp ============================================================================== --- vendor/lldb/dist/source/Host/linux/LibcGlue.cpp Sat Jun 3 15:21:24 2017 (r319532) +++ vendor/lldb/dist/source/Host/linux/LibcGlue.cpp Sat Jun 3 15:21:27 2017 (r319533) @@ -14,13 +14,13 @@ #include #include -#ifndef HAVE_PROCESS_VM_READV // If the syscall wrapper is not available, - // provide one. +#if !HAVE_PROCESS_VM_READV +// If the syscall wrapper is not available, provide one. ssize_t process_vm_readv(::pid_t pid, const struct iovec *local_iov, unsigned long liovcnt, const struct iovec *remote_iov, unsigned long riovcnt, unsigned long flags) { -#ifdef HAVE_NR_PROCESS_VM_READV // If we have the syscall number, we can issue - // the syscall ourselves. +#if HAVE_NR_PROCESS_VM_READV + // If we have the syscall number, we can issue the syscall ourselves. return syscall(__NR_process_vm_readv, pid, local_iov, liovcnt, remote_iov, riovcnt, flags); #else // If not, let's pretend the syscall is not present. Modified: vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Sat Jun 3 15:21:24 2017 (r319532) +++ vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Sat Jun 3 15:21:27 2017 (r319533) @@ -33,6 +33,7 @@ #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolFile.h" #include "lldb/Symbol/SymbolVendor.h" +#include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Utility/DataBufferLLVM.h" @@ -1762,4 +1763,80 @@ PlatformDarwin::LaunchProcess(lldb_private::ProcessLau // Let our parent class do the real launching. return PlatformPOSIX::LaunchProcess(launch_info); +} + +lldb_private::Status +PlatformDarwin::FindBundleBinaryInExecSearchPaths (const ModuleSpec &module_spec, Process *process, + ModuleSP &module_sp, + const FileSpecList *module_search_paths_ptr, + ModuleSP *old_module_sp_ptr, bool *did_create_ptr) +{ + const FileSpec &platform_file = module_spec.GetFileSpec(); + // See if the file is present in any of the module_search_paths_ptr directories. + if (!module_sp && module_search_paths_ptr && platform_file) { + // create a vector of all the file / directory names in platform_file + // e.g. this might be + // /System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation + // + // We'll need to look in the module_search_paths_ptr directories for + // both "UIFoundation" and "UIFoundation.framework" -- most likely the + // latter will be the one we find there. + + FileSpec platform_pull_apart(platform_file); + std::vector path_parts; + ConstString unix_root_dir("/"); + while (true) { + ConstString part = platform_pull_apart.GetLastPathComponent(); + platform_pull_apart.RemoveLastPathComponent(); + if (part.IsEmpty() || part == unix_root_dir) + break; + path_parts.push_back(part.AsCString()); + } + const size_t path_parts_size = path_parts.size(); + + size_t num_module_search_paths = module_search_paths_ptr->GetSize(); + for (size_t i = 0; i < num_module_search_paths; ++i) { + Log *log_verbose = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST); + if (log_verbose) + log_verbose->Printf ("PlatformRemoteDarwinDevice::GetSharedModule searching for binary in search-path %s", module_search_paths_ptr->GetFileSpecAtIndex(i).GetPath().c_str()); + // Create a new FileSpec with this module_search_paths_ptr + // plus just the filename ("UIFoundation"), then the parent + // dir plus filename ("UIFoundation.framework/UIFoundation") + // etc - up to four names (to handle "Foo.framework/Contents/MacOS/Foo") + + for (size_t j = 0; j < 4 && j < path_parts_size - 1; ++j) { + FileSpec path_to_try(module_search_paths_ptr->GetFileSpecAtIndex(i)); + + // Add the components backwards. For + // .../PrivateFrameworks/UIFoundation.framework/UIFoundation + // path_parts is + // [0] UIFoundation + // [1] UIFoundation.framework + // [2] PrivateFrameworks + // + // and if 'j' is 2, we want to append path_parts[1] and then + // path_parts[0], aka + // 'UIFoundation.framework/UIFoundation', to the module_search_paths_ptr + // path. + + for (int k = j; k >= 0; --k) { + path_to_try.AppendPathComponent(path_parts[k]); + } + + if (path_to_try.Exists()) { + ModuleSpec new_module_spec(module_spec); + new_module_spec.GetFileSpec() = path_to_try; + Status new_error(Platform::GetSharedModule( + new_module_spec, process, module_sp, NULL, old_module_sp_ptr, + did_create_ptr)); + + if (module_sp) { + module_sp->SetPlatformFileSpec(path_to_try); + return new_error; + } + } + } + } + } + return Status(); } Modified: vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.h ============================================================================== --- vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.h Sat Jun 3 15:21:24 2017 (r319532) +++ vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformDarwin.h Sat Jun 3 15:21:27 2017 (r319533) @@ -128,9 +128,15 @@ class PlatformDarwin : public PlatformPOSIX { (protect std::vector &options, SDKType sdk_type); + const char *GetDeveloperDirectory(); + + lldb_private::Status + FindBundleBinaryInExecSearchPaths (const lldb_private::ModuleSpec &module_spec, lldb_private::Process *process, + lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr, + lldb::ModuleSP *old_module_sp_ptr, bool *did_create_ptr); + std::string m_developer_directory; - const char *GetDeveloperDirectory(); private: DISALLOW_COPY_AND_ASSIGN(PlatformDarwin); Modified: vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp Sat Jun 3 15:21:24 2017 (r319532) +++ vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp Sat Jun 3 15:21:27 2017 (r319533) @@ -339,5 +339,9 @@ lldb_private::Status PlatformMacOSX::GetSharedModule( } } } + + if (!module_sp) { + error = FindBundleBinaryInExecSearchPaths (module_spec, process, module_sp, module_search_paths_ptr, old_module_sp_ptr, did_create_ptr); + } return error; } Modified: vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp Sat Jun 3 15:21:24 2017 (r319532) +++ vendor/lldb/dist/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp Sat Jun 3 15:21:27 2017 (r319533) @@ -605,70 +605,12 @@ Status PlatformRemoteDarwinDevice::GetSharedModule( // See if the file is present in any of the module_search_paths_ptr // directories. - if (!module_sp && module_search_paths_ptr && platform_file) { - // create a vector of all the file / directory names in platform_file - // e.g. this might be - // /System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation - // - // We'll need to look in the module_search_paths_ptr directories for - // both "UIFoundation" and "UIFoundation.framework" -- most likely the - // latter will be the one we find there. + if (!module_sp) + error = PlatformDarwin::FindBundleBinaryInExecSearchPaths (module_spec, process, module_sp, + module_search_paths_ptr, old_module_sp_ptr, did_create_ptr); - FileSpec platform_pull_apart(platform_file); - std::vector path_parts; - ConstString unix_root_dir("/"); - while (true) { - ConstString part = platform_pull_apart.GetLastPathComponent(); - platform_pull_apart.RemoveLastPathComponent(); - if (part.IsEmpty() || part == unix_root_dir) - break; - path_parts.push_back(part.AsCString()); - } - const size_t path_parts_size = path_parts.size(); - - size_t num_module_search_paths = module_search_paths_ptr->GetSize(); - for (size_t i = 0; i < num_module_search_paths; ++i) { - LLDB_LOGV(log, "searching for binary in search-path {0}", - module_search_paths_ptr->GetFileSpecAtIndex(i)); - // Create a new FileSpec with this module_search_paths_ptr - // plus just the filename ("UIFoundation"), then the parent - // dir plus filename ("UIFoundation.framework/UIFoundation") - // etc - up to four names (to handle "Foo.framework/Contents/MacOS/Foo") - - for (size_t j = 0; j < 4 && j < path_parts_size - 1; ++j) { - FileSpec path_to_try(module_search_paths_ptr->GetFileSpecAtIndex(i)); - - // Add the components backwards. For - // .../PrivateFrameworks/UIFoundation.framework/UIFoundation - // path_parts is - // [0] UIFoundation - // [1] UIFoundation.framework - // [2] PrivateFrameworks - // - // and if 'j' is 2, we want to append path_parts[1] and then - // path_parts[0], aka - // 'UIFoundation.framework/UIFoundation', to the module_search_paths_ptr - // path. - - for (int k = j; k >= 0; --k) { - path_to_try.AppendPathComponent(path_parts[k]); - } - - if (path_to_try.Exists()) { - ModuleSpec new_module_spec(module_spec); - new_module_spec.GetFileSpec() = path_to_try; - Status new_error(Platform::GetSharedModule( - new_module_spec, process, module_sp, NULL, old_module_sp_ptr, - did_create_ptr)); - - if (module_sp) { - module_sp->SetPlatformFileSpec(path_to_try); - return new_error; - } - } - } - } - } + if (error.Success()) + return error; const bool always_create = false; error = ModuleList::GetSharedModule( Modified: vendor/lldb/dist/source/Symbol/ClangASTContext.cpp ============================================================================== --- vendor/lldb/dist/source/Symbol/ClangASTContext.cpp Sat Jun 3 15:21:24 2017 (r319532) +++ vendor/lldb/dist/source/Symbol/ClangASTContext.cpp Sat Jun 3 15:21:27 2017 (r319533) @@ -3938,6 +3938,11 @@ ClangASTContext::GetTypeInfo(lldb::opaque_compiler_typ const clang::Type::TypeClass type_class = qual_type->getTypeClass(); switch (type_class) { + case clang::Type::Attributed: + return GetTypeInfo( + qual_type->getAs() + ->getModifiedType().getAsOpaquePtr(), + pointee_or_element_clang_type); case clang::Type::Builtin: { const clang::BuiltinType *builtin_type = llvm::dyn_cast( qual_type->getCanonicalTypeInternal()); Modified: vendor/lldb/dist/unittests/CMakeLists.txt ============================================================================== --- vendor/lldb/dist/unittests/CMakeLists.txt Sat Jun 3 15:21:24 2017 (r319532) +++ vendor/lldb/dist/unittests/CMakeLists.txt Sat Jun 3 15:21:27 2017 (r319533) @@ -40,7 +40,7 @@ function(add_lldb_unittest test_name) POST_BUILD COMMAND "${CMAKE_COMMAND}" -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/Inputs) - target_link_libraries(${test_name} ${ARG_LINK_LIBS} ${CLANG_USED_LIBS} ${LLDB_SYSTEM_LIBS}) + target_link_libraries(${test_name} ${ARG_LINK_LIBS} ${LLDB_SYSTEM_LIBS}) endfunction() function(add_unittest_inputs test_name inputs) From owner-svn-src-vendor@freebsd.org Sat Jun 3 15:21:35 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 61C08BF3BAB; Sat, 3 Jun 2017 15:21:35 +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 0F27E7385B; Sat, 3 Jun 2017 15:21: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 v53FLYpc083215; Sat, 3 Jun 2017 15:21:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53FLYVC083214; Sat, 3 Jun 2017 15:21:34 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706031521.v53FLYVC083214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 3 Jun 2017 15:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r319534 - vendor/lldb/lldb-trunk-r304659 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 15:21:35 -0000 Author: dim Date: Sat Jun 3 15:21:33 2017 New Revision: 319534 URL: https://svnweb.freebsd.org/changeset/base/319534 Log: Tag lldb trunk r304659. Added: vendor/lldb/lldb-trunk-r304659/ - copied from r319533, vendor/lldb/dist/