Skip to content

Commit 15a38d7

Browse files
committed
Rename macros from HAS to IS
1 parent fda520d commit 15a38d7

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
@@ -853,7 +853,7 @@ static bool zend_check_and_resolve_property_class_type(
853853
if (ZEND_TYPE_HAS_LIST(info->type)) {
854854
zend_type *list_type;
855855

856-
if (ZEND_TYPE_HAS_INTERSECTION(info->type)) {
856+
if (ZEND_TYPE_IS_INTERSECTION(info->type)) {
857857
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(info->type), list_type) {
858858
if (ZEND_TYPE_HAS_NAME(*list_type)) {
859859
zend_string *name = ZEND_TYPE_NAME(*list_type);
@@ -1027,7 +1027,7 @@ static zend_always_inline bool zend_check_type_slow(
10271027
zend_class_entry *ce;
10281028
if (UNEXPECTED(ZEND_TYPE_HAS_LIST(*type))) {
10291029
zend_type *list_type;
1030-
if (ZEND_TYPE_HAS_INTERSECTION(*type)) {
1030+
if (ZEND_TYPE_IS_INTERSECTION(*type)) {
10311031
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(*type), list_type) {
10321032
if (HAVE_CACHE_SLOT && *cache_slot) {
10331033
ce = *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
@@ -148,10 +148,9 @@ typedef struct {
148148
/* TODO: bit 21 is not used */
149149
/* Whether the type list is arena allocated */
150150
#define _ZEND_TYPE_ARENA_BIT (1u << 20)
151-
/* Whether the type list has an intersection type,
152-
* or the single type is part of an intersection type */
151+
/* Whether the type list is an intersection type */
153152
#define _ZEND_TYPE_INTERSECTION_BIT (1u << 19)
154-
/* Whether the type list has a union type */
153+
/* Whether the type is a union type */
155154
#define _ZEND_TYPE_UNION_BIT (1u << 18)
156155
/* Type mask excluding the flags above. */
157156
#define _ZEND_TYPE_MAY_BE_MASK ((1u << 18) - 1)
@@ -175,10 +174,10 @@ typedef struct {
175174
#define ZEND_TYPE_HAS_LIST(t) \
176175
((((t).type_mask) & _ZEND_TYPE_LIST_BIT) != 0)
177176

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

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

184183
#define ZEND_TYPE_USES_ARENA(t) \

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ static zend_always_inline bool zend_jit_verify_type_common(zval *arg, zend_arg_i
13461346
zend_class_entry *ce;
13471347
if (ZEND_TYPE_HAS_LIST(arg_info->type)) {
13481348
zend_type *list_type;
1349-
if (ZEND_TYPE_HAS_INTERSECTION(arg_info->type)) {
1349+
if (ZEND_TYPE_IS_INTERSECTION(arg_info->type)) {
13501350
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(arg_info->type), list_type) {
13511351
if (*cache_slot) {
13521352
ce = *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)