[libc-commits] [libc] [libc] Fix missing math_extras include (PR #74356)

via libc-commits libc-commits at lists.llvm.org
Mon Dec 4 10:42:14 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: None (michaelrj-google)

<details>
<summary>Changes</summary>

The file integer_utils.h assumes it has access to the add_with_carry
function from math_extras.h, but did not have a direct include for that
file. This caused build errors on arm32 where the indirect include chain
was broken. This patch adds the missing include.


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


2 Files Affected:

- (modified) libc/src/__support/CMakeLists.txt (+1) 
- (modified) libc/src/__support/integer_utils.h (+1) 


``````````diff
diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index ba80965b5aaaf..06e335c9dd8b5 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -190,6 +190,7 @@ add_header_library(
   DEPENDS
     .bit
     .number_pair
+    .math_extras
     libc.src.__support.common
     libc.src.__support.CPP.type_traits
 )
diff --git a/libc/src/__support/integer_utils.h b/libc/src/__support/integer_utils.h
index 433e99227bcfd..661318f03bfd3 100644
--- a/libc/src/__support/integer_utils.h
+++ b/libc/src/__support/integer_utils.h
@@ -13,6 +13,7 @@
 #include "src/__support/common.h"
 
 #include "bit.h"
+#include "math_extras.h"
 #include "number_pair.h"
 
 #include <stdint.h>

``````````

</details>


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


More information about the libc-commits mailing list