@@ -713,6 +713,11 @@ static ExprResult SemaBuiltinDumpStruct(Sema &S, CallExpr
*TheCall) {
return ExprError();
}
const RecordDecl *RD = PtrArgType->getPointeeType()->getAsRecordDecl();
+ if (!RD->isCompleteDefinition()) {
zygoloid wrote:
You need to
@@ -727,6 +729,44 @@ void InitListChecker::FillInEmptyInitForField(unsigned
Init, FieldDecl *Field,
if (hadError || VerifyOnly) {
// Do nothing
} else if (Init < NumInits) {
zygoloid wrote:
Hm, right, we still call this with `Init >= NumInits` w
zygoloid wrote:
> At this point we either ignore the implicitly generated `TagDecl`, or we can
> tweak the attribute printing, so that they are printed even if we only print
> the declaration, though when I tried that 10 test cases failed, so I'm not
> sure we want to pursue that solution.
I
https://github.com/zygoloid closed
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
zygoloid wrote:
Thanks for looking into this!
I wonder if it would make sense to move the checking for this warning here, to
the `else` case in line 725:
https://github.com/llvm/llvm-project/blob/ac30780250875802d13450d17e6959f9e2ad3a70/clang/lib/Sema/SemaInit.cpp#L717-L734
That should remove
zygoloid wrote:
I don't think this type-based approach is the right choice. It will lead to a
lot of false negatives, and I'm especially concerned that this patch is also
dropping warnings for comparisons that just happen to be the same type as
`size_t` (eg, direct use of `unsigned long` or `u
zygoloid wrote:
I *think* the new map should be unnecessary: `FunctionTemplateDecl` and
`VarTemplateDecl` already have a list of specializations that you can walk and
check the point of instantiation and template specialization kind to see if
there's a pending instantiation.
If you want/need
zygoloid wrote:
> > I _think_ the new map should be unnecessary: `FunctionTemplateDecl` and
> > `VarTemplateDecl` already have a list of specializations that you can walk
> > and check the point of instantiation and template specialization kind to
> > see if there's a pending instantiation.
>
@@ -6481,6 +6481,33 @@ void Sema::PerformPendingInstantiations(bool LocalOnly) {
PendingInstantiations.swap(delayedPCHInstantiations);
}
+// Instantiate all referenced specializations of the given function template
+// definition. This make sure that function template that
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/73463
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zygoloid commented:
Thanks!
https://github.com/llvm/llvm-project/pull/73463
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4836,6 +4837,16 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef,
StringRef isysroot,
assert(SemaRef.PendingLocalImplicitInstantiations.empty() &&
"There are local ones at end of translation unit!");
+ // Build a record containing all of pending insta
@@ -181,6 +181,9 @@ class ExternalSemaSource : public ExternalASTSource {
SmallVectorImpl > &Pending) {}
+ virtual void ReadPendingOfInstantiationsForConstexprEntity(
zygoloid wrote:
The "Of" here seems out of place; maybe remove it? You also
@@ -6481,6 +6481,33 @@ void Sema::PerformPendingInstantiations(bool LocalOnly) {
PendingInstantiations.swap(delayedPCHInstantiations);
}
+// Instantiate all referenced specializations of the given function template
+// definition. This make sure that function template that
@@ -8718,6 +8731,18 @@ void ASTReader::ReadPendingInstantiations(
PendingInstantiations.clear();
}
+void ASTReader::ReadPendingOfInstantiationsForConstexprEntity(
+const NamedDecl *D, llvm::SmallSetVector &Decls) {
+ for (auto *Redecl : D->redecls()) {
+DeclID Id =
@@ -6481,6 +6481,33 @@ void Sema::PerformPendingInstantiations(bool LocalOnly) {
PendingInstantiations.swap(delayedPCHInstantiations);
}
+// Instantiate all referenced specializations of the given function template
+// definition. This make sure that function template that
@@ -112,6 +112,9 @@ template
constexpr int f(T t) { // expected-note {{'f' defined here}}
return id(t); // expected-note {{'f' is an immediate function because
its body contains a call to a consteval function 'id' and that call is not a
constant expression}}
}
+
+
+
https://github.com/zygoloid approved this pull request.
Thanks! I assume you'll also be looking at the variable case (perhaps as a
separate commit)?
https://github.com/llvm/llvm-project/pull/73463
___
cfe-commits mailing list
cfe-commits@lists.llvm.or
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/75456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -640,3 +640,36 @@ namespace PR46637 {
template struct Y { T x; };
Y auto> y; // expected-error {{'auto' not allowed in template
argument}}
}
+
+namespace GH71015 {
+
+// Check that there is no error in case a templated function is recursive and
+// has a placeholder ret
https://github.com/zygoloid approved this pull request.
Looks good, thanks!
https://github.com/llvm/llvm-project/pull/75456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
zygoloid wrote:
How about instead using `-fvisibility-global-new-delete=`? We want a
mutually-exclusive set of options here, and we know we want more than two of
them, and a flag with an argument value is the way we usually express that.
Perhaps we can use values of `force-hidden`, `force-defa
zygoloid wrote:
To be clear: I didn't mean to suggest that
`-fvisibility-global-new-delete=force-hidden` itself would be deprecated. I
think supporting it would have low cost and it may be exactly what is desired
in some cases, and the previous spelling [has quite a few
uses](https://www.goog
@@ -640,3 +640,36 @@ namespace PR46637 {
template struct Y { T x; };
Y auto> y; // expected-error {{'auto' not allowed in template
argument}}
}
+
+namespace GH71015 {
+
+// Check that there is no error in case a templated function is recursive and
+// has a placeholder ret
Author: Richard Smith
Date: 2022-06-29T13:08:40-07:00
New Revision: 5086e05bb0cdeef68b110336dba2fe229be95110
URL:
https://github.com/llvm/llvm-project/commit/5086e05bb0cdeef68b110336dba2fe229be95110
DIFF:
https://github.com/llvm/llvm-project/commit/5086e05bb0cdeef68b110336dba2fe229be95110.diff
Author: Richard Smith
Date: 2022-06-29T13:08:40-07:00
New Revision: dcea10c3c6ac963387e53f918c3616b64cb82e8d
URL:
https://github.com/llvm/llvm-project/commit/dcea10c3c6ac963387e53f918c3616b64cb82e8d
DIFF:
https://github.com/llvm/llvm-project/commit/dcea10c3c6ac963387e53f918c3616b64cb82e8d.diff
Author: Richard Smith
Date: 2022-03-31T20:02:53-07:00
New Revision: f1b0a4fc540f986372f09768c325d505b75b414d
URL:
https://github.com/llvm/llvm-project/commit/f1b0a4fc540f986372f09768c325d505b75b414d
DIFF:
https://github.com/llvm/llvm-project/commit/f1b0a4fc540f986372f09768c325d505b75b414d.diff
Author: Richard Smith
Date: 2022-08-04T17:08:08-07:00
New Revision: 73b62f813550b602f189afc3a60b0b39ae89f16d
URL:
https://github.com/llvm/llvm-project/commit/73b62f813550b602f189afc3a60b0b39ae89f16d
DIFF:
https://github.com/llvm/llvm-project/commit/73b62f813550b602f189afc3a60b0b39ae89f16d.diff
Author: Richard Smith
Date: 2022-04-13T21:34:08-07:00
New Revision: 836e610d9332772ad4511e86ef126a200f1ab281
URL:
https://github.com/llvm/llvm-project/commit/836e610d9332772ad4511e86ef126a200f1ab281
DIFF:
https://github.com/llvm/llvm-project/commit/836e610d9332772ad4511e86ef126a200f1ab281.diff
Author: Richard Smith
Date: 2022-04-15T14:09:45-07:00
New Revision: 64c045e25b8471bbb572bd29159c294a82a86a25
URL:
https://github.com/llvm/llvm-project/commit/64c045e25b8471bbb572bd29159c294a82a86a25
DIFF:
https://github.com/llvm/llvm-project/commit/64c045e25b8471bbb572bd29159c294a82a86a25.diff
Author: Richard Smith
Date: 2022-04-15T14:51:30-07:00
New Revision: a571f82a50416b767fd3cce0fb5027bb5dfec58c
URL:
https://github.com/llvm/llvm-project/commit/a571f82a50416b767fd3cce0fb5027bb5dfec58c
DIFF:
https://github.com/llvm/llvm-project/commit/a571f82a50416b767fd3cce0fb5027bb5dfec58c.diff
Author: Richard Smith
Date: 2022-04-15T16:31:39-07:00
New Revision: fc3090109643af8d2da9822d0f99c84742b9c877
URL:
https://github.com/llvm/llvm-project/commit/fc3090109643af8d2da9822d0f99c84742b9c877
DIFF:
https://github.com/llvm/llvm-project/commit/fc3090109643af8d2da9822d0f99c84742b9c877.diff
Author: Richard Smith
Date: 2022-04-17T13:26:16-07:00
New Revision: b27430f9f46b88bcd54d992debc8d72e131e1bd0
URL:
https://github.com/llvm/llvm-project/commit/b27430f9f46b88bcd54d992debc8d72e131e1bd0
DIFF:
https://github.com/llvm/llvm-project/commit/b27430f9f46b88bcd54d992debc8d72e131e1bd0.diff
Author: Richard Smith
Date: 2022-04-17T19:25:20-07:00
New Revision: 3eeca524569744d2927fd13304ab5abb7217e108
URL:
https://github.com/llvm/llvm-project/commit/3eeca524569744d2927fd13304ab5abb7217e108
DIFF:
https://github.com/llvm/llvm-project/commit/3eeca524569744d2927fd13304ab5abb7217e108.diff
Author: Richard Smith
Date: 2022-04-18T11:11:21-07:00
New Revision: e43c93dd63cca295ef26ab69cd305816a71d45fd
URL:
https://github.com/llvm/llvm-project/commit/e43c93dd63cca295ef26ab69cd305816a71d45fd
DIFF:
https://github.com/llvm/llvm-project/commit/e43c93dd63cca295ef26ab69cd305816a71d45fd.diff
Author: Richard Smith
Date: 2022-04-19T14:48:42-07:00
New Revision: 63814be4fa23ef9b36cf2d14388c7f6ba591d3b6
URL:
https://github.com/llvm/llvm-project/commit/63814be4fa23ef9b36cf2d14388c7f6ba591d3b6
DIFF:
https://github.com/llvm/llvm-project/commit/63814be4fa23ef9b36cf2d14388c7f6ba591d3b6.diff
Author: Richard Smith
Date: 2022-04-20T17:58:31-07:00
New Revision: 72315d02c432a0fe0acae9c96c69eac8d8e1a9f6
URL:
https://github.com/llvm/llvm-project/commit/72315d02c432a0fe0acae9c96c69eac8d8e1a9f6
DIFF:
https://github.com/llvm/llvm-project/commit/72315d02c432a0fe0acae9c96c69eac8d8e1a9f6.diff
Author: Richard Smith
Date: 2022-04-21T14:21:07-07:00
New Revision: f6a5ab6c8c316fa4f60e40030586e230920a63ea
URL:
https://github.com/llvm/llvm-project/commit/f6a5ab6c8c316fa4f60e40030586e230920a63ea
DIFF:
https://github.com/llvm/llvm-project/commit/f6a5ab6c8c316fa4f60e40030586e230920a63ea.diff
Author: Richard Smith
Date: 2022-02-02T17:02:47-08:00
New Revision: 30baa5d2a450d5e302d8cba3fc7a26a59d4b7ae1
URL:
https://github.com/llvm/llvm-project/commit/30baa5d2a450d5e302d8cba3fc7a26a59d4b7ae1
DIFF:
https://github.com/llvm/llvm-project/commit/30baa5d2a450d5e302d8cba3fc7a26a59d4b7ae1.diff
Author: Devin Jeanpierre
Date: 2022-02-02T17:42:20-08:00
New Revision: 19aa2db023c0128913da223d4fb02c474541ee22
URL:
https://github.com/llvm/llvm-project/commit/19aa2db023c0128913da223d4fb02c474541ee22
DIFF:
https://github.com/llvm/llvm-project/commit/19aa2db023c0128913da223d4fb02c474541ee22.di
Author: Richard Smith
Date: 2022-02-08T17:25:52-08:00
New Revision: dc8f4e118d92982ff5f6316fe7d541d120ebabd1
URL:
https://github.com/llvm/llvm-project/commit/dc8f4e118d92982ff5f6316fe7d541d120ebabd1
DIFF:
https://github.com/llvm/llvm-project/commit/dc8f4e118d92982ff5f6316fe7d541d120ebabd1.diff
Author: Richard Smith
Date: 2022-02-15T17:56:45-08:00
New Revision: 13b6f31548784452990da6dba555af8d7a061958
URL:
https://github.com/llvm/llvm-project/commit/13b6f31548784452990da6dba555af8d7a061958
DIFF:
https://github.com/llvm/llvm-project/commit/13b6f31548784452990da6dba555af8d7a061958.diff
Author: Richard Smith
Date: 2022-05-03T11:55:14-07:00
New Revision: c7ecfadf9beb936e5101db4362dd2935d415b04d
URL:
https://github.com/llvm/llvm-project/commit/c7ecfadf9beb936e5101db4362dd2935d415b04d
DIFF:
https://github.com/llvm/llvm-project/commit/c7ecfadf9beb936e5101db4362dd2935d415b04d.diff
Author: Richard Smith
Date: 2022-05-05T15:58:26-07:00
New Revision: c2572d8b1fccffcc5dd7b900cf3c4cfa07df3b50
URL:
https://github.com/llvm/llvm-project/commit/c2572d8b1fccffcc5dd7b900cf3c4cfa07df3b50
DIFF:
https://github.com/llvm/llvm-project/commit/c2572d8b1fccffcc5dd7b900cf3c4cfa07df3b50.diff
Author: Richard Smith
Date: 2022-05-05T16:04:19-07:00
New Revision: f6c74932b59619aa1a680caa7c4b78d4d29c2877
URL:
https://github.com/llvm/llvm-project/commit/f6c74932b59619aa1a680caa7c4b78d4d29c2877
DIFF:
https://github.com/llvm/llvm-project/commit/f6c74932b59619aa1a680caa7c4b78d4d29c2877.diff
@@ -3173,41 +3174,46 @@ class ArrayType : public Type, public
llvm::FoldingSetNode {
return T->getTypeClass() == ConstantArray ||
T->getTypeClass() == VariableArray ||
T->getTypeClass() == IncompleteArray ||
- T->getTypeClass() == DependentS
@@ -2503,6 +2506,29 @@ Stmt *BlockExpr::getBody() {
// Generic Expression Routines
//===--===//
+bool Expr::mayBranchOut() const {
zygoloid wrote:
Computing this seems a little expensive in
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+constexpr int increment(int& x) {
+ x++;
+ return x;
+}
+
+constexpr int test_clzg_0() {
+ int x = 0;
+ [[maybe_unused]] int unused = __builtin_clzg(0U, increment(x));
+ return x;
+}
zygoloid wrote:
I don't think we've established an explicit policy, and we've made ABI-breaking
changes previously. I think we should avoid breaks within a major release
version (don't backport this) to avoid giving packagers headaches: the ubsan
runtime is installed in a versioned directory,
zygoloid wrote:
IIRC the issue here is that in C++98, the MTE is in a "weird" place in the AST,
because of the different rules governing how and when temporaries are formed.
For example, for `const int &r = C().a[0];`, we'll form an MTE wrapping just
the `C()` expression, converting it to an x
@@ -1117,19 +1118,37 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for floats
zygoloid wrote:
> +1 for this, it will be the 95%/5% rule, you might think all cases of
> (identifier) is a cast, but I'm pretty sure it won't be
Specifically, what I suggested was: when disambiguating whether
`(identifier)&...` or `(identifier)*...` is a cast vs a multiplication or
bitwise a
https://github.com/zygoloid approved this pull request.
https://github.com/llvm/llvm-project/pull/81950
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zygoloid closed
https://github.com/llvm/llvm-project/pull/81950
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/75481
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zygoloid commented:
Generally this looks good to me, thanks.
https://github.com/llvm/llvm-project/pull/75481
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4564,15 +4737,41 @@ Value *ScalarExprEmitter::VisitBinAssign(const
BinaryOperator *E) {
case Qualifiers::OCL_None:
// __block variables need to have the rhs evaluated first, plus
// this should improve codegen just a little.
-RHS = Visit(E->getRHS());
+Va
@@ -5571,11 +5571,50 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const
BinaryOperator *E) {
break;
}
-RValue RV = EmitAnyExpr(E->getRHS());
+llvm::Value *Previous = nullptr;
+RValue RV;
+QualType SrcType = E->getRHS()->getType();
+// Chec
@@ -5571,11 +5571,50 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const
BinaryOperator *E) {
break;
}
-RValue RV = EmitAnyExpr(E->getRHS());
+llvm::Value *Previous = nullptr;
+RValue RV;
+QualType SrcType = E->getRHS()->getType();
+// Chec
@@ -5571,11 +5571,50 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const
BinaryOperator *E) {
break;
}
-RValue RV = EmitAnyExpr(E->getRHS());
+llvm::Value *Previous = nullptr;
+RValue RV;
+QualType SrcType = E->getRHS()->getType();
+// Chec
@@ -5571,11 +5571,50 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const
BinaryOperator *E) {
break;
}
-RValue RV = EmitAnyExpr(E->getRHS());
+llvm::Value *Previous = nullptr;
+RValue RV;
+QualType SrcType = E->getRHS()->getType();
+// Chec
@@ -555,13 +555,11 @@ static void
handleImplicitConversion(ImplicitConversionData *Data,
ReportOptions Opts, ValueHandle Src,
ValueHandle Dst) {
SourceLocation Loc = Data->Loc.acquire();
- ErrorType E
zygoloid wrote:
> I'm not opposed to the changes, though I do find it somewhat strange to add
> them to UBSan given that they're not undefined behavior (even though there's
> precedent).
This is adding checks to `-fsanitize=implicit-conversion`, which is not part of
`-fsanitize=undefined`. It
@@ -555,13 +555,11 @@ static void
handleImplicitConversion(ImplicitConversionData *Data,
ReportOptions Opts, ValueHandle Src,
ValueHandle Dst) {
SourceLocation Loc = Data->Loc.acquire();
- ErrorType E
https://github.com/zygoloid commented:
Looks good to me. @AaronBallman Did you have remaining concerns here?
https://github.com/llvm/llvm-project/pull/75481
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/75481
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5571,11 +5571,52 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const
BinaryOperator *E) {
break;
}
-RValue RV = EmitAnyExpr(E->getRHS());
+llvm::Value *Previous = nullptr;
+RValue RV;
+QualType SrcType = E->getRHS()->getType();
+// Chec
@@ -26996,18 +26996,38 @@ class, structure, array, or other object.
Arguments:
""
-The ``llvm.objectsize`` intrinsic takes four arguments. The first argument is a
-pointer to or into the ``object``. The second argument determines whether
-``llvm.objectsize`` returns 0
@@ -1052,11 +1053,143 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const
Expr *E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+/// SubobjectFinder - A simple visitor to find the "sub-object" pointed to b
@@ -1052,11 +1053,143 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const
Expr *E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+/// SubobjectFinder - A simple visitor to find the "sub-object" pointed to b
@@ -1052,11 +1053,143 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const
Expr *E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+/// SubobjectFinder - A simple visitor to find the "sub-object" pointed to b
@@ -1052,11 +1053,143 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const
Expr *E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+/// SubobjectFinder - A simple visitor to find the "sub-object" pointed to b
@@ -1052,11 +1053,143 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const
Expr *E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+/// SubobjectFinder - A simple visitor to find the "sub-object" pointed to b
@@ -26996,18 +26996,38 @@ class, structure, array, or other object.
Arguments:
""
-The ``llvm.objectsize`` intrinsic takes four arguments. The first argument is a
-pointer to or into the ``object``. The second argument determines whether
-``llvm.objectsize`` returns 0
@@ -26996,18 +26996,38 @@ class, structure, array, or other object.
Arguments:
""
-The ``llvm.objectsize`` intrinsic takes four arguments. The first argument is a
-pointer to or into the ``object``. The second argument determines whether
-``llvm.objectsize`` returns 0
@@ -26996,18 +26996,38 @@ class, structure, array, or other object.
Arguments:
""
-The ``llvm.objectsize`` intrinsic takes four arguments. The first argument is a
-pointer to or into the ``object``. The second argument determines whether
-``llvm.objectsize`` returns 0
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/83204
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -26996,18 +26996,38 @@ class, structure, array, or other object.
Arguments:
""
-The ``llvm.objectsize`` intrinsic takes four arguments. The first argument is a
-pointer to or into the ``object``. The second argument determines whether
-``llvm.objectsize`` returns 0
@@ -3173,41 +3174,46 @@ class ArrayType : public Type, public
llvm::FoldingSetNode {
return T->getTypeClass() == ConstantArray ||
T->getTypeClass() == VariableArray ||
T->getTypeClass() == IncompleteArray ||
- T->getTypeClass() == DependentS
@@ -896,6 +896,12 @@ def Launder : Builtin {
let Prototype = "void*(void*)";
}
+def StartObjectLifeTime : Builtin {
zygoloid wrote:
Nit: lifetime is one word not two, so the `T` should not be capitalized.
https://github.com/llvm/llvm-project/pull/82776
___
@@ -17626,6 +17626,25 @@ class SequenceChecker : public
ConstEvaluatedExprVisitor {
for (unsigned I = 0; I < Elts.size(); ++I)
Tree.merge(Elts[I]);
}
+
+ void VisitCXXParenListInitExpr(const CXXParenListInitExpr *PLIE) {
+// C++20 parenthesized list initializa
@@ -17626,6 +17626,25 @@ class SequenceChecker : public
ConstEvaluatedExprVisitor {
for (unsigned I = 0; I < Elts.size(); ++I)
Tree.merge(Elts[I]);
}
+
+ void VisitCXXParenListInitExpr(const CXXParenListInitExpr *PLIE) {
+// C++20 parenthesized list initializa
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/83476
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zygoloid commented:
Thanks!
[I'm not sure when I'll have time to circle back to this, so I'd be happy for
someone else to finish the review and approve.]
https://github.com/llvm/llvm-project/pull/83476
___
cfe-commits mailing list
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) {
return nullptr;
}
+// Sorted common C++ non-keyword types.
+static SmallVector CppNonKeywordTypes = {
+"byte", "int16_t", "int32_t", "int64_t", "int8_t",
zygoloid wrote:
Does `byte`
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) {
return nullptr;
}
+// Sorted common C++ non-keyword types.
+static SmallVector CppNonKeywordTypes = {
+"byte", "int16_t", "int32_t", "int64_t", "int8_t",
+"size_t", "uint16_t", "uint32_t", "uint64
@@ -66,13 +72,17 @@ bool FormatToken::isSimpleTypeSpecifier() const {
case tok::kw_decltype:
case tok::kw__Atomic:
return true;
+ case tok::identifier:
+return IsCpp && std::binary_search(CppNonKeywordTypes.begin(),
+ CppNonKey
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) {
return nullptr;
}
+// Sorted common C++ non-keyword types.
+static SmallVector CppNonKeywordTypes = {
+"byte", "int16_t", "int32_t", "int64_t", "int8_t",
+"size_t", "uint16_t", "uint32_t", "uint64
zygoloid wrote:
Another possibility to consider for the original bug: `(single_identifier)` is
almost certainly a cast, not redundant parentheses, unless `single_identifier`
names a macro argument. So I wonder if that would be a better heuristic to use
to fix the regression.
https://github.co
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) {
return nullptr;
}
+// Sorted common C++ non-keyword types.
+static SmallVector CppNonKeywordTypes = {
+"byte", "int16_t", "int32_t", "int64_t", "int8_t",
+"size_t", "uint16_t", "uint32_t", "uint64
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) {
return nullptr;
}
+// Sorted common C++ non-keyword types.
+static SmallVector CppNonKeywordTypes = {
+"byte", "int16_t", "int32_t", "int64_t", "int8_t",
+"size_t", "uint16_t", "uint32_t", "uint64
zygoloid wrote:
> > Another possibility to consider for the original bug: `(single_identifier)`
> > is almost certainly a cast, not redundant parentheses, unless
> > `single_identifier` names a macro argument. So I wonder if that would be a
> > better heuristic to use to fix the regression.
>
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) {
return nullptr;
}
+// Sorted common C++ non-keyword types.
+static SmallVector CppNonKeywordTypes = {
+"byte", "int16_t", "int32_t", "int64_t", "int8_t",
+"size_t", "uint16_t", "uint32_t", "uint64
zygoloid wrote:
> This patch does not only fix formatting of C-casting to a C++ standard type.
> It correctly identifies (most of) such types and might have fixed other kinds
> of bugs.
Sure, this patch seems like a good change. But it does not fix #83400.
https://github.com/llvm/llvm-project
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) {
return nullptr;
}
+// Sorted common C++ non-keyword types.
+static SmallVector CppNonKeywordTypes = {
+"byte", "int16_t", "int32_t", "int64_t", "int8_t",
+"size_t", "uint16_t", "uint32_t", "uint64
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/83709
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
zygoloid wrote:
> It does fix the example given.
#83400 has 6 real-world examples. This patch fixes none of them. It also has a
reduced testcase, which this patch does fix. But fixing the reduced testcase
without fixing the real-world examples is not fixing the bug.
https://github.com/llvm/l
zygoloid wrote:
It might be academic at this point, but for what it's worth,
`__builtin_dynamic_object_size` is not a GCC builtin that clang copied, it's [a
clang builtin](https://reviews.llvm.org/D56760) that GCC copied.
https://github.com/llvm/llvm-project/pull/78526
@@ -1051,6 +1052,145 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr
*E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+/// \p StructBaseExpr returns the base \p Expr with a structure or union type
@@ -1051,6 +1052,145 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr
*E, unsigned Type,
return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0,
IsSigned));
}
+namespace {
+
+/// \p StructBaseExpr returns the base \p Expr with a structure or union type
1001 - 1100 of 4244 matches
Mail list logo