From owner-svn-src-all@freebsd.org Sun Apr 12 16:07:01 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 22AA32C15D7; Sun, 12 Apr 2020 16:07:01 +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 490c846kwZz4Hm0; Sun, 12 Apr 2020 16:07: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C88DE430C; Sun, 12 Apr 2020 16:07: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 03CG70v9074429; Sun, 12 Apr 2020 16:07:00 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03CG70tj074426; Sun, 12 Apr 2020 16:07:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202004121607.03CG70tj074426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 12 Apr 2020 16:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359826 - head/contrib/llvm-project/clang/lib/CodeGen X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/clang/lib/CodeGen X-SVN-Commit-Revision: 359826 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: Sun, 12 Apr 2020 16:07:01 -0000 Author: dim Date: Sun Apr 12 16:06:59 2020 New Revision: 359826 URL: https://svnweb.freebsd.org/changeset/base/359826 Log: Merge commit 30588a739 from llvm git (by Erich Keane): Make target features check work with ctor and dtor- The problem was reported in PR45468, applying target features to an always_inline constructor/destructor runs afoul of GlobalDecl construction assert when checking for target-feature compatibility. The core problem is fixed by using the version of the check that takes a FunctionDecl rather than the GlobalDecl. However, while writing the test, I discovered that source locations weren't properly set for this check on ctors/dtors. This patch also fixes constructors and CALLED destructors. Unfortunately, it doesn't seem too possible to get a meaningful source location for a 'cleanup' destructor, so those are still 'frontend' level errors unfortunately. A fixme was added to the test to cover that situation. This should fix 'Assertion failed: (!isa(D) && "Use other ctor with ctor decls!"), function Init, file /usr/src/contrib/llvm-project/clang/include/clang/AST/GlobalDecl.h, line 45' when compiling the security/botan2 port. PR: 245550 MFC after: 6 weeks X-MFC-With: 358851 Modified: head/contrib/llvm-project/clang/lib/CodeGen/CGClass.cpp head/contrib/llvm-project/clang/lib/CodeGen/CGExprCXX.cpp head/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp Modified: head/contrib/llvm-project/clang/lib/CodeGen/CGClass.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/CodeGen/CGClass.cpp Sun Apr 12 15:30:00 2020 (r359825) +++ head/contrib/llvm-project/clang/lib/CodeGen/CGClass.cpp Sun Apr 12 16:06:59 2020 (r359826) @@ -2157,7 +2157,7 @@ void CodeGenFunction::EmitCXXConstructorCall(const CXX const CGFunctionInfo &Info = CGM.getTypes().arrangeCXXConstructorCall( Args, D, Type, ExtraArgs.Prefix, ExtraArgs.Suffix, PassPrototypeArgs); CGCallee Callee = CGCallee::forDirect(CalleePtr, GlobalDecl(D, Type)); - EmitCall(Info, Callee, ReturnValueSlot(), Args); + EmitCall(Info, Callee, ReturnValueSlot(), Args, nullptr, Loc); // Generate vtable assumptions if we're constructing a complete object // with a vtable. We don't do this for base subobjects for two reasons: Modified: head/contrib/llvm-project/clang/lib/CodeGen/CGExprCXX.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/CodeGen/CGExprCXX.cpp Sun Apr 12 15:30:00 2020 (r359825) +++ head/contrib/llvm-project/clang/lib/CodeGen/CGExprCXX.cpp Sun Apr 12 16:06:59 2020 (r359826) @@ -112,7 +112,8 @@ RValue CodeGenFunction::EmitCXXDestructorCall( commonEmitCXXMemberOrOperatorCall(*this, DtorDecl, This, ImplicitParam, ImplicitParamTy, CE, Args, nullptr); return EmitCall(CGM.getTypes().arrangeCXXStructorDeclaration(Dtor), Callee, - ReturnValueSlot(), Args); + ReturnValueSlot(), Args, nullptr, + CE ? CE->getExprLoc() : SourceLocation{}); } RValue CodeGenFunction::EmitCXXPseudoDestructorExpr( @@ -380,7 +381,7 @@ RValue CodeGenFunction::EmitCXXMemberOrOperatorMemberC IsArrow ? Base->getType()->getPointeeType() : Base->getType(); EmitCXXDestructorCall(GD, Callee, This.getPointer(*this), ThisTy, /*ImplicitParam=*/nullptr, - /*ImplicitParamTy=*/QualType(), nullptr); + /*ImplicitParamTy=*/QualType(), CE); } return RValue::get(nullptr); } Modified: head/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp Sun Apr 12 15:30:00 2020 (r359825) +++ head/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp Sun Apr 12 16:06:59 2020 (r359826) @@ -2324,8 +2324,7 @@ void CodeGenFunction::checkTargetFeatures(SourceLocati SmallVector ReqFeatures; llvm::StringMap CalleeFeatureMap; - CGM.getContext().getFunctionFeatureMap(CalleeFeatureMap, - GlobalDecl(TargetDecl)); + CGM.getContext().getFunctionFeatureMap(CalleeFeatureMap, TargetDecl); for (const auto &F : ParsedAttr.Features) { if (F[0] == '+' && CalleeFeatureMap.lookup(F.substr(1)))