[clang] [clang][bytecode][NFC] Simplify VisitCXXDefaultArgExpr (PR #123024)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 14 23:52:32 PST 2025


https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/123024

We have `discard()` these days.

>From b6da1ccfe8f0ff9ff25e226dc01b781291892c65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Wed, 15 Jan 2025 08:50:52 +0100
Subject: [PATCH] [clang][bytecode][NFC] Simplify VisitCXXDefaultArgExpr

We have `discard()` these days.
---
 clang/lib/AST/ByteCode/Compiler.cpp | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index a5dfaaf3196559..b659feb4536b70 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -4805,12 +4805,7 @@ template <class Emitter>
 bool Compiler<Emitter>::VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *E) {
   SourceLocScope<Emitter> SLS(this, E);
 
-  const Expr *SubExpr = E->getExpr();
-  if (std::optional<PrimType> T = classify(E->getExpr()))
-    return this->visit(SubExpr);
-
-  assert(Initializing);
-  return this->visitInitializer(SubExpr);
+  return this->delegate(E->getExpr());
 }
 
 template <class Emitter>



More information about the cfe-commits mailing list