diff options
author | Faisal Abbas <90.abbasfaisal@gmail.com> | 2022-07-30 18:24:42 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-08-25 12:40:26 +0100 |
commit | 266891d17c751d104d8c75e0258cf1b462756ad9 (patch) | |
tree | 15b7600afa59e77cca4105cf859d066f961e3e30 /gcc/rust/backend/rust-tree.h | |
parent | fdbe92d898f11a4d395b5ee9a547707675edf442 (diff) | |
download | gcc-266891d17c751d104d8c75e0258cf1b462756ad9.zip gcc-266891d17c751d104d8c75e0258cf1b462756ad9.tar.gz gcc-266891d17c751d104d8c75e0258cf1b462756ad9.tar.bz2 |
rust-constexpr.cc: port VIEW_CONVERT_EXPR and CONVERT_EXPR cases to
eval_constant_expression(). Throws away code under UNARY_PLUS_EXPR
and PTRMEM_CST as those tree codes come from cp-tree.def.
Diffstat (limited to 'gcc/rust/backend/rust-tree.h')
-rw-r--r-- | gcc/rust/backend/rust-tree.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-tree.h b/gcc/rust/backend/rust-tree.h index b7c4676..d4b7d86 100644 --- a/gcc/rust/backend/rust-tree.h +++ b/gcc/rust/backend/rust-tree.h @@ -1248,6 +1248,21 @@ extern GTY (()) tree cp_global_trees[CPTI_MAX]; are not constexprs. Other NOP_EXPRs are. */ #define REINTERPRET_CAST_P(NODE) TREE_LANG_FLAG_0 (NOP_EXPR_CHECK (NODE)) +/* Returns true if NODE is an object type: + + [basic.types] + + An object type is a (possibly cv-qualified) type that is not a + function type, not a reference type, and not a void type. + + Keep these checks in ascending order, for speed. */ +#define TYPE_OBJ_P(NODE) \ + (!TYPE_REF_P (NODE) && !VOID_TYPE_P (NODE) && !FUNC_OR_METHOD_TYPE_P (NODE)) + +/* Returns true if NODE is a pointer to an object. Keep these checks + in ascending tree code order. */ +#define TYPE_PTROB_P(NODE) (TYPE_PTR_P (NODE) && TYPE_OBJ_P (TREE_TYPE (NODE))) + #if defined ENABLE_TREE_CHECKING #define LANG_DECL_MIN_CHECK(NODE) \ @@ -2582,6 +2597,8 @@ extern bool require_deduced_type (tree, tsubst_flags_t = tf_warning_or_error); extern bool decl_constant_var_p (tree); +extern tree build_new_constexpr_heap_type (tree, tree, tree); + // forked from gcc/cp/cp-tree.h enum |