diff --git a/Zend/Optimizer/dce.c b/Zend/Optimizer/dce.c index 7bb5020c5a5..4aca34c943c 100644 --- a/Zend/Optimizer/dce.c +++ b/Zend/Optimizer/dce.c @@ -22,7 +22,6 @@ #include "Optimizer/zend_ssa.h" #include "Optimizer/zend_func_info.h" #include "Optimizer/zend_call_graph.h" -#include "zend_arena.h" #include "zend_bitset.h" /* This pass implements a form of dead code elimination (DCE). The algorithm optimistically assumes diff --git a/Zend/Optimizer/sccp.c b/Zend/Optimizer/sccp.c index 45ae7627376..9373ad2adc6 100644 --- a/Zend/Optimizer/sccp.c +++ b/Zend/Optimizer/sccp.c @@ -18,11 +18,8 @@ */ #include "zend_API.h" -#include "zend_arena.h" -#include "zend_multiply.h" // for zend_safe_address_guarded() #include "zend_exceptions.h" #include "zend_ini.h" -#include "zend_optimizer.h" #include "zend_type_info.h" #include "Optimizer/zend_optimizer_internal.h" #include "Optimizer/zend_call_graph.h" diff --git a/Zend/Optimizer/scdf.c b/Zend/Optimizer/scdf.c index fb7337a1009..54925e8287b 100644 --- a/Zend/Optimizer/scdf.c +++ b/Zend/Optimizer/scdf.c @@ -16,9 +16,8 @@ +----------------------------------------------------------------------+ */ -#include "Optimizer/scdf.h" #include "Optimizer/zend_optimizer_internal.h" -#include "zend_arena.h" +#include "Optimizer/scdf.h" /* This defines a generic framework for sparse conditional dataflow propagation. The algorithm is * based on "Sparse conditional constant propagation" by Wegman and Zadeck. We're using a diff --git a/Zend/Optimizer/scdf.h b/Zend/Optimizer/scdf.h index f72b2ca151f..840a99065bc 100644 --- a/Zend/Optimizer/scdf.h +++ b/Zend/Optimizer/scdf.h @@ -20,11 +20,6 @@ #define _SCDF_H #include "zend_bitset.h" -#include "zend_long.h" -#include "zend_ssa.h" - -typedef struct _zend_op_array zend_op_array; -typedef struct _zend_optimizer_ctx zend_optimizer_ctx; typedef struct _scdf_ctx { zend_op_array *op_array; diff --git a/Zend/Optimizer/zend_call_graph.c b/Zend/Optimizer/zend_call_graph.c index 70342c06547..c2b7b00cbee 100644 --- a/Zend/Optimizer/zend_call_graph.c +++ b/Zend/Optimizer/zend_call_graph.c @@ -16,11 +16,15 @@ +----------------------------------------------------------------------+ */ -#include "zend_call_graph.h" -#include "zend_arena.h" -#include "zend_bitset.h" -#include "zend_func_info.h" +#include "zend_compile.h" +#include "zend_extensions.h" +#include "Optimizer/zend_optimizer.h" #include "zend_optimizer_internal.h" +#include "zend_inference.h" +#include "zend_call_graph.h" +#include "zend_func_info.h" +#include "zend_inference.h" +#include "zend_call_graph.h" static void zend_op_array_calc(zend_op_array *op_array, void *context) { diff --git a/Zend/Optimizer/zend_call_graph.h b/Zend/Optimizer/zend_call_graph.h index 7dd6430dd4e..5b1634d561d 100644 --- a/Zend/Optimizer/zend_call_graph.h +++ b/Zend/Optimizer/zend_call_graph.h @@ -20,9 +20,8 @@ #define ZEND_CALL_GRAPH_H #include "zend_ssa.h" - -typedef struct _zend_func_info zend_func_info; -typedef struct _zend_call_info zend_call_info; +#include "zend_func_info.h" +#include "zend_optimizer.h" typedef struct _zend_send_arg_info { zend_op *opline; diff --git a/Zend/Optimizer/zend_cfg.c b/Zend/Optimizer/zend_cfg.c index e99051542c4..6d538f71316 100644 --- a/Zend/Optimizer/zend_cfg.c +++ b/Zend/Optimizer/zend_cfg.c @@ -16,12 +16,13 @@ +----------------------------------------------------------------------+ */ +#include "zend_compile.h" #include "zend_cfg.h" -#include "zend_func_info.h" // for ZEND_FUNC_FREE_LOOP_VAR -#include "zend_globals.h" // struct _zend_executor_globals -#include "zend_globals_macros.h" // for EG() -#include "zend_optimizer_internal.h" +#include "zend_func_info.h" #include "zend_worklist.h" +#include "zend_optimizer.h" +#include "zend_optimizer_internal.h" +#include "zend_sort.h" static void zend_mark_reachable(zend_op *opcodes, zend_cfg *cfg, zend_basic_block *b) /* {{{ */ { diff --git a/Zend/Optimizer/zend_cfg.h b/Zend/Optimizer/zend_cfg.h index cf0a591b363..93d45506068 100644 --- a/Zend/Optimizer/zend_cfg.h +++ b/Zend/Optimizer/zend_cfg.h @@ -19,13 +19,6 @@ #ifndef ZEND_CFG_H #define ZEND_CFG_H -#include "zend_portability.h" // for BEGIN_EXTERN_C - -#include - -typedef struct _zend_arena zend_arena; -typedef struct _zend_op_array zend_op_array; - /* zend_basic_block.flags */ #define ZEND_BB_START (1<<0) /* first block */ #define ZEND_BB_FOLLOW (1<<1) /* follows the next block */ diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index 532e8985688..1aeaa02f7b3 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -16,15 +16,13 @@ +----------------------------------------------------------------------+ */ +#include "zend_compile.h" +#include "zend_generators.h" #include "zend_inference.h" -#include "zend_closures.h" // for zend_ce_closure -#include "zend_generators.h" // for zend_ce_generator #include "zend_func_info.h" -#include "zend_globals.h" // struct _zend_executor_globals -#include "zend_globals_macros.h" // for EG() #include "zend_call_graph.h" +#include "zend_closures.h" #include "zend_worklist.h" -#include "zend_optimizer.h" #include "zend_optimizer_internal.h" /* The used range inference algorithm is described in: diff --git a/Zend/Optimizer/zend_inference.h b/Zend/Optimizer/zend_inference.h index 65b48ee6a86..f27c5ecdc48 100644 --- a/Zend/Optimizer/zend_inference.h +++ b/Zend/Optimizer/zend_inference.h @@ -19,11 +19,12 @@ #ifndef ZEND_INFERENCE_H #define ZEND_INFERENCE_H -#include "zend_cfg.h" // for CRT_CONSTANT() -#include "zend_compile.h" // for struct _zend_op -#include "zend_portability.h" // for BEGIN_EXTERN_C +#include "zend_optimizer.h" #include "zend_ssa.h" -#include "zend_type_info.h" // for MAY_BE_* +#include "zend_bitset.h" + +/* Bitmask for type inference (zend_ssa_var_info.type) */ +#include "zend_type_info.h" #define MAY_BE_PACKED_GUARD (1<<27) /* needs packed array guard */ #define MAY_BE_CLASS_GUARD (1<<27) /* needs class guard */ diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c index dcbb355ff99..b5841159bf1 100644 --- a/Zend/Optimizer/zend_optimizer.c +++ b/Zend/Optimizer/zend_optimizer.c @@ -21,16 +21,17 @@ #include "Optimizer/zend_optimizer.h" #include "Optimizer/zend_optimizer_internal.h" -#include "php_globals.h" // for PG() -#include "zend_API.h" // for ZVAL_EMPTY_STRING() -#include "zend_arena.h" -#include "zend_call_graph.h" // for struct _zend_func_info -#include "zend_dump.h" // for zend_dump_op_array() -#include "zend_inference.h" // for OP1_INFO(), ... -#include "zend_ini.h" -#include "zend_observer.h" -#include "zend_virtual_cwd.h" //for IS_ABSOLUTE_PATH() +#include "zend_API.h" +#include "zend_constants.h" +#include "zend_execute.h" #include "zend_vm.h" +#include "zend_cfg.h" +#include "zend_func_info.h" +#include "zend_call_graph.h" +#include "zend_inference.h" +#include "zend_dump.h" +#include "php.h" +#include "zend_observer.h" #ifndef ZEND_OPTIMIZER_MAX_REGISTERED_PASSES # define ZEND_OPTIMIZER_MAX_REGISTERED_PASSES 32 diff --git a/Zend/Optimizer/zend_optimizer.h b/Zend/Optimizer/zend_optimizer.h index ae794b1ae66..16bfd75520d 100644 --- a/Zend/Optimizer/zend_optimizer.h +++ b/Zend/Optimizer/zend_optimizer.h @@ -22,11 +22,8 @@ #ifndef ZEND_OPTIMIZER_H #define ZEND_OPTIMIZER_H -#include "zend_compile.h" // for zend_op_array -#include "zend_hash.h" -#include "zend_portability.h" // for BEGIN_EXTERN_C - -typedef struct _zend_string zend_string; +#include "zend.h" +#include "zend_compile.h" #define ZEND_OPTIMIZER_PASS_1 (1<<0) /* Simple local optimizations */ #define ZEND_OPTIMIZER_PASS_2 (1<<1) /* */ diff --git a/Zend/Optimizer/zend_ssa.c b/Zend/Optimizer/zend_ssa.c index 84f0d4d260f..67165a9b26d 100644 --- a/Zend/Optimizer/zend_ssa.c +++ b/Zend/Optimizer/zend_ssa.c @@ -17,13 +17,12 @@ +----------------------------------------------------------------------+ */ -#include "zend_ssa.h" -#include "zend_arena.h" -#include "zend_optimizer_internal.h" +#include "zend_compile.h" #include "zend_dfg.h" +#include "zend_ssa.h" #include "zend_dump.h" -#include "zend_inference.h" // for zend_sub_will_overflow() -#include "zend_type_info.h" // for MAY_BE_REF +#include "zend_inference.h" +#include "Optimizer/zend_optimizer_internal.h" static bool dominates(const zend_basic_block *blocks, int a, int b) { while (blocks[b].level > blocks[a].level) { diff --git a/Zend/Optimizer/zend_ssa.h b/Zend/Optimizer/zend_ssa.h index 035cce5cae2..9fde352c79c 100644 --- a/Zend/Optimizer/zend_ssa.h +++ b/Zend/Optimizer/zend_ssa.h @@ -19,14 +19,8 @@ #ifndef ZEND_SSA_H #define ZEND_SSA_H +#include "zend_optimizer.h" #include "zend_cfg.h" -#include "zend_compile.h" // for struct _zend_op -#include "zend_long.h" -#include "zend_portability.h" // for BEGIN_EXTERN_C -#include "zend_types.h" // for zend_result - -typedef struct _zend_class_entry zend_class_entry; -typedef struct _zend_script zend_script; typedef struct _zend_ssa_range { zend_long min; diff --git a/Zend/zend_arena.h b/Zend/zend_arena.h index 45ef617cf19..a44082e52fb 100644 --- a/Zend/zend_arena.h +++ b/Zend/zend_arena.h @@ -19,10 +19,7 @@ #ifndef _ZEND_ARENA_H_ #define _ZEND_ARENA_H_ -#include "zend_multiply.h" // for zend_safe_address() -#include "zend.h" // for zend_error() - -#include // for size_t +#include "zend.h" #ifndef ZEND_TRACK_ARENA_ALLOC diff --git a/Zend/zend_bitset.h b/Zend/zend_bitset.h index 0a573852a49..fdb6ab79a1e 100644 --- a/Zend/zend_bitset.h +++ b/Zend/zend_bitset.h @@ -19,13 +19,6 @@ #ifndef _ZEND_BITSET_H_ #define _ZEND_BITSET_H_ -#include "zend_portability.h" // for zend_always_inline - -#include "zend_long.h" - -#include -#include - typedef zend_ulong *zend_bitset; #define ZEND_BITSET_ELM_SIZE sizeof(zend_ulong) diff --git a/Zend/zend_build.h b/Zend/zend_build.h index 795f2fa9fd5..c604fb311a7 100644 --- a/Zend/zend_build.h +++ b/Zend/zend_build.h @@ -19,12 +19,6 @@ #ifndef ZEND_BUILD_H #define ZEND_BUILD_H -#ifdef PHP_WIN32 -#include "config.w32.h" -#else -#include "php_config.h" -#endif - #define ZEND_TOSTR_(x) #x #define ZEND_TOSTR(x) ZEND_TOSTR_(x) diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c index 4e6fe95917d..1f3687642ab 100644 --- a/Zend/zend_extensions.c +++ b/Zend/zend_extensions.c @@ -18,10 +18,7 @@ */ #include "zend_extensions.h" -#include "zend_arena.h" -#include "zend_globals.h" // for struct _zend_compiler_globals -#include "zend_globals_macros.h" // for CG() -#include "zend_system_id.h" // for zend_add_system_entropy() +#include "zend_system_id.h" ZEND_API zend_llist zend_extensions; ZEND_API uint32_t zend_extension_flags = 0; diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h index ff28a14509a..14ba9054d9b 100644 --- a/Zend/zend_extensions.h +++ b/Zend/zend_extensions.h @@ -20,15 +20,8 @@ #ifndef ZEND_EXTENSIONS_H #define ZEND_EXTENSIONS_H -#include "zend_build.h" // for ZEND_TOSTR() -#include "zend_portability.h" // for BEGIN_EXTERN_C -#include "zend_types.h" // for zend_result - -#include // for size_t - -typedef struct _zend_execute_data zend_execute_data; -typedef struct _zend_op_array zend_op_array; -typedef struct _zend_llist zend_llist; +#include "zend_compile.h" +#include "zend_build.h" /* The constants below are derived from ext/opcache/ZendAccelerator.h diff --git a/Zend/zend_float.c b/Zend/zend_float.c index ca2ed83282d..90af0c4a5f9 100644 --- a/Zend/zend_float.c +++ b/Zend/zend_float.c @@ -16,9 +16,9 @@ +----------------------------------------------------------------------+ */ +#include "zend.h" +#include "zend_compile.h" #include "zend_float.h" -#include "zend_globals.h" // struct _zend_executor_globals -#include "zend_globals_macros.h" // for EG() ZEND_API void zend_init_fpu(void) /* {{{ */ { diff --git a/Zend/zend_float.h b/Zend/zend_float.h index d4d67592a5f..c8e91122a35 100644 --- a/Zend/zend_float.h +++ b/Zend/zend_float.h @@ -19,8 +19,6 @@ #ifndef ZEND_FLOAT_H #define ZEND_FLOAT_H -#include "zend_portability.h" // for BEGIN_EXTERN_C - BEGIN_EXTERN_C() /* diff --git a/Zend/zend_long.h b/Zend/zend_long.h index f2d3ee81bd6..3796f1c5aba 100644 --- a/Zend/zend_long.h +++ b/Zend/zend_long.h @@ -19,12 +19,6 @@ #ifndef ZEND_LONG_H #define ZEND_LONG_H -#ifdef PHP_WIN32 -#include "config.w32.h" -#else -#include "php_config.h" // for SIZEOF_SIZE_T -#endif - #include #include diff --git a/Zend/zend_map_ptr.h b/Zend/zend_map_ptr.h index 0ab1a357eec..aa726e0cdd3 100644 --- a/Zend/zend_map_ptr.h +++ b/Zend/zend_map_ptr.h @@ -19,7 +19,7 @@ #ifndef ZEND_MAP_PTR_H #define ZEND_MAP_PTR_H -#include "zend_portability.h" // for BEGIN_EXTERN_C +#include "zend_portability.h" #define ZEND_MAP_PTR_KIND_PTR 0 #define ZEND_MAP_PTR_KIND_PTR_OR_OFFSET 1 @@ -69,8 +69,6 @@ # error "Unknown ZEND_MAP_PTR_KIND" #endif -typedef struct _zend_string zend_string; - BEGIN_EXTERN_C() ZEND_API void zend_map_ptr_reset(void); diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h index 417ee9990a8..a99e858bd77 100644 --- a/Zend/zend_multiply.h +++ b/Zend/zend_multiply.h @@ -17,12 +17,11 @@ +----------------------------------------------------------------------+ */ +#include "zend_portability.h" + #ifndef ZEND_MULTIPLY_H #define ZEND_MULTIPLY_H -#include "zend_portability.h" -#include "zend.h" // for zend_error_noreturn() - #if PHP_HAVE_BUILTIN_SMULL_OVERFLOW && SIZEOF_LONG == SIZEOF_ZEND_LONG #define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index 41b89d1d86b..8e11841ad26 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -19,11 +19,9 @@ +----------------------------------------------------------------------+ */ +#include "zend.h" +#include "zend_compile.h" #include "zend_stream.h" -#include "zend_globals.h" // struct _zend_compiler_globals -#include "zend_globals_macros.h" // for CG() -#include "zend_string.h" -#include "zend.h" // for zend_stream_open_function ZEND_DLIMPORT int isatty(int fd); diff --git a/Zend/zend_stream.h b/Zend/zend_stream.h index 22541bf8d92..047719e175a 100644 --- a/Zend/zend_stream.h +++ b/Zend/zend_stream.h @@ -22,16 +22,9 @@ #ifndef ZEND_STREAM_H #define ZEND_STREAM_H -#include "zend_portability.h" // for BEGIN_EXTERN_C -#include "zend_types.h" // for zend_uchar - -#include -#include // for FILE -#include // for ssize_t +#include #include -typedef struct _zend_string zend_string; - /* Lightweight stream implementation for the ZE scanners. * These functions are private to the engine. * */ diff --git a/Zend/zend_system_id.c b/Zend/zend_system_id.c index deb3e27823e..8390bba8b0f 100644 --- a/Zend/zend_system_id.c +++ b/Zend/zend_system_id.c @@ -15,10 +15,11 @@ +----------------------------------------------------------------------+ */ +#include "php.h" #include "zend_system_id.h" -#include "zend_extensions.h" // for ZEND_EXTENSION_BUILD_ID +#include "zend_extensions.h" #include "ext/standard/md5.h" -#include "ext/hash/php_hash.h" // for php_hash_bin2hex() +#include "ext/hash/php_hash.h" ZEND_API char zend_system_id[32]; diff --git a/Zend/zend_system_id.h b/Zend/zend_system_id.h index 3c008637694..60514e15a09 100644 --- a/Zend/zend_system_id.h +++ b/Zend/zend_system_id.h @@ -17,9 +17,6 @@ #ifndef ZEND_SYSTEM_ID_H #define ZEND_SYSTEM_ID_H -#include "zend_portability.h" // for BEGIN_EXTERN_C -#include "zend_types.h" // for ZEND_RESULT_CODE - BEGIN_EXTERN_C() /* True global; Write-only during MINIT/startup */ extern ZEND_API char zend_system_id[32]; diff --git a/Zend/zend_types.h b/Zend/zend_types.h index 888c35482a4..e6505d8b62a 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -24,8 +24,6 @@ #include "zend_portability.h" #include "zend_long.h" -#include "zend_type_info.h" // for MAY_BE_* - #include #ifdef __SSE2__ diff --git a/ext/opcache/zend_accelerator_hash.c b/ext/opcache/zend_accelerator_hash.c index 2354409fd51..676ed32ce8f 100644 --- a/ext/opcache/zend_accelerator_hash.c +++ b/ext/opcache/zend_accelerator_hash.c @@ -19,7 +19,9 @@ +----------------------------------------------------------------------+ */ +#include "ZendAccelerator.h" #include "zend_accelerator_hash.h" +#include "zend_hash.h" #include "zend_shared_alloc.h" /* Generated on an Octa-ALPHA 300MHz CPU & 2.5GB RAM monster */ diff --git a/ext/opcache/zend_accelerator_hash.h b/ext/opcache/zend_accelerator_hash.h index c868427491e..755d3f13ec5 100644 --- a/ext/opcache/zend_accelerator_hash.h +++ b/ext/opcache/zend_accelerator_hash.h @@ -22,12 +22,7 @@ #ifndef ZEND_ACCELERATOR_HASH_H #define ZEND_ACCELERATOR_HASH_H -#include "zend_long.h" -#include "zend_portability.h" // for BEGIN_EXTERN_C - -#include - -typedef struct _zend_string zend_string; +#include "zend.h" /* zend_accel_hash - is a hash table allocated in shared memory and diff --git a/ext/standard/md5.c b/ext/standard/md5.c index b7cff21d024..899ff6aaeec 100644 --- a/ext/standard/md5.c +++ b/ext/standard/md5.c @@ -16,6 +16,7 @@ +----------------------------------------------------------------------+ */ +#include "php.h" #include "md5.h" PHPAPI void make_digest(char *md5str, const unsigned char *digest) /* {{{ */ diff --git a/ext/standard/md5.h b/ext/standard/md5.h index 5814142f196..0003a934be6 100644 --- a/ext/standard/md5.h +++ b/ext/standard/md5.h @@ -18,10 +18,6 @@ #ifndef MD5_H #define MD5_H -#include "php.h" // for PHPAPI - -#include - PHPAPI void make_digest(char *md5str, const unsigned char *digest); PHPAPI void make_digest_ex(char *md5str, const unsigned char *digest, int len); diff --git a/main/php_globals.h b/main/php_globals.h index 9a9653f4c1e..cbf0271c7b7 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -17,7 +17,6 @@ #ifndef PHP_GLOBALS_H #define PHP_GLOBALS_H -#include "php.h" // for PHPAPI #include "zend_globals.h" typedef struct _php_core_globals php_core_globals;