From owner-svn-src-all@freebsd.org Fri Feb 14 21:24:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB45124309C; Fri, 14 Feb 2020 21:24:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48K5wq6lX9z4HJ2; Fri, 14 Feb 2020 21:24:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E23A42040; Fri, 14 Feb 2020 21:24:11 +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 01ELOBYt000808; Fri, 14 Feb 2020 21:24:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01ELO3OE000767; Fri, 14 Feb 2020 21:24:03 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202002142124.01ELO3OE000767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 14 Feb 2020 21:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r357937 - in vendor/llvm-project/release-10.x: clang/include/clang/AST clang/include/clang/Basic clang/include/clang/Driver clang/include/clang/Lex clang/include/clang/Sema clang/lib/AS... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm-project/release-10.x: clang/include/clang/AST clang/include/clang/Basic clang/include/clang/Driver clang/include/clang/Lex clang/include/clang/Sema clang/lib/AST clang/lib/Basic clang/l... X-SVN-Commit-Revision: 357937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Feb 2020 21:24:12 -0000 Author: dim Date: Fri Feb 14 21:24:03 2020 New Revision: 357937 URL: https://svnweb.freebsd.org/changeset/base/357937 Log: Vendor import of llvm-project branch release/10.x llvmorg-10.0.0-rc2-0-g90c78073f73. Added: vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/RISCVSchedRocket32.td vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/RISCVSchedRocket64.td vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/RISCVSchedule.td Deleted: vendor/llvm-project/release-10.x/llvm/lib/Target/AMDGPU/SIRemoveShortExecBranches.cpp Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTConcept.h vendor/llvm-project/release-10.x/clang/include/clang/AST/ExprConcepts.h vendor/llvm-project/release-10.x/clang/include/clang/Basic/Cuda.h vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticDriverKinds.td vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticGroups.td vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticSemaKinds.td vendor/llvm-project/release-10.x/clang/include/clang/Driver/CC1Options.td vendor/llvm-project/release-10.x/clang/include/clang/Driver/Job.h vendor/llvm-project/release-10.x/clang/include/clang/Lex/PreprocessorOptions.h vendor/llvm-project/release-10.x/clang/include/clang/Sema/Sema.h vendor/llvm-project/release-10.x/clang/include/clang/Sema/SemaConcept.h vendor/llvm-project/release-10.x/clang/lib/AST/ASTConcept.cpp vendor/llvm-project/release-10.x/clang/lib/AST/ASTContext.cpp vendor/llvm-project/release-10.x/clang/lib/AST/CXXInheritance.cpp vendor/llvm-project/release-10.x/clang/lib/AST/DeclCXX.cpp vendor/llvm-project/release-10.x/clang/lib/AST/Expr.cpp vendor/llvm-project/release-10.x/clang/lib/AST/ExprConcepts.cpp vendor/llvm-project/release-10.x/clang/lib/AST/StmtProfile.cpp vendor/llvm-project/release-10.x/clang/lib/Basic/Cuda.cpp vendor/llvm-project/release-10.x/clang/lib/CodeGen/CodeGenModule.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/Compilation.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/Driver.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/Job.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Clang.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Cuda.cpp vendor/llvm-project/release-10.x/clang/lib/Frontend/CompilerInvocation.cpp vendor/llvm-project/release-10.x/clang/lib/Headers/__clang_cuda_intrinsics.h vendor/llvm-project/release-10.x/clang/lib/Headers/__clang_cuda_runtime_wrapper.h vendor/llvm-project/release-10.x/clang/lib/Headers/xmmintrin.h vendor/llvm-project/release-10.x/clang/lib/Lex/Lexer.cpp vendor/llvm-project/release-10.x/clang/lib/Lex/Pragma.cpp vendor/llvm-project/release-10.x/clang/lib/Parse/ParseDecl.cpp vendor/llvm-project/release-10.x/clang/lib/Parse/ParseDeclCXX.cpp vendor/llvm-project/release-10.x/clang/lib/Parse/ParseExprCXX.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaCast.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaConcept.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaDecl.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaDeclCXX.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaExpr.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaExprCXX.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaOverload.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplate.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateDeduction.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateInstantiate.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp vendor/llvm-project/release-10.x/clang/lib/Serialization/ASTReaderDecl.cpp vendor/llvm-project/release-10.x/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp vendor/llvm-project/release-10.x/clang/tools/driver/cc1_main.cpp vendor/llvm-project/release-10.x/clang/tools/driver/cc1as_main.cpp vendor/llvm-project/release-10.x/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp vendor/llvm-project/release-10.x/libcxx/include/__config vendor/llvm-project/release-10.x/lld/ELF/Arch/ARM.cpp vendor/llvm-project/release-10.x/lld/ELF/Arch/PPC.cpp vendor/llvm-project/release-10.x/lld/ELF/InputSection.cpp vendor/llvm-project/release-10.x/lld/ELF/Relocations.cpp vendor/llvm-project/release-10.x/lld/ELF/SyntheticSections.cpp vendor/llvm-project/release-10.x/lld/ELF/SyntheticSections.h vendor/llvm-project/release-10.x/lld/ELF/Thunks.cpp vendor/llvm-project/release-10.x/lld/docs/ReleaseNotes.rst vendor/llvm-project/release-10.x/lldb/source/DataFormatters/FormatCache.cpp vendor/llvm-project/release-10.x/lldb/source/DataFormatters/LanguageCategory.cpp vendor/llvm-project/release-10.x/lldb/source/Interpreter/CommandAlias.cpp vendor/llvm-project/release-10.x/lldb/source/Interpreter/Options.cpp vendor/llvm-project/release-10.x/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp vendor/llvm-project/release-10.x/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h vendor/llvm-project/release-10.x/llvm/include/llvm/ADT/StringRef.h vendor/llvm-project/release-10.x/llvm/include/llvm/CodeGen/AsmPrinter.h vendor/llvm-project/release-10.x/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h vendor/llvm-project/release-10.x/llvm/include/llvm/ExecutionEngine/Orc/Core.h vendor/llvm-project/release-10.x/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h vendor/llvm-project/release-10.x/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h vendor/llvm-project/release-10.x/llvm/include/llvm/ExecutionEngine/Orc/Layer.h vendor/llvm-project/release-10.x/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h vendor/llvm-project/release-10.x/llvm/include/llvm/Support/CrashRecoveryContext.h vendor/llvm-project/release-10.x/llvm/include/llvm/Support/Process.h vendor/llvm-project/release-10.x/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h vendor/llvm-project/release-10.x/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h vendor/llvm-project/release-10.x/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/CodeGenPrepare.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/GlobalMerge.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/LiveDebugVariables.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/StackColoring.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/TypePromotion.cpp vendor/llvm-project/release-10.x/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp vendor/llvm-project/release-10.x/llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp vendor/llvm-project/release-10.x/llvm/lib/ExecutionEngine/Orc/Core.cpp vendor/llvm-project/release-10.x/llvm/lib/ExecutionEngine/Orc/IRCompileLayer.cpp vendor/llvm-project/release-10.x/llvm/lib/ExecutionEngine/Orc/IRTransformLayer.cpp vendor/llvm-project/release-10.x/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp vendor/llvm-project/release-10.x/llvm/lib/ExecutionEngine/Orc/Layer.cpp vendor/llvm-project/release-10.x/llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp vendor/llvm-project/release-10.x/llvm/lib/IR/AsmWriter.cpp vendor/llvm-project/release-10.x/llvm/lib/Linker/IRMover.cpp vendor/llvm-project/release-10.x/llvm/lib/Support/CRC.cpp vendor/llvm-project/release-10.x/llvm/lib/Support/CrashRecoveryContext.cpp vendor/llvm-project/release-10.x/llvm/lib/Support/ErrorHandling.cpp vendor/llvm-project/release-10.x/llvm/lib/Support/Process.cpp vendor/llvm-project/release-10.x/llvm/lib/Support/Windows/Signals.inc vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h vendor/llvm-project/release-10.x/llvm/lib/Target/AMDGPU/AMDGPU.h vendor/llvm-project/release-10.x/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/AMDGPU/CaymanInstructions.td vendor/llvm-project/release-10.x/llvm/lib/Target/AMDGPU/EvergreenInstructions.td vendor/llvm-project/release-10.x/llvm/lib/Target/AMDGPU/R600Instructions.td vendor/llvm-project/release-10.x/llvm/lib/Target/AMDGPU/SIInsertSkips.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/ARM/ARMISelLowering.h vendor/llvm-project/release-10.x/llvm/lib/Target/ARM/ARMInstrInfo.td vendor/llvm-project/release-10.x/llvm/lib/Target/ARM/ARMInstrThumb2.td vendor/llvm-project/release-10.x/llvm/lib/Target/ARM/ARMTargetTransformInfo.h vendor/llvm-project/release-10.x/llvm/lib/Target/BPF/BPFISelLowering.h vendor/llvm-project/release-10.x/llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/RISCV.td vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/RISCVInstrFormats.td vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/RISCVInstrInfo.td vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/RISCVInstrInfoA.td vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/RISCVInstrInfoC.td vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/RISCVInstrInfoD.td vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/RISCVInstrInfoF.td vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/RISCVInstrInfoM.td vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h vendor/llvm-project/release-10.x/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86ISelLowering.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86MCInstLower.cpp vendor/llvm-project/release-10.x/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp vendor/llvm-project/release-10.x/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp vendor/llvm-project/release-10.x/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp vendor/llvm-project/release-10.x/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp vendor/llvm-project/release-10.x/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp vendor/llvm-project/release-10.x/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h vendor/llvm-project/release-10.x/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp vendor/llvm-project/release-10.x/llvm/tools/lli/lli.cpp Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTConcept.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTConcept.h Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTConcept.h Fri Feb 14 21:24:03 2020 (r357937) @@ -29,14 +29,14 @@ class ConceptSpecializationExpr; class ConstraintSatisfaction : public llvm::FoldingSetNode { // The template-like entity that 'owns' the constraint checked here (can be a // constrained entity or a concept). - NamedDecl *ConstraintOwner = nullptr; + const NamedDecl *ConstraintOwner = nullptr; llvm::SmallVector TemplateArgs; public: ConstraintSatisfaction() = default; - ConstraintSatisfaction(NamedDecl *ConstraintOwner, + ConstraintSatisfaction(const NamedDecl *ConstraintOwner, ArrayRef TemplateArgs) : ConstraintOwner(ConstraintOwner), TemplateArgs(TemplateArgs.begin(), TemplateArgs.end()) { } @@ -57,7 +57,7 @@ class ConstraintSatisfaction : public llvm::FoldingSet } static void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C, - NamedDecl *ConstraintOwner, + const NamedDecl *ConstraintOwner, ArrayRef TemplateArgs); }; Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/ExprConcepts.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/AST/ExprConcepts.h Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/ExprConcepts.h Fri Feb 14 21:24:03 2020 (r357937) @@ -63,6 +63,12 @@ class ConceptSpecializationExpr final : public Expr, p ArrayRef ConvertedArgs, const ConstraintSatisfaction *Satisfaction); + ConceptSpecializationExpr(const ASTContext &C, ConceptDecl *NamedConcept, + ArrayRef ConvertedArgs, + const ConstraintSatisfaction *Satisfaction, + bool Dependent, + bool ContainsUnexpandedParameterPack); + ConceptSpecializationExpr(EmptyShell Empty, unsigned NumTemplateArgs); public: @@ -74,6 +80,13 @@ class ConceptSpecializationExpr final : public Expr, p const ASTTemplateArgumentListInfo *ArgsAsWritten, ArrayRef ConvertedArgs, const ConstraintSatisfaction *Satisfaction); + + static ConceptSpecializationExpr * + Create(const ASTContext &C, ConceptDecl *NamedConcept, + ArrayRef ConvertedArgs, + const ConstraintSatisfaction *Satisfaction, + bool Dependent, + bool ContainsUnexpandedParameterPack); static ConceptSpecializationExpr * Create(ASTContext &C, EmptyShell Empty, unsigned NumTemplateArgs); Modified: vendor/llvm-project/release-10.x/clang/include/clang/Basic/Cuda.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/Basic/Cuda.h Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/include/clang/Basic/Cuda.h Fri Feb 14 21:24:03 2020 (r357937) @@ -11,6 +11,7 @@ namespace llvm { class StringRef; +class Twine; class VersionTuple; } // namespace llvm @@ -30,7 +31,7 @@ enum class CudaVersion { }; const char *CudaVersionToString(CudaVersion V); // Input is "Major.Minor" -CudaVersion CudaStringToVersion(llvm::StringRef S); +CudaVersion CudaStringToVersion(const llvm::Twine &S); enum class CudaArch { UNKNOWN, Modified: vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticDriverKinds.td ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticDriverKinds.td Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticDriverKinds.td Fri Feb 14 21:24:03 2020 (r357937) @@ -60,6 +60,9 @@ def err_drv_cuda_version_unsupported : Error< "but installation at %3 is %4. Use --cuda-path to specify a different CUDA " "install, pass a different GPU arch with --cuda-gpu-arch, or pass " "--no-cuda-version-check.">; +def warn_drv_unknown_cuda_version: Warning< + "Unknown CUDA version %0. Assuming the latest supported version %1">, + InGroup; def err_drv_cuda_host_arch : Error<"unsupported architecture '%0' for host compilation.">; def err_drv_mix_cuda_hip : Error<"Mixed Cuda and HIP compilation is not supported.">; def err_drv_invalid_thread_model_for_target : Error< Modified: vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticGroups.td Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticGroups.td Fri Feb 14 21:24:03 2020 (r357937) @@ -384,7 +384,10 @@ def GNULabelsAsValue : DiagGroup<"gnu-label-as-value"> def LiteralRange : DiagGroup<"literal-range">; def LocalTypeTemplateArgs : DiagGroup<"local-type-template-args", [CXX98CompatLocalTypeTemplateArgs]>; -def RangeLoopAnalysis : DiagGroup<"range-loop-analysis">; +def RangeLoopConstruct : DiagGroup<"range-loop-construct">; +def RangeLoopBindReference : DiagGroup<"range-loop-bind-reference">; +def RangeLoopAnalysis : DiagGroup<"range-loop-analysis", + [RangeLoopConstruct, RangeLoopBindReference]>; def ForLoopAnalysis : DiagGroup<"for-loop-analysis">; def LoopAnalysis : DiagGroup<"loop-analysis", [ForLoopAnalysis, RangeLoopAnalysis]>; @@ -858,14 +861,15 @@ def Most : DiagGroup<"most", [ Comment, DeleteNonVirtualDtor, Format, + ForLoopAnalysis, Implicit, InfiniteRecursion, IntInBoolContext, - LoopAnalysis, MismatchedTags, MissingBraces, Move, MultiChar, + RangeLoopConstruct, Reorder, ReturnType, SelfAssignment, @@ -1112,6 +1116,9 @@ def SerializedDiagnostics : DiagGroup<"serialized-diag // A warning group for warnings about code that clang accepts when // compiling CUDA C/C++ but which is not compatible with the CUDA spec. def CudaCompat : DiagGroup<"cuda-compat">; + +// Warning about unknown CUDA SDK version. +def CudaUnknownVersion: DiagGroup<"unknown-cuda-version">; // A warning group for warnings about features supported by HIP but // ignored by CUDA. Modified: vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticSemaKinds.td Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticSemaKinds.td Fri Feb 14 21:24:03 2020 (r357937) @@ -2378,17 +2378,17 @@ def warn_for_range_const_reference_copy : Warning< "loop variable %0 " "%diff{has type $ but is initialized with type $" "| is initialized with a value of a different type}1,2 resulting in a copy">, - InGroup, DefaultIgnore; + InGroup, DefaultIgnore; def note_use_type_or_non_reference : Note< "use non-reference type %0 to keep the copy or type %1 to prevent copying">; def warn_for_range_variable_always_copy : Warning< "loop variable %0 is always a copy because the range of type %1 does not " "return a reference">, - InGroup, DefaultIgnore; + InGroup, DefaultIgnore; def note_use_non_reference_type : Note<"use non-reference type %0">; def warn_for_range_copy : Warning< "loop variable %0 of type %1 creates a copy from type %2">, - InGroup, DefaultIgnore; + InGroup, DefaultIgnore; def note_use_reference_type : Note<"use reference type %0 to prevent copying">; def err_objc_for_range_init_stmt : Error< "initialization statement is not supported when iterating over Objective-C " @@ -4683,6 +4683,8 @@ def note_checking_constraints_for_var_spec_id_here : N def note_checking_constraints_for_class_spec_id_here : Note< "while checking constraint satisfaction for class template partial " "specialization '%0' required here">; +def note_checking_constraints_for_function_here : Note< + "while checking constraint satisfaction for function '%0' required here">; def note_constraint_substitution_here : Note< "while substituting template arguments into constraint expression here">; def note_constraint_normalization_here : Note< @@ -6746,6 +6748,10 @@ def err_bad_cxx_cast_scalar_to_vector_different_size : def err_bad_cxx_cast_vector_to_vector_different_size : Error< "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " "to vector %2 of different size">; +def warn_bad_cxx_cast_nested_pointer_addr_space : Warning< + "%select{reinterpret_cast|C-style cast}0 from %1 to %2 " + "changes address space of nested pointers">, + InGroup; def err_bad_lvalue_to_rvalue_cast : Error< "cannot cast from lvalue of type %1 to rvalue reference type %2; types are " "not compatible">; @@ -8390,6 +8396,12 @@ def note_defaulted_comparison_cannot_deduce : Note< "return type of defaulted 'operator<=>' cannot be deduced because " "return type %2 of three-way comparison for %select{|member|base class}0 %1 " "is not a standard comparison category type">; +def err_defaulted_comparison_cannot_deduce_undeduced_auto : Error< + "return type of defaulted 'operator<=>' cannot be deduced because " + "three-way comparison for %select{|member|base class}0 %1 " + "has a deduced return type and is not yet defined">; +def note_defaulted_comparison_cannot_deduce_undeduced_auto : Note< + "%select{|member|base class}0 %1 declared here">; def note_defaulted_comparison_cannot_deduce_callee : Note< "selected 'operator<=>' for %select{|member|base class}0 %1 declared here">; def err_incorrect_defaulted_comparison_constexpr : Error< Modified: vendor/llvm-project/release-10.x/clang/include/clang/Driver/CC1Options.td ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/Driver/CC1Options.td Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/include/clang/Driver/CC1Options.td Fri Feb 14 21:24:03 2020 (r357937) @@ -859,6 +859,8 @@ def detailed_preprocessing_record : Flag<["-"], "detai HelpText<"include a detailed record of preprocessing actions">; def setup_static_analyzer : Flag<["-"], "setup-static-analyzer">, HelpText<"Set up preprocessor for static analyzer (done automatically when static analyzer is run).">; +def disable_pragma_debug_crash : Flag<["-"], "disable-pragma-debug-crash">, + HelpText<"Disable any #pragma clang __debug that can lead to crashing behavior. This is meant for testing.">; //===----------------------------------------------------------------------===// // OpenCL Options Modified: vendor/llvm-project/release-10.x/clang/include/clang/Driver/Job.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/Driver/Job.h Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/include/clang/Driver/Job.h Fri Feb 14 21:24:03 2020 (r357937) @@ -55,9 +55,6 @@ class Command { /// The list of program arguments which are inputs. llvm::opt::ArgStringList InputFilenames; - /// Whether to print the input filenames when executing. - bool PrintInputFilenames = false; - /// Response file name, if this command is set to use one, or nullptr /// otherwise const char *ResponseFile = nullptr; @@ -86,6 +83,12 @@ class Command { void writeResponseFile(raw_ostream &OS) const; public: + /// Whether to print the input filenames when executing. + bool PrintInputFilenames = false; + + /// Whether the command will be executed in this process or not. + bool InProcess = false; + Command(const Action &Source, const Tool &Creator, const char *Executable, const llvm::opt::ArgStringList &Arguments, ArrayRef Inputs); @@ -128,9 +131,6 @@ class Command { /// Print a command argument, and optionally quote it. static void printArg(llvm::raw_ostream &OS, StringRef Arg, bool Quote); - /// Set whether to print the input filenames when executing. - void setPrintInputFilenames(bool P) { PrintInputFilenames = P; } - protected: /// Optionally print the filenames to be compiled void PrintFileNames() const; @@ -139,7 +139,9 @@ class Command { /// Use the CC1 tool callback when available, to avoid creating a new process class CC1Command : public Command { public: - using Command::Command; + CC1Command(const Action &Source, const Tool &Creator, const char *Executable, + const llvm::opt::ArgStringList &Arguments, + ArrayRef Inputs); void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote, CrashReportInfo *CrashInfo = nullptr) const override; Modified: vendor/llvm-project/release-10.x/clang/include/clang/Lex/PreprocessorOptions.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/Lex/PreprocessorOptions.h Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/include/clang/Lex/PreprocessorOptions.h Fri Feb 14 21:24:03 2020 (r357937) @@ -189,6 +189,9 @@ class PreprocessorOptions { (public) /// Set up preprocessor for RunAnalysis action. bool SetUpStaticAnalyzer = false; + /// Prevents intended crashes when using #pragma clang __debug. For testing. + bool DisablePragmaDebugCrash = false; + public: PreprocessorOptions() : PrecompiledPreambleBytes(0, false) {} Modified: vendor/llvm-project/release-10.x/clang/include/clang/Sema/Sema.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/Sema/Sema.h Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/include/clang/Sema/Sema.h Fri Feb 14 21:24:03 2020 (r357937) @@ -6275,7 +6275,7 @@ class Sema final { (public) /// \returns true if an error occurred and satisfaction could not be checked, /// false otherwise. bool CheckConstraintSatisfaction( - NamedDecl *Template, ArrayRef ConstraintExprs, + const NamedDecl *Template, ArrayRef ConstraintExprs, ArrayRef TemplateArgs, SourceRange TemplateIDRange, ConstraintSatisfaction &Satisfaction); @@ -6288,6 +6288,17 @@ class Sema final { (public) bool CheckConstraintSatisfaction(const Expr *ConstraintExpr, ConstraintSatisfaction &Satisfaction); + /// Check whether the given function decl's trailing requires clause is + /// satisfied, if any. Returns false and updates Satisfaction with the + /// satisfaction verdict if successful, emits a diagnostic and returns true if + /// an error occured and satisfaction could not be determined. + /// + /// \returns true if an error occurred, false otherwise. + bool CheckFunctionConstraints(const FunctionDecl *FD, + ConstraintSatisfaction &Satisfaction, + SourceLocation UsageLoc = SourceLocation()); + + /// \brief Ensure that the given template arguments satisfy the constraints /// associated with the given template, emitting a diagnostic if they do not. /// @@ -6986,7 +6997,7 @@ class Sema final { (public) /// Get a template argument mapping the given template parameter to itself, /// e.g. for X in \c template, this would return an expression template /// argument referencing X. - TemplateArgumentLoc getIdentityTemplateArgumentLoc(Decl *Param, + TemplateArgumentLoc getIdentityTemplateArgumentLoc(NamedDecl *Param, SourceLocation Location); void translateTemplateArguments(const ASTTemplateArgsPtr &In, Modified: vendor/llvm-project/release-10.x/clang/include/clang/Sema/SemaConcept.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/Sema/SemaConcept.h Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/include/clang/Sema/SemaConcept.h Fri Feb 14 21:24:03 2020 (r357937) @@ -43,11 +43,15 @@ struct AtomicConstraint { if (ParameterMapping->size() != Other.ParameterMapping->size()) return false; - for (unsigned I = 0, S = ParameterMapping->size(); I < S; ++I) - if (!C.getCanonicalTemplateArgument((*ParameterMapping)[I].getArgument()) - .structurallyEquals(C.getCanonicalTemplateArgument( - (*Other.ParameterMapping)[I].getArgument()))) + for (unsigned I = 0, S = ParameterMapping->size(); I < S; ++I) { + llvm::FoldingSetNodeID IDA, IDB; + C.getCanonicalTemplateArgument((*ParameterMapping)[I].getArgument()) + .Profile(IDA, C); + C.getCanonicalTemplateArgument((*Other.ParameterMapping)[I].getArgument()) + .Profile(IDB, C); + if (IDA != IDB) return false; + } return true; } Modified: vendor/llvm-project/release-10.x/clang/lib/AST/ASTConcept.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/AST/ASTConcept.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/AST/ASTConcept.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -59,8 +59,8 @@ ASTConstraintSatisfaction::Create(const ASTContext &C, } void ConstraintSatisfaction::Profile( - llvm::FoldingSetNodeID &ID, const ASTContext &C, NamedDecl *ConstraintOwner, - ArrayRef TemplateArgs) { + llvm::FoldingSetNodeID &ID, const ASTContext &C, + const NamedDecl *ConstraintOwner, ArrayRef TemplateArgs) { ID.AddPointer(ConstraintOwner); ID.AddInteger(TemplateArgs.size()); for (auto &Arg : TemplateArgs) Modified: vendor/llvm-project/release-10.x/clang/lib/AST/ASTContext.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/AST/ASTContext.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/AST/ASTContext.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -756,12 +756,8 @@ canonicalizeImmediatelyDeclaredConstraint(const ASTCon NewConverted.push_back(Arg); } Expr *NewIDC = ConceptSpecializationExpr::Create( - C, NestedNameSpecifierLoc(), /*TemplateKWLoc=*/SourceLocation(), - CSE->getConceptNameInfo(), /*FoundDecl=*/CSE->getNamedConcept(), - CSE->getNamedConcept(), - // Actually canonicalizing a TemplateArgumentLoc is difficult so we - // simply omit the ArgsAsWritten - /*ArgsAsWritten=*/nullptr, NewConverted, nullptr); + C, CSE->getNamedConcept(), NewConverted, nullptr, + CSE->isInstantiationDependent(), CSE->containsUnexpandedParameterPack()); if (auto *OrigFold = dyn_cast(IDC)) NewIDC = new (C) CXXFoldExpr(OrigFold->getType(), SourceLocation(), NewIDC, Modified: vendor/llvm-project/release-10.x/clang/lib/AST/CXXInheritance.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/AST/CXXInheritance.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/AST/CXXInheritance.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -758,6 +758,8 @@ CXXRecordDecl::getFinalOverriders(CXXFinalOverriderMap return false; }; + // FIXME: IsHidden reads from Overriding from the middle of a remove_if + // over the same sequence! Is this guaranteed to work? Overriding.erase( std::remove_if(Overriding.begin(), Overriding.end(), IsHidden), Overriding.end()); Modified: vendor/llvm-project/release-10.x/clang/lib/AST/DeclCXX.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/AST/DeclCXX.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/AST/DeclCXX.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -2038,17 +2038,36 @@ CXXMethodDecl::getCorrespondingMethodInClass(const CXX if (auto *MD = getCorrespondingMethodDeclaredInClass(RD, MayBeBase)) return MD; + llvm::SmallVector FinalOverriders; + auto AddFinalOverrider = [&](CXXMethodDecl *D) { + // If this function is overridden by a candidate final overrider, it is not + // a final overrider. + for (CXXMethodDecl *OtherD : FinalOverriders) { + if (declaresSameEntity(D, OtherD) || recursivelyOverrides(OtherD, D)) + return; + } + + // Other candidate final overriders might be overridden by this function. + FinalOverriders.erase( + std::remove_if(FinalOverriders.begin(), FinalOverriders.end(), + [&](CXXMethodDecl *OtherD) { + return recursivelyOverrides(D, OtherD); + }), + FinalOverriders.end()); + + FinalOverriders.push_back(D); + }; + for (const auto &I : RD->bases()) { const RecordType *RT = I.getType()->getAs(); if (!RT) continue; const auto *Base = cast(RT->getDecl()); - CXXMethodDecl *T = this->getCorrespondingMethodInClass(Base); - if (T) - return T; + if (CXXMethodDecl *D = this->getCorrespondingMethodInClass(Base)) + AddFinalOverrider(D); } - return nullptr; + return FinalOverriders.size() == 1 ? FinalOverriders.front() : nullptr; } CXXMethodDecl *CXXMethodDecl::Create(ASTContext &C, CXXRecordDecl *RD, @@ -2104,6 +2123,11 @@ CXXMethodDecl *CXXMethodDecl::getDevirtualizedMethod(c // There may be a method corresponding to MD in a derived class. CXXMethodDecl *DevirtualizedMethod = getCorrespondingMethodInClass(BestDynamicDecl); + + // If there final overrider in the dynamic type is ambiguous, we can't + // devirtualize this call. + if (!DevirtualizedMethod) + return nullptr; // If that method is pure virtual, we can't devirtualize. If this code is // reached, the result would be UB, not a direct call to the derived class Modified: vendor/llvm-project/release-10.x/clang/lib/AST/Expr.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/AST/Expr.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/AST/Expr.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -1685,6 +1685,11 @@ MemberExpr *MemberExpr::Create( CXXRecordDecl *RD = dyn_cast_or_null(DC); if (RD && RD->isDependentContext() && RD->isCurrentInstantiation(DC)) E->setTypeDependent(T->isDependentType()); + + // Bitfield with value-dependent width is type-dependent. + FieldDecl *FD = dyn_cast(MemberDecl); + if (FD && FD->isBitField() && FD->getBitWidth()->isValueDependent()) + E->setTypeDependent(true); } if (HasQualOrFound) { Modified: vendor/llvm-project/release-10.x/clang/lib/AST/ExprConcepts.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/AST/ExprConcepts.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/AST/ExprConcepts.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -46,24 +46,12 @@ ConceptSpecializationExpr::ConceptSpecializationExpr(c ASTConstraintSatisfaction::Create(C, *Satisfaction) : nullptr) { setTemplateArguments(ConvertedArgs); -} - -ConceptSpecializationExpr::ConceptSpecializationExpr(EmptyShell Empty, - unsigned NumTemplateArgs) - : Expr(ConceptSpecializationExprClass, Empty), ConceptReference(), - NumTemplateArgs(NumTemplateArgs) { } - -void ConceptSpecializationExpr::setTemplateArguments( - ArrayRef Converted) { - assert(Converted.size() == NumTemplateArgs); - std::uninitialized_copy(Converted.begin(), Converted.end(), - getTrailingObjects()); bool IsInstantiationDependent = false; bool ContainsUnexpandedParameterPack = false; - for (const TemplateArgument& Arg : Converted) { - if (Arg.isInstantiationDependent()) + for (const TemplateArgumentLoc& ArgLoc : ArgsAsWritten->arguments()) { + if (ArgLoc.getArgument().isInstantiationDependent()) IsInstantiationDependent = true; - if (Arg.containsUnexpandedParameterPack()) + if (ArgLoc.getArgument().containsUnexpandedParameterPack()) ContainsUnexpandedParameterPack = true; if (ContainsUnexpandedParameterPack && IsInstantiationDependent) break; @@ -80,6 +68,18 @@ void ConceptSpecializationExpr::setTemplateArguments( "should not be value-dependent"); } +ConceptSpecializationExpr::ConceptSpecializationExpr(EmptyShell Empty, + unsigned NumTemplateArgs) + : Expr(ConceptSpecializationExprClass, Empty), ConceptReference(), + NumTemplateArgs(NumTemplateArgs) { } + +void ConceptSpecializationExpr::setTemplateArguments( + ArrayRef Converted) { + assert(Converted.size() == NumTemplateArgs); + std::uninitialized_copy(Converted.begin(), Converted.end(), + getTrailingObjects()); +} + ConceptSpecializationExpr * ConceptSpecializationExpr::Create(const ASTContext &C, NestedNameSpecifierLoc NNS, @@ -96,6 +96,39 @@ ConceptSpecializationExpr::Create(const ASTContext &C, ConceptNameInfo, FoundDecl, NamedConcept, ArgsAsWritten, ConvertedArgs, Satisfaction); +} + +ConceptSpecializationExpr::ConceptSpecializationExpr( + const ASTContext &C, ConceptDecl *NamedConcept, + ArrayRef ConvertedArgs, + const ConstraintSatisfaction *Satisfaction, bool Dependent, + bool ContainsUnexpandedParameterPack) + : Expr(ConceptSpecializationExprClass, C.BoolTy, VK_RValue, OK_Ordinary, + /*TypeDependent=*/false, + /*ValueDependent=*/!Satisfaction, Dependent, + ContainsUnexpandedParameterPack), + ConceptReference(NestedNameSpecifierLoc(), SourceLocation(), + DeclarationNameInfo(), NamedConcept, + NamedConcept, nullptr), + NumTemplateArgs(ConvertedArgs.size()), + Satisfaction(Satisfaction ? + ASTConstraintSatisfaction::Create(C, *Satisfaction) : + nullptr) { + setTemplateArguments(ConvertedArgs); +} + +ConceptSpecializationExpr * +ConceptSpecializationExpr::Create(const ASTContext &C, + ConceptDecl *NamedConcept, + ArrayRef ConvertedArgs, + const ConstraintSatisfaction *Satisfaction, + bool Dependent, + bool ContainsUnexpandedParameterPack) { + void *Buffer = C.Allocate(totalSizeToAlloc( + ConvertedArgs.size())); + return new (Buffer) ConceptSpecializationExpr( + C, NamedConcept, ConvertedArgs, Satisfaction, Dependent, + ContainsUnexpandedParameterPack); } ConceptSpecializationExpr * Modified: vendor/llvm-project/release-10.x/clang/lib/AST/StmtProfile.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/AST/StmtProfile.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/AST/StmtProfile.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -1535,8 +1535,8 @@ static Stmt::StmtClass DecodeOperatorCall(const CXXOpe return Stmt::BinaryOperatorClass; case OO_Spaceship: - // FIXME: Update this once we support <=> expressions. - llvm_unreachable("<=> expressions not supported yet"); + BinaryOp = BO_Cmp; + return Stmt::BinaryOperatorClass; case OO_AmpAmp: BinaryOp = BO_LAnd; Modified: vendor/llvm-project/release-10.x/clang/lib/Basic/Cuda.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Basic/Cuda.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Basic/Cuda.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -2,6 +2,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSwitch.h" +#include "llvm/ADT/Twine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/VersionTuple.h" @@ -31,8 +32,8 @@ const char *CudaVersionToString(CudaVersion V) { llvm_unreachable("invalid enum"); } -CudaVersion CudaStringToVersion(llvm::StringRef S) { - return llvm::StringSwitch(S) +CudaVersion CudaStringToVersion(const llvm::Twine &S) { + return llvm::StringSwitch(S.str()) .Case("7.0", CudaVersion::CUDA_70) .Case("7.5", CudaVersion::CUDA_75) .Case("8.0", CudaVersion::CUDA_80) @@ -40,7 +41,8 @@ CudaVersion CudaStringToVersion(llvm::StringRef S) { .Case("9.1", CudaVersion::CUDA_91) .Case("9.2", CudaVersion::CUDA_92) .Case("10.0", CudaVersion::CUDA_100) - .Case("10.1", CudaVersion::CUDA_101); + .Case("10.1", CudaVersion::CUDA_101) + .Default(CudaVersion::UNKNOWN); } const char *CudaArchToString(CudaArch A) { Modified: vendor/llvm-project/release-10.x/clang/lib/CodeGen/CodeGenModule.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/CodeGen/CodeGenModule.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/CodeGen/CodeGenModule.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -537,6 +537,13 @@ void CodeGenModule::Release() { getModule().addModuleFlag(llvm::Module::Error, "min_enum_size", EnumWidth); } + if (Arch == llvm::Triple::riscv32 || Arch == llvm::Triple::riscv64) { + StringRef ABIStr = Target.getABI(); + llvm::LLVMContext &Ctx = TheModule.getContext(); + getModule().addModuleFlag(llvm::Module::Error, "target-abi", + llvm::MDString::get(Ctx, ABIStr)); + } + if (CodeGenOpts.SanitizeCfiCrossDso) { // Indicate that we want cross-DSO control flow integrity checks. getModule().addModuleFlag(llvm::Module::Override, "Cross-DSO CFI", 1); Modified: vendor/llvm-project/release-10.x/clang/lib/Driver/Compilation.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Driver/Compilation.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Driver/Compilation.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -258,13 +258,22 @@ void Compilation::initCompilationForDiagnostics() { // Remove any user specified output. Claim any unclaimed arguments, so as // to avoid emitting warnings about unused args. - OptSpecifier OutputOpts[] = { options::OPT_o, options::OPT_MD, - options::OPT_MMD }; + OptSpecifier OutputOpts[] = { + options::OPT_o, options::OPT_MD, options::OPT_MMD, options::OPT_M, + options::OPT_MM, options::OPT_MF, options::OPT_MG, options::OPT_MJ, + options::OPT_MQ, options::OPT_MT, options::OPT_MV}; for (unsigned i = 0, e = llvm::array_lengthof(OutputOpts); i != e; ++i) { if (TranslatedArgs->hasArg(OutputOpts[i])) TranslatedArgs->eraseArg(OutputOpts[i]); } TranslatedArgs->ClaimAllArgs(); + + // Force re-creation of the toolchain Args, otherwise our modifications just + // above will have no effect. + for (auto Arg : TCArgs) + if (Arg.second != TranslatedArgs) + delete Arg.second; + TCArgs.clear(); // Redirect stdout/stderr to /dev/null. Redirects = {None, {""}, {""}}; Modified: vendor/llvm-project/release-10.x/clang/lib/Driver/Driver.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Driver/Driver.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Driver/Driver.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -3757,6 +3757,11 @@ void Driver::BuildJobs(Compilation &C) const { /*TargetDeviceOffloadKind*/ Action::OFK_None); } + // If we have more than one job, then disable integrated-cc1 for now. + if (C.getJobs().size() > 1) + for (auto &J : C.getJobs()) + J.InProcess = false; + // If the user passed -Qunused-arguments or there were errors, don't warn // about any unused arguments. if (Diags.hasErrorOccurred() || Modified: vendor/llvm-project/release-10.x/clang/lib/Driver/Job.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Driver/Job.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Driver/Job.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -371,14 +371,29 @@ int Command::Execute(ArrayRef Inputs) + : Command(Source, Creator, Executable, Arguments, Inputs) { + InProcess = true; +} + void CC1Command::Print(raw_ostream &OS, const char *Terminator, bool Quote, CrashReportInfo *CrashInfo) const { - OS << " (in-process)\n"; + if (InProcess) + OS << " (in-process)\n"; Command::Print(OS, Terminator, Quote, CrashInfo); } -int CC1Command::Execute(ArrayRef> /*Redirects*/, +int CC1Command::Execute(ArrayRef> Redirects, std::string *ErrMsg, bool *ExecutionFailed) const { + // FIXME: Currently, if there're more than one job, we disable + // -fintegrate-cc1. If we're no longer a integrated-cc1 job, fallback to + // out-of-process execution. See discussion in https://reviews.llvm.org/D74447 + if (!InProcess) + return Command::Execute(Redirects, ErrMsg, ExecutionFailed); + PrintFileNames(); SmallVector Argv; Modified: vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Clang.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Clang.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -4679,6 +4679,11 @@ void Clang::ConstructJob(Compilation &C, const JobActi : "-"); } + // Give the gen diagnostics more chances to succeed, by avoiding intentional + // crashes. + if (D.CCGenDiagnostics) + CmdArgs.push_back("-disable-pragma-debug-crash"); + bool UseSeparateSections = isUseSeparateSections(Triple); if (Args.hasFlag(options::OPT_ffunction_sections, @@ -6048,7 +6053,7 @@ void Clang::ConstructJob(Compilation &C, const JobActi if (Output.getType() == types::TY_Object && Args.hasFlag(options::OPT__SLASH_showFilenames, options::OPT__SLASH_showFilenames_, false)) { - C.getJobs().getJobs().back()->setPrintInputFilenames(true); + C.getJobs().getJobs().back()->PrintInputFilenames = true; } if (Arg *A = Args.getLastArg(options::OPT_pg)) Modified: vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Cuda.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Cuda.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Cuda.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -32,37 +32,24 @@ using namespace llvm::opt; // Parses the contents of version.txt in an CUDA installation. It should // contain one line of the from e.g. "CUDA Version 7.5.2". -static CudaVersion ParseCudaVersionFile(llvm::StringRef V) { +static CudaVersion ParseCudaVersionFile(const Driver &D, llvm::StringRef V) { if (!V.startswith("CUDA Version ")) return CudaVersion::UNKNOWN; V = V.substr(strlen("CUDA Version ")); - int Major = -1, Minor = -1; - auto First = V.split('.'); - auto Second = First.second.split('.'); - if (First.first.getAsInteger(10, Major) || - Second.first.getAsInteger(10, Minor)) + SmallVector VersionParts; + V.split(VersionParts, '.'); + if (VersionParts.size() < 2) return CudaVersion::UNKNOWN; + std::string MajorMinor = join_items(".", VersionParts[0], VersionParts[1]); + CudaVersion Version = CudaStringToVersion(MajorMinor); + if (Version != CudaVersion::UNKNOWN) + return Version; - if (Major == 7 && Minor == 0) { - // This doesn't appear to ever happen -- version.txt doesn't exist in the - // CUDA 7 installs I've seen. But no harm in checking. - return CudaVersion::CUDA_70; - } - if (Major == 7 && Minor == 5) - return CudaVersion::CUDA_75; - if (Major == 8 && Minor == 0) - return CudaVersion::CUDA_80; - if (Major == 9 && Minor == 0) - return CudaVersion::CUDA_90; - if (Major == 9 && Minor == 1) - return CudaVersion::CUDA_91; - if (Major == 9 && Minor == 2) - return CudaVersion::CUDA_92; - if (Major == 10 && Minor == 0) - return CudaVersion::CUDA_100; - if (Major == 10 && Minor == 1) - return CudaVersion::CUDA_101; - return CudaVersion::UNKNOWN; + // Issue a warning and assume that the version we've found is compatible with + // the latest version we support. + D.Diag(diag::warn_drv_unknown_cuda_version) + << MajorMinor << CudaVersionToString(CudaVersion::LATEST); + return CudaVersion::LATEST; } CudaInstallationDetector::CudaInstallationDetector( @@ -160,7 +147,7 @@ CudaInstallationDetector::CudaInstallationDetector( // version.txt isn't present. Version = CudaVersion::CUDA_70; } else { - Version = ParseCudaVersionFile((*VersionFile)->getBuffer()); + Version = ParseCudaVersionFile(D, (*VersionFile)->getBuffer()); } if (Version >= CudaVersion::CUDA_90) { Modified: vendor/llvm-project/release-10.x/clang/lib/Frontend/CompilerInvocation.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Frontend/CompilerInvocation.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Frontend/CompilerInvocation.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -3440,6 +3440,7 @@ static void ParsePreprocessorArgs(PreprocessorOptions Opts.LexEditorPlaceholders = false; Opts.SetUpStaticAnalyzer = Args.hasArg(OPT_setup_static_analyzer); + Opts.DisablePragmaDebugCrash = Args.hasArg(OPT_disable_pragma_debug_crash); } static void ParsePreprocessorOutputArgs(PreprocessorOutputOptions &Opts, Modified: vendor/llvm-project/release-10.x/clang/lib/Headers/__clang_cuda_intrinsics.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Headers/__clang_cuda_intrinsics.h Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Headers/__clang_cuda_intrinsics.h Fri Feb 14 21:24:03 2020 (r357937) @@ -45,7 +45,7 @@ _Static_assert(sizeof(__val) == sizeof(__Bits)); \ _Static_assert(sizeof(__Bits) == 2 * sizeof(int)); \ __Bits __tmp; \ - memcpy(&__val, &__tmp, sizeof(__val)); \ + memcpy(&__tmp, &__val, sizeof(__val)); \ __tmp.__a = ::__FnName(__tmp.__a, __offset, __width); \ __tmp.__b = ::__FnName(__tmp.__b, __offset, __width); \ long long __ret; \ @@ -129,7 +129,7 @@ __MAKE_SHUFFLES(__shfl_xor, __nvvm_shfl_bfly_i32, __nv _Static_assert(sizeof(__val) == sizeof(__Bits)); \ _Static_assert(sizeof(__Bits) == 2 * sizeof(int)); \ __Bits __tmp; \ - memcpy(&__val, &__tmp, sizeof(__val)); \ + memcpy(&__tmp, &__val, sizeof(__val)); \ __tmp.__a = ::__FnName(__mask, __tmp.__a, __offset, __width); \ __tmp.__b = ::__FnName(__mask, __tmp.__b, __offset, __width); \ long long __ret; \ Modified: vendor/llvm-project/release-10.x/clang/lib/Headers/__clang_cuda_runtime_wrapper.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Headers/__clang_cuda_runtime_wrapper.h Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Headers/__clang_cuda_runtime_wrapper.h Fri Feb 14 21:24:03 2020 (r357937) @@ -48,7 +48,7 @@ #include "cuda.h" #if !defined(CUDA_VERSION) #error "cuda.h did not define CUDA_VERSION" -#elif CUDA_VERSION < 7000 || CUDA_VERSION > 10010 +#elif CUDA_VERSION < 7000 #error "Unsupported CUDA version!" #endif Modified: vendor/llvm-project/release-10.x/clang/lib/Headers/xmmintrin.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Headers/xmmintrin.h Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Headers/xmmintrin.h Fri Feb 14 21:24:03 2020 (r357937) @@ -2181,7 +2181,7 @@ void _mm_sfence(void); /// 3: Bits [63:48] are copied to the destination. /// \returns A 16-bit integer containing the extracted 16 bits of packed data. #define _mm_extract_pi16(a, n) \ - (int)__builtin_ia32_vec_ext_v4hi((__m64)a, (int)n) + (int)__builtin_ia32_vec_ext_v4hi((__v4hi)a, (int)n) /// Copies data from the 64-bit vector of [4 x i16] to the destination, /// and inserts the lower 16-bits of an integer operand at the 16-bit offset @@ -2212,7 +2212,7 @@ void _mm_sfence(void); /// \returns A 64-bit integer vector containing the copied packed data from the /// operands. #define _mm_insert_pi16(a, d, n) \ - (__m64)__builtin_ia32_vec_set_v4hi((__m64)a, (int)d, (int)n) + (__m64)__builtin_ia32_vec_set_v4hi((__v4hi)a, (int)d, (int)n) /// Compares each of the corresponding packed 16-bit integer values of /// the 64-bit integer vectors, and writes the greater value to the Modified: vendor/llvm-project/release-10.x/clang/lib/Lex/Lexer.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Lex/Lexer.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Lex/Lexer.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -2552,8 +2552,8 @@ bool Lexer::SkipBlockComment(Token &Result, const char '/', '/', '/', '/', '/', '/', '/', '/', '/', '/', '/', '/', '/', '/', '/', '/' }; - while (CurPtr+16 <= BufferEnd && - !vec_any_eq(*(const vector unsigned char*)CurPtr, Slashes)) + while (CurPtr + 16 <= BufferEnd && + !vec_any_eq(*(const __vector unsigned char *)CurPtr, Slashes)) CurPtr += 16; #else // Scan for '/' quickly. Many block comments are very large. Modified: vendor/llvm-project/release-10.x/clang/lib/Lex/Pragma.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Lex/Pragma.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Lex/Pragma.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -30,6 +30,7 @@ #include "clang/Lex/PPCallbacks.h" #include "clang/Lex/Preprocessor.h" #include "clang/Lex/PreprocessorLexer.h" +#include "clang/Lex/PreprocessorOptions.h" #include "clang/Lex/Token.h" #include "clang/Lex/TokenLexer.h" #include "llvm/ADT/ArrayRef.h" @@ -39,7 +40,6 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/ADT/StringRef.h" -#include "llvm/Support/CrashRecoveryContext.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" #include @@ -1035,15 +1035,19 @@ struct PragmaDebugHandler : public PragmaHandler { IdentifierInfo *II = Tok.getIdentifierInfo(); if (II->isStr("assert")) { - llvm_unreachable("This is an assertion!"); + if (!PP.getPreprocessorOpts().DisablePragmaDebugCrash) + llvm_unreachable("This is an assertion!"); } else if (II->isStr("crash")) { - LLVM_BUILTIN_TRAP; + if (!PP.getPreprocessorOpts().DisablePragmaDebugCrash) + LLVM_BUILTIN_TRAP; } else if (II->isStr("parser_crash")) { - Token Crasher; - Crasher.startToken(); - Crasher.setKind(tok::annot_pragma_parser_crash); - Crasher.setAnnotationRange(SourceRange(Tok.getLocation())); - PP.EnterToken(Crasher, /*IsReinject*/false); + if (!PP.getPreprocessorOpts().DisablePragmaDebugCrash) { + Token Crasher; + Crasher.startToken(); + Crasher.setKind(tok::annot_pragma_parser_crash); + Crasher.setAnnotationRange(SourceRange(Tok.getLocation())); + PP.EnterToken(Crasher, /*IsReinject*/ false); + } } else if (II->isStr("dump")) { Token Identifier; PP.LexUnexpandedToken(Identifier); @@ -1075,9 +1079,11 @@ struct PragmaDebugHandler : public PragmaHandler { << II->getName(); } } else if (II->isStr("llvm_fatal_error")) { - llvm::report_fatal_error("#pragma clang __debug llvm_fatal_error"); + if (!PP.getPreprocessorOpts().DisablePragmaDebugCrash) + llvm::report_fatal_error("#pragma clang __debug llvm_fatal_error"); } else if (II->isStr("llvm_unreachable")) { - llvm_unreachable("#pragma clang __debug llvm_unreachable"); + if (!PP.getPreprocessorOpts().DisablePragmaDebugCrash) + llvm_unreachable("#pragma clang __debug llvm_unreachable"); } else if (II->isStr("macro")) { Token MacroName; PP.LexUnexpandedToken(MacroName); @@ -1104,11 +1110,8 @@ struct PragmaDebugHandler : public PragmaHandler { } M->dump(); } else if (II->isStr("overflow_stack")) { - DebugOverflowStack(); - } else if (II->isStr("handle_crash")) { - llvm::CrashRecoveryContext *CRC =llvm::CrashRecoveryContext::GetCurrent(); - if (CRC) - CRC->HandleCrash(); + if (!PP.getPreprocessorOpts().DisablePragmaDebugCrash) + DebugOverflowStack(); } else if (II->isStr("captured")) { HandleCaptured(PP); } else { Modified: vendor/llvm-project/release-10.x/clang/lib/Parse/ParseDecl.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Parse/ParseDecl.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Parse/ParseDecl.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -5060,6 +5060,8 @@ bool Parser::isDeclarationSpecifier(bool Disambiguatin // recurse to handle whatever we get. if (TryAnnotateTypeOrScopeToken()) return true; + if (TryAnnotateTypeConstraint()) + return true; if (Tok.is(tok::identifier)) return false; @@ -5192,11 +5194,14 @@ bool Parser::isDeclarationSpecifier(bool Disambiguatin // placeholder-type-specifier case tok::annot_template_id: { - TemplateIdAnnotation *TemplateId = takeTemplateIdAnnotation(Tok); - return TemplateId->Kind == TNK_Concept_template && + return isTypeConstraintAnnotation() && (NextToken().is(tok::kw_auto) || NextToken().is(tok::kw_decltype)); } - + case tok::annot_cxxscope: + if (NextToken().is(tok::identifier) && TryAnnotateTypeConstraint()) + return true; + return isTypeConstraintAnnotation() && + GetLookAheadToken(2).isOneOf(tok::kw_auto, tok::kw_decltype); case tok::kw___declspec: case tok::kw___cdecl: case tok::kw___stdcall: Modified: vendor/llvm-project/release-10.x/clang/lib/Parse/ParseDeclCXX.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Parse/ParseDeclCXX.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Parse/ParseDeclCXX.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -2716,7 +2716,7 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier // C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq appertains // to a friend declaration, that declaration shall be a definition. if (DeclaratorInfo.isFunctionDeclarator() && - DefinitionKind != FDK_Definition && DS.isFriendSpecified()) { + DefinitionKind == FDK_Declaration && DS.isFriendSpecified()) { // Diagnose attributes that appear before decl specifier: // [[]] friend int foo(); ProhibitAttributes(FnAttrs); Modified: vendor/llvm-project/release-10.x/clang/lib/Parse/ParseExprCXX.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Parse/ParseExprCXX.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Parse/ParseExprCXX.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -3374,25 +3374,6 @@ ExprResult Parser::ParseRequiresExpression() { Diag(Tok, diag::err_requires_expr_missing_arrow) << FixItHint::CreateInsertion(Tok.getLocation(), "->"); // Try to parse a 'type-constraint' - CXXScopeSpec SS; - if (ParseOptionalCXXScopeSpecifier(SS, ParsedType(), - /*EnteringContext=*/false, - /*MayBePseudoDestructor=*/nullptr, - // If this is not a type-constraint, - // then this scope-spec is part of - // the typename of a non-type - // template parameter - /*IsTypename=*/true, - /*LastII=*/nullptr, - // We won't find concepts in - // non-namespaces anyway, so might as - // well parse this correctly for - // possible type names. - /*OnlyNamespace=*/false, - /*SuppressDiagnostic=*/true)) { - SkipUntil(tok::semi, tok::r_brace, SkipUntilFlags::StopBeforeMatch); - break; - } if (TryAnnotateTypeConstraint()) { SkipUntil(tok::semi, tok::r_brace, SkipUntilFlags::StopBeforeMatch); break; @@ -3402,8 +3383,13 @@ ExprResult Parser::ParseRequiresExpression() { SkipUntil(tok::semi, tok::r_brace, SkipUntilFlags::StopBeforeMatch); break; } - if (Tok.is(tok::annot_cxxscope)) + CXXScopeSpec SS; + if (Tok.is(tok::annot_cxxscope)) { + Actions.RestoreNestedNameSpecifierAnnotation(Tok.getAnnotationValue(), + Tok.getAnnotationRange(), + SS); ConsumeAnnotationToken(); + } Req = Actions.ActOnCompoundRequirement( Expression.get(), NoexceptLoc, SS, takeTemplateIdAnnotation(Tok), @@ -3490,6 +3476,7 @@ ExprResult Parser::ParseRequiresExpression() { // We need to consume the typename to allow 'requires { typename a; }' SourceLocation TypenameKWLoc = ConsumeToken(); if (TryAnnotateCXXScopeToken()) { + TPA.Commit(); SkipUntil(tok::semi, tok::r_brace, SkipUntilFlags::StopBeforeMatch); break; } Modified: vendor/llvm-project/release-10.x/clang/lib/Sema/SemaCast.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Sema/SemaCast.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Sema/SemaCast.cpp Fri Feb 14 21:24:03 2020 (r357937) @@ -2311,6 +2311,24 @@ static TryCastResult TryReinterpretCast(Sema &Self, Ex return SuccessResult; } + // Diagnose address space conversion in nested pointers. + QualType DestPtee = DestType->getPointeeType().isNull() + ? DestType->getPointeeType() + : DestType->getPointeeType()->getPointeeType(); + QualType SrcPtee = SrcType->getPointeeType().isNull() + ? SrcType->getPointeeType() + : SrcType->getPointeeType()->getPointeeType(); + while (!DestPtee.isNull() && !SrcPtee.isNull()) { + if (DestPtee.getAddressSpace() != SrcPtee.getAddressSpace()) { + Self.Diag(OpRange.getBegin(), + diag::warn_bad_cxx_cast_nested_pointer_addr_space) + << CStyle << SrcType << DestType << SrcExpr.get()->getSourceRange(); + break; + } + DestPtee = DestPtee->getPointeeType(); + SrcPtee = SrcPtee->getPointeeType(); + } + // C++ 5.2.10p7: A pointer to an object can be explicitly converted to // a pointer to an object of different type. // Void pointers are not specified, but supported by every compiler out there. Modified: vendor/llvm-project/release-10.x/clang/lib/Sema/SemaConcept.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Sema/SemaConcept.cpp Fri Feb 14 21:05:15 2020 (r357936) +++ vendor/llvm-project/release-10.x/clang/lib/Sema/SemaConcept.cpp Fri Feb 14 21:24:03 2020 (r357937) *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***