From owner-svn-src-head@freebsd.org Thu Mar 26 17:46:45 2020 Return-Path: Delivered-To: svn-src-head@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 7AB262A5524; Thu, 26 Mar 2020 17:46:45 +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 48pC8y4hMDz41Nh; Thu, 26 Mar 2020 17:46:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80578A294; Thu, 26 Mar 2020 17:46: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 02QHkYpq020792; Thu, 26 Mar 2020 17:46:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 02QHkW4b020783; Thu, 26 Mar 2020 17:46:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202003261746.02QHkW4b020783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 26 Mar 2020 17:46:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359338 - in head: contrib/llvm-project/clang/include/clang/Sema contrib/llvm-project/clang/lib/Driver/ToolChains contrib/llvm-project/clang/lib/Parse contrib/llvm-project/clang/lib/Sem... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm-project/clang/include/clang/Sema contrib/llvm-project/clang/lib/Driver/ToolChains contrib/llvm-project/clang/lib/Parse contrib/llvm-project/clang/lib/Sema lib/clang/include lib/c... X-SVN-Commit-Revision: 359338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Mar 2020 17:46:45 -0000 Author: dim Date: Thu Mar 26 17:46:32 2020 New Revision: 359338 URL: https://svnweb.freebsd.org/changeset/base/359338 Log: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.0-0-gd32170dbd5b (aka 10.0.0 release). PR: 244251 MFC after: 6 weeks X-MFC-With: 358851 Modified: head/contrib/llvm-project/clang/include/clang/Sema/Sema.h head/contrib/llvm-project/clang/lib/Driver/ToolChains/Cuda.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Cuda.h head/contrib/llvm-project/clang/lib/Parse/ParseDecl.cpp head/contrib/llvm-project/clang/lib/Parse/ParseTemplate.cpp head/contrib/llvm-project/clang/lib/Sema/SemaTemplate.cpp head/contrib/llvm-project/clang/lib/Sema/TreeTransform.h head/lib/clang/include/VCSVersion.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/llvm-project/ (props changed) head/contrib/llvm-project/clang/ (props changed) Modified: head/contrib/llvm-project/clang/include/clang/Sema/Sema.h ============================================================================== --- head/contrib/llvm-project/clang/include/clang/Sema/Sema.h Thu Mar 26 17:41:33 2020 (r359337) +++ head/contrib/llvm-project/clang/include/clang/Sema/Sema.h Thu Mar 26 17:46:32 2020 (r359338) @@ -6885,7 +6885,8 @@ class Sema final { (public) QualType ObjectType, bool EnteringContext, bool &MemberOfUnknownSpecialization, SourceLocation TemplateKWLoc = SourceLocation(), - AssumedTemplateKind *ATK = nullptr); + AssumedTemplateKind *ATK = nullptr, + bool Disambiguation = false); TemplateNameKind isTemplateName(Scope *S, CXXScopeSpec &SS, @@ -6894,7 +6895,8 @@ class Sema final { (public) ParsedType ObjectType, bool EnteringContext, TemplateTy &Template, - bool &MemberOfUnknownSpecialization); + bool &MemberOfUnknownSpecialization, + bool Disambiguation = false); /// Try to resolve an undeclared template name as a type template. /// Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Cuda.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Cuda.cpp Thu Mar 26 17:41:33 2020 (r359337) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Cuda.cpp Thu Mar 26 17:46:32 2020 (r359338) @@ -32,26 +32,30 @@ 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(const Driver &D, llvm::StringRef V) { +void CudaInstallationDetector::ParseCudaVersionFile(llvm::StringRef V) { + Version = CudaVersion::UNKNOWN; if (!V.startswith("CUDA Version ")) - return CudaVersion::UNKNOWN; + return; V = V.substr(strlen("CUDA Version ")); 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); + return; + DetectedVersion = join_items(".", VersionParts[0], VersionParts[1]); + Version = CudaStringToVersion(DetectedVersion); if (Version != CudaVersion::UNKNOWN) - return Version; + return; - // 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; + Version = CudaVersion::LATEST; + DetectedVersionIsNotSupported = true; } +void CudaInstallationDetector::WarnIfUnsupportedVersion() { + if (DetectedVersionIsNotSupported) + D.Diag(diag::warn_drv_unknown_cuda_version) + << DetectedVersion << CudaVersionToString(Version); +} + CudaInstallationDetector::CudaInstallationDetector( const Driver &D, const llvm::Triple &HostTriple, const llvm::opt::ArgList &Args) @@ -147,7 +151,7 @@ CudaInstallationDetector::CudaInstallationDetector( // version.txt isn't present. Version = CudaVersion::CUDA_70; } else { - Version = ParseCudaVersionFile(D, (*VersionFile)->getBuffer()); + ParseCudaVersionFile((*VersionFile)->getBuffer()); } if (Version >= CudaVersion::CUDA_90) { @@ -565,8 +569,10 @@ CudaToolChain::CudaToolChain(const Driver &D, const ll const Action::OffloadKind OK) : ToolChain(D, Triple, Args), HostTC(HostTC), CudaInstallation(D, HostTC.getTriple(), Args), OK(OK) { - if (CudaInstallation.isValid()) + if (CudaInstallation.isValid()) { + CudaInstallation.WarnIfUnsupportedVersion(); getProgramPaths().push_back(CudaInstallation.getBinPath()); + } // Lookup binaries into the driver directory, this is used to // discover the clang-offload-bundler executable. getProgramPaths().push_back(getDriver().Dir); Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Cuda.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Cuda.h Thu Mar 26 17:41:33 2020 (r359337) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Cuda.h Thu Mar 26 17:46:32 2020 (r359338) @@ -30,6 +30,8 @@ class CudaInstallationDetector { (private) const Driver &D; bool IsValid = false; CudaVersion Version = CudaVersion::UNKNOWN; + std::string DetectedVersion; + bool DetectedVersionIsNotSupported = false; std::string InstallPath; std::string BinPath; std::string LibPath; @@ -75,6 +77,10 @@ class CudaInstallationDetector { (private) std::string getLibDeviceFile(StringRef Gpu) const { return LibDeviceMap.lookup(Gpu); } + void WarnIfUnsupportedVersion(); + +private: + void ParseCudaVersionFile(llvm::StringRef V); }; namespace tools { Modified: head/contrib/llvm-project/clang/lib/Parse/ParseDecl.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Parse/ParseDecl.cpp Thu Mar 26 17:41:33 2020 (r359337) +++ head/contrib/llvm-project/clang/lib/Parse/ParseDecl.cpp Thu Mar 26 17:46:32 2020 (r359338) @@ -3252,6 +3252,9 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, goto DoneWithDeclSpec; if (isTypeConstraintAnnotation()) continue; + if (NextToken().is(tok::annot_template_id)) + // Might have been annotated by TryAnnotateTypeConstraint. + continue; // Eat the scope spec so the identifier is current. ConsumeAnnotationToken(); ParsedAttributesWithRange Attrs(AttrFactory); @@ -3404,6 +3407,9 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, if (TryAnnotateTypeConstraint()) goto DoneWithDeclSpec; if (isTypeConstraintAnnotation()) + continue; + if (Tok.is(tok::annot_template_id)) + // Might have been annotated by TryAnnotateTypeConstraint. continue; ParsedAttributesWithRange Attrs(AttrFactory); if (ParseImplicitInt(DS, nullptr, TemplateInfo, AS, DSContext, Attrs)) { Modified: head/contrib/llvm-project/clang/lib/Parse/ParseTemplate.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Parse/ParseTemplate.cpp Thu Mar 26 17:41:33 2020 (r359337) +++ head/contrib/llvm-project/clang/lib/Parse/ParseTemplate.cpp Thu Mar 26 17:46:32 2020 (r359338) @@ -710,7 +710,8 @@ bool Parser::TryAnnotateTypeConstraint() { /*ObjectType=*/ParsedType(), /*EnteringContext=*/false, PossibleConcept, - MemberOfUnknownSpecialization); + MemberOfUnknownSpecialization, + /*Disambiguation=*/true); if (MemberOfUnknownSpecialization || !PossibleConcept || TNK != TNK_Concept_template) { if (SS.isNotEmpty()) Modified: head/contrib/llvm-project/clang/lib/Sema/SemaTemplate.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/SemaTemplate.cpp Thu Mar 26 17:41:33 2020 (r359337) +++ head/contrib/llvm-project/clang/lib/Sema/SemaTemplate.cpp Thu Mar 26 17:46:32 2020 (r359338) @@ -174,7 +174,8 @@ TemplateNameKind Sema::isTemplateName(Scope *S, ParsedType ObjectTypePtr, bool EnteringContext, TemplateTy &TemplateResult, - bool &MemberOfUnknownSpecialization) { + bool &MemberOfUnknownSpecialization, + bool Disambiguation) { assert(getLangOpts().CPlusPlus && "No template names in C!"); DeclarationName TName; @@ -204,7 +205,7 @@ TemplateNameKind Sema::isTemplateName(Scope *S, LookupResult R(*this, TName, Name.getBeginLoc(), LookupOrdinaryName); if (LookupTemplateName(R, S, SS, ObjectType, EnteringContext, MemberOfUnknownSpecialization, SourceLocation(), - &AssumedTemplate)) + &AssumedTemplate, Disambiguation)) return TNK_Non_template; if (AssumedTemplate != AssumedTemplateKind::None) { @@ -371,7 +372,8 @@ bool Sema::LookupTemplateName(LookupResult &Found, bool EnteringContext, bool &MemberOfUnknownSpecialization, SourceLocation TemplateKWLoc, - AssumedTemplateKind *ATK) { + AssumedTemplateKind *ATK, + bool Disambiguation) { if (ATK) *ATK = AssumedTemplateKind::None; @@ -494,8 +496,9 @@ bool Sema::LookupTemplateName(LookupResult &Found, } } - if (Found.empty() && !IsDependent) { - // If we did not find any names, attempt to correct any typos. + if (Found.empty() && !IsDependent && !Disambiguation) { + // If we did not find any names, and this is not a disambiguation, attempt + // to correct any typos. DeclarationName Name = Found.getLookupName(); Found.clear(); // Simple filter callback that, for keywords, only accepts the C++ *_cast Modified: head/contrib/llvm-project/clang/lib/Sema/TreeTransform.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/TreeTransform.h Thu Mar 26 17:41:33 2020 (r359337) +++ head/contrib/llvm-project/clang/lib/Sema/TreeTransform.h Thu Mar 26 17:46:32 2020 (r359338) @@ -11303,7 +11303,7 @@ TreeTransform::TransformRequiresExpr(Requires SemaRef, Sema::ExpressionEvaluationContext::Unevaluated); RequiresExprBodyDecl *Body = RequiresExprBodyDecl::Create( - getSema().Context, E->getBody()->getDeclContext(), + getSema().Context, getSema().CurContext, E->getBody()->getBeginLoc()); Sema::ContextRAII SavedContext(getSema(), Body, /*NewThisContext*/false); Modified: head/lib/clang/include/VCSVersion.inc ============================================================================== --- head/lib/clang/include/VCSVersion.inc Thu Mar 26 17:41:33 2020 (r359337) +++ head/lib/clang/include/VCSVersion.inc Thu Mar 26 17:46:32 2020 (r359338) @@ -1,14 +1,14 @@ // $FreeBSD$ -#define LLVM_REVISION "llvmorg-10.0.0-rc4-5-g52c365aa9ca" +#define LLVM_REVISION "llvmorg-10.0.0-0-gd32170dbd5b" #define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git" -#define CLANG_REVISION "llvmorg-10.0.0-rc4-5-g52c365aa9ca" +#define CLANG_REVISION "llvmorg-10.0.0-0-gd32170dbd5b" #define CLANG_REPOSITORY "git@github.com:llvm/llvm-project.git" // - -#define LLD_REVISION "llvmorg-10.0.0-rc4-5-g52c365aa9ca-1300007" +#define LLD_REVISION "llvmorg-10.0.0-0-gd32170dbd5b-1300007" #define LLD_REPOSITORY "FreeBSD" -#define LLDB_REVISION "llvmorg-10.0.0-rc4-5-g52c365aa9ca" +#define LLDB_REVISION "llvmorg-10.0.0-0-gd32170dbd5b" #define LLDB_REPOSITORY "git@github.com:llvm/llvm-project.git" Modified: head/lib/clang/include/llvm/Support/VCSRevision.h ============================================================================== --- head/lib/clang/include/llvm/Support/VCSRevision.h Thu Mar 26 17:41:33 2020 (r359337) +++ head/lib/clang/include/llvm/Support/VCSRevision.h Thu Mar 26 17:46:32 2020 (r359338) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define LLVM_REVISION "llvmorg-10.0.0-rc4-5-g52c365aa9ca" +#define LLVM_REVISION "llvmorg-10.0.0-0-gd32170dbd5b" #define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git"