mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 21:18:35 +00:00
Bug 1267550 (part 1) - Rename MOZ_MUST_USE as MOZ_MUST_USE_TYPE. r=ehsan.
This will allow MOZ_MUST_USE to be used for a different and more common case. MozReview-Commit-ID: 4dQsdWjJfc6 --HG-- extra : rebase_source : 390ab56ef83d71eb6d28759a0195a79a78b153bd
This commit is contained in:
parent
3ac624c914
commit
a5c843fe5f
@ -336,7 +336,7 @@ static CustomTypeAnnotation HeapClass =
|
||||
static CustomTypeAnnotation NonTemporaryClass =
|
||||
CustomTypeAnnotation("moz_non_temporary_class", "non-temporary");
|
||||
static CustomTypeAnnotation MustUse =
|
||||
CustomTypeAnnotation("moz_must_use", "must-use");
|
||||
CustomTypeAnnotation("moz_must_use_type", "must-use");
|
||||
|
||||
class MemMoveAnnotation final : public CustomTypeAnnotation {
|
||||
public:
|
||||
|
@ -1,7 +1,7 @@
|
||||
#define MOZ_MUST_USE __attribute__((annotate("moz_must_use")))
|
||||
#define MOZ_MUST_USE_TYPE __attribute__((annotate("moz_must_use_type")))
|
||||
#define MOZ_STACK_CLASS __attribute__((annotate("moz_stack_class")))
|
||||
|
||||
class MOZ_MUST_USE MOZ_STACK_CLASS TestClass {};
|
||||
class MOZ_MUST_USE_TYPE MOZ_STACK_CLASS TestClass {};
|
||||
|
||||
TestClass foo; // expected-error {{variable of type 'TestClass' only valid on the stack}} expected-note {{value incorrectly allocated in a global variable}}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#define MOZ_MUST_USE __attribute__((annotate("moz_must_use")))
|
||||
#define MOZ_MUST_USE_TYPE __attribute__((annotate("moz_must_use_type")))
|
||||
|
||||
struct Temporary { ~Temporary(); };
|
||||
class MOZ_MUST_USE MustUse {};
|
||||
class MOZ_MUST_USE_TYPE MustUse {};
|
||||
class MayUse {};
|
||||
|
||||
MustUse producesMustUse();
|
||||
|
@ -45,7 +45,7 @@ namespace image {
|
||||
*
|
||||
* BAD_ARGS: We failed to draw because bad arguments were passed to draw().
|
||||
*/
|
||||
enum class MOZ_MUST_USE DrawResult : uint8_t
|
||||
enum class MOZ_MUST_USE_TYPE DrawResult : uint8_t
|
||||
{
|
||||
SUCCESS,
|
||||
INCOMPLETE,
|
||||
|
@ -29,7 +29,7 @@ struct unused_t;
|
||||
* because of the sheer number of usages of already_AddRefed.
|
||||
*/
|
||||
template<class T>
|
||||
struct MOZ_MUST_USE MOZ_NON_AUTOABLE already_AddRefed
|
||||
struct MOZ_MUST_USE_TYPE MOZ_NON_AUTOABLE already_AddRefed
|
||||
{
|
||||
/*
|
||||
* We want to allow returning nullptr from functions returning
|
||||
|
@ -508,9 +508,9 @@
|
||||
* function. This is intended to be used with operator->() of our smart
|
||||
* pointer classes to ensure that the refcount of an object wrapped in a
|
||||
* smart pointer is not manipulated directly.
|
||||
* MOZ_MUST_USE: Applies to type declarations. Makes it a compile time error to not
|
||||
* use the return value of a function which has this type. This is intended to be
|
||||
* used with types which it is an error to not use.
|
||||
* MOZ_MUST_USE_TYPE: Applies to type declarations. Makes it a compile time
|
||||
* error to not use the return value of a function which has this type. This
|
||||
* is intended to be used with types which it is an error to not use.
|
||||
* MOZ_NEEDS_NO_VTABLE_TYPE: Applies to template class declarations. Makes it
|
||||
* a compile time error to instantiate this template with a type parameter which
|
||||
* has a VTable.
|
||||
@ -526,7 +526,7 @@
|
||||
* MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS: Applies to template class
|
||||
* declarations where an instance of the template should be considered, for
|
||||
* static analysis purposes, to inherit any type annotations (such as
|
||||
* MOZ_MUST_USE and MOZ_STACK_CLASS) from its template arguments.
|
||||
* MOZ_MUST_USE_TYPE and MOZ_STACK_CLASS) from its template arguments.
|
||||
* MOZ_NON_AUTOABLE: Applies to class declarations. Makes it a compile time error to
|
||||
* use `auto` in place of this type in variable declarations. This is intended to
|
||||
* be used with types which are intended to be implicitly constructed into other
|
||||
@ -552,7 +552,7 @@
|
||||
# define MOZ_NON_OWNING_REF __attribute__((annotate("moz_weak_ref")))
|
||||
# define MOZ_UNSAFE_REF(reason) __attribute__((annotate("moz_weak_ref")))
|
||||
# define MOZ_NO_ADDREF_RELEASE_ON_RETURN __attribute__((annotate("moz_no_addref_release_on_return")))
|
||||
# define MOZ_MUST_USE __attribute__((annotate("moz_must_use")))
|
||||
# define MOZ_MUST_USE_TYPE __attribute__((annotate("moz_must_use_type")))
|
||||
# define MOZ_NEEDS_NO_VTABLE_TYPE __attribute__((annotate("moz_needs_no_vtable_type")))
|
||||
# define MOZ_NON_MEMMOVABLE __attribute__((annotate("moz_non_memmovable")))
|
||||
# define MOZ_NEEDS_MEMMOVABLE_TYPE __attribute__((annotate("moz_needs_memmovable_type")))
|
||||
@ -585,7 +585,7 @@
|
||||
# define MOZ_NON_OWNING_REF /* nothing */
|
||||
# define MOZ_UNSAFE_REF(reason) /* nothing */
|
||||
# define MOZ_NO_ADDREF_RELEASE_ON_RETURN /* nothing */
|
||||
# define MOZ_MUST_USE /* nothing */
|
||||
# define MOZ_MUST_USE_TYPE /* nothing */
|
||||
# define MOZ_NEEDS_NO_VTABLE_TYPE /* nothing */
|
||||
# define MOZ_NON_MEMMOVABLE /* nothing */
|
||||
# define MOZ_NEEDS_MEMMOVABLE_TYPE /* nothing */
|
||||
|
Loading…
x
Reference in New Issue
Block a user