gecko-dev/build/clang-plugin/CustomAttributes.inc
Aaron Klotz b21e723d2e Bug 1569681: Part 1 - Add support for moz_static_local_class and moz_trivial_dtor to clang-plugin; r=Ehsan
This patch is in support of adding a variant of Static{Auto,Ref}Ptr for use as
static locals, taking advantage of C++11 "magic statics" such that we can lazily
initialize those variables in a thread-safe way.

In support of those classes, this patch adds two new attributes:

* `moz_static_local_class` to ensure that any instantiations of that class only
  occur as static local variables;
* `moz_trivial_dtor` to ensure that these classes do not implicitly call `atexit`
  and add a whole bunch of shutdown crap.

`moz_static_local_class` works similarly to `moz_global_class`, except that its
object must only instantiate as static locals.

`TrivialDtorChecker` is based on `TrivialCtorDtorChecker`, with the ctor-specific
bits removed.

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

--HG--
rename : build/clang-plugin/TrivialCtorDtorChecker.cpp => build/clang-plugin/TrivialDtorChecker.cpp
rename : build/clang-plugin/TrivialCtorDtorChecker.h => build/clang-plugin/TrivialDtorChecker.h
extra : moz-landing-system : lando
2019-07-30 18:50:52 +00:00

31 lines
867 B
PHP

ATTR(moz_allow_temporary)
ATTR(moz_can_run_script)
ATTR(moz_can_run_script_boundary)
ATTR(moz_global_class)
ATTR(moz_heap_allocator)
ATTR(moz_heap_class)
ATTR(moz_implicit)
ATTR(moz_inherit_type_annotations_from_template_args)
ATTR(moz_is_smartptr_to_refcounted)
ATTR(moz_may_call_after_must_return)
ATTR(moz_must_override)
ATTR(moz_must_return_from_caller)
ATTR(moz_must_use_type)
ATTR(moz_needs_memmovable_members)
ATTR(moz_needs_memmovable_type)
ATTR(moz_needs_no_vtable_type)
ATTR(moz_no_addref_release_on_return)
ATTR(moz_no_arith_expr_in_arg)
ATTR(moz_no_dangling_on_temporaries)
ATTR(moz_non_autoable)
ATTR(moz_non_memmovable)
ATTR(moz_non_param)
ATTR(moz_non_temporary_class)
ATTR(moz_nonheap_class)
ATTR(moz_required_base_method)
ATTR(moz_stack_class)
ATTR(moz_static_local_class)
ATTR(moz_temporary_class)
ATTR(moz_trivial_ctor_dtor)
ATTR(moz_trivial_dtor)