Skip to content

Conversation

@petrhosek
Copy link
Member

math_extras.h is used in integer_utils.h when building for 32-bit platforms but the include is missing.

@llvmbot
Copy link
Member

llvmbot commented Dec 3, 2023

@llvm/pr-subscribers-libc

Author: Petr Hosek (petrhosek)

Changes

math_extras.h is used in integer_utils.h when building for 32-bit platforms but the include is missing.


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

2 Files Affected:

  • (modified) libc/src/__support/CMakeLists.txt (+1)
  • (modified) libc/src/__support/integer_utils.h (+4)
diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index ba80965b5aaaf..d6dbad661cb73 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -189,6 +189,7 @@ add_header_library(
     integer_utils.h
   DEPENDS
     .bit
+    .math_extras
     .number_pair
     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..619e13f51c411 100644
--- a/libc/src/__support/integer_utils.h
+++ b/libc/src/__support/integer_utils.h
@@ -15,6 +15,10 @@
 #include "bit.h"
 #include "number_pair.h"
 
+#ifndef __SIZEOF_INT128__
+#include "math_extras.h"
+#endif
+
 #include <stdint.h>
 
 namespace LIBC_NAMESPACE {

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one minor change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this include should be unconditional since the function is always used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

math_extras.h is used in integer_utils.h when building for 32-bit
platforms but the include is missing.
@petrhosek petrhosek force-pushed the libc-missing-math-extras-include branch from 13f523c to dae715c Compare December 4, 2023 19:01
@petrhosek petrhosek merged commit c33e5d5 into llvm:main Dec 4, 2023
@petrhosek petrhosek deleted the libc-missing-math-extras-include branch December 4, 2023 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants