[llvm] Delete the incorrect assert that assumes size of `APFloat` is the same as `IEEEFloat`. (PR #111780)

Daniel Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 19:08:20 PDT 2024


https://github.com/DanielCChen created https://github.com/llvm/llvm-project/pull/111780

This addition of the the following code in commit https://github.com/llvm/llvm-project/commit/6004f5550c8032f4c632cdbf5dbc0894bb33e51f#diff-3ec11da67f69353fd755e59cc71f551b5e93773fd4e6f6327c7f1c7074a82709R1474

```
static_assert(sizeof(APFloat) == sizeof(detail::IEEEFloat),
              "Empty base class optimization is not performed.");
```

broke our downstream code as not all the members of `APFloat` is IEEE. 

This PR is to delete the assertion.

@Ariel-Burton

>From 8126cba7c9c121899d03d7ca144a32bfdead24e6 Mon Sep 17 00:00:00 2001
From: cdchen-ca <cdchen at ca.ibm.com>
Date: Wed, 9 Oct 2024 21:59:17 -0400
Subject: [PATCH] Delete the incorrect assert that assumes size of APFloat is
 the same as IEEEFloat.

---
 llvm/include/llvm/ADT/APFloat.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h
index 6f1e24e5da33a9..de11cd93b48478 100644
--- a/llvm/include/llvm/ADT/APFloat.h
+++ b/llvm/include/llvm/ADT/APFloat.h
@@ -1473,9 +1473,6 @@ class APFloat : public APFloatBase {
   friend DoubleAPFloat;
 };
 
-static_assert(sizeof(APFloat) == sizeof(detail::IEEEFloat),
-              "Empty base class optimization is not performed.");
-
 /// See friend declarations above.
 ///
 /// These additional declarations are required in order to compile LLVM with IBM



More information about the llvm-commits mailing list