diff options
Diffstat (limited to 'gcc/cp/rtti.c')
-rw-r--r-- | gcc/cp/rtti.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index b6a9a2e..e83d666 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -173,7 +173,7 @@ build_headof (tree exp) tree offset; tree index; - gcc_assert (TREE_CODE (type) == POINTER_TYPE); + gcc_assert (TYPE_PTR_P (type)); type = TREE_TYPE (type); if (!TYPE_POLYMORPHIC_P (type)) @@ -327,7 +327,7 @@ build_typeid (tree exp, tsubst_flags_t complain) /* FIXME when integrating with c_fully_fold, mark resolves_to_fixed_type_p case as a non-constant expression. */ if (INDIRECT_REF_P (exp) - && TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == POINTER_TYPE + && TYPE_PTR_P (TREE_TYPE (TREE_OPERAND (exp, 0))) && TYPE_POLYMORPHIC_P (TREE_TYPE (exp)) && ! resolves_to_fixed_type_p (exp, &nonnull) && ! nonnull) @@ -528,7 +528,7 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain) switch (tc) { case POINTER_TYPE: - if (TREE_CODE (TREE_TYPE (type)) == VOID_TYPE) + if (VOID_TYPE_P (TREE_TYPE (type))) break; /* Fall through. */ case REFERENCE_TYPE: @@ -559,7 +559,7 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain) expr = mark_rvalue_use (expr); - if (TREE_CODE (exprtype) != POINTER_TYPE) + if (!TYPE_PTR_P (exprtype)) { errstr = _("source is not a pointer"); goto fail; @@ -620,7 +620,7 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain) { expr = build_base_path (PLUS_EXPR, convert_from_reference (expr), binfo, 0, complain); - if (TREE_CODE (exprtype) == POINTER_TYPE) + if (TYPE_PTR_P (exprtype)) expr = rvalue (expr); return expr; } @@ -822,7 +822,7 @@ target_incomplete_p (tree type) return true; type = TYPE_PTRMEM_POINTED_TO_TYPE (type); } - else if (TREE_CODE (type) == POINTER_TYPE) + else if (TYPE_PTR_P (type)) type = TREE_TYPE (type); else return !COMPLETE_OR_VOID_TYPE_P (type); @@ -1053,7 +1053,7 @@ typeinfo_in_lib_p (tree type) { /* The typeinfo objects for `T*' and `const T*' are in the runtime library for simple types T. */ - if (TREE_CODE (type) == POINTER_TYPE + if (TYPE_PTR_P (type) && (cp_type_quals (TREE_TYPE (type)) == TYPE_QUAL_CONST || cp_type_quals (TREE_TYPE (type)) == TYPE_UNQUALIFIED)) type = TREE_TYPE (type); |