[clang] [CIR] Handle NullStmt (PR #134889)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 8 10:53:32 PDT 2025


================
@@ -90,3 +90,18 @@ int f3(void) {
 // OGCG-NEXT:   store i32 3, ptr %[[I_PTR]], align 4
 // OGCG-NEXT:   %[[I:.*]] = load i32, ptr %[[I_PTR]], align 4
 // OGCG-NEXT:   ret i32 %[[I]]
+
+// Verify null statement handling.
+void f4(void) {
+  ;
----------------
erichkeane wrote:

The trailing one does.  The `{}` is a compound-stmt.  I notice in class-codegen we do some stuff to figure out if the `for` loop is empty (or `while` loop/etc) that checks it IIRC.  

https://github.com/llvm/llvm-project/pull/134889


More information about the cfe-commits mailing list