[clang] [clang][bytecode][NFC] Simplify VisitCompoundLiteralExpr (PR #140547)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Mon May 19 07:25:09 PDT 2025
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/140547
None
>From ba9bf827b8b599a127247222ef9177bd92df42c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Mon, 19 May 2025 16:24:29 +0200
Subject: [PATCH] [clang][bytecode][NFC] Simplify VisitCompoundLiteralExpr
---
clang/lib/AST/ByteCode/Compiler.cpp | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index aa8f009f58bb9..a8687044ca4d5 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -2935,16 +2935,9 @@ bool Compiler<Emitter>::VisitCompoundLiteralExpr(const CompoundLiteralExpr *E) {
if (!this->emitGetPtrLocal(LocalIndex, E))
return false;
- if (T) {
- if (!this->visit(Init)) {
- return false;
- }
- return this->emitInit(*T, E);
- } else {
- if (!this->visitInitializer(Init) || !this->emitFinishInit(E))
- return false;
- }
- return true;
+ if (T)
+ return this->visit(Init) && this->emitInit(*T, E);
+ return this->visitInitializer(Init) && this->emitFinishInit(E);
}
return false;
More information about the cfe-commits
mailing list