[clang] [CIR] Implement NYI: function declaration that forces code gen (PR #194663)

via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 28 09:04:50 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions c,cpp -- clang/test/CIR/CodeGen/force-externally-visibile-def.c clang/lib/CIR/CodeGen/CIRGenModule.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
index 230f20971..d746d87ca 100644
--- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
@@ -530,7 +530,7 @@ void CIRGenModule::emitGlobal(clang::GlobalDecl gd) {
       cir::FuncType ty = getTypes().getFunctionType(fi);
 
       getOrCreateCIRFunction(mangledName, ty, gd, /*ForVTable=*/false,
-                              /*DontDefer=*/false);
+                             /*DontDefer=*/false);
       return;
     }
   } else {
@@ -2725,7 +2725,7 @@ void CIRGenModule::setFunctionAttributes(GlobalDecl globalDecl,
   // translation to LLVM. Thus, we don't need to check for them here.
 
   // If this function has a body somewhere in the AST, we must use that
-  // definition for attributes and linkage calculation. This prevents AST 
+  // definition for attributes and linkage calculation. This prevents AST
   // assertions when forcing inline definitions from forward declarations.
   const auto *funcDecl = cast<FunctionDecl>(globalDecl.getDecl());
   const FunctionDecl *fdDef;

``````````

</details>


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


More information about the cfe-commits mailing list