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

66 Коммитов

Автор SHA1 Сообщение Дата
Jon Bauman c3c1e322ad Bug 1639637 - Add Maybe method to move out contents leaving Nothing() behind. r=froydnj
Add take() and extract() methods returning Maybe<T> and T respectively.

Differential Revision: https://phabricator.services.mozilla.com/D76526
2020-05-22 19:46:07 +00:00
Simon Giesecke 3eeb9d7e2d Bug 1625869 - Maybe<T> should be trivially destructible for move-only T. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68758

--HG--
extra : moz-landing-system : lando
2020-03-31 08:20:58 +00:00
Bogdan Tara d6d7d84fec Backed out 2 changesets (bug 1625871, bug 1625869) for gtest assertions on Maybe.h CLOSED TREE
Backed out changeset 8dee41ad98cf (bug 1625871)
Backed out changeset 39fbc765525b (bug 1625869)
2020-03-30 17:29:09 +03:00
Simon Giesecke b30450b50d Bug 1625869 - Maybe<T> should be trivially destructible for move-only T. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68758

--HG--
extra : moz-landing-system : lando
2020-03-30 12:26:58 +00:00
André Bargull 14ca007916 Bug 1625138 - Part 41: Remove no longer needed includes for mozilla/TypeTraits. r=froydnj
Also adds missing includes in some files, these were previously only transivitely
included through mozilla/TypeTraits.h.

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

--HG--
extra : moz-landing-system : lando
2020-03-28 16:00:09 +00:00
André Bargull 32cb16fc45 Bug 1625138 - Part 32: Replace mozilla::RemoveConst with std::remove_const. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68551

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:19 +00:00
André Bargull cf0b1e89e9 Bug 1625138 - Part 30: Replace mozilla::RemoveCV with std::remove_cv. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68547

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:18 +00:00
André Bargull 1be056677a Bug 1625138 - Part 26: Replace mozilla::Conditional with std::conditional. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68381

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:18 +00:00
André Bargull 3ee851a1a5 Bug 1625138 - Part 25: Replace mozilla::RemoveReference with std::remove_reference. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68380

--HG--
extra : moz-landing-system : lando
2020-03-28 14:16:19 +00:00
Simon Giesecke d3deabac64 Bug 1613363 - Maybe<T> should preserve trivial copy-constructability and destructability of T. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68173

--HG--
extra : moz-landing-system : lando
2020-03-27 14:22:51 +00:00
Simon Giesecke 0cc5c6e63f Bug 1052940 - Make Maybe<T> only declare copy/move operations if T is copyable/movable. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68172

--HG--
extra : moz-landing-system : lando
2020-03-27 14:10:45 +00:00
Simon Giesecke a22b36fb7a Bug 1620568 - Disable equality comparison operators for Maybe<T&>. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D67135

--HG--
extra : moz-landing-system : lando
2020-03-18 13:24:17 +00:00
Simon Giesecke 84fb884937 Bug 1620568 - Add support for Maybe<T&>. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D66068

--HG--
extra : moz-landing-system : lando
2020-03-12 14:54:28 +00:00
Simon Giesecke b5fae19786 Bug 1617546 - Provide operator== for mozilla::Nothing. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63842

--HG--
extra : moz-landing-system : lando
2020-02-24 17:53:39 +00:00
Cosmin Sabou 7f1afff492 Backed out 5 changesets (bug 1617604, bug 1617542, bug 1617546) for causing build bustages on ipc/mscom/Interceptor.cpp.
CLOSED TREE

Backed out changeset 5faa54ad950e (bug 1617542)
Backed out changeset cb38779e1eb6 (bug 1617604)
Backed out changeset 3aea18e0396f (bug 1617542)
Backed out changeset bc3eeefdfb6c (bug 1617542)
Backed out changeset b76a3aa5ff6f (bug 1617546)
2020-02-24 19:50:13 +02:00
Simon Giesecke 24ebaad98d Bug 1617546 - Provide operator== for mozilla::Nothing. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63842

--HG--
extra : moz-landing-system : lando
2020-02-24 16:15:20 +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
David Major 824b73f655 Bug 1572205 - Use a single-member union as the storage for Maybe r=jwalden
My personal motivation for doing this is to stop the compiler from inserting stack protectors into tons of functions that wouldn't otherwise have them (arrays on the stack are one of the triggers for stack protection). But others see different benefits, such as being able to remove the `MOZ_NON_PARAM` annotation. Also this is the approach recommended by https://github.com/CppCon/CppCon2019/tree/master/Presentations/how_to_hold_a_t.

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

--HG--
extra : moz-landing-system : lando
2020-01-07 23:50:31 +00:00
David Major fd241bcb5a Bug 1594267 - Make OutOfLinePoisoner::poison be MOZ_NEVER_INLINE r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D51960

--HG--
extra : moz-landing-system : lando
2019-11-06 14:10:15 +00:00
Andrew McCreight 9e451b1da0 Bug 1517611 - Cycle collect WebAuthnManager and U2F more. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D17026

--HG--
extra : moz-landing-system : lando
2019-01-18 23:21:46 +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
Gerald Squelart 964e9708ac Bug 1054115 - Maybe::map and apply now take the function through a forwarding reference - r=froydnj
No need to specify the return type in C++14, this save some less-readable
decltype&declval work.

And we make sure to std::forward the function object before invoking it, to
preserve its const and l/rvalue qualifiers.

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

--HG--
extra : moz-landing-system : lando
2018-10-25 17:20:02 +00:00
Mike Hommey b487ebbc58 Bug 1493093 - Allow to relax MOZ_NON_TEMPORARY_CLASS for some specific constructors r=andi
Differential Revision: https://phabricator.services.mozilla.com/D6566

--HG--
extra : moz-landing-system : lando
2018-09-24 22:47:12 +00:00
Dylan Roeh b18b70dfcf Bug 1489257 - Backed out 3 changesets (bug 1441059, bug 1478171) for causing bug 1489257. r=me
Backed out changeset f7bd4f224f9a (bug 1441059)
Backed out changeset e66e6bd82e3f (bug 1441059)
Backed out changeset 94cfd6113ca7 (bug 1478171)
2018-09-13 12:27:23 -05:00
arthur.iakab 9b05873885 Backed out changeset 16d2d6dc3cdf (bug 1489257)on request by droeh for causing geckowiev failures
--HG--
extra : rebase_source : 6a1e51a55ff18795c981518845735fe73bd78b6c
extra : amend_source : 3c5f4c8f15db8f361b41f29e632ff42563753639
2018-09-11 18:47:58 +03:00
Dylan Roeh 2cf215fea4 Bug 1489257 - Backed out 3 changesets (bug 1441059, bug 1478171) for causing bug 1489257. r=me
Backed out changeset f7bd4f224f9a (bug 1441059)
Backed out changeset e66e6bd82e3f (bug 1441059)
Backed out changeset 94cfd6113ca7 (bug 1478171)
2018-09-10 16:15:31 -05:00
Dylan Roeh 5fa70ba038 Bug 1441059 - Add cycle collection implementations for Maybe. r=bz 2018-07-17 10:34:58 -05:00
Emilio Cobos Álvarez 1e9c395548 Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj
Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:

  s/mozilla::Forward/std::forward/
  s/Forward</std::forward</

The only file that required manual fixup was TestTreeTraversal.cpp, which had
a class called TestNodeForward with template parameters :)

MozReview-Commit-ID: A88qFG5AccP
2018-06-02 09:33:26 +02: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 b29b040b36 Bug 1410186 - turn Maybe assertions into diagnostic assertions; r=bkelly
We out-of-line the relevant functions because assertions can generate
quite a bit of code, and we'd rather let the compiler determine if these
functions should be inlined now.
2018-05-21 10:03:59 -04:00
Bogdan Tara 2aa42f2cab Backed out changeset c82274a23aea (bug 1410186) on request by igoldan a=backout 2018-05-21 16:53:30 +03:00
Nathan Froyd d0ba1c83de Bug 1410186 - turn Maybe assertions into diagnostic assertions; r=bkelly
We out-of-line the relevant functions because assertions can generate
quite a bit of code, and we'd rather let the compiler determine if these
functions should be inlined now.
2018-05-15 16:34:59 -04:00
Nathan Froyd cc035fe9e0 Bug 1444125 - don't poison Maybe on construction; r=gerald
This behavior is pretty heavy-handed and degrades performance.
2018-04-10 13:46:00 -04:00
Nathan Froyd e7e0eac6bc Bug 1444125 - work harder to generate good code for Maybe poisoning; r=gerald 2018-04-10 13:46:00 -04:00
Nathan Froyd 2bd0c8e0a2 Bug 1414901 - part 2 - poison Maybe<T> instances when not in use; r=Waldo 2018-03-06 11:35:50 -05:00
Nicholas Nethercote 4d9d19123c Backout 15b89e515c94 (bug 1410186) for causing too many crashes on Nightly. 2017-11-13 12:14:02 +11:00
Nathan Froyd 37e5710099 Bug 1410186 - turn Maybe assertions into release assertions; r=bkelly
We out-of-line the relevant functions because release assertions can
generate quite a bit of code, and we'd rather let the compiler determine
if these functions should be inlined now.
2017-11-09 12:27:51 -05:00
Xidorn Quan 667a3cb5a4 Bug 1391103 - Align Maybe::mStorage like when the type is in a struct. r=froydnj
MozReview-Commit-ID: 6ArNhZA4Wdf

--HG--
extra : rebase_source : f69ae80c146f2acb308a6c9707aac7ee22f5d992
2017-08-17 09:49:19 +10:00
Steve Fink 678a2ca3dc Bug 1356063 - Make Maybe<T> inherit static analysis annotations from T, r=mystor
--HG--
extra : rebase_source : 7f5e41e471b319f0143e9f91a331b1edcafc7359
2017-04-13 11:35:01 -07:00
Jeff Walden fceda02d9b Bug 1287006 - Use |alignas(T) unsigned char mStorage[sizeof(T)]| instead of AlignedStorage2 inside Maybe. r=froydnj
--HG--
extra : rebase_source : 59e8039481b332decacd1acc7cf1cb73ec8b78cf
2017-01-30 15:56:04 -08:00
Jeff Walden 8f8272ae04 Bug 1339555 - Make various operator-news into a known-non-null pointer use a ::operator new overload that odesn't null-check. r=froydnj
--HG--
extra : rebase_source : cad3ffa778db607bb2ccee2ac42671e60d3c8160
2017-02-14 11:23:18 -08:00
Jonathan Watt 94c9b96404 Bug 1335780, part 1 - Make Maybe<T>::emplace() work when T is const. r=froydnj 2017-01-03 08:53:05 +00:00
Botond Ballo 79e41b270d Bug 1331495 - Add an operator<< overload for Maybe. r=froydnj
MozReview-Commit-ID: 8TcYoikeCvR

--HG--
extra : rebase_source : 591e3c635ae5521418105e2ad1fc2672143eceeb
2017-01-18 13:53:35 -05:00
Xidorn Quan b4ceaa3474 Bug 1325351 part 3 - Make Maybe accept value from different Maybe type when the inner type is convertible. r=froydnj
MozReview-Commit-ID: 2kYTncYh1Or

--HG--
extra : rebase_source : f3263ce10f3afae6e8ac734296dbb0e641c55c99
2016-12-23 11:49:33 +11:00
Xidorn Quan 30961dadd7 Bug 1325351 part 2 - Simplify 'Some' function. r=froydnj
MozReview-Commit-ID: AkLVQw9WYwy

--HG--
extra : rebase_source : 97449d0b2376d53ee7761da2a1ab425492c70ba6
2016-12-23 11:32:33 +11:00
Xidorn Quan 3526b1e58d Bug 1325351 part 1 - Remove workaround for VC in Maybe. r=froydnj
MozReview-Commit-ID: Anlrf3D2WtN

--HG--
extra : rebase_source : 9cc2e29e374753ad40774ebd0a0efce9f9449e3b
2016-12-29 10:58:01 +11:00
Sebastian Hengst 82a8828349 Backed out changeset b4d189ca8add (bug 1325351) for spidermonkey cgc and plain shell failure in Maybe.h. r=backout 2016-12-27 10:41:01 +01:00
Sebastian Hengst fe7c0739e3 Backed out changeset 79754b9b89b7 (bug 1325351) 2016-12-27 10:39:49 +01:00
Sebastian Hengst 6c5fadc6f5 Backed out changeset 45f0755ff471 (bug 1325351) 2016-12-27 10:39:45 +01:00