[clang] [clang][bytecode][NFC] Remove an unreachable parameter check (PR #219977)

via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 31 07:04:13 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>

We check this both in Context and in ByteCodeEmitter. The latter is not reachable since the former will already not create Function instances for such functions.

---
Full diff: https://github.com/llvm/llvm-project/pull/219977.diff


1 Files Affected:

- (modified) clang/lib/AST/ByteCode/ByteCodeEmitter.cpp (-5) 


``````````diff
diff --git a/clang/lib/AST/ByteCode/ByteCodeEmitter.cpp b/clang/lib/AST/ByteCode/ByteCodeEmitter.cpp
index def93866fb0c9..bc1ef1bb6e7b2 100644
--- a/clang/lib/AST/ByteCode/ByteCodeEmitter.cpp
+++ b/clang/lib/AST/ByteCode/ByteCodeEmitter.cpp
@@ -26,11 +26,6 @@ void ByteCodeEmitter::compileFunc(const FunctionDecl *FuncDecl,
   assert(Func);
   assert(FuncDecl->isThisDeclarationADefinition());
 
-  // Manually created functions that haven't been assigned proper
-  // parameters yet.
-  if (!FuncDecl->param_empty() && !FuncDecl->param_begin())
-    return;
-
   // Set up lambda captures.
   if (Func->isLambdaCallOperator()) {
     // Set up lambda capture to closure record field mapping.

``````````

</details>


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


More information about the cfe-commits mailing list