[clang] [CIR] Implement deferred V-Table emission (PR #185655)

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 10 07:08:25 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 cpp,h -- clang/test/CIR/CodeGenCXX/vtable-linkage.cpp clang/test/CIR/CodeGenCXX/vtable-virt-thunk-adj.cpp clang/include/clang/CIR/MissingFeatures.h clang/lib/CIR/CodeGen/CIRGenCXXABI.h clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp clang/lib/CIR/CodeGen/CIRGenModule.cpp clang/lib/CIR/CodeGen/CIRGenModule.h clang/lib/CIR/CodeGen/CIRGenVTables.cpp clang/test/CIR/CodeGen/vbase.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/CIRGenItaniumCXXABI.cpp b/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
index 6db3c1d39..6b8ddf8d6 100644
--- a/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
@@ -227,7 +227,7 @@ public:
   classifyRTTIUniqueness(QualType canTy, cir::GlobalLinkageKind linkage) const;
 
 private:
- bool hasAnyUnusedVirtualInlineFunction(const CXXRecordDecl *rd) const;
+  bool hasAnyUnusedVirtualInlineFunction(const CXXRecordDecl *rd) const;
   bool isVTableHidden(const CXXRecordDecl *rd) const;
 };
 
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.h b/clang/lib/CIR/CodeGen/CIRGenModule.h
index 247155594..d2f764245 100644
--- a/clang/lib/CIR/CodeGen/CIRGenModule.h
+++ b/clang/lib/CIR/CodeGen/CIRGenModule.h
@@ -103,7 +103,7 @@ private:
   llvm::DenseSet<clang::GlobalDecl> diagnosedConflictingDefinitions;
 
   /// A queue of (optional) vtables to consider emitting.
-  std::vector<const CXXRecordDecl*> deferredVTables;
+  std::vector<const CXXRecordDecl *> deferredVTables;
 
   /// A queue of (optional) vtables that may be emitted opportunistically.
   std::vector<const CXXRecordDecl *> opportunisticVTables;
@@ -499,7 +499,6 @@ public:
     deferredVTables.push_back(rd);
   }
 
-
   /// Emit code for a single global function or variable declaration. Forward
   /// declarations are emitted lazily.
   void emitGlobal(clang::GlobalDecl gd);

``````````

</details>


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


More information about the cfe-commits mailing list