diff options
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 34 |
1 files changed, 30 insertions, 4 deletions
@@ -2994,11 +2994,34 @@ extern void decl_fini_priority_insert (tree, priority_type); #define DECL_IS_MALLOC(NODE) \ (FUNCTION_DECL_CHECK (NODE)->function_decl.malloc_flag) +/* Macro for direct set and get of function_decl.decl_type. */ +#define FUNCTION_DECL_DECL_TYPE(NODE) \ + (NODE->function_decl.decl_type) + +/* Set decl_type of a DECL. Set it to T when SET is true, or reset + it to NONE. */ + +static inline void +set_function_decl_type (tree decl, function_decl_type t, bool set) +{ + if (set) + { + gcc_assert (FUNCTION_DECL_DECL_TYPE (decl) == NONE + || FUNCTION_DECL_DECL_TYPE (decl) == t); + decl->function_decl.decl_type = t; + } + else if (FUNCTION_DECL_DECL_TYPE (decl) == t) + FUNCTION_DECL_DECL_TYPE (decl) = NONE; +} + /* Nonzero in a FUNCTION_DECL means this function should be treated as C++ operator new, meaning that it returns a pointer for which we should not use type based aliasing. */ -#define DECL_IS_OPERATOR_NEW(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->function_decl.operator_new_flag) +#define DECL_IS_OPERATOR_NEW_P(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->function_decl.decl_type == OPERATOR_NEW) + +#define DECL_SET_IS_OPERATOR_NEW(NODE, VAL) \ + set_function_decl_type (FUNCTION_DECL_CHECK (NODE), OPERATOR_NEW, VAL) /* Nonzero in a FUNCTION_DECL means this function may return more than once. */ @@ -3143,8 +3166,11 @@ extern vec<tree, va_gc> **decl_debug_args_insert (tree); (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.cxx_destructor) /* In FUNCTION_DECL, this is set if this function is a lambda function. */ -#define DECL_LAMBDA_FUNCTION(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->function_decl.lambda_function) +#define DECL_LAMBDA_FUNCTION_P(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->function_decl.decl_type == LAMBDA_FUNCTION) + +#define DECL_SET_LAMBDA_FUNCTION(NODE, VAL) \ + set_function_decl_type (FUNCTION_DECL_CHECK (NODE), LAMBDA_FUNCTION, VAL) /* In FUNCTION_DECL that represent an virtual method this is set when the method is final. */ |