From nobody Thu Oct 12 07:43:00 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S5hSj0GyYz4xPvY; Thu, 12 Oct 2023 07:43:01 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S5hSh4h9Wz3Jrc; Thu, 12 Oct 2023 07:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697096580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0V/lyXDYbvP3dMie9/goz1WRwAaSq0HLVp5yrD040Jo=; b=LvWvo+CU0m0BqKFIM+f6MkXHLZQrc9DEY/6Ohx7leE6fAfzL27fwv9fieLIwpAMR5g3Dd0 5I72hA/S0F8BErnMIJbiJgQFtpDRQUh7fq1B68DsLDLpjKxGisUFxpBJggnFkFbPFhsLVu /pYBYPzz4jPQfedoxBj1jf4FbHXZfsuYcBIwkxvyfOjX1ZZqppUpRK+fLmTax4os+jnhfN 9Y38PWC0OyufJq+riA0BMIZewh3zkUlynTotLsaEdjD2q74nNBepVwrIuezVUSP2hjMwc8 O70D/JlzErHafsNMnfVWVpPTnTMCeTGbE1m1gL80X7loSGUDctfs8lpGHBzZ/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697096580; a=rsa-sha256; cv=none; b=OjSeGPdbLiH6M4Y5/sNeMp09yOyix2C3j7zIcQ5jU2/KmAw11zOD4/kkJPnL8zcF2YBeIs +Ui6j1WI85pDDL1y1HC5T5eUkJAPnXYfApHkNtyKR+439NyC3jGvBcXEkASKP8vN/fde1J tEq6d++LHgPfRp2IV7ZncLAG78Uy2ZnFKvYqlbu6YqiAx8MKhq0jx+9xZomAcFmQXC8QV7 Ttxvk43K9haxS9WoU+tq6zTTdXK+RpMhsoeP3K5kmJfHA/r3FNVgdNneUeB6no0s3VqlqZ CiAzLqzChtO34/hZ66+6V9+Oeq+TittxufDkYQvfZSoPSueXDtmCRE44GgJvrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697096580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0V/lyXDYbvP3dMie9/goz1WRwAaSq0HLVp5yrD040Jo=; b=ujZuwSgup+QN+YWFLFAdbcuxjT5ypjhpXyM1BNexZXE8zsEQ7v4EVOVtN5NFaNvCetUO1Z J2rlH2vP0QDo85g/1WhGIJRo/xRJ7YhiLP/knkXSViZBV2L1vqRdQviblaHBZEwjMwIaHJ S+ND0r0aQCStZ1BcTxmM/YEr7VWywH/Zsf8NYJdeleh5vGWDqqB7rB/yncpLQrIJ7btArx otDkIZGnYnu4W7zlqK3qrDwoTopflHyIJFnm+m5McXt+zWrQjV5eGwV1X9sH62Cb7ToJr4 lhisR1JMKrS5QyrksTdrE25R3QHzw3g7azdN1MulWuGvFLvZIO5q31AA5yZ52Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S5hSh3p0rzvqd; Thu, 12 Oct 2023 07:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39C7h0qx024035; Thu, 12 Oct 2023 07:43:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39C7h0JE024032; Thu, 12 Oct 2023 07:43:00 GMT (envelope-from git) Date: Thu, 12 Oct 2023 07:43:00 GMT Message-Id: <202310120743.39C7h0JE024032@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Gleb Popov Subject: git: 6ce10eb9d74f - 2023Q4 - devel/llvm15: Pull in a patch fixing a crash in libclang. List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: ports X-Git-Refname: refs/heads/2023Q4 X-Git-Reftype: branch X-Git-Commit: 6ce10eb9d74f65f47f305832ee2e17fc26ceba89 Auto-Submitted: auto-generated The branch 2023Q4 has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=6ce10eb9d74f65f47f305832ee2e17fc26ceba89 commit 6ce10eb9d74f65f47f305832ee2e17fc26ceba89 Author: Gleb Popov AuthorDate: 2023-10-05 14:24:06 +0000 Commit: Gleb Popov CommitDate: 2023-10-12 07:39:49 +0000 devel/llvm15: Pull in a patch fixing a crash in libclang. This unbreaks KDevelop with C++ projects. Relevant discussion on the KDE Bugzilla: https://bugs.kde.org/show_bug.cgi?id=438249#c33 Approved by: brooks Differential Revision: https://reviews.freebsd.org/D42089 (cherry picked from commit 5d388efd8d1cc1369bfbdc4b247b26abd001e366) --- devel/llvm15/Makefile | 2 +- devel/llvm15/files/patch-dependent-bit-width | 114 +++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 1 deletion(-) diff --git a/devel/llvm15/Makefile b/devel/llvm15/Makefile index b6e0f0880057..90b0fbbf2903 100644 --- a/devel/llvm15/Makefile +++ b/devel/llvm15/Makefile @@ -1,6 +1,6 @@ PORTNAME= llvm DISTVERSION= 15.0.7 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= devel lang MASTER_SITES= https://github.com/llvm/llvm-project/releases/download/llvmorg-${DISTVERSION:S/rc/-rc/}/ \ https://${PRE_}releases.llvm.org/${LLVM_RELEASE}${RCDIR}/ diff --git a/devel/llvm15/files/patch-dependent-bit-width b/devel/llvm15/files/patch-dependent-bit-width new file mode 100644 index 000000000000..06bfeb348a7b --- /dev/null +++ b/devel/llvm15/files/patch-dependent-bit-width @@ -0,0 +1,114 @@ +From 48fb6659610a3177e8606681046dfa0d19f67203 Mon Sep 17 00:00:00 2001 +From: Collin Baker +Date: Tue, 14 Mar 2023 09:57:44 -0400 +Subject: [PATCH] [libclang] No longer attempt to get a dependent bit-width + +Handle template parameter-dependent bit field widths in libclang + +In a class template, a bit field's width may depend on a template +parameter. In this case the width expression cannot be evaluated. + +Previously clang_getFieldDeclBitWidth() would assert, or cause memory +unsafety and return an invalid result if assertions are disabled. + +This adds a check for this case which returns an error code. + +This work was largely taken from an earlier patch which was reverted +due to an accidental API duplication +(https://reviews.llvm.org/D130303). + +Fixes: https://github.com/llvm/llvm-project/issues/56644 +Co-authored-by: Aaron Ballman +Differential Revision: https://reviews.llvm.org/D146039 +--- + clang/docs/ReleaseNotes.rst | 4 ++++ + clang/include/clang-c/Index.h | 26 ++++++++++++++++++-------- + clang/tools/libclang/CXType.cpp | 4 ++-- + 3 files changed, 24 insertions(+), 10 deletions(-) + +diff --git a/clang/docs/ReleaseNotes.rst clang/docs/ReleaseNotes.rst +index cfec4ed96ad9bf9..66a9210c35b6610 100644 +--- a/clang/docs/ReleaseNotes.rst ++++ clang/docs/ReleaseNotes.rst +@@ -315,6 +315,10 @@ libclang + ``clang_CXIndex_setInvocationEmissionPathOption`` in favor of the new + function ``clang_createIndexWithOptions`` in order to improve thread safety. + ++- Added check in ``clang_getFieldDeclBitWidth`` for whether a bit-field ++ has an evaluable bit width. Fixes undefined behavior when called on a ++ bit-field whose width depends on a template paramter. ++ + Static Analyzer + --------------- + - Fix incorrect alignment attribute on the this parameter of certain +diff --git a/clang/include/clang-c/Index.h clang/include/clang-c/Index.h +index bc9e100846be699..710668740e0e6f6 100644 +--- a/clang/include/clang-c/Index.h ++++ clang/include/clang-c/Index.h +@@ -3029,9 +3029,25 @@ CINDEX_LINKAGE unsigned long long + clang_getEnumConstantDeclUnsignedValue(CXCursor C); + + /** +- * Retrieve the bit width of a bit field declaration as an integer. ++ * Returns non-zero if the cursor specifies a Record member that is a bit-field. ++ */ ++CINDEX_LINKAGE unsigned clang_Cursor_isBitField(CXCursor C); ++ ++/** ++ * Retrieve the bit width of a bit-field declaration as an integer. + * +- * If a cursor that is not a bit field declaration is passed in, -1 is returned. ++ * If the cursor does not reference a bit-field, or if the bit-field's width ++ * expression cannot be evaluated, -1 is returned. ++ * ++ * For example: ++ * \code ++ * if (clang_Cursor_isBitField(Cursor)) { ++ * int Width = clang_getFieldDeclBitWidth(Cursor); ++ * if (Width != -1) { ++ * // The bit-field width is not value-dependent. ++ * } ++ * } ++ * \endcode + */ + CINDEX_LINKAGE int clang_getFieldDeclBitWidth(CXCursor C); + +@@ -3660,12 +3676,6 @@ CINDEX_LINKAGE CXType clang_Type_getTemplateArgumentAsType(CXType T, + */ + CINDEX_LINKAGE enum CXRefQualifierKind clang_Type_getCXXRefQualifier(CXType T); + +-/** +- * Returns non-zero if the cursor specifies a Record member that is a +- * bitfield. +- */ +-CINDEX_LINKAGE unsigned clang_Cursor_isBitField(CXCursor C); +- + /** + * Returns 1 if the base class specified by the cursor with kind + * CX_CXXBaseSpecifier is virtual. +diff --git a/clang/tools/libclang/CXType.cpp clang/tools/libclang/CXType.cpp +index a1d157c63995b14..eb8bfc25a7c9106 100644 +--- a/clang/tools/libclang/CXType.cpp ++++ clang/tools/libclang/CXType.cpp +@@ -10,11 +10,11 @@ + // + //===--------------------------------------------------------------------===// + ++#include "CXType.h" + #include "CIndexer.h" + #include "CXCursor.h" + #include "CXString.h" + #include "CXTranslationUnit.h" +-#include "CXType.h" + #include "clang/AST/Decl.h" + #include "clang/AST/DeclObjC.h" + #include "clang/AST/DeclTemplate.h" +@@ -378,7 +378,7 @@ int clang_getFieldDeclBitWidth(CXCursor C) { + const Decl *D = getCursorDecl(C); + + if (const FieldDecl *FD = dyn_cast_or_null(D)) { +- if (FD->isBitField()) ++ if (FD->isBitField() && !FD->getBitWidth()->isValueDependent()) + return FD->getBitWidthValue(getCursorContext(C)); + } + }