https://github.com/zygoloid approved this pull request.
https://github.com/llvm/llvm-project/pull/93115
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zygoloid updated
https://github.com/llvm/llvm-project/pull/96573
>From 3394d999888087535db9ede87668829eddc33ac7 Mon Sep 17 00:00:00 2001
From: Richard Smith
Date: Mon, 24 Jun 2024 15:52:18 -0700
Subject: [PATCH 1/2] Add documentation for `__builtin_object_size`.
Explicitly d
@@ -5368,16 +5368,85 @@ The ``#pragma comment(lib, ...)`` directive is
supported on all ELF targets.
The second parameter is the library name (without the traditional Unix prefix
of
``lib``). This allows you to provide an implicit link of dependent libraries.
-Evaluating Ob
https://github.com/zygoloid created
https://github.com/llvm/llvm-project/pull/96573
Explicitly describe how the Clang builtin works, given that it's not exactly
the same as GCC's builtin of the same name -- but is drop-in compatible.
Fixes #95635.
>From 3394d999888087535db9ede87668829eddc33ac
@@ -1392,7 +1392,8 @@ class CXXRecordDecl : public RecordDecl {
bool allowConstDefaultInit() const {
return !data().HasUninitializedFields ||
!(data().HasDefaultedDefaultConstructor ||
- needsImplicitDefaultConstructor());
+ needsImplici
@@ -141,3 +141,15 @@ namespace r360308_regression {
return a == b;
}
}
+
+namespace GH95598 {
+template
+struct __is_pointer {};
+// expected-warning@-1 {{keyword '__is_pointer' will be made available as an
identifier for the remainder of the translation unit}}
-
@@ -141,3 +141,15 @@ namespace r360308_regression {
return a == b;
}
}
+
+namespace GH95598 {
+template
+struct __is_pointer {};
+// expected-warning@-1 {{keyword '__is_pointer' will be made available as an
identifier for the remainder of the translation unit}}
-
@@ -141,3 +141,15 @@ namespace r360308_regression {
return a == b;
}
}
+
+namespace GH95598 {
+template
+struct __is_pointer {};
+// expected-warning@-1 {{keyword '__is_pointer' will be made available as an
identifier for the remainder of the translation unit}}
-
zygoloid wrote:
Perhaps we can start by supplying `CheckForModifiableLvalue` with extra
information about *why* we're doing the check. The current diagnostic we get
for incrementing a non-modifiable lvalue:
```console
:2:3: error: cannot assign to variable 'n' with const-qualified type
'const
@@ -13273,6 +13273,23 @@ enum {
ConstUnknown, // Keep as last element
};
+static void MaybeSuggestDerefFixIt(Sema &S, const Expr *E, SourceLocation Loc)
{
+ ExprResult Deref;
+ Expr *TE = const_cast(E);
+ {
+Sema::TentativeAnalysisScope Trap(S);
+Deref = S.ActOn
@@ -65,8 +65,10 @@ void test4(void) {
void test5(int *X, float *P) {
(float*)X = P; // expected-error {{assignment to cast is illegal, lvalue
casts are not supported}}
+ // expected-note@-1 {{add '*' to dereference it}}
zygoloid wrote:
This is a diagnos
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %s
+
+struct S {
+ void f() {
+++this; // expected-error {{expression is not assignable}}
+// expected-note@-1 {{add '*' to dereference it}}
+ }
+
+ void g() const {
+++this; // expected-error {{e
@@ -13273,6 +13273,23 @@ enum {
ConstUnknown, // Keep as last element
};
+static void MaybeSuggestDerefFixIt(Sema &S, const Expr *E, SourceLocation Loc)
{
+ ExprResult Deref;
+ Expr *TE = const_cast(E);
+ {
+Sema::TentativeAnalysisScope Trap(S);
+Deref = S.ActOn
@@ -65,8 +65,10 @@ void test4(void) {
void test5(int *X, float *P) {
(float*)X = P; // expected-error {{assignment to cast is illegal, lvalue
casts are not supported}}
+ // expected-note@-1 {{add '*' to dereference it}}
#define FOO ((float*) X)
FOO = P; // expected
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %s
+
+struct S {
+ void f() {
+++this; // expected-error {{expression is not assignable}}
+// expected-note@-1 {{add '*' to dereference it}}
zygoloid wrote:
This is a bad diagnostic ch
https://github.com/zygoloid commented:
I have some significant concerns about the approach of this PR. It seems to be
producing notes that in a lot of cases suggest doing something that doesn't
make sense or won't compile, and tentatively building a `*p` expression is
unsafe.
Can we revert an
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/94159
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2261,8 +2261,17 @@ bool Lexer::LexRawStringLiteral(Token &Result, const
char *CurPtr,
unsigned PrefixLen = 0;
- while (PrefixLen != 16 && isRawStringDelimBody(CurPtr[PrefixLen]))
+ while (PrefixLen != 16 && isRawStringDelimBody(CurPtr[PrefixLen])) {
++PrefixLen;
zygoloid wrote:
> > I guess the general question is - is it acceptable to have the Scanner
> > operating in a language standard different than the passed in language mode
> > and different than the compiler language standard?
>
> I think that is acceptable. It is kinda hacky, but the lexer and
@@ -77,3 +77,38 @@ namespace use_self {
int fib(int n) { return FibTree{n}.v; }
}
+
+namespace nested_union {
+ union Test1 {
+union {
+ int inner { 42 };
+};
+int outer;
+ };
+ static_assert(Test1{}.inner == 42, "");
+ struct Test2 {
+union {
+
https://github.com/zygoloid approved this pull request.
Looks good to me too.
https://github.com/llvm/llvm-project/pull/91692
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -77,3 +77,38 @@ namespace use_self {
int fib(int n) { return FibTree{n}.v; }
}
+
+namespace nested_union {
+ union Test1 {
+union {
+ int inner { 42 };
+};
+int outer;
+ };
+ static_assert(Test1{}.inner == 42, "");
+ struct Test2 {
+union {
+
https://github.com/zygoloid edited
https://github.com/llvm/llvm-project/pull/91692
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -152,16 +151,17 @@ LLVM_READONLY inline bool isHexDigit(unsigned char c) {
/// Note that '_' is both a punctuation character and an identifier character!
LLVM_READONLY inline bool isPunctuation(unsigned char c) {
using namespace charinfo;
- return (InfoTable[c] & (CHAR_UN
https://github.com/zygoloid approved this pull request.
https://github.com/llvm/llvm-project/pull/90303
___
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.
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://lists.llvm
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
___
cfe
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 me
@@ -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
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
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
https://lists.llvm.org/cgi-bin/mailm
@@ -2433,6 +2429,30 @@ CFGBlock *CFGBuilder::VisitChildren(Stmt *S) {
return B;
}
+CFGBlock *CFGBuilder::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *Arg,
+ AddStmtChoice asc) {
+ if (Arg->hasRewrittenInit()) {
+if (asc.alwaysAdd
@@ -2433,6 +2429,30 @@ CFGBlock *CFGBuilder::VisitChildren(Stmt *S) {
return B;
}
+CFGBlock *CFGBuilder::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *Arg,
+ AddStmtChoice asc) {
+ if (Arg->hasRewrittenInit()) {
+if (asc.alwaysAdd
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 fixi
@@ -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 initializ
@@ -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 &r = 0; };
co
@@ -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
{{&lifetime_extended_object{Composite, viaReference, S{{[0-9]+}}} }}
// clang does not currently implement extending lifetime of object bound to
reference me
@@ -269,6 +269,26 @@ void init_capture_init_list() {
// CHECK: }
}
+void check_dr1815() { // dr1815: yes
+#if __cplusplus >= 201402L
+
+ struct A {
+int &&r = 0;
+~A() {}
+ };
+
+ struct B {
+A &&a = A{};
+~B() {}
+ };
+
+ // CHECK: void @_Z12check_dr181
@@ -8194,25 +8216,18 @@ void Sema::checkInitializerLifetime(const
InitializedEntity &Entity,
}
switch (shouldLifetimeExtendThroughPath(Path)) {
+ case PathLifetimeKind::ShouldExtend:
zygoloid wrote:
Do we need separate `ShouldExtend` and `Ex
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 &PP,
- Module *RootModule) {
+std::optional>
+GetAffectingModuleMaps(const Pre
@@ -161,8 +161,13 @@ static TypeCode getTypeCodeForTypeClass(Type::TypeClass
id) {
namespace {
-std::set GetAffectingModuleMaps(const Preprocessor &PP,
- Module *RootModule) {
+std::optional>
+GetAffectingModuleMaps(const Pre
@@ -161,8 +161,13 @@ static TypeCode getTypeCodeForTypeClass(Type::TypeClass
id) {
namespace {
-std::set GetAffectingModuleMaps(const Preprocessor &PP,
- Module *RootModule) {
+std::optional>
+GetAffectingModuleMaps(const Pre
@@ -1403,94 +1421,146 @@ bool
HeaderSearch::isFileMultipleIncludeGuarded(FileEntryRef File) const {
void HeaderSearch::MarkFileModuleHeader(FileEntryRef FE,
ModuleMap::ModuleHeaderRole Role,
bool i
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 mo
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 &S,
JumpDest LoopExit = getJumpDestInCurrentScope("for.end");
LexicalScope ForScope(*this, S.getSourceRange());
+ const DeclStmt *RangeDS = cast(S.getRangeStmt());
+ const VarDecl *RangeV
@@ -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 appea
@@ -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` dec
@@ -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 s
@@ -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` in
@@ -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:
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
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() == DependentS
@@ -3173,41 +3174,46 @@ class ArrayType : public Type, public
llvm::FoldingSetNode {
return T->getTypeClass() == ConstantArray ||
T->getTypeClass() == VariableArray ||
T->getTypeClass() == IncompleteArray ||
- T->getTypeClass() == DependentS
@@ -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 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
@@ -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
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
https://lists.llvm.org/cgi-bin/mailman/
@@ -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
@@ -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
@@ -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
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 a
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
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", "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
101 - 200 of 1726 matches
Mail list logo