[clang] [codegen] Emit missing cleanups for stmt-expr and coro suspensions [take-2] (PR #85398)

2024-03-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Hopefully @rjmccall or @efriedma-quic can take a look at the codegen bits. I did have some questions about other kinds of flow control statements we might want to cover. https://github.com/llvm/llvm-project/pull/85398

[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-03-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: The changes seem reasonable to me, but there are test failures in `llvm/utils/lit/tests` that could perhaps be related to your changes. I think .natvis files should be CRLF (those are used with Visual Studio for debug visualizers).

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-25 Thread Aaron Ballman via cfe-commits
@@ -49,3 +49,62 @@ if ((MINGW OR CYGWIN) AND BUILD_SHARED_LIBS) # despite potential dllexports. target_link_options(clangInterpreter PRIVATE LINKER:--export-all-symbols) endif() + +if(MSVC) + set_target_properties(clangInterpreter PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS 1)

[clang] 5184e6a - Removing accidental code from 527a624205748814dd9309eda7ee308b40b2359a

2024-03-22 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-03-22T13:01:14-04:00 New Revision: 5184e6ad69b0ca69dfba6fb0982a675c595f49a2 URL: https://github.com/llvm/llvm-project/commit/5184e6ad69b0ca69dfba6fb0982a675c595f49a2 DIFF: https://github.com/llvm/llvm-project/commit/5184e6ad69b0ca69dfba6fb0982a675c595f49a2.diff

[clang] d2f6846 - [C99] Update status of DR290, which we do not yet implement

2024-03-22 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-03-22T12:50:18-04:00 New Revision: d2f684685afeffcffba7e889e7267bce1d905911 URL: https://github.com/llvm/llvm-project/commit/d2f684685afeffcffba7e889e7267bce1d905911 DIFF: https://github.com/llvm/llvm-project/commit/d2f684685afeffcffba7e889e7267bce1d905911.diff

[clang] 527a624 - [C11] Update the status of N1365 on constant expression handling

2024-03-22 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-03-22T12:50:18-04:00 New Revision: 527a624205748814dd9309eda7ee308b40b2359a URL: https://github.com/llvm/llvm-project/commit/527a624205748814dd9309eda7ee308b40b2359a DIFF: https://github.com/llvm/llvm-project/commit/527a624205748814dd9309eda7ee308b40b2359a.diff

[clang] [llvm] [Sema] Implement support for -Wformat-signedness (PR #74440)

2024-03-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/74440 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] d231e3b - [C11] Add test & update status of N1282 and DR087

2024-03-22 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-03-22T10:17:50-04:00 New Revision: d231e3b10ead90e4360f7ceb88e4bca9d42d7d04 URL: https://github.com/llvm/llvm-project/commit/d231e3b10ead90e4360f7ceb88e4bca9d42d7d04 DIFF: https://github.com/llvm/llvm-project/commit/d231e3b10ead90e4360f7ceb88e4bca9d42d7d04.diff

[clang] [llvm] [Sema] Implement support for -Wformat-signedness (PR #74440)

2024-03-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Can you also add a test showing the difference between `-Wformat -Wformat-signedness` and `-Wformat-signedness` by itself (which does nothing)? I'd also like to see a test demonstrating that `#pragma GCC diagnostic ignored -Wformat` disables the

[clang] [llvm] [Sema] Implement support for -Wformat-signedness (PR #74440)

2024-03-22 Thread Aaron Ballman via cfe-commits
@@ -12465,6 +12465,20 @@ isArithmeticArgumentPromotion(Sema , const ImplicitCastExpr *ICE) { S.Context.getFloatingTypeOrder(From, To) < 0; } +static analyze_format_string::ArgType::MatchKind +handleFormatSignedness(analyze_format_string::ArgType::MatchKind Match, +

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2024-03-22 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Oof, that one is a bit messier to resolve -- it's mixing unrelated reference and pointer types and hoping the casts correctly convert back and forth properly. The fix to that should probably be done separately from the sanitizer fix so we get reasonable code review from

[clang] [cfi][CodeGen] Call SetLLVMFunctionAttributes{, ForDefinition} on __cf… (PR #78253)

2024-03-22 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, do you need someone to land this on your behalf? https://github.com/llvm/llvm-project/pull/78253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2024-03-22 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > @AaronBallman @amy-kwan I am working on a patch for this build breaking in > https://lab.llvm.org/buildbot/#/builders/57/builds/33656. Is there anything > else I should also be considering? Thank you for working on the patch! I would change the definition of

[clang] [clang][AST][NFC] Add '[[fallthrough]]' to cases fall through (PR #85921)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > So in this case, I suppose, I’ll leave it to someone more familiar w/ codegen > than me to approve/reject this pr for good. I think in this case we should remove the comment, but maybe @rjmccall or @efriedma-quic feel differently? We could also update the comment to say

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2024-03-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/86131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Thank you all for the review help on this! https://github.com/llvm/llvm-project/pull/86131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST][NFC] Add '[[fallthrough]]' to cases fall through (PR #85921)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > E.g: > > https://github.com/llvm/llvm-project/blob/50801f1095d33e712c3a51fdeef82569bd09007f/clang/lib/Interpreter/IncrementalParser.cpp#L141-L151 I think this is a demonstration of exactly what we *don't* want to see in the code base. That's just purely noise IMO.

[clang] [llvm] [Sema] Implement support for -Wformat-signedness (PR #74440)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I need to extend the tablegen backend ClangDiagnosticsEmitter with some > > kind of new option to handle this, right? > > Alternatively, you could probably use `DiagnosticsEngine::isIgnored` to check > if the `-Wformat-signedness` is enabled or not, and control whether

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I've put up a PR for review at https://github.com/llvm/llvm-project/pull/86131 https://github.com/llvm/llvm-project/pull/77178 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: CC @Abhinkop https://github.com/llvm/llvm-project/pull/86131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Split -Wcast-function-type into a separate group (PR #86131)

2024-03-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/86131 We want to add -Wcast-function-type to -Wextra (as done in 1de7e6c8cba27296f3fc16d107822ea0ee856759), but we do not want to add -Wcast-function-type-strict in at the same time

[clang] [clang][AST][NFC] Add '[[fallthrough]]' to cases fall through (PR #85921)

2024-03-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Is this addressing a diagnostic you're seeing in the wild? This shouldn't be necessary because the `case` statements are adjacent to one another with only comments/whitespace between them: https://godbolt.org/z/oM7x65hq9 (I'd like to understand the

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Yeah, I was hoping to avoid having to introduce another diagnostic group, but I think that's going to be the best way forward. I've got a patch in progress to add `-Wcast-function-type-mismatch` so we end up with: ``` -Wcast-function-type |- -Wcast-function-type-mismatch |-

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I'm confused as to how this code ever compiled in the first place... In > > each case, this is C++ code that's failing: > > ``` > >

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-21 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I'm confused as to how this code ever compiled in the first place... In each case, this is C++ code that's failing: ```

[clang] 7955bde - [C11] Add test coverage for N1310 and claim conformance

2024-03-20 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-03-20T15:08:43-04:00 New Revision: 7955bde64ef9aebbcaf6b6308a25fac31041ea9a URL: https://github.com/llvm/llvm-project/commit/7955bde64ef9aebbcaf6b6308a25fac31041ea9a DIFF: https://github.com/llvm/llvm-project/commit/7955bde64ef9aebbcaf6b6308a25fac31041ea9a.diff

[clang] [Clang] Update missing varargs arg extension warnings (PR #84520)

2024-03-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from a comment request https://github.com/llvm/llvm-project/pull/84520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Update missing varargs arg extension warnings (PR #84520)

2024-03-20 Thread Aaron Ballman via cfe-commits
@@ -993,11 +993,18 @@ MacroArgs *Preprocessor::ReadMacroCallArgumentList(Token , // If the macro contains the comma pasting extension, the diagnostic // is suppressed; we know we'll get another diagnostic later. if (!MI->hasCommaPasting()) { -//

[clang] [Clang] Update missing varargs arg extension warnings (PR #84520)

2024-03-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/84520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. I think the changes here make sense (keeping in mind what @efriedma-quic says about long-term goals vs 18.x practicality). Eli, @serge-sans-paille, are you okay with the changes as well? (Please don't land on my approval without

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-20 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > Did you explicitly list ??3@YAXPEAX_K@Z as it was not part of that code? > > It is part of that code: > https://github.com/llvm/llvm-project/pull/84769/files#diff-d7f5dca2bd540f1b18ba90a66497b6b12e40fd07058b70f0fdec638c8e97406eR35 @vgvassilev and I chatted off-list

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-20 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Did you explicitly list ??3@YAXPEAX_K@Z as it was not part of that code? It is part of that code: https://github.com/llvm/llvm-project/pull/84769/files#diff-d7f5dca2bd540f1b18ba90a66497b6b12e40fd07058b70f0fdec638c8e97406eR35

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/77178 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/77178 >From d147292312ea05eb6b4a28940faffe54093c900e Mon Sep 17 00:00:00 2001 From: Abhin Parekadan Jose Date: Sat, 6 Jan 2024 05:09:36 +0100 Subject: [PATCH 1/9] [clang] move -Wcast-function-type under -Wextra

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-20 Thread Aaron Ballman via cfe-commits
@@ -164,6 +164,8 @@ Deprecated Compiler Flags Modified Compiler Flags --- +* ``-Wextra`` group flag now contains an additional flag i.e, ``-Wcast-function-type``. AaronBallman wrote: ```suggestion - Added ``-Wcast-function-type`` as a

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! I'll fix up the nit and land on your behalf; thank you for the improvement! https://github.com/llvm/llvm-project/pull/77178 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/77178 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-03-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/77178 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-20 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: That didn't seem to help (I applied only the CMake changes from the linked PR however). Here's the output I get when calling `dump()` on the `ExecutionSession` which is failing: ``` JIT session error: Symbols not found: [ ??3@YAXPEAX_K@Z ] JITDylib "" (ES:

[clang] [clang] Add `__has_extension(swiftcc)` support (PR #85347)

2024-03-20 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Do you need someone to commit this on your behalf? https://github.com/llvm/llvm-project/pull/85347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-19 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > ; Function Attrs: nobuiltin allocsize(0) > > declare dso_local noundef nonnull ptr @"??2@YAPEAX_K@Z"(i64 noundef %0) #6 > > That's probably the problem. We do not "see" the definition of the operator > delete. Is that "exported" on msvc? That one demangles to `void *

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-19 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > > > > > > There is a Windows failure that I can't reproduce: > > > > > > > > https://buildkite.com/llvm-project/github-pull-requests/builds/46331 > > > > > > > > Can someone help me to figure out what is wrong? > > > > > > > > > > > > > > > > > > > > > I'm not

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-19 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > > > > There is a Windows failure that I can't reproduce: > > > > > > https://buildkite.com/llvm-project/github-pull-requests/builds/46331 > > > > > > Can someone help me to figure out what is wrong? > > > > > > > > > > > > > > > I'm not certain what's going on yet,

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-19 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > > > There is a Windows failure that I can't reproduce: > > > > > https://buildkite.com/llvm-project/github-pull-requests/builds/46331 > > > > > Can someone help me to figure out what is wrong? > > > > > > > > > > > > I'm not certain what's going on yet, but it

[clang] 9ed1aa3 - Fixing up an edit missed in #84014; NFC

2024-03-19 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-03-19T12:48:54-04:00 New Revision: 9ed1aa36be654f6687c4f9000c973b722217881c URL: https://github.com/llvm/llvm-project/commit/9ed1aa36be654f6687c4f9000c973b722217881c DIFF: https://github.com/llvm/llvm-project/commit/9ed1aa36be654f6687c4f9000c973b722217881c.diff

[clang] [clang] Add `intrin0.h` header to mimic `intrin0.h` used by MSVC STL for clang-cl (PR #75711)

2024-03-19 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > @AaronBallman Can you merge this please? We are eagerly waiting for this to > end up in a release! ;-) Thank you for the ping, this fell off my radar! https://github.com/llvm/llvm-project/pull/75711 ___ cfe-commits mailing list

[clang] [clang] Add `intrin0.h` header to mimic `intrin0.h` used by MSVC STL for clang-cl (PR #75711)

2024-03-19 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/75711 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -855,7 +865,14 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { Out << Proto << " -> "; Proto.clear(); } - AFT->getReturnType().print(Out, Policy, Proto); + if (!Policy.SuppressTagKeyword && Policy.SuppressScope && +

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -1022,7 +1039,13 @@ void DeclPrinter::VisitVarDecl(VarDecl *D) { ? D->getIdentifier()->deuglifiedName() : D->getName(); - printDeclType(T, Name); + if (!Policy.SuppressTagKeyword && Policy.SuppressScope && + !Policy.SuppressUnwrittenScope)

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I spotted some simplifications that can be applied. If precommit CI comes back green, then I think this is basically ready to go. https://github.com/llvm/llvm-project/pull/84014 ___ cfe-commits mailing list

[clang] [clang][C23] N3006 Underspecified object declarations (PR #79845)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -7639,6 +7639,8 @@ def err_attribute_arm_mve_polymorphism : Error< "'__clang_arm_mve_strict_polymorphism' attribute can only be applied to an MVE/NEON vector type">; def err_attribute_webassembly_funcref : Error< "'__funcref' attribute can only be applied to a function

[clang] [clang][C23] N3006 Underspecified object declarations (PR #79845)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -std=c2x -verify %s + +/* WG14 N3006: Full + * Underspecified object declarations + */ + +struct S1 { int x, y; };// expected-note {{previous definition is here}} +union U1 { int a; double b; }; // expected-note {{previous definition

[clang] [clang][C23] N3006 Underspecified object declarations (PR #79845)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -7813,6 +7813,32 @@ Sema::BuildCompoundLiteralExpr(SourceLocation LParenLoc, TypeSourceInfo *TInfo, diag::err_variable_object_no_init)) return ExprError(); } + } else if (LangOpts.C23 && AaronBallman

[clang] [clang][C23] N3006 Underspecified object declarations (PR #79845)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for working on this! I think there's something here worth considering: how an implementation handles use of underspecified declarations is left implementation-defined. I think we want to diagnose many of the situations it covers, but I

[clang] [clang][C23] N3006 Underspecified object declarations (PR #79845)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/79845 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add `__has_extension(swiftcc)` support (PR #85347)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I'm happy enough with the changes so long as Swift folks are okay with the change in behavior for existing code. CC @compnerd @rjmccall for opinions (I'll leave the approval to one of them). https://github.com/llvm/llvm-project/pull/85347

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -679,6 +679,19 @@ static void printExplicitSpecifier(ExplicitSpecifier ES, llvm::raw_ostream , Out << Proto; } +static void AddPrefix(PrintingPolicy , QualType T, + llvm::raw_ostream ) { + if (!Policy.SuppressTagKeyword && Policy.SuppressScope && +

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -855,7 +868,17 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { Out << Proto << " -> "; Proto.clear(); } - AFT->getReturnType().print(Out, Policy, Proto); + if (!Policy.SuppressTagKeyword && Policy.SuppressScope && +

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -679,6 +679,19 @@ static void printExplicitSpecifier(ExplicitSpecifier ES, llvm::raw_ostream , Out << Proto; } +static void AddPrefix(PrintingPolicy , QualType T, AaronBallman wrote: This is a pretty non-descriptive function name; the caller will have

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -1635,6 +1635,17 @@ void TypePrinter::printElaboratedBefore(const ElaboratedType *T, if (T->getKeyword() != ElaboratedTypeKeyword::None) OS << " "; NestedNameSpecifier *Qualifier = T->getQualifier(); +if (!Policy.SuppressTagKeyword && Policy.SuppressScope

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -855,7 +868,17 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { Out << Proto << " -> "; Proto.clear(); } - AFT->getReturnType().print(Out, Policy, Proto); + if (!Policy.SuppressTagKeyword && Policy.SuppressScope && +

[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -1022,7 +1045,17 @@ void DeclPrinter::VisitVarDecl(VarDecl *D) { ? D->getIdentifier()->deuglifiedName() : D->getName(); - printDeclType(T, Name); + if (!Policy.SuppressTagKeyword && Policy.SuppressScope && + !Policy.SuppressUnwrittenScope)

[clang] add some missing Kinds to libclang python bindings (PR #85571)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/85571 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] add some missing Kinds to libclang python bindings (PR #85571)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/85571 >From e61c6511b274c2503c02a8eb6c2c1d8bf902c106 Mon Sep 17 00:00:00 2001 From: ykiko <486685...@qq.com> Date: Mon, 18 Mar 2024 00:01:47 +0800 Subject: [PATCH 1/4] add some missing CursorKinds in libclang

[clang] add some missing Kinds to libclang python bindings (PR #85571)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Nit, I'll fix when landing. https://github.com/llvm/llvm-project/pull/85571 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] add some missing Kinds to libclang python bindings (PR #85571)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -544,6 +544,8 @@ Python Binding Changes -- - Exposed `CXRewriter` API as `class Rewriter`. +- Add some missing kinds from Index.h (CursorKind: 149-156, 272-320, 420-437. + TemplateArgumentKind: 5-9. TypeKind: 161-175 and 178).

[clang] add some missing Kinds to libclang python bindings (PR #85571)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/85571 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] add some missing Kinds to libclang python bindings (PR #85571)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/85571 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] add some missing Kinds to libclang python bindings (PR #85571)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Code changes LGTM (we don't require test coverage for bindings, so that's fine), but can you add a release note to `clang/docs/ReleaseNotes.rst` under `Python Binding Changes` so others know about the improvement?

[clang] [Clang] Ignore assumptions with side effects at compile time (PR #85534)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: LGTM as well. https://github.com/llvm/llvm-project/pull/85534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Ignore assumptions with side effects at compile time (PR #85534)

2024-03-18 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I think this is also https://eel.is/c++draft/expr.const#6.4, the note is a bit more clear than the standard wording. https://github.com/llvm/llvm-project/pull/85534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][ExprConst] Can't be past an invalid LValue designator (PR #84293)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/84293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-18 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > There is a Windows failure that I can't reproduce: > https://buildkite.com/llvm-project/github-pull-requests/builds/46331 Can > someone help me to figure out what is wrong? I'm not certain what's going on yet, but it smells a bit like the interpreter needs to know about

[clang] [Sema] Allow -Wno-main to suppress the arg wrong error (PR #85494)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -250,6 +250,9 @@ Improvements to Clang's diagnostics such as attempting to call ``free`` on an unallocated object. Fixes `#79443 `_. +- The ``XXX parameter of 'main' must be of type`` error can now be disabled via

[clang] [Sema] Allow -Wno-main to suppress the arg wrong error (PR #85494)

2024-03-18 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > There is a use case to pass customized arguments to main without using > -ffreestanding. This is not motivating for C++ because that's not actually valid to do (https://eel.is/c++draft/basic.start.main#3.sentence-1), and it's only barely motivating for C (you can call

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/81976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/81976 >From 07c73f087a430f5115ecdfec23730c5afcab37f3 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 16 Feb 2024 14:26:36 +0530 Subject: [PATCH 1/4] fix unnecessary warning when using bitand with boolean

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -250,6 +250,11 @@ Improvements to Clang's diagnostics such as attempting to call ``free`` on an unallocated object. Fixes `#79443 `_. +- Clang now does not warn in cases where bitand operator is + intentionally used

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM with a small tweak to the release notes. https://github.com/llvm/llvm-project/pull/81976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-18 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/81976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-18 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > currently the macro definition for both `&` and `bitand` is not giving any > warning however should the `&` one warn? or current working is correct > behaviour as expected? The current behavior is what I'd expect. The idea being: if the user is using `&` directly, it's

[clang] [clang] Add /Zc:__STDC__ flag to clang-cl (PR #68690)

2024-03-18 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,11 @@ +// Note: %s must be preceded by --, otherwise it may be interpreted as a +// command-line option, e.g. on Mac where %s is commonly under /Users. +// +// Note: see also cl-zc.cpp + +// RUN: %clang_cl /TC /dev/null /E -Xclang -dM /Zc:__STDC__- 2>&1 | FileCheck %s

[clang] [clang][Interp] Integral pointers (PR #84159)

2024-03-15 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: @@ -53,6 +57,10 @@ class FunctionPointer final { return toAPValue().getAsString(Ctx, Func->getDecl()->getType()); } + uint32_t getIntegerRepresentation() const { +return

[clang] [clang][Interp] Integral pointers (PR #84159)

2024-03-15 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -28,11 +28,26 @@ class Block; class DeadBlock; class Pointer; class Context; +template class Integral; enum PrimType : unsigned; class Pointer; inline llvm::raw_ostream <<(llvm::raw_ostream ,

[clang] [clang][Interp] Integral pointers (PR #84159)

2024-03-15 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -28,11 +28,26 @@ class Block; class DeadBlock; class Pointer; class Context; +template class Integral; enum PrimType : unsigned; class Pointer; inline llvm::raw_ostream <<(llvm::raw_ostream ,

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2024-03-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. You should add a release note letting users know about the new extension in clang/docs/ReleaseNotes.rst, but otherwise, this LGTM! https://github.com/llvm/llvm-project/pull/73376 ___

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-15 Thread Aaron Ballman via cfe-commits
@@ -45,8 +45,8 @@ void test(boolean a, boolean b, int *p, volatile int *q, int i) { b = bar() & (i > 4); b = (i == 7) & foo(); #ifdef __cplusplus - b = foo() bitand bar(); // expected-warning {{use of bitwise '&' with boolean operands}} - //

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/81976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-15 Thread Aaron Ballman via cfe-commits
@@ -16191,12 +16191,24 @@ static void AnalyzeImplicitConversions( BO->getRHS()->isKnownToHaveBooleanValue() && BO->getLHS()->HasSideEffects(S.Context) && BO->getRHS()->HasSideEffects(S.Context)) { - S.Diag(BO->getBeginLoc(),

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-15 Thread Aaron Ballman via cfe-commits
@@ -16191,12 +16191,24 @@ static void AnalyzeImplicitConversions( BO->getRHS()->isKnownToHaveBooleanValue() && BO->getLHS()->HasSideEffects(S.Context) && BO->getRHS()->HasSideEffects(S.Context)) { - S.Diag(BO->getBeginLoc(),

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for the improvement! Please be sure to add a release note about the changes as well. https://github.com/llvm/llvm-project/pull/81976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Add `__has_feature(swiftcc)` support (PR #85347)

2024-03-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: You should also add documentation for this to https://github.com/llvm/llvm-project/blob/main/clang/docs/LanguageExtensions.rst and a release note for the change in https://github.com/llvm/llvm-project/blob/main/clang/docs/ReleaseNotes.rst.

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-13 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Separating out some bits of discussion here. Standardization of flexible arrays in unions --- We can dispense with this topic quickly: the standard doesn't allow this, if the standard should be relaxed then someone needs to write a

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread Aaron Ballman via cfe-commits
@@ -9037,45 +9055,46 @@ class PointerExprEvaluator return Error(E); } bool VisitCXXThisExpr(const CXXThisExpr *E) { -// Can't look at 'this' when checking a potential constant expression. -if (Info.checkingPotentialConstantExpression()) - return false; -

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread Aaron Ballman via cfe-commits
@@ -8485,6 +8485,53 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool HandleLambdaCapture(EvalInfo , const Expr *E, LValue , +const CXXMethodDecl *MD, const

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/81102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread Aaron Ballman via cfe-commits
@@ -8485,6 +8485,53 @@ class LValueExprEvaluator }; } // end anonymous namespace +/// Get an lvalue to a field of a lambda's closure type. +static bool HandleLambdaCapture(EvalInfo , const Expr *E, LValue , +const CXXMethodDecl *MD, const

[clang] [Clang][Sema] Properly get captured 'this' pointer in lambdas with an explicit object parameter in constant evaluator (PR #81102)

2024-03-13 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from some coding style guideline nits https://github.com/llvm/llvm-project/pull/81102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] [Sema] Fix bug in `_Complex float`+`int` arithmetic (PR #83063)

2024-03-13 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, thank you for the fix! https://github.com/llvm/llvm-project/pull/83063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

<    4   5   6   7   8   9   10   11   12   13   >