Граф коммитов

34 Коммитов

Автор SHA1 Сообщение Дата
Nathan Froyd e3ebda1914 Bug 1223932 - delete guard object uses from the tree; r=jwalden
CLOSED TREE

We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Mihai Alexandru Michis a911a108d0 Backed out changeset ac9c811bc427 (bug 1223932) for causing spidermonkey rust failures.
CLOSED TREE
2020-07-30 18:23:21 +03:00
Nathan Froyd bec9f9b93a Bug 1223932 - delete guard object uses from the tree; r=jwalden
We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Simon Giesecke ad6c02c994 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in mfbt. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D62542

--HG--
extra : moz-landing-system : lando
2020-02-13 11:20:27 +00:00
Mihai Alexandru Michis 395eb2050d Backed out changeset f3d9fbb2daf1 (bug 1613985) for causing hazard bustages on Linux.
CLOSED TREE
2020-02-12 16:43:30 +02:00
Simon Giesecke 066ea869b7 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in mfbt. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D62542

--HG--
extra : moz-landing-system : lando
2020-02-12 11:13:24 +00:00
Emilio Cobos Álvarez 256c124f94 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
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 four 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)

   Which I really didn't feel like digging into.

 * 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

 * Also had to partially restore include order in JsepSessionImpl.cpp to avoid
   some -WError issues due to some static inline functions being defined in a
   header but not used in the rest of the compilation unit.

Differential Revision: https://phabricator.services.mozilla.com/D60327

--HG--
extra : moz-landing-system : lando
2020-01-20 16:19:48 +00:00
Emilio Cobos Álvarez aa3a695712 Bug 1609996 - Remove mozilla/Move.h. r=froydnj
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.

Differential Revision: https://phabricator.services.mozilla.com/D60323

--HG--
extra : moz-landing-system : lando
2020-01-20 16:18:20 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Nathan Froyd 550f775a8d Bug 1252902 - remove ScopedFreePtr; r=Waldo
We have UniqueFreePtr as a replacement, which at least uses
more-standard machinery to do its job.
2016-03-02 11:44:27 -05:00
Nathan Froyd 76173ee85d Bug 1251723 - remove ScopedDeletePtr; r=Waldo
UniquePtr is more standard than ScopedDeletePtr; using standard
constructs whenever possible is preferable.
2016-02-26 15:08:03 -05:00
Michael Layzell 0097c41e01 Bug 1201190 - Part 3: Mark every consumer of GUARD_OBJECT as MOZ_RAII, r=ehsan 2015-09-12 16:53:33 -04:00
Michael Layzell 1eaae658aa Bug 1156802 - Part 2: Remove all explicit move constructors, r=ehsan 2015-09-12 12:34:45 -04:00
Masatoshi Kimura bf312ad056 Bug 1120062 - Part 1: Remove most Nullptr.h includes. r=waldo 2015-01-11 11:34:52 +09:00
Ehsan Akhgari 4354953b4f Bug 1118486 - Part 1: Use `= delete` instead of MOZ_DELETE directly; r=Waldo
Most of this patch (with the exception of dom/bindings/Codegen.py) was
generated by the following bash script:

#!/bin/bash

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "*/.git*" \
       ! -wholename "obj-*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_DELETE '= delete'
2015-01-08 23:19:05 -05:00
Jeff Walden fb7578dac2 Bug 1037103 - Remove ScopedDeleteArray from Scoped.h. r=jcranmer 2014-07-10 17:43:59 -07:00
Jeff Walden bb16b5790f Bug 1037103 - Add deprecation notice/comments to Scoped.h. r=jcranmer
--HG--
extra : rebase_source : dabef0b6f8631ac2103039026b8cef8af1271c01
2014-07-10 17:45:45 -07:00
Nicholas Nethercote 2a0942be41 Bug 1036789 - Convert the third quarter of MFBT to Gecko style. r=Ms2ger.
--HG--
extra : rebase_source : 668cd394806203ddfa34bd4f226335ff26c846b5
2014-07-10 19:10:17 -07:00
Dan Gohman 73faa4dc74 Bug 1012971 - Fix compiler warnings in mfbt r=nbp 2014-05-22 11:15:06 -07:00
Jim Blandy 4138c776b2 Bug 944176: Implement move construction and move assignment for mozilla::Scoped derivatives. r=waldo 2014-03-27 09:52:48 -07:00
Jim Blandy 7a81916776 Bug 944176: In mozilla::Scoped, don't gratuitously repeat template arguments within the class template itself. r=waldo 2014-03-27 09:52:43 -07:00
Birunthan Mohanathas 9e65e2904f Bug 784739 - Switch from NULL to nullptr in mfbt/. r=jwalden
--HG--
extra : rebase_source : 090706fa9d97854fe3071adf037a09d914a0854f
2013-07-25 16:31:48 -07:00
Ryan VanderMeulen c5cf7535b6 Backed out 3 changesets (bug 896124, bug 784739, bug 894026) for Windows checktest orange on a CLOSED TREE.
Backed out changeset 631b3d5d54f4 (bug 896124)
Backed out changeset 5e1dd28ede5d (bug 894026)
Backed out changeset c10c0a6270ec (bug 784739)
2013-07-26 00:08:51 -04:00
Birunthan Mohanathas 0c642c695d Bug 784739 - Switch from NULL to nullptr in mfbt/. r=jwalden 2013-07-25 16:31:48 -07:00
Ms2ger 51f391870b Bug 896341 - Update include guards and modelines in MFBT; r=Waldo 2013-07-24 09:41:39 +02:00
Nicholas Nethercote d4951cc6b8 Bug 563195: Avoid triggering -Wshadow warnings in mfbt/. r=Waldo 2013-02-17 22:56:32 -08:00
Brian Smith b4d60d3f56 Bug 812531: Make MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE comply with two-phase template name lookup rules, as clang requires, r=khuey
--HG--
extra : rebase_source : 5c4c8c0ff4f2dfcb4d83e63376036a5bf45ab0ab
2012-11-15 17:02:11 -08:00
Brian Smith 5d5eed3185 Bug 767240 - Make it easier to create type-specific scoped pointers (TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE), r=jwalden
--HG--
extra : rebase_source : 845b429d56ee1abb296925624928c355451edc3c
2012-07-24 15:36:06 -07:00
Jeff Walden f071f38e8c Bug 760995 - Move Scoped.h into the mozilla namespace. r=sparky
--HG--
extra : rebase_source : 534c787c834fc1d7174b51d8fb8f13ec339c0a58
2012-06-11 16:16:47 -07:00
Ed Morley 5a59a93dac Backout 1c5a8d617bff (bug 765990), 617cb36ead59, b3067d05a76a (bug 760995), 79f9a61a1e43 (bug 426163) for bustage 2012-06-21 10:00:36 +01:00
Jeff Walden 765347bb6f Bug 760995 - Move Scoped.h into the mozilla namespace. r=sparky
--HG--
extra : rebase_source : ea32c4240ea552c72ed16074c803927e638474dc
2012-06-11 16:16:47 -07:00
Jeff Walden 986ff95100 Style patrol to make everything conform to mfbt/STYLE. No bug, r=sparky 2012-06-03 20:36:43 -07:00
David Rajchenbach-Teller 5996ca7f8c Bug 718938 - Add RAII helper to mfbt. r=waldo,luke,cjones 2012-04-06 11:16:33 +02:00