[clang] Introduce paged vector (PR #66430)

2023-09-27 Thread Richard Smith via cfe-commits
@@ -0,0 +1,301 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier

[clang] Introduce paged vector (PR #66430)

2023-09-27 Thread Richard Smith via cfe-commits
@@ -0,0 +1,323 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier

[clang] Introduce paged vector (PR #66430)

2023-09-27 Thread Richard Smith via cfe-commits
@@ -0,0 +1,301 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier

[clang] Introduce paged vector (PR #66430)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid unresolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid resolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid resolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid resolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid resolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid resolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid resolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid resolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid resolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid resolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Recommit "Implement [[msvc::no_unique_address]] (#65675)" (PR #67199)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid approved this pull request. Looks awesome, thanks :) https://github.com/llvm/llvm-project/pull/67199 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Recommit "Implement [[msvc::no_unique_address]] (#65675)" (PR #67199)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid resolved https://github.com/llvm/llvm-project/pull/67199 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Recommit "Implement [[msvc::no_unique_address]] (#65675)" (PR #67199)

2023-09-27 Thread Richard Smith via cfe-commits
zygoloid wrote: (Please remember to update the commit message to describe the tablegen change when merging.) https://github.com/llvm/llvm-project/pull/67199 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/66894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid commented: Thanks, I like the code reuse! There are some minor optimization and simplification opportunities in the code you're reusing that might be worth addressing now. I'm worried that vectors with padding (which I think is only vectors of x86 `long double`) ar

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-09-27 Thread Richard Smith via cfe-commits
@@ -2732,6 +2732,92 @@ static bool truncateBitfieldValue(EvalInfo &Info, const Expr *E, return true; } +static bool BitcastAPIntToVector(EvalInfo &Info, const VectorType *VTy, + const llvm::APInt &SValInt, + Sm

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-09-27 Thread Richard Smith via cfe-commits
@@ -7304,6 +7382,21 @@ class BufferToAPValueConverter { return ArrayValue; } + std::optional visit(const VectorType *Ty, CharUnits Offset) { +SmallVector Bytes; +if (!Buffer.readObject(Offset, Info.Ctx.getTypeSizeInChars(Ty), Bytes)) + return std::nullopt;

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-09-27 Thread Richard Smith via cfe-commits
@@ -2732,6 +2732,92 @@ static bool truncateBitfieldValue(EvalInfo &Info, const Expr *E, return true; } +static bool BitcastAPIntToVector(EvalInfo &Info, const VectorType *VTy, + const llvm::APInt &SValInt, + Sm

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-09-27 Thread Richard Smith via cfe-commits
@@ -7095,6 +7157,22 @@ class APValueToBufferConverter { return true; } + bool visitVector(const APValue &Val, QualType Ty, CharUnits Offset) { +const VectorType *VTy = Ty->castAs(); + +APInt Bits; +if (!BitcastVectorToAPInt(Info, VTy, Val, Bits)) + retu

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-09-27 Thread Richard Smith via cfe-commits
@@ -2732,6 +2732,92 @@ static bool truncateBitfieldValue(EvalInfo &Info, const Expr *E, return true; } +static bool BitcastAPIntToVector(EvalInfo &Info, const VectorType *VTy, + const llvm::APInt &SValInt, + Sm

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-09-27 Thread Richard Smith via cfe-commits
@@ -2732,6 +2732,92 @@ static bool truncateBitfieldValue(EvalInfo &Info, const Expr *E, return true; } +static bool BitcastAPIntToVector(EvalInfo &Info, const VectorType *VTy, + const llvm::APInt &SValInt, + Sm

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/66894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-09-27 Thread Richard Smith via cfe-commits
@@ -7304,6 +7382,21 @@ class BufferToAPValueConverter { return ArrayValue; } + std::optional visit(const VectorType *Ty, CharUnits Offset) { +SmallVector Bytes; +if (!Buffer.readObject(Offset, Info.Ctx.getTypeSizeInChars(Ty), Bytes)) + return std::nullopt;

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-09-27 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/66894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExprConst] Don't create useless temporary variable (PR #67716)

2023-09-28 Thread Richard Smith via cfe-commits
zygoloid wrote: The semantics of `ArrayInitLoopExpr` are to first evaluate (once, up-front) the common expression, and then evaluate the subexpression once for each array element, where the subexpression can make repeated reference to the value of the common expression. With this change, we wi

[clang] [clang] Fix a crash from nested ArrayInitLoopExpr (PR #67722)

2023-09-28 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/67722 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix a crash from nested ArrayInitLoopExpr (PR #67722)

2023-09-28 Thread Richard Smith via cfe-commits
@@ -10950,6 +10950,9 @@ bool ArrayExprEvaluator::VisitCXXParenListOrInitListExpr( } bool ArrayExprEvaluator::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *E) { + + FullExpressionRAII Scope(Info); + zygoloid wrote: This should be done after we evaluate the

[clang] [clang] Fix a crash from nested ArrayInitLoopExpr (PR #67722)

2023-09-28 Thread Richard Smith via cfe-commits
https://github.com/zygoloid requested changes to this pull request. https://github.com/llvm/llvm-project/pull/67722 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix a crash from nested ArrayInitLoopExpr (PR #67722)

2023-09-28 Thread Richard Smith via cfe-commits
@@ -10950,6 +10950,9 @@ bool ArrayExprEvaluator::VisitCXXParenListOrInitListExpr( } bool ArrayExprEvaluator::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *E) { + + FullExpressionRAII Scope(Info); + zygoloid wrote: Here's a rejects-valid testcase: https://

[clang] [clang] Fix a crash from nested ArrayInitLoopExpr (PR #67722)

2023-09-28 Thread Richard Smith via cfe-commits
@@ -10950,6 +10950,9 @@ bool ArrayExprEvaluator::VisitCXXParenListOrInitListExpr( } bool ArrayExprEvaluator::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *E) { + + FullExpressionRAII Scope(Info); + zygoloid wrote: Better testcase, avoiding the use of muta

[clang] Introduce paged vector (PR #66430)

2023-09-28 Thread Richard Smith via cfe-commits
https://github.com/zygoloid resolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-28 Thread Richard Smith via cfe-commits
https://github.com/zygoloid unresolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-28 Thread Richard Smith via cfe-commits
https://github.com/zygoloid resolved https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-28 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/66430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-28 Thread Richard Smith via cfe-commits
@@ -0,0 +1,301 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier

[clang] Introduce paged vector (PR #66430)

2023-09-28 Thread Richard Smith via cfe-commits
@@ -0,0 +1,282 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier

[clang] Introduce paged vector (PR #66430)

2023-09-28 Thread Richard Smith via cfe-commits
@@ -0,0 +1,301 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier

[clang] Introduce paged vector (PR #66430)

2023-09-28 Thread Richard Smith via cfe-commits
@@ -0,0 +1,282 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier

[clang] Introduce paged vector (PR #66430)

2023-09-28 Thread Richard Smith via cfe-commits
https://github.com/zygoloid approved this pull request. It looks like there were a couple of unaddressed comments from my earlier reviews; I think github may have been "helpfully" hiding them from you by default. I've added comments on them so you should hopefully be able to find them. Thanks

[clang] Introduce paged vector (PR #66430)

2023-09-28 Thread Richard Smith via cfe-commits
@@ -0,0 +1,301 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier

[clang] Introduce paged vector (PR #66430)

2023-09-28 Thread Richard Smith via cfe-commits
@@ -0,0 +1,282 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier

[clang] [clang] Fix a crash from nested ArrayInitLoopExpr (PR #67722)

2023-09-28 Thread Richard Smith via cfe-commits
https://github.com/zygoloid commented: ExprConstant changes LGTM. I don't have state on the Interp changes; someone else should review that. https://github.com/llvm/llvm-project/pull/67722 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] -fsanitize=alignment: check memcpy/memmove arguments (PR #67766)

2023-09-29 Thread Richard Smith via cfe-commits
zygoloid wrote: > Uh, why are we allowed to assume that memcpy pointer arguments are aligned? > This looks like a miscompile to me. This is definitely a bit weird, but... > A plain `int *` pointer is not required to be aligned, and memcpy works on > `void *` pointers, so I'm not sure where an

[clang] -fsanitize=alignment: check memcpy/memmove arguments (PR #67766)

2023-10-01 Thread Richard Smith via cfe-commits
zygoloid wrote: > @zygoloid Is reusing the message for regular stores clear (current behavior) > enough? > > ``` > // CHECK-MEMCPY-STORE: misaligned.cpp:[[#@LINE+4]]{{(:12)?}}: runtime error: > store to misaligned address [[PTR:0x[0-9a-f]*]] for type 'int *', which > requires 4 byte alignment

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-01 Thread Richard Smith via cfe-commits
@@ -7304,6 +7382,21 @@ class BufferToAPValueConverter { return ArrayValue; } + std::optional visit(const VectorType *Ty, CharUnits Offset) { +SmallVector Bytes; +if (!Buffer.readObject(Offset, Info.Ctx.getTypeSizeInChars(Ty), Bytes)) + return std::nullopt;

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-04 Thread Richard Smith via cfe-commits
@@ -7304,6 +7382,21 @@ class BufferToAPValueConverter { return ArrayValue; } + std::optional visit(const VectorType *Ty, CharUnits Offset) { +SmallVector Bytes; +if (!Buffer.readObject(Offset, Info.Ctx.getTypeSizeInChars(Ty), Bytes)) + return std::nullopt;

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-04 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/66894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-04 Thread Richard Smith via cfe-commits
@@ -7441,6 +7500,28 @@ static bool handleLValueToRValueBitCast(EvalInfo &Info, APValue &DestValue, return true; } +static bool handleLValueToRValueBitCast(EvalInfo &Info, APValue &DestValue, +APValue &SourceValue, +

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-04 Thread Richard Smith via cfe-commits
https://github.com/zygoloid approved this pull request. Thanks, looks good. Just a couple of minor suggestions. https://github.com/llvm/llvm-project/pull/66894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-04 Thread Richard Smith via cfe-commits
@@ -10517,41 +10598,19 @@ bool VectorExprEvaluator::VisitCastExpr(const CastExpr *E) { return Success(Elts, E); } case CK_BitCast: { -// Evaluate the operand into an APInt we can extract from. -llvm::APInt SValInt; -if (!EvalAndBitcastToAPInt(Info, SE, SVal

[clang] 7c5e4ef - Track the RequestingModule in the HeaderSearch LookupFile cache.

2023-07-21 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2023-07-21T15:49:47-07:00 New Revision: 7c5e4efb099e0badb4912467b7286938a4ed5011 URL: https://github.com/llvm/llvm-project/commit/7c5e4efb099e0badb4912467b7286938a4ed5011 DIFF: https://github.com/llvm/llvm-project/commit/7c5e4efb099e0badb4912467b7286938a4ed5011.diff

[clang] 9d525bf - Optimize emission of `dynamic_cast` to final classes.

2023-07-21 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2023-07-21T19:07:59-07:00 New Revision: 9d525bf94b255df89587db955b5fa2d3c03c2c3e URL: https://github.com/llvm/llvm-project/commit/9d525bf94b255df89587db955b5fa2d3c03c2c3e DIFF: https://github.com/llvm/llvm-project/commit/9d525bf94b255df89587db955b5fa2d3c03c2c3e.diff

[clang] 6cf8179 - Don't perform dynamic_cast optimization at -O0.

2023-07-24 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2023-07-24T22:24:33-07:00 New Revision: 6cf8179661997f8d512cdf944f4f4c0c01cb37c1 URL: https://github.com/llvm/llvm-project/commit/6cf8179661997f8d512cdf944f4f4c0c01cb37c1 DIFF: https://github.com/llvm/llvm-project/commit/6cf8179661997f8d512cdf944f4f4c0c01cb37c1.diff

[clang] b6847ed - For #64088: mark vtable as used if we might emit a reference to it.

2023-07-25 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2023-07-25T14:42:10-07:00 New Revision: b6847edfc235829b37dd6d734ef5bbfa0a58b6fc URL: https://github.com/llvm/llvm-project/commit/b6847edfc235829b37dd6d734ef5bbfa0a58b6fc DIFF: https://github.com/llvm/llvm-project/commit/b6847edfc235829b37dd6d734ef5bbfa0a58b6fc.diff

[clang] 61c7a91 - Commit to a primary definition for a class when we load its first

2023-07-25 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2023-07-25T15:59:21-07:00 New Revision: 61c7a9140becb19c5b1bc644e54452c6f782f5d5 URL: https://github.com/llvm/llvm-project/commit/61c7a9140becb19c5b1bc644e54452c6f782f5d5 DIFF: https://github.com/llvm/llvm-project/commit/61c7a9140becb19c5b1bc644e54452c6f782f5d5.diff

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-10 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/66894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-10 Thread Richard Smith via cfe-commits
@@ -7098,6 +7052,69 @@ class APValueToBufferConverter { return true; } + bool visitVector(const APValue &Val, QualType Ty, CharUnits Offset) { +const VectorType *VTy = Ty->castAs(); +QualType EltTy = VTy->getElementType(); +unsigned NElts = VTy->getNumElemen

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-10 Thread Richard Smith via cfe-commits
@@ -7307,6 +7324,74 @@ class BufferToAPValueConverter { return ArrayValue; } + std::optional visit(const VectorType *VTy, CharUnits Offset) { +QualType EltTy = VTy->getElementType(); +unsigned NElts = VTy->getNumElements(); +unsigned EltSize = +VTy->

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-10 Thread Richard Smith via cfe-commits
@@ -138,13 +138,14 @@ void g27(void) { // PR8073 void g28(void) { typedef long long v1i64 __attribute((vector_size(8))); typedef short v12i16 __attribute((vector_size(24))); + typedef unsigned char v24u8 __attribute((vector_size(24))); typedef long double v2f80 __attrib

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-10 Thread Richard Smith via cfe-commits
https://github.com/zygoloid commented: Looks good, other than the handling of `x86_fp80`, which doesn't seem to match Clang's current runtime behavior. https://github.com/llvm/llvm-project/pull/66894 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-10 Thread Richard Smith via cfe-commits
@@ -138,13 +138,14 @@ void g27(void) { // PR8073 void g28(void) { typedef long long v1i64 __attribute((vector_size(8))); typedef short v12i16 __attribute((vector_size(24))); + typedef unsigned char v24u8 __attribute((vector_size(24))); typedef long double v2f80 __attrib

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-10 Thread Richard Smith via cfe-commits
https://github.com/zygoloid dismissed https://github.com/llvm/llvm-project/pull/66894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)

2023-10-11 Thread Richard Smith via cfe-commits
@@ -7098,6 +7052,69 @@ class APValueToBufferConverter { return true; } + bool visitVector(const APValue &Val, QualType Ty, CharUnits Offset) { +const VectorType *VTy = Ty->castAs(); +QualType EltTy = VTy->getElementType(); +unsigned NElts = VTy->getNumElemen

[clang] Use the correct namespace for looking up matching operator!= (PR #68922)

2023-10-12 Thread Richard Smith via cfe-commits
zygoloid wrote: Does this work for function-scope operator declarations? https://github.com/llvm/llvm-project/pull/68922 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] Fix host/device context in concept (PR #67721)

2023-10-12 Thread Richard Smith via cfe-commits
@@ -176,3 +176,34 @@ Predefined Macros * - ``HIP_API_PER_THREAD_DEFAULT_STREAM`` - Alias to ``__HIP_API_PER_THREAD_DEFAULT_STREAM__``. Deprecated. +C++20 Concepts with HIP and CUDA + + +In Clang, when working with HIP or CUDA, it's impor

[clang] Use the correct namespace for looking up matching operator!= (PR #68922)

2023-10-13 Thread Richard Smith via cfe-commits
zygoloid wrote: > > Does this work for function-scope operator declarations? > > @zygoloid I am not sure I follow. Could you please give an example. Sure: ```c++ struct X { operator int(); }; bool f(X x) { bool operator==(X, int); return x == x; } bool g(X x) { bool operator==(X, int)

[clang] Correctly compute conversion seq for args to fn with reversed param order (PR #68999)

2023-10-17 Thread Richard Smith via cfe-commits
https://github.com/zygoloid approved this pull request. Thanks, looks good. Our overall approach here seems error-prone, and I wonder if there's a better way to model the reversal of the conversion sequence. For example, perhaps we could change `ConversionSequenceList` into a class that tracks

Re: [clang] 3b34d69 - Revert "For #64088: mark vtable as used if we might emit a reference to it."

2023-08-01 Thread Richard Smith via cfe-commits
This revert reintroduces a wrong-code bug, can you explain what the purpose of the revert is? On Fri, 28 Jul 2023 at 03:50, Dmitry Chernenkov via cfe-commits < cfe-commits@lists.llvm.org> wrote: > > Author: Dmitry Chernenkov > Date: 2023-07-28T10:49:53Z > New Revision: 3b34d69ac7a643742364be3591b

[clang] [clang][Sema] Stop format size estimator upon %p to adapt to linux kernel's extension (PR #65969)

2023-09-11 Thread Richard Smith via cfe-commits
zygoloid wrote: Is there some way we can narrow the scope of this patch so we don't lose warnings for normal `snprintf`s, only for the kernel one? If we really can't tell the difference from the source code, we could move the affected warnings to a different warning group instead, so the kerne

[clang] [clang][Sema] Stop format size estimator upon %p to adapt to linux kernel's extension (PR #65969)

2023-09-12 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/65969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Stop format size estimator upon %p to adapt to linux kernel's extension (PR #65969)

2023-09-12 Thread Richard Smith via cfe-commits
https://github.com/zygoloid requested changes to this pull request. This looks like the wrong approach to me. I really think you should be splitting the warning into two parts, so that only the kernel developers see a change in diagnostic output. That would seem to make this patch simpler as we

[clang] [clang][Sema] Stop format size estimator upon %p to adapt to linux kernel's extension (PR #65969)

2023-09-12 Thread Richard Smith via cfe-commits
@@ -851,6 +851,50 @@ class ScanfDiagnosticFormatHandler } }; +/// `I` points to the next character of `%p` format. +/// This functon checks if the subsequent character can be linux kernel's +/// extnded format specifier +static inline constexpr bool canBeLinuxFormatExtension

[clang] [clang][Sema] Stop format size estimator upon %p to adapt to linux kernel's extension (PR #65969)

2023-09-13 Thread Richard Smith via cfe-commits
https://github.com/zygoloid resolved https://github.com/llvm/llvm-project/pull/65969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Stop format size estimator upon %p to adapt to linux kernel's extension (PR #65969)

2023-09-13 Thread Richard Smith via cfe-commits
https://github.com/zygoloid edited https://github.com/llvm/llvm-project/pull/65969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Stop format size estimator upon %p to adapt to linux kernel's extension (PR #65969)

2023-09-13 Thread Richard Smith via cfe-commits
@@ -961,10 +961,16 @@ def FormatNonStandard : DiagGroup<"format-non-iso">; def FormatY2K : DiagGroup<"format-y2k">; def FormatPedantic : DiagGroup<"format-pedantic">; def FormatTypeConfusion : DiagGroup<"format-type-confusion">; + +def FormatOverflowNonKprintf: DiagGroup<"forma

[clang] [clang][Sema] Stop format size estimator upon %p to adapt to linux kernel's extension (PR #65969)

2023-09-13 Thread Richard Smith via cfe-commits
@@ -1350,10 +1360,17 @@ void Sema::checkFortifiedBuiltinMemoryFunction(FunctionDecl *FD, llvm::APSInt::getUnsigned(H.getSizeLowerBound()) .extOrTrunc(SizeTypeWidth); if (FormatSize > *SourceSize && *SourceSize != 0) { - DiagID = dia

[clang] [clang][Sema] Stop format size estimator upon %p to adapt to linux kernel's extension (PR #65969)

2023-09-13 Thread Richard Smith via cfe-commits
https://github.com/zygoloid commented: I'm happy with the overall approach here; please don't block on further review from me. https://github.com/llvm/llvm-project/pull/65969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [clang][Sema] Stop format size estimator upon %p to adapt to linux kernel's extension (PR #65969)

2023-09-13 Thread Richard Smith via cfe-commits
https://github.com/zygoloid review_requested https://github.com/llvm/llvm-project/pull/65969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Stop format size estimator upon %p to adapt to linux kernel's extension (PR #65969)

2023-09-13 Thread Richard Smith via cfe-commits
https://github.com/zygoloid review_request_removed https://github.com/llvm/llvm-project/pull/65969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Stop format size estimator upon %p to adapt to linux kernel's extension (PR #65969)

2023-09-13 Thread Richard Smith via cfe-commits
https://github.com/zygoloid dismissed https://github.com/llvm/llvm-project/pull/65969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-09-16 Thread Richard Smith via cfe-commits
@@ -1625,6 +1625,35 @@ SmallVector has grown a few other minor advantages over std::vector, causing and is no longer "private to the implementation". A name like ``SmallVectorHeader`` might be more appropriate. +.. _dss_pagedvector: + +llvm/ADT/PagedVector.h +^^

[clang] Introduce paged vector (PR #66430)

2023-09-16 Thread Richard Smith via cfe-commits
@@ -1625,6 +1625,35 @@ SmallVector has grown a few other minor advantages over std::vector, causing and is no longer "private to the implementation". A name like ``SmallVectorHeader`` might be more appropriate. +.. _dss_pagedvector: + +llvm/ADT/PagedVector.h +^^

[clang] Introduce paged vector (PR #66430)

2023-09-16 Thread Richard Smith via cfe-commits
@@ -0,0 +1,131 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier

[clang] Introduce paged vector (PR #66430)

2023-09-16 Thread Richard Smith via cfe-commits
@@ -0,0 +1,133 @@ +//===- llvm/ADT/PagedVector.h - 'Lazyly allocated' vectors *- C++ +//-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier

[clang] 7f0ef7f - Fix profiling of overloaded postincrement / postdecrement.

2023-07-11 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2023-07-11T08:41:21-07:00 New Revision: 7f0ef7f304b1b91694f14e5c9c10de2aa6f38c95 URL: https://github.com/llvm/llvm-project/commit/7f0ef7f304b1b91694f14e5c9c10de2aa6f38c95 DIFF: https://github.com/llvm/llvm-project/commit/7f0ef7f304b1b91694f14e5c9c10de2aa6f38c95.diff

[clang] 3a9683f - Fix comparison of constrained deduced return types in explicit

2023-07-13 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2023-07-13T19:59:19-07:00 New Revision: 3a9683fce362ecfd7c4d76d4bf1198b59193e361 URL: https://github.com/llvm/llvm-project/commit/3a9683fce362ecfd7c4d76d4bf1198b59193e361 DIFF: https://github.com/llvm/llvm-project/commit/3a9683fce362ecfd7c4d76d4bf1198b59193e361.diff

Re: [PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-29 Thread Richard Smith via cfe-commits
On Tue, 22 Aug 2023 at 12:43, Nouman Amir via Phabricator via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Index: clang/include/clang/Basic/DiagnosticSemaKinds.td > === > --- clang/include/clang/Basic/DiagnosticSemaKinds.td > ++

[clang] [AST] Only dump desugared type when visibly different (PR #65214)

2023-09-06 Thread Richard Smith via cfe-commits
https://github.com/zygoloid commented: The change looks good and like a nice improvement to me. I don't think this is undoing any of the intended functional changes of @mizvekov's work. https://github.com/llvm/llvm-project/pull/65214 ___ cfe-commits m

[clang] dc4259d - [c++20] Further extend the set of comparisons broken by C++20 that we

2020-03-20 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2020-03-20T14:22:48-07:00 New Revision: dc4259d5a38409e65b60266a7df0f03c3b91a151 URL: https://github.com/llvm/llvm-project/commit/dc4259d5a38409e65b60266a7df0f03c3b91a151 DIFF: https://github.com/llvm/llvm-project/commit/dc4259d5a38409e65b60266a7df0f03c3b91a151.diff

[clang] fc8a009 - Clean up and simplify after collision of c48442c and 19fccc5, which

2020-03-20 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2020-03-20T14:53:09-07:00 New Revision: fc8a009bf39d74ce0ee3f586e0b4056035db30cb URL: https://github.com/llvm/llvm-project/commit/fc8a009bf39d74ce0ee3f586e0b4056035db30cb DIFF: https://github.com/llvm/llvm-project/commit/fc8a009bf39d74ce0ee3f586e0b4056035db30cb.diff

[clang] be10b7e - Use values cached in ConstantExprs for expression evaluation where

2020-03-20 Thread Richard Smith via cfe-commits
Author: Wyatt Childers Date: 2020-03-20T18:14:58-07:00 New Revision: be10b7e43a3a10fbd3244f826591f3f65c0b7e21 URL: https://github.com/llvm/llvm-project/commit/be10b7e43a3a10fbd3244f826591f3f65c0b7e21 DIFF: https://github.com/llvm/llvm-project/commit/be10b7e43a3a10fbd3244f826591f3f65c0b7e21.diff

[clang] ced7617 - PR45267: Don't reject pure-specifiers with escaped newlines in their '0' token.

2020-03-20 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2020-03-20T18:44:55-07:00 New Revision: ced7617c3853d19ffa00a578e92ffd7c54b6c2fb URL: https://github.com/llvm/llvm-project/commit/ced7617c3853d19ffa00a578e92ffd7c54b6c2fb DIFF: https://github.com/llvm/llvm-project/commit/ced7617c3853d19ffa00a578e92ffd7c54b6c2fb.diff

[clang] 502915c - PR45142: 'template ~X' is ill-formed; reject it rather than crashing.

2020-03-23 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2020-03-23T15:07:06-07:00 New Revision: 502915c619a32972ddc525be585794371bfbd27b URL: https://github.com/llvm/llvm-project/commit/502915c619a32972ddc525be585794371bfbd27b DIFF: https://github.com/llvm/llvm-project/commit/502915c619a32972ddc525be585794371bfbd27b.diff

[clang] 5bd0611 - Update documentation for __builtin_operator_new and

2020-03-23 Thread Richard Smith via cfe-commits
Author: Richard Smith Date: 2020-03-23T16:31:10-07:00 New Revision: 5bd06118c2a798f1f87b9251953bae8a27f21e5f URL: https://github.com/llvm/llvm-project/commit/5bd06118c2a798f1f87b9251953bae8a27f21e5f DIFF: https://github.com/llvm/llvm-project/commit/5bd06118c2a798f1f87b9251953bae8a27f21e5f.diff

Re: [clang] 857bf5d - [FIX] Do not copy an llvm::function_ref if it has to be reused

2020-03-26 Thread Richard Smith via cfe-commits
On Thu, 26 Mar 2020 at 17:07, David Blaikie via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On Thu, Mar 26, 2020 at 3:12 PM Arthur O'Dwyer > wrote: > >> I'm not sure, but I do see that the call stack contains a call to >> >> bool llvm::function_ref> bool)>::callback_fn >> const>(long, cla

Re: [clang] 857bf5d - [FIX] Do not copy an llvm::function_ref if it has to be reused

2020-03-27 Thread Richard Smith via cfe-commits
On Thu, 26 Mar 2020 at 21:50, Arthur O'Dwyer via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On Thu, Mar 26, 2020 at 11:49 PM Richard Smith > wrote: > >> On Thu, 26 Mar 2020 at 17:07, David Blaikie via cfe-commits < >> cfe-commits@lists.llvm.org> wrote: >> >>> On Thu, Mar 26, 2020 at 3:12

Re: [clang] 857bf5d - [FIX] Do not copy an llvm::function_ref if it has to be reused

2020-03-27 Thread Richard Smith via cfe-commits
On Fri, 27 Mar 2020 at 16:35, David Blaikie via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On Thu, Mar 26, 2020 at 8:49 PM Richard Smith > wrote: > >> On Thu, 26 Mar 2020 at 17:07, David Blaikie via cfe-commits < >> cfe-commits@lists.llvm.org> wrote: >> >>> On Thu, Mar 26, 2020 at 3:12 PM

<    11   12   13   14   15   16   17   18   19   20   >