-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc] Add the missing math_extras.h include #74259
[libc] Add the missing math_extras.h include #74259
Conversation
@llvm/pr-subscribers-libc Author: Petr Hosek (petrhosek) Changesmath_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:
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 {
|
There was a problem hiding this 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
libc/src/__support/integer_utils.h
Outdated
@@ -15,6 +15,10 @@ | |||
#include "bit.h" | |||
#include "number_pair.h" | |||
|
|||
#ifndef __SIZEOF_INT128__ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
13f523c
to
dae715c
Compare
math_extras.h is used in integer_utils.h when building for 32-bit platforms but the include is missing.