Closed Bug 1609996 Opened 6 years ago Closed 6 years ago

Remove mozilla::Swap in favor of std::swap.

Categories

(Core :: MFBT, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

(Regressed 1 open bug)

Details

Attachments

(5 files)

No description provided.

Now mfbt/Move.h is empty except for that excellent comment about move
semantics... Should we put it somewhere else and delete the header as a
follow-up? Or just delete the header and carry on?

rg -l 'mozilla/Move.h' | xargs sed -i 's/#include "mozilla/Move.h"/#include <utility>/g'

Further manual fixups and cleanups to the include order incoming.

Depends on D60297

This makes Gecko build again. I'll squash this into the previous commit anyhow.

Depends on D60323

This was done by:

This was done by applying:

diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
         from subprocess import Popen, PIPE, check_output, CalledProcessError

         diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
-        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']

         if not output_file:
             args.append("-i")

Then running ./mach clang-format -c <commit-hash>

Then undoing that patch.

Then running check_spidermonkey_style.py --fixup

Then running ./mach clang-format

I had to fix three things:

  • I needed to move <utility> back down in GuardObjects.h because I was hitting
    obscure problems with our system include wrappers like this:

0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void realloc (void __ptr, size_t __size)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void
, void
, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94 MOZ_MEMORY_API return_type name##_impl(VA_ARGS);
0:03.94 ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)

  • I had to restore the order of TrustOverrideUtils.h and related files in nss
    because the .inc files depend on TrustOverrideUtils.h being included earlier.

  • I had to add a missing include to RollingNumber.h

Depends on D60325

See Also: → 892839
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: