Skip to content

Commit 3bb462b

Browse files
committed
Rename macros from HAS to IS
1 parent 94599a6 commit 3bb462b

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

Zend/zend_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ zend_string *zend_type_to_string_resolved(zend_type type, zend_class_entry *scop
11991199

12001200
if (ZEND_TYPE_HAS_LIST(type)) {
12011201
zend_type *list_type;
1202-
bool is_intersection = ZEND_TYPE_HAS_INTERSECTION(type);
1202+
bool is_intersection = ZEND_TYPE_IS_INTERSECTION(type);
12031203
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(type), list_type) {
12041204
if (ZEND_TYPE_HAS_CE(*list_type)) {
12051205
str = add_type_string(str, ZEND_TYPE_CE(*list_type)->name, is_intersection);

Zend/zend_execute.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ static bool zend_check_and_resolve_property_class_type(
851851
zend_class_entry *ce;
852852
if (ZEND_TYPE_HAS_LIST(info->type)) {
853853
zend_type *list_type;
854-
bool has_intersection = ZEND_TYPE_HAS_INTERSECTION(info->type);
854+
bool has_intersection = ZEND_TYPE_IS_INTERSECTION(info->type);
855855

856856
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(info->type), list_type) {
857857
if (ZEND_TYPE_HAS_NAME(*list_type)) {
@@ -999,7 +999,7 @@ static zend_always_inline bool zend_check_type_slow(
999999
if (ZEND_TYPE_HAS_LIST(*type)) {
10001000
zend_type *list_type;
10011001

1002-
if (ZEND_TYPE_HAS_INTERSECTION(*type)) {
1002+
if (ZEND_TYPE_IS_INTERSECTION(*type)) {
10031003
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(*type), list_type) {
10041004
/* Fetch class_entry */
10051005
if (HAVE_CACHE_SLOT && *cache_slot) {

Zend/zend_inheritance.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ static inheritance_status zend_perform_covariant_type_check(
546546

547547
/* For intersection types loop over the parent types first as a child
548548
* can add them */
549-
if (ZEND_TYPE_HAS_INTERSECTION(proto_type) || ZEND_TYPE_HAS_INTERSECTION(fe_type)) {
549+
if (ZEND_TYPE_IS_INTERSECTION(proto_type) || ZEND_TYPE_IS_INTERSECTION(fe_type)) {
550550
/* First try to check whether we can succeed without resolving anything */
551551
ZEND_TYPE_FOREACH(proto_type, single_type) {
552552
inheritance_status status;
@@ -577,7 +577,7 @@ static inheritance_status zend_perform_covariant_type_check(
577577
}
578578
} ZEND_TYPE_FOREACH_END();
579579
}
580-
/* if (ZEND_TYPE_HAS_UNION(fe_type) || ZEND_TYPE_HAS_UNION(proto_type)) */
580+
/* if (ZEND_TYPE_IS_UNION(fe_type) || ZEND_TYPE_IS_UNION(proto_type)) */
581581
else {
582582
/* First try to check whether we can succeed without resolving anything */
583583
ZEND_TYPE_FOREACH(fe_type, single_type) {
@@ -612,7 +612,7 @@ static inheritance_status zend_perform_covariant_type_check(
612612
}
613613

614614
/* Register all classes that may have to be resolved */
615-
if (ZEND_TYPE_HAS_INTERSECTION(proto_type)) {
615+
if (ZEND_TYPE_IS_INTERSECTION(proto_type)) {
616616
// TODO Register intersection type classes
617617
} else {
618618
ZEND_TYPE_FOREACH(fe_type, single_type) {

Zend/zend_types.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,9 @@ typedef struct {
149149
#define _ZEND_TYPE_CACHE_BIT (1u << 21)
150150
/* Whether the type list is arena allocated */
151151
#define _ZEND_TYPE_ARENA_BIT (1u << 20)
152-
/* Whether the type list has an intersection type,
153-
* or the single type is part of an intersection type */
152+
/* Whether the type list is an intersection type */
154153
#define _ZEND_TYPE_INTERSECTION_BIT (1u << 19)
155-
/* Whether the type list has a union type */
154+
/* Whether the type is a union type */
156155
#define _ZEND_TYPE_UNION_BIT (1u << 18)
157156
/* Type mask excluding the flags above. */
158157
#define _ZEND_TYPE_MAY_BE_MASK ((1u << 18) - 1)
@@ -176,10 +175,10 @@ typedef struct {
176175
#define ZEND_TYPE_HAS_LIST(t) \
177176
((((t).type_mask) & _ZEND_TYPE_LIST_BIT) != 0)
178177

179-
#define ZEND_TYPE_HAS_INTERSECTION(t) \
178+
#define ZEND_TYPE_IS_INTERSECTION(t) \
180179
((((t).type_mask) & _ZEND_TYPE_INTERSECTION_BIT) != 0)
181180

182-
#define ZEND_TYPE_HAS_UNION(t) \
181+
#define ZEND_TYPE_IS_UNION(t) \
183182
((((t).type_mask) & _ZEND_TYPE_UNION_BIT) != 0)
184183

185184
#define ZEND_TYPE_HAS_CE_CACHE(t) \

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ static zend_always_inline bool zend_jit_verify_type_common(zval *arg, zend_arg_i
13451345
zend_class_entry *ce;
13461346
if (ZEND_TYPE_HAS_LIST(arg_info->type)) {
13471347
zend_type *list_type;
1348-
if (ZEND_TYPE_HAS_INTERSECTION(arg_info->type)) {
1348+
if (ZEND_TYPE_IS_INTERSECTION(arg_info->type)) {
13491349
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(arg_info->type), list_type) {
13501350
/* Fetch class_entry */
13511351
if (*cache_slot) {

ext/reflection/php_reflection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,10 +1339,10 @@ static reflection_type_kind get_type_kind(zend_type type) {
13391339
uint32_t type_mask_without_null = ZEND_TYPE_PURE_MASK_WITHOUT_NULL(type);
13401340

13411341
if (ZEND_TYPE_HAS_LIST(type)) {
1342-
if (ZEND_TYPE_HAS_INTERSECTION(type)) {
1342+
if (ZEND_TYPE_IS_INTERSECTION(type)) {
13431343
return INTERSECTION_TYPE;
13441344
}
1345-
ZEND_ASSERT(ZEND_TYPE_HAS_UNION(type));
1345+
ZEND_ASSERT(ZEND_TYPE_IS_UNION(type));
13461346
return UNION_TYPE;
13471347
}
13481348

0 commit comments

Comments
 (0)