[clang] [CIR] Implement__builtin_va_arg (PR #153834)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 16 07:48:53 PDT 2025


================
@@ -384,6 +384,19 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
     return Visit(e->getReplacement());
   }
 
+  mlir::Value VisitVAArgExpr(VAArgExpr *ve) {
+    QualType Ty = ve->getType();
+
+    if (Ty->isVariablyModifiedType()) {
+      cgf.cgm.errorNYI(ve->getSourceRange(), "variably modified types in varargs");
+    }
+
+    Address argValue = Address::invalid();
+    mlir::Value val = cgf.emitVAArg(ve, argValue);
+
+    return val;
----------------
xlauko wrote:

```suggestion
    return cgf.emitVAArg(ve, argValue);
```

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


More information about the cfe-commits mailing list