Bug 1266295 - Remove unnecessary compiler version checks for gcc <= 4.8.0 in xpcom. r=froydnj
authorChris Peterson <cpeterson@mozilla.com>
Sun, 17 Apr 2016 17:10:00 -0700
changeset 294434 7df8f4cd5d4aa4237d60bbdbc62a1e41186ee57b
parent 294433 5b1c09821da16aa3be4179465bc7519c5a5f40fa
child 294435 e956fb34b9d8f9686d8fde7c86bd749e108c4971
push id75537
push usercpeterson@mozilla.com
push dateFri, 22 Apr 2016 05:54:49 +0000
treeherdermozilla-inbound@7df8f4cd5d4a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1266295
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1266295 - Remove unnecessary compiler version checks for gcc <= 4.8.0 in xpcom. r=froydnj
xpcom/ds/nsAtomTable.cpp
xpcom/glue/nsISupportsImpl.h
--- a/xpcom/ds/nsAtomTable.cpp
+++ b/xpcom/ds/nsAtomTable.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Assertions.h"
 #include "mozilla/Attributes.h"
-#include "mozilla/Compiler.h"
 #include "mozilla/HashFunctions.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/unused.h"
 
 #include "nsAtomTable.h"
 #include "nsStaticAtom.h"
 #include "nsString.h"
@@ -33,24 +32,16 @@
 //
 // - StaticAtom: the atom itself is heap allocated, but it points to a static
 //   nsStringBuffer. |gAtomTable| effectively owns StaticAtoms, because such
 //   atoms ignore all AddRef/Release calls, which ensures they stay alive until
 //   |gAtomTable| itself is destroyed whereupon they are explicitly deleted.
 
 using namespace mozilla;
 
-#if defined(__clang__)
-#  pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
-#elif MOZ_IS_GCC
-#  if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
-#    pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
-#  endif
-#endif
-
 //----------------------------------------------------------------------
 
 class CheckStaticAtomSizes
 {
   CheckStaticAtomSizes()
   {
     static_assert((sizeof(nsFakeStringBuffer<1>().mRefCnt) ==
                    sizeof(nsStringBuffer().mRefCount)) &&
--- a/xpcom/glue/nsISupportsImpl.h
+++ b/xpcom/glue/nsISupportsImpl.h
@@ -33,24 +33,23 @@
 
 #if defined(__clang__)
    // bug 1028428 shows that at least in FreeBSD 10.0 with Clang 3.4 and libc++ 3.4,
    // std::is_destructible is buggy in that it returns false when it should return true
    // on ipc::SharedMemory. On the other hand, all Clang versions currently in use
    // seem to handle the fallback just fine.
 #  define MOZ_CAN_USE_IS_DESTRUCTIBLE_FALLBACK
 #elif defined(__GNUC__)
-   // GCC 4.7 is has buggy std::is_destructible
-#  if MOZ_USING_LIBSTDCXX && MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
+   // GCC 4.7 has buggy std::is_destructible.
+#  if MOZ_USING_LIBSTDCXX
 #    define MOZ_HAVE_STD_IS_DESTRUCTIBLE
+#  endif
    // Some GCC versions have an ICE when using destructors in decltype().
    // Works on GCC 4.8 at least.
-#  elif MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
-#    define MOZ_CAN_USE_IS_DESTRUCTIBLE_FALLBACK
-#  endif
+#  define MOZ_CAN_USE_IS_DESTRUCTIBLE_FALLBACK
 #endif
 
 #ifdef MOZ_HAVE_STD_IS_DESTRUCTIBLE
 #  include <type_traits>
 #  define MOZ_IS_DESTRUCTIBLE(X) (std::is_destructible<X>::value)
 #elif defined MOZ_CAN_USE_IS_DESTRUCTIBLE_FALLBACK
   namespace mozilla {
     struct IsDestructibleFallbackImpl
@@ -135,24 +134,16 @@ private:
 
 #define NS_LOG_RELEASE(_p, _rc, _type) \
   NS_LogRelease((_p), (_rc), (_type))
 
 #include "mozilla/TypeTraits.h"
 #define MOZ_ASSERT_CLASSNAME(_type)                         \
   static_assert(mozilla::IsClass<_type>::value,             \
                 "Token '" #_type "' is not a class type.")
-// Older versions of gcc can't instantiate local classes in templates.
-// GCC 4.7 doesn't have this problem.
-#if MOZ_IS_GCC
-# if !MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
-#  undef MOZ_ASSERT_CLASSNAME
-#  define MOZ_ASSERT_CLASSNAME(_type)
-# endif
-#endif
 
 // Note that the following constructor/destructor logging macros are redundant
 // for refcounted objects that log via the NS_LOG_ADDREF/NS_LOG_RELEASE macros.
 // Refcount logging is preferred.
 #define MOZ_COUNT_CTOR(_type)                                 \
 do {                                                          \
   MOZ_ASSERT_CLASSNAME(_type);                                \
   NS_LogCtor((void*)this, #_type, sizeof(*this));             \