https://github.com/zygoloid approved this pull request.
Looks good. Do we also need to worry about overwriting tail padding here?
https://github.com/llvm/llvm-project/pull/93115
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/zygoloid approved this pull request.
LG
https://github.com/llvm/llvm-project/pull/78060
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zygoloid commented:
I think we should go ahead with this. The behavior here is subtle but I think
it does make sense, and we're in the process of proposing this change to WG21.
https://github.com/llvm/llvm-project/pull/90820
___
zygoloid wrote:
> The immediate deprecation causes a few issues
On the one hand: waiting to deprecate something that we know we're going to
deprecate usually doesn't help anyone. We delay getting the message out to our
users, we sometimes forget to do it for the next release, and at best it
@@ -14,13 +14,18 @@ void __builtin_va_copy(double d);
// expected-error@+2 {{cannot redeclare builtin function '__builtin_va_end'}}
// expected-note@+1 {{'__builtin_va_end' is a builtin with type}}
void __builtin_va_end(__builtin_va_list);
-// RUN: %clang_cc1 %s -fsyntax-only
https://github.com/zygoloid approved this pull request.
Nothing further on my side, LGTM
https://github.com/llvm/llvm-project/pull/90842
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
zygoloid wrote:
> I'd like to proposal a separate PR for static analyzer. #91879 WDYT?
That sounds good to me.
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -2433,6 +2429,30 @@ CFGBlock *CFGBuilder::VisitChildren(Stmt *S) {
return B;
}
+CFGBlock *CFGBuilder::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *Arg,
+ AddStmtChoice asc) {
+ if (Arg->hasRewrittenInit()) {
+if
@@ -2433,6 +2429,30 @@ CFGBlock *CFGBuilder::VisitChildren(Stmt *S) {
return B;
}
+CFGBlock *CFGBuilder::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *Arg,
+ AddStmtChoice asc) {
+ if (Arg->hasRewrittenInit()) {
+if
https://github.com/zygoloid approved this pull request.
Looks great!
I think it'd be good to understand what's happening with the static analyzer
test, and update the comment to explain. But given that this is fixing a
conformance / wrong code bug, I don't think we should block this PR on
@@ -711,6 +711,26 @@ void InitListChecker::FillInEmptyInitForField(unsigned
Init, FieldDecl *Field,
if (VerifyOnly)
return;
+ // Enter a lifetime extension context, then we can support lifetime
+ // extension of temporary created by aggregate
@@ -206,13 +206,10 @@ namespace cwg1814 { // cwg1814: yes
#endif
}
-namespace cwg1815 { // cwg1815: no
+namespace cwg1815 { // cwg1815: yes
zygoloid wrote:
A test for constant evaluation would be nice here too. Maybe:
```c++
struct C { const int = 0; };
@@ -10698,7 +10698,7 @@ C++ defect report implementation
status
https://cplusplus.github.io/CWG/issues/1815.html;>1815
CD4
Lifetime extension in aggregate initialization
-No
+Clang 19
zygoloid wrote:
```suggestion
Clang 19
```
We use
@@ -122,7 +122,7 @@ void aggregateWithReferences() {
clang_analyzer_dump(viaReference.ry); // expected-warning-re
{{_extended_object{Composite, viaReference, S{{[0-9]+}}} }}
// clang does not currently implement extending lifetime of object bound to
reference members of
@@ -269,6 +269,26 @@ void init_capture_init_list() {
// CHECK: }
}
+void check_dr1815() { // dr1815: yes
+#if __cplusplus >= 201402L
+
+ struct A {
+int & = 0;
+~A() {}
+ };
+
+ struct B {
+A & = A{};
+~B() {}
+ };
+
+ // CHECK: void
@@ -8194,25 +8216,18 @@ void Sema::checkInitializerLifetime(const
InitializedEntity ,
}
switch (shouldLifetimeExtendThroughPath(Path)) {
+ case PathLifetimeKind::ShouldExtend:
zygoloid wrote:
Do we need separate `ShouldExtend` and `Extend`
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/87933
___
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 for working on this.
https://github.com/llvm/llvm-project/pull/87933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zygoloid commented:
Another possibility to consider: when [transforming a member
access](https://github.com/llvm/llvm-project/blob/ff210b94d449de8ebe1f32cf0d7763ba63b27b39/clang/lib/Sema/TreeTransform.h#L11950),
strip off any implicit member accesses from the base expression
zygoloid wrote:
> Note that the AST for the expression `T{}` looks like:
>
> ```
> // using T = int;
> CXXFunctionalCastExpr 'T':'int' functional cast to T
> `-InitListExpr 'T':'int'
> // using T = const int;
> CXXFunctionalCastExpr 'int' functional cast to T
> `-InitListExpr 'int'
> // using
@@ -8343,58 +8343,52 @@ bool
Sema::CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param,
// C++1z [temp.arg.template]p3: (DR 150)
// A template-argument matches a template template-parameter P when P
// is at least as specialized as the template-argument A.
zygoloid wrote:
> Unfortunately with this patch I'm still seeing the same
> source-location-exhausted error.
Can you try applying #89428 as well? I think we would need both in order to
prune the module map from the serialized SLocEntries.
https://github.com/llvm/llvm-project/pull/89005
https://github.com/zygoloid approved this pull request.
Thank you!
https://github.com/llvm/llvm-project/pull/89428
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1313,6 +1313,14 @@ OptionalFileEntryRef
HeaderSearch::LookupSubframeworkHeader(
// File Info Management.
//===--===//
+static bool
+headerFileInfoModuleBitsMatchRole(const HeaderFileInfo *HFI,
+
@@ -1313,6 +1313,14 @@ OptionalFileEntryRef
HeaderSearch::LookupSubframeworkHeader(
// File Info Management.
//===--===//
+static bool
+headerFileInfoModuleBitsMatchRole(const HeaderFileInfo *HFI,
+
@@ -161,8 +161,13 @@ static TypeCode getTypeCodeForTypeClass(Type::TypeClass
id) {
namespace {
-std::set GetAffectingModuleMaps(const Preprocessor ,
- Module *RootModule) {
+std::optional>
+GetAffectingModuleMaps(const
@@ -161,8 +161,13 @@ static TypeCode getTypeCodeForTypeClass(Type::TypeClass
id) {
namespace {
-std::set GetAffectingModuleMaps(const Preprocessor ,
- Module *RootModule) {
+std::optional>
+GetAffectingModuleMaps(const
@@ -161,8 +161,13 @@ static TypeCode getTypeCodeForTypeClass(Type::TypeClass
id) {
namespace {
-std::set GetAffectingModuleMaps(const Preprocessor ,
- Module *RootModule) {
+std::optional>
+GetAffectingModuleMaps(const
@@ -1403,94 +1421,146 @@ bool
HeaderSearch::isFileMultipleIncludeGuarded(FileEntryRef File) const {
void HeaderSearch::MarkFileModuleHeader(FileEntryRef FE,
ModuleMap::ModuleHeaderRole Role,
bool
zygoloid wrote:
Have you tried changing the behavior of the existing `-fmodule-map-file=` to
load the file after we load module files? If so, what kinds of things do you
see breaking or changing? If we can avoid it, I think it would be better to
only have a single mode here, and loading the
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/86960
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1230,11 +1230,26 @@ CodeGenFunction::EmitCXXForRangeStmt(const
CXXForRangeStmt ,
JumpDest LoopExit = getJumpDestInCurrentScope("for.end");
LexicalScope ForScope(*this, S.getSourceRange());
+ const DeclStmt *RangeDS = cast(S.getRangeStmt());
+ const VarDecl
@@ -1537,6 +1537,10 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S,
bool AddToContext) {
cast(D)->isFunctionTemplateSpecialization())
return;
+ if (isa(D) && D->getDeclName().isEmpty()) {
zygoloid wrote:
The reserved identifier check
@@ -1537,6 +1537,10 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S,
bool AddToContext) {
cast(D)->isFunctionTemplateSpecialization())
return;
+ if (isa(D) && D->getDeclName().isEmpty()) {
zygoloid wrote:
For what name? The `using enum`
@@ -1537,6 +1537,10 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S,
bool AddToContext) {
cast(D)->isFunctionTemplateSpecialization())
return;
+ if (isa(D) && D->getDeclName().isEmpty()) {
zygoloid wrote:
Are those useful checks? It seems
@@ -1537,6 +1537,10 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S,
bool AddToContext) {
cast(D)->isFunctionTemplateSpecialization())
return;
+ if (isa(D) && D->getDeclName().isEmpty()) {
zygoloid wrote:
Why do we push a `UsingEnumDecl`
@@ -1117,19 +1118,37 @@ NumericLiteralParser::NumericLiteralParser(StringRef
TokSpelling,
if (isImaginary) break; // Cannot be repeated.
isImaginary = true;
continue; // Success.
+case '_':
+ if (isFPConstant)
+break; // Invalid for
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 = C().a[0];`, we'll form an MTE wrapping just
the `C()` expression, converting it to an
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,
@@ -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;
+}
@@ -2503,6 +2506,29 @@ Stmt *BlockExpr::getBody() {
// Generic Expression Routines
//===--===//
+bool Expr::mayBranchOut() const {
zygoloid wrote:
Computing this seems a little expensive in
@@ -3173,41 +3174,46 @@ class ArrayType : public Type, public
llvm::FoldingSetNode {
return T->getTypeClass() == ConstantArray ||
T->getTypeClass() == VariableArray ||
T->getTypeClass() == IncompleteArray ||
- T->getTypeClass() ==
@@ -3173,41 +3174,46 @@ class ArrayType : public Type, public
llvm::FoldingSetNode {
return T->getTypeClass() == ConstantArray ||
T->getTypeClass() == VariableArray ||
T->getTypeClass() == IncompleteArray ||
- T->getTypeClass() ==
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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();
+//
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:
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
@@ -555,13 +555,11 @@ static void
handleImplicitConversion(ImplicitConversionData *Data,
ReportOptions Opts, ValueHandle Src,
ValueHandle Dst) {
SourceLocation Loc = Data->Loc.acquire();
- ErrorType
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`.
@@ -555,13 +555,11 @@ static void
handleImplicitConversion(ImplicitConversionData *Data,
ReportOptions Opts, ValueHandle Src,
ValueHandle Dst) {
SourceLocation Loc = Data->Loc.acquire();
- ErrorType
@@ -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();
+//
@@ -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();
+//
@@ -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();
+//
@@ -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();
+//
@@ -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());
+
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
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 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 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
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
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/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
@@ -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",
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.
@@ -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",
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",
@@ -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",
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",
@@ -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(),
+
@@ -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",
@@ -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`
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
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
@@ -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
@@ -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
@@ -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
@@ -4842,7 +4842,7 @@ bool TokenAnnotator::spaceRequiredBefore(const
AnnotatedLine ,
return true;
}
if (Left.is(TT_UnaryOperator)) {
-if (Right.isNot(tok::l_paren)) {
+if (!Right.isOneOf(tok::r_paren, tok::l_paren, tok::exclaim)) {
zygoloid
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/78176
___
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/78176
___
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/78176
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4842,7 +4842,7 @@ bool TokenAnnotator::spaceRequiredBefore(const
AnnotatedLine ,
return true;
}
if (Left.is(TT_UnaryOperator)) {
-if (Right.isNot(tok::l_paren)) {
+if (!Right.isOneOf(tok::r_paren, tok::l_paren, tok::exclaim)) {
zygoloid
@@ -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
@@ -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
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
zygoloid wrote:
> I'm not sure I understand why gcc is giving an error in
> https://godbolt.org/z/qGfnzhfsK. It doesn't give an error with `typename`
> keyword and I think there shouldn't be any difference since `Y::E` refers to
> current instantiation and is being used by class member
zygoloid wrote:
> My answer for the question "what's the semantics of GCC's builtin X?" has
> always been "whatever GCC does." It's the best we can rely upon. But then we
> get into situations like this, where you and @nikic have one interpretation
> of their documentation and I have another.
zygoloid wrote:
> Perhaps we need clarification on what GCC means by "may point to multiple
> objects" in this instance. To me that means either "get me the size of the
> largest of these multiple objects" or "size of the smallest." In my eyes,
> that means pointing to a union field.
Per
zygoloid wrote:
Taking a step back, while this patch is not the right direction, we can and
should do better for the original example. Probably the best way to do that is
to analyze the operand to `__builtin_[dynamic_]object_size` in the frontend and
compute a better bound based on the form
1 - 100 of 3721 matches
Mail list logo