[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2025-01-28 Thread Timm Baeder via cfe-commits
tbaederr wrote: Sounds like an LGTM from Nikita, does anyone else have other reservations? (Other than the missing release note) https://github.com/llvm/llvm-project/pull/105789 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2025-01-24 Thread Nikita Popov via cfe-commits
nikic wrote: > That's an interesting situation! I'm not sure what I'd expect the LLVM IR to > be there. For Clang AST, we want to keep around the expression AST nodes. But > for LLVM IR, perhaps it makes sense to drop anything without a value rather > than mark it as undef? No strong opinion,

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2025-01-17 Thread via cfe-commits
github-actions[bot] wrote: :warning: undef deprecator found issues in your code. :warning: You can test this locally with the following command: ``bash git diff -U0 --pickaxe-regex -S '([^a-zA-Z0-9#_-]undef[^a-zA-Z0-9_-]|UndefValue::get)' f66a5e220cbc2650a5843db854d0734d2aaa030f

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2025-01-17 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > For > > ```c++ > void f() { > [[clang::annotate("B", (void)1, (void)2, 7)]] int j = 0; > } > ``` > > The IR is: > > ```llvm > @.str = private unnamed_addr constant [2 x i8] c"B\00", section > "llvm.metadata" > @.str.1 = private unnamed_addr constant [10 x i8] c"array.c

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2025-01-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/105789 >From 62c8614cd64e0b97b62eb5700ff39dd290bbeebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 23 Aug 2024 08:54:12 +0200 Subject: [PATCH] [clang] Remove an incorrect assertion in Consta

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2025-01-17 Thread Timm Baeder via cfe-commits
tbaederr wrote: For ```c++ void f() { [[clang::annotate("B", (void)1, (void)2, 7)]] int j = 0; } ``` The IR is: ```llvm @.str = private unnamed_addr constant [2 x i8] c"B\00", section "llvm.metadata" @.str.1 = private unnamed_addr constant [10 x i8] c"array.cpp\00", section "llvm.metadata" @.

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2024-09-16 Thread Erich Keane via cfe-commits
erichkeane wrote: > > CC @AaronBallman for an opinion about the AST represenation > > This is a bit awkward in that it's only used for the `annotate` attributes' > argument lists, which should pass all of their arguments down to LLVM IR. > However, we don't typically generate LLVM IR for disca

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2024-09-16 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > CC @AaronBallman for an opinion about the AST represenation This is a bit awkward in that it's only used for the `annotate` attributes' argument lists, which should pass all of their arguments down to LLVM IR. However, we don't typically generate LLVM IR for discarded val

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2024-09-07 Thread Timm Baeder via cfe-commits
tbaederr wrote: CC @AaronBallman for an opinion about the AST represenation https://github.com/llvm/llvm-project/pull/105789 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2024-08-26 Thread via cfe-commits
Sirraide wrote: > Hm, what comment are you referring to exactly? Ah, this one: https://github.com/llvm/llvm-project/blob/d88876e74f7882643546becc544a771a5e5e9787/clang/include/clang/Sema/Sema.h#L1838-L1842 The main thing I’m (if only a bit) worried about is that some code somewhere might be ex

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2024-08-23 Thread Timm Baeder via cfe-commits
tbaederr wrote: > > I guess it might make sense to create the `ConstantExpr` in any case, even > > for a `None` `APValue`? > > The comment above `ConstantFoldAttrArgs` seems to suggest that that’s what’s > supposed to happen if the expression isn’t dependent—I don’t know if there’s > any code

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2024-08-23 Thread via cfe-commits
Sirraide wrote: > I guess it might make sense to create the `ConstantExpr` in any case, even > for a `None` `APValue`? The comment above `ConstantFoldAttrArgs` seems to suggest that that’s what’s supposed to happen if the expression isn’t dependent—I don’t know if there’s any code that depend

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2024-08-23 Thread Timm Baeder via cfe-commits
tbaederr wrote: I guess it might make sense to create the `ConstantExpr` in any case, even for a `None` `APValue`? Dumping the `ConstantExpr` didn't print any `APValue` though, so I was assuming that it ignores `None` anyway. https://github.com/llvm/llvm-project/pull/105789 ___

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2024-08-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes Evaluating the attribute expression can be successful without resulting in a value. Namely, when the expression is of type void. --- Full diff: https://github.com/llvm/llvm-project/pull/105789.diff 2 Fil

[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

2024-08-22 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/105789 Evaluating the attribute expression can be successful without resulting in a value. Namely, when the expression is of type void. >From 920eb8d753070b72b8ba0b2766333d7db9bed0a9 Mon Sep 17 00:00:00 2001 From: