commit bfad0646716e74e8a39b40cf9ed4f1fb890da400
parent 8ea4758d577bf6fe3345f553def548159cd57efb
Author: serge-sans-paille <sguelton@mozilla.com>
Date: Thu, 2 Oct 2025 13:38:39 +0000
Bug 1991856 - Simplify mfbt/Compiler.h usage r=emilio
- Remove some unused definition
- Remove obsolete bug reference now that we use more modern gcc/clang
version
Differential Revision: https://phabricator.services.mozilla.com/D267176
Diffstat:
8 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/intl/components/src/Collator.h b/intl/components/src/Collator.h
@@ -10,7 +10,6 @@
#include "unicode/ucol.h"
-#include "mozilla/Compiler.h"
#include "mozilla/intl/ICU4CGlue.h"
#include "mozilla/intl/ICUError.h"
#include "mozilla/Result.h"
diff --git a/js/public/Conversions.h b/js/public/Conversions.h
@@ -10,7 +10,6 @@
#define js_Conversions_h
#include "mozilla/Casting.h"
-#include "mozilla/Compiler.h"
#include "mozilla/FloatingPoint.h"
#include "mozilla/MathAlgorithms.h"
#include "mozilla/WrappingOperations.h"
@@ -377,9 +376,7 @@ inline SignedInteger ToSignedInteger(double d) {
return mozilla::WrapToSigned(u);
}
-// clang crashes compiling this when targeting arm:
-// https://llvm.org/bugs/show_bug.cgi?id=22974
-#if defined(__arm__) && MOZ_IS_GCC
+#if defined(__arm__)
template <>
inline int32_t ToSignedInteger<int32_t>(double d) {
@@ -509,7 +506,7 @@ inline int32_t ToSignedInteger<int32_t>(double d) {
return i;
}
-#endif // defined (__arm__) && MOZ_IS_GCC
+#endif // defined (__arm__)
namespace detail {
diff --git a/js/public/Utility.h b/js/public/Utility.h
@@ -11,7 +11,6 @@
#include "mozilla/Atomics.h"
#include "mozilla/Attributes.h"
#include "mozilla/CheckedArithmetic.h"
-#include "mozilla/Compiler.h"
#include "mozilla/Likely.h"
#include "mozilla/UniquePtr.h"
diff --git a/mfbt/Assertions.h b/mfbt/Assertions.h
@@ -30,7 +30,6 @@
#endif
#include "mozilla/Attributes.h"
-#include "mozilla/Compiler.h"
#include "mozilla/Fuzzing.h"
#include "mozilla/Likely.h"
#include "mozilla/MacroArgs.h"
diff --git a/mfbt/Compiler.h b/mfbt/Compiler.h
@@ -9,11 +9,7 @@
#ifndef mozilla_Compiler_h
#define mozilla_Compiler_h
-#define MOZ_IS_GCC 0
-
#if !defined(__clang__) && defined(__GNUC__)
-
-# undef MOZ_IS_GCC
# define MOZ_IS_GCC 1
/*
* These macros should simplify gcc version checking. For example, to check
@@ -25,10 +21,8 @@
# define MOZ_GCC_VERSION_AT_MOST(major, minor, patchlevel) \
((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) <= \
((major) * 10000 + (minor) * 100 + (patchlevel)))
-# if !MOZ_GCC_VERSION_AT_LEAST(6, 1, 0)
-# error "mfbt (and Gecko) require at least gcc 6.1 to build."
-# endif
-
+#else
+# define MOZ_IS_GCC 0
#endif
#endif /* mozilla_Compiler_h */
diff --git a/mfbt/EndianUtils.h b/mfbt/EndianUtils.h
@@ -68,7 +68,6 @@
#include "mozilla/Assertions.h"
#include "mozilla/Attributes.h"
-#include "mozilla/Compiler.h"
#include "mozilla/DebugOnly.h"
#include <stdint.h>
diff --git a/mfbt/UniquePtr.h b/mfbt/UniquePtr.h
@@ -15,7 +15,6 @@
#include "mozilla/Assertions.h"
#include "mozilla/Attributes.h"
-#include "mozilla/Compiler.h"
namespace mozilla {
diff --git a/xpcom/base/nsISupportsImpl.h b/xpcom/base/nsISupportsImpl.h
@@ -23,7 +23,6 @@
#include "mozilla/Attributes.h"
#include "mozilla/Assertions.h"
#include "mozilla/Atomics.h"
-#include "mozilla/Compiler.h"
#include "mozilla/Likely.h"
#include "mozilla/MacroArgs.h"
#include "mozilla/MacroForEach.h"