[clang] [CIR] Add vptr type and generate vptr field when needed (PR #151377)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 1 09:31:53 PDT 2025


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 HEAD~1 HEAD --extensions cpp -- clang/test/CIR/CodeGen/virtual-function-calls.cpp clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp clang/lib/CIR/Dialect/IR/CIRTypes.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
index db527f232..4fecb0108 100644
--- a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
+++ b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
@@ -708,9 +708,8 @@ VPtrType::getTypeSizeInBits(const mlir::DataLayout &dataLayout,
   return llvm::TypeSize::getFixed(64);
 }
 
-uint64_t
-VPtrType::getABIAlignment(const mlir::DataLayout &dataLayout,
-                          mlir::DataLayoutEntryListRef params) const {
+uint64_t VPtrType::getABIAlignment(const mlir::DataLayout &dataLayout,
+                                   mlir::DataLayoutEntryListRef params) const {
   // FIXME: consider alignment differences under different ABIs
   return 8;
 }

``````````

</details>


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


More information about the cfe-commits mailing list