aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorYounan Zhang <zyn7109@gmail.com>2025-03-11 15:41:56 +0800
committerGitHub <noreply@github.com>2025-03-11 15:41:56 +0800
commitf4218753ad93dd44b019e38bae61dceb93514aee (patch)
treed788b45565304a61352db297810417780096af63 /clang/lib/CodeGen/CodeGenFunction.h
parentf120b0d6d2629e226e6fa75974fbd17f46206bca (diff)
downloadllvm-f4218753ad93dd44b019e38bae61dceb93514aee.zip
llvm-f4218753ad93dd44b019e38bae61dceb93514aee.tar.gz
llvm-f4218753ad93dd44b019e38bae61dceb93514aee.tar.bz2
[Clang] Implement P0963R3 "Structured binding declaration as a condition" (#130228)
This implements the R2 semantics of P0963. The R1 semantics, as outlined in the paper, were introduced in Clang 6. In addition to that, the paper proposes swapping the evaluation order of condition expressions and the initialization of binding declarations (i.e. std::tuple-like decompositions).
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 018fc66..ca00a0e 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -3377,7 +3377,7 @@ public:
/// EmitDecl - Emit a declaration.
///
/// This function can be called with a null (unreachable) insert point.
- void EmitDecl(const Decl &D);
+ void EmitDecl(const Decl &D, bool EvaluateConditionDecl = false);
/// EmitVarDecl - Emit a local variable declaration.
///
@@ -3474,6 +3474,8 @@ public:
void emitAutoVarTypeCleanup(const AutoVarEmission &emission,
QualType::DestructionKind dtorKind);
+ void MaybeEmitDeferredVarDeclInit(const VarDecl *var);
+
/// Emits the alloca and debug information for the size expressions for each
/// dimension of an array. It registers the association of its (1-dimensional)
/// QualTypes and size expression's debug node, so that CGDebugInfo can
@@ -5180,7 +5182,8 @@ public:
void EmitBranchOnBoolExpr(const Expr *Cond, llvm::BasicBlock *TrueBlock,
llvm::BasicBlock *FalseBlock, uint64_t TrueCount,
Stmt::Likelihood LH = Stmt::LH_None,
- const Expr *ConditionalOp = nullptr);
+ const Expr *ConditionalOp = nullptr,
+ const VarDecl *ConditionalDecl = nullptr);
/// Given an assignment `*LHS = RHS`, emit a test that checks if \p RHS is
/// nonnull, if \p LHS is marked _Nonnull.