[PATCH] D122768: [Clang][C++20] Support capturing structured bindings in lambdas
Erich Keane via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 13 09:00:40 PDT 2022
erichkeane added a comment.
Just about all of the '%' variables in LLVM are unstable names, so you need to use wildcards. Additionally, it seems like you're checking EVERY line of the llvm function, which is likely a mistake, it ends up being incredibly unstable as a result. I'd suggest just checking the individual lines (and the bare minimum on them!) that you need to prove that the 'right thing' is being emitted.
================
Comment at: clang/test/CodeGenCXX/cxx20-decomposition.cpp:17
+// CHECK-LABEL: define{{.*}} i32 @_Z1fv()
+// CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 @__const._Z1fv., i64 8, i1 false)
+// CHECK: %1 = getelementptr inbounds %class.anon, ptr %ref.tmp, i32 0, i32 0
----------------
Are all of these lines necessary to prove what you want to prove? This seems like a lot of extra check lines.
================
Comment at: clang/test/CodeGenCXX/cxx20-decomposition.cpp:19
+// CHECK: %1 = getelementptr inbounds %class.anon, ptr %ref.tmp, i32 0, i32 0
+// CHECK: %j = getelementptr inbounds %struct.S, ptr %0, i32 0, i32 1
+// CHECK: %2 = load i32, ptr %j, align 4
----------------
Names of LLVM variables are NOT stable, and in fact, some configs of the compiler remove them. You typically want to use filecheck 'wildcards' for them.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122768/new/
https://reviews.llvm.org/D122768
More information about the cfe-commits
mailing list