[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-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 c

[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
@@ -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
@@ -855,7 +865,14 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) { Out << Proto << " -> "; Proto.clear(); } - AFT->getReturnType().print(Out, Policy, Proto); + if (!Policy.SuppressTagKeyword && Policy.SuppressScope && + !Policy.

[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] 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] 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-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 smells

[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, b

[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 certai

[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] 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-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: 0x02ae9a53836

[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] 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 https

[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 war

[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
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-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 https://github.com/llvm/llvm-project/pull/8377

[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 abou

[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 waiti

[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] 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 &MacroName, // 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 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 https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[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] 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: ``` /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_posix_lib

[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: > > ``` > > /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/compiler-rt/lib/sanitizer_common/san

[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][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 mo

[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 (https://lab.llvm.org/buildbo

[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] [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 https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[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][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. https:

[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] 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] [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-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 `MallocStres

[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 https://lists.llvm.org/cgi-bin/ma

[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 LLV

[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 &S, const ImplicitCastExpr *ICE) { S.Context.getFloatingTypeOrder(From, To) < 0; } +static analyze_format_string::ArgType::MatchKind +handleFormatSignedness(analyze_format_string::ArgType::MatchKind Match, +

[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 signe

[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 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] 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] 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] 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] [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] [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). https://github.com

[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] [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 edited https://github.com/llvm/llvm-project/pull/85398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-03-25 Thread Aaron Ballman via cfe-commits
@@ -2503,6 +2505,26 @@ Stmt *BlockExpr::getBody() { // Generic Expression Routines //===--===// +bool Expr::mayBranchOut() const { + struct BranchDetector : public RecursiveASTVisitor { +bool HasBranch =

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

2024-03-25 Thread Aaron Ballman via cfe-commits
@@ -2503,6 +2505,26 @@ Stmt *BlockExpr::getBody() { // Generic Expression Routines //===--===// +bool Expr::mayBranchOut() const { + struct BranchDetector : public RecursiveASTVisitor { +bool HasBranch =

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

2024-03-25 Thread Aaron Ballman via cfe-commits
@@ -2503,6 +2505,26 @@ Stmt *BlockExpr::getBody() { // Generic Expression Routines //===--===// +bool Expr::mayBranchOut() const { + struct BranchDetector : public RecursiveASTVisitor { +bool HasBranch =

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

2024-03-25 Thread Aaron Ballman via cfe-commits
@@ -2503,6 +2505,26 @@ Stmt *BlockExpr::getBody() { // Generic Expression Routines //===--===// +bool Expr::mayBranchOut() const { + struct BranchDetector : public RecursiveASTVisitor { +bool HasBranch =

[clang] [clang][Interp] Merge ByteCodeExprGen and ByteCodeStmtGen (PR #83683)

2024-03-25 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/AaronBallman commented: Splitting the code across a few implementation files might be a reasonable approach, but in general, I'm fine with how this is proceeding. I reviewed t

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

2024-03-25 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/84159 ___ cfe-commits

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

2024-03-25 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: https://github.com/AaronBallman approved this pull request. Basically LGTM, just a few minor things. https://github.com/

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

2024-03-25 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: @@ -1912,6 +1929,10 @@ inline bool NoRet(InterpState &S, CodePtr OpPC) { inline bool NarrowPtr(InterpS

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

2024-03-25 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -199,6 +207,41 @@ bool ByteCodeExprGen::VisitCastExpr(const CastExpr *CE) { return true; } + case CK_IntegralToPoin

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

2024-03-25 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -2218,6 +2238,14 @@ inline bool GetFnPtr(InterpState &S, CodePtr OpPC, const Function *Func) { return true; } +template

[clang] [clang] Fix assertion failure when printing atomic apvalues (PR #85259)

2024-03-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: LGTM but this should be testable because `getAsString()` uses `printPretty()`: https://github.com/llvm/llvm-project/blob/e6f63a942a45e3545332cd9a43982a69a4d5667b/clang/lib/AST/Interp/FunctionPointer.h#L53, https://github.com/llvm/llvm-project/blob/e6f

[clang] Match against all plugins when parsing microsoft attributes (PR #86426)

2024-03-25 Thread Aaron Ballman via cfe-commits
@@ -5061,11 +5061,15 @@ void Parser::ParseMicrosoftAttributes(ParsedAttributes &Attrs) { IdentifierInfo *II = Tok.getIdentifierInfo(); SourceLocation NameLoc = Tok.getLocation(); ConsumeToken(); -ParsedAttr::Kind AttrKind = -ParsedAt

[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: I didn't look too hard at the codegen bits, but the Expr bits look good to me. Perhaps we want this test to live in CodeGen rather than CodeGenCoroutines given that it covers so many non-coroutine test cases as well? https://github.com/llvm/llvm-proje

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

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

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

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

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

2024-03-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for the fix! I have another suggested test case, and please be sure to add a release note to clang/docs/ReleaseNotes.rst so users know about the fix. Also, I think AttrDocs.td should be updated to document the fact that `always_destroy` will

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

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

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

2024-03-25 Thread Aaron Ballman via cfe-commits
@@ -51,6 +51,11 @@ struct A { ~A(); }; } namespace test5 { +struct A { ~A(); }; +[[clang::always_destroy]] A a; // no warning +} + AaronBallman wrote: ```suggestion struct A { ~A(); }; [[clang::always_destroy]] A a; // no warning void func() { [[clang::alw

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-25 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,74 @@ +//===- SemaOpenACC.h - Semantic Analysis for OpenACC constructs ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

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

2024-03-25 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > Can you also add a test showing the difference between `-Wformat > > -Wformat-signedness` and `-Wformat-signedness` by itself (which does > > nothing)? > > With the current implementation `-Wformat-signedness` by itself actually turn > on the signedness warnings. This

[clang] [clang] Emit bad shift warnings (PR #70307)

2024-03-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman requested changes to this pull request. https://github.com/llvm/llvm-project/pull/70307 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Emit bad shift warnings (PR #70307)

2024-03-25 Thread Aaron Ballman via cfe-commits
@@ -19959,7 +19961,10 @@ bool Sema::DiagRuntimeBehavior(SourceLocation Loc, ArrayRef Stmts, case ExpressionEvaluationContext::ConstantEvaluated: case ExpressionEvaluationContext::ImmediateFunctionContext: // Relevant diagnostics should be produced by constant evaluatio

[clang] [clang] Emit bad shift warnings (PR #70307)

2024-03-25 Thread Aaron Ballman via cfe-commits
@@ -11523,9 +11525,9 @@ static void DiagnoseBadShiftValues(Sema& S, ExprResult &LHS, ExprResult &RHS, } S.Diag(Loc, diag::warn_shift_result_gt_typewidth) -<< HexResult.str() << Result.getMinSignedBits() << LHSType -<< Left.getBitWidth() << LHS.get()->getSourceRang

[clang] [clang] Emit bad shift warnings (PR #70307)

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

[clang] [clang] Emit bad shift warnings (PR #70307)

2024-03-25 Thread Aaron Ballman via cfe-commits
@@ -2805,7 +2805,7 @@ static bool handleIntIntBinOp(EvalInfo &Info, const Expr *E, const APSInt &LHS, unsigned SA = (unsigned) RHS.getLimitedValue(LHS.getBitWidth()-1); if (SA != RHS) { Info.CCEDiag(E, diag::note_constexpr_large_shift) -<< RHS << E->getTy

[clang] [clang] Emit bad shift warnings (PR #70307)

2024-03-25 Thread Aaron Ballman via cfe-commits
@@ -11428,7 +11428,7 @@ static bool isScopedEnumerationType(QualType T) { return false; } -static void DiagnoseBadShiftValues(Sema& S, ExprResult &LHS, ExprResult &RHS, +static void DiagnoseBadShiftValues(Sema &S, ExprResult &LHS, ExprResult &RHS, AaronBallm

[clang] 6fd3677 - Fixing a think-o with swapped information

2024-03-25 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-03-25T12:01:48-04:00 New Revision: 6fd3677fb4f4e806f2efa43bfa814aaf063c506c URL: https://github.com/llvm/llvm-project/commit/6fd3677fb4f4e806f2efa43bfa814aaf063c506c DIFF: https://github.com/llvm/llvm-project/commit/6fd3677fb4f4e806f2efa43bfa814aaf063c506c.diff

[clang] 7ee1007 - [C99] Claim full support for WG14 N772

2024-03-25 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-03-25T12:19:40-04:00 New Revision: 7ee1007eddcfc4efe582512b78704038f17fa5a3 URL: https://github.com/llvm/llvm-project/commit/7ee1007eddcfc4efe582512b78704038f17fa5a3 DIFF: https://github.com/llvm/llvm-project/commit/7ee1007eddcfc4efe582512b78704038f17fa5a3.diff

[clang] d99cfa0 - [C99] Claim conformance to WG14 N631 and WG14 N696

2024-03-25 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-03-25T12:55:43-04:00 New Revision: d99cfa053998483e7283e91ff204fbe117345685 URL: https://github.com/llvm/llvm-project/commit/d99cfa053998483e7283e91ff204fbe117345685 DIFF: https://github.com/llvm/llvm-project/commit/d99cfa053998483e7283e91ff204fbe117345685.diff

[clang] bd4086f - [C99] Claim conformance to "additional predefined macro names"

2024-03-25 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-03-25T13:47:46-04:00 New Revision: bd4086f0464cc6e3e85b57ae58bc6892e777297f URL: https://github.com/llvm/llvm-project/commit/bd4086f0464cc6e3e85b57ae58bc6892e777297f DIFF: https://github.com/llvm/llvm-project/commit/bd4086f0464cc6e3e85b57ae58bc6892e777297f.diff

[clang] 32466e5 - Add a triple to this test

2024-03-25 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-03-25T13:50:10-04:00 New Revision: 32466e55b19586880199347744fc1b76d6b04cfb URL: https://github.com/llvm/llvm-project/commit/32466e55b19586880199347744fc1b76d6b04cfb DIFF: https://github.com/llvm/llvm-project/commit/32466e55b19586880199347744fc1b76d6b04cfb.diff

[clang] edfa97a - [C99] Claim conformance to "new block scopes for selection and iteration statements"

2024-03-25 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-03-25T14:20:45-04:00 New Revision: edfa97a8fbd5d8a763c30b083771c679d6a51a31 URL: https://github.com/llvm/llvm-project/commit/edfa97a8fbd5d8a763c30b083771c679d6a51a31 DIFF: https://github.com/llvm/llvm-project/commit/edfa97a8fbd5d8a763c30b083771c679d6a51a31.diff

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

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

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-03-26 Thread Aaron Ballman via cfe-commits
@@ -1804,7 +1806,7 @@ void is_layout_compatible(int n) static_assert(!__is_layout_compatible(EnumForward, int)); static_assert(!__is_layout_compatible(EnumClassForward, int)); // FIXME: the following should be rejected (array of unknown bound and void are the only allowe

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-03-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman requested changes to this pull request. My primary question is: then what is it? We return true for `__is_aggregrate` (https://godbolt.org/z/67zjeo7Mj), and an aggregate is an array or class type (https://eel.is/c++draft/dcl.init.aggr#1). This isn't a class type

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

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

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

2024-03-26 Thread Aaron Ballman via cfe-commits
@@ -6069,6 +6069,9 @@ def AlwaysDestroyDocs : Documentation { The ``always_destroy`` attribute specifies that a variable with static or thread storage duration should have its exit-time destructor run. This attribute is the default unless clang was invoked with -fno-c++-stati

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

2024-03-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from a few minor nits, thank you for the improvement! I'm assuming you need me to land this on your behalf, so I'll go ahead and apply the fixes myself and then land the changes. https://github.com/llvm/llvm-project/pull/86

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

2024-03-26 Thread Aaron Ballman via cfe-commits
@@ -289,6 +289,10 @@ Improvements to Clang's diagnostics - Clang now correctly diagnoses no arguments to a variadic macro parameter as a C23/C++20 extension. Fixes #GH84495. +- Clang no longer emits the ``exit-time destructor`` warning on static variables explicitly --

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

2024-03-26 Thread Aaron Ballman via cfe-commits
@@ -289,6 +289,10 @@ Improvements to Clang's diagnostics - Clang now correctly diagnoses no arguments to a variadic macro parameter as a C23/C++20 extension. Fixes #GH84495. +- Clang no longer emits a ``-Wexit-time destructor`` warning on static variables explicitly --

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

2024-03-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Suggesting a typo fix to my previous suggested edits https://github.com/llvm/llvm-project/pull/86486 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

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

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

2024-03-26 Thread Aaron Ballman via cfe-commits
@@ -6069,6 +6069,9 @@ def AlwaysDestroyDocs : Documentation { The ``always_destroy`` attribute specifies that a variable with static or thread storage duration should have its exit-time destructor run. This attribute is the default unless clang was invoked with -fno-c++-stati

[clang] [[clang::always_destroy]] attribute silences warn-exit-time-destructor (PR #86486)

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

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-03-26 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > According to the spec it's ill-formed, so I'm not sure it falls under any > sensible category. It's an extension we support so it's up to us to decide what sensible is. > For T[0] this returns false. Understood, but why is this not the bug to be fixed? (It would also fix

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

2024-03-26 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,223 @@ +// RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -std=c11 -fsyntax-only -verify -Wformat -Wformat-signedness %s +// RUN: %clang_cc1 -triple=x86_64-pc-win32 -std=c11 -fsyntax-only -verify -Wformat -Wformat-signedness %s + +// Verify that -Wformat-signedness alone

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

2024-03-26 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,223 @@ +// RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -std=c11 -fsyntax-only -verify -Wformat -Wformat-signedness %s +// RUN: %clang_cc1 -triple=x86_64-pc-win32 -std=c11 -fsyntax-only -verify -Wformat -Wformat-signedness %s + +// Verify that -Wformat-signedness alone

<    7   8   9   10   11   12   13   14   15   16   >