Remove some type-level indirections from template-metaprogramming
helpers.
Additionally, replace some nearby uses of `typedef` with `using`, as
suggested by clang-tidy.
No functional changes.
Differential Revision: https://phabricator.services.mozilla.com/D201784
When compiled with -std=c++17, u8"" string literals have type `const char[]`. When compiled with -std=c++20, u8"" string literals have type `const char8_t[]`. This patch adds the minimum char8_t overloads needed to compile Firefox with -std=c++20. If we want to use char8_t in more code or replace `Utf8Unit` with char8_t, that will require an extensive redesign of MFBT's and xpcom's string classes after we update from -std=c++17 to c++20.
Differential Revision: https://phabricator.services.mozilla.com/D201672
The built-in version is better as it also allows annotating particular
parameters (it not only applies to method declarations).
Differential Revision: https://phabricator.services.mozilla.com/D200432
The built-in version is better as it also allows annotating particular
parameters (it not only applies to method declarations).
Differential Revision: https://phabricator.services.mozilla.com/D200432
This prevents it from being used in the foot-gunny way described in
comment 0.
This in turn allows us to add a constructor for temporary callables.
Turns out we only had test usages of non-temporary FunctionRefs, so this
is much simpler than the initial approach I considered.
Fix the tests to keep compiling, and add a test for the new constructor.
Differential Revision: https://phabricator.services.mozilla.com/D200157
size_t is already correctly used in many places, only ConstIterator uses
uint32_t for position tracking. It would be better to align these data types
and use size_t everywhere.
Differential Revision: https://phabricator.services.mozilla.com/D197774
MozTaggedMemoryIsSupported doesn't work under ASAN because it tries to prctl the
nullptr page. It should be harmless to simply call prctl and ignore the error.
Depends on D195064
Differential Revision: https://phabricator.services.mozilla.com/D195065
Remove all of the code in `RefPtr` and `AgileReference` that allowed
for implicitly converting between the two in via constructors or the
assignment operator.
Replace these with a slightly-less-convenient-but-substantially-more-
explicit `Resolve` function family.
(This also eliminates the dependency that `class RefPtr` had on
`class AgileReference`.)
Differential Revision: https://phabricator.services.mozilla.com/D196365
Remove all of the code in `RefPtr` and `AgileReference` that allowed
for implicitly converting between the two in via constructors or the
assignment operator.
Replace these with a slightly-less-convenient-but-substantially-more-
explicit `Resolve` function family.
(This also eliminates the dependency that `class RefPtr` had on
`class AgileReference`.)
Differential Revision: https://phabricator.services.mozilla.com/D196365
In the fx codebase, we tend to use __attribute__((naked)) for plain
assembly functions with a C interface. Instrumenting these functions can
mess up this assembly, so we conservatively also want to prevent
instrumentation.
Differential Revision: https://phabricator.services.mozilla.com/D196154
The patch implements the move assigment operator in terms of the move
constructor. This fulfills the requirements for std::swap to compile.
Differential Revision: https://phabricator.services.mozilla.com/D196035
The patch implements the move assigment operator in terms of the move
constructor. This fulfills the requirements for std::swap to compile.
Differential Revision: https://phabricator.services.mozilla.com/D196035
This patch makes mingwclang builds compile with -include _mingw.h. This
makes MSVC-style constants defined from the start of C++ files rather
than at the point where they start including files that depend on
_mingw.h. Thus, mingwclang builds will behave more closely to regular
builds, potentially avoiding future backouts for mingwclang build
failures and/or successful but incorrect mingwclang builds.
Differential Revision: https://phabricator.services.mozilla.com/D195662