https://github.com/vvuksanovic created
https://github.com/llvm/llvm-project/pull/142147
Fixes macros being replaced instead of their expansion.
Closes #52632
>From 82f35e120d075eb0f55d02ff2a4d750e6e352475 Mon Sep 17 00:00:00 2001
From: Vladimir Vuksanovic
Date: Fri, 30 May 2025 05:41:09 -0700
https://github.com/vvuksanovic created
https://github.com/llvm/llvm-project/pull/142150
Initializer lists with designators, missing elements or omitted braces can now
be rewritten. Any missing designators are added and they get sorted according
to the new order.
```
struct Foo {
int a;
in
https://github.com/vvuksanovic created
https://github.com/llvm/llvm-project/pull/142149
Add checks to prevent rewriting when doing so might result in incorrect code.
The following cases are checked:
- There are multiple field declarations in one statement like `int a, b`
- Multiple fields are c
vvuksanovic wrote:
@alexander-shaposhnikov
https://github.com/llvm/llvm-project/pull/142147
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
vvuksanovic wrote:
@alexander-shaposhnikov
https://github.com/llvm/llvm-project/pull/142149
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vvuksanovic updated
https://github.com/llvm/llvm-project/pull/142149
>From b8481a36b33e71248170c8cc195b45fa9de4f777 Mon Sep 17 00:00:00 2001
From: Vladimir Vuksanovic
Date: Fri, 30 May 2025 05:42:55 -0700
Subject: [PATCH] [clang-reorder-fields] Prevent rewriting unsupported c
vvuksanovic wrote:
@legrosbuffle
https://github.com/llvm/llvm-project/pull/142150
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -50,6 +50,55 @@ static const RecordDecl *findDefinition(StringRef RecordName,
return selectFirst("recordDecl", Results);
}
+static bool isSafeToRewrite(const RecordDecl *Decl, const ASTContext &Context)
{
+ // Don't attempt to rewrite if there is a declaration like 'int
@@ -0,0 +1,16 @@
+// RUN: clang-reorder-fields -record-name ::bar::Foo -fields-order z,y,x %s --
| FileCheck %s
vvuksanovic wrote:
Done.
https://github.com/llvm/llvm-project/pull/142149
___
cfe-commits mailing list
cf