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

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


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-adt

Author: Daniel Chen (DanielCChen)

<details>
<summary>Changes</summary>

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

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


1 Files Affected:

- (modified) llvm/include/llvm/ADT/APFloat.h (-3) 


``````````diff
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

``````````

</details>


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


More information about the llvm-commits mailing list