Skip to content

Zend/Optimizer/zend_func_info.h: remove forward declarations #10494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Zend/Optimizer/dfa_pass.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "zend_bitset.h"
#include "zend_cfg.h"
#include "zend_ssa.h"
#include "zend_func_info.h"
#include "zend_call_graph.h"
#include "zend_inference.h"
#include "zend_dump.h"
Expand Down
9 changes: 6 additions & 3 deletions Zend/Optimizer/zend_call_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
#define ZEND_CALL_GRAPH_H

#include "zend_ssa.h"
#include "zend_func_info.h"
#include "zend_optimizer.h"

typedef struct _zend_send_arg_info {
zend_op *opline;
} zend_send_arg_info;

typedef struct _zend_call_info zend_call_info;

struct _zend_call_info {
zend_op_array *caller_op_array;
zend_op *caller_init_opline;
Expand All @@ -42,22 +43,24 @@ struct _zend_call_info {
zend_send_arg_info arg_info[1];
};

struct _zend_func_info {
typedef struct _zend_func_info {
int num;
uint32_t flags;
zend_ssa ssa; /* Static Single Assignment Form */
zend_call_info *caller_info; /* where this function is called from */
zend_call_info *callee_info; /* which functions are called from this one */
zend_call_info **call_map; /* Call info associated with init/call/send opnum */
zend_ssa_var_info return_info;
};
} zend_func_info;

typedef struct _zend_call_graph {
int op_arrays_count;
zend_op_array **op_arrays;
zend_func_info *func_infos;
} zend_call_graph;

#include "zend_func_info.h"

BEGIN_EXTERN_C()

ZEND_API void zend_build_call_graph(zend_arena **arena, zend_script *script, zend_call_graph *call_graph);
Expand Down
4 changes: 3 additions & 1 deletion Zend/Optimizer/zend_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@

#include "zend_compile.h"
#include "zend_cfg.h"
#include "zend_func_info.h"
#include "zend_call_graph.h"
#include "zend_worklist.h"
#include "zend_optimizer.h"
#include "zend_optimizer_internal.h"
#include "zend_sort.h"
#include "zend_arena.h"
#include "zend_globals.h"

static void zend_mark_reachable(zend_op *opcodes, zend_cfg *cfg, zend_basic_block *b) /* {{{ */
{
Expand Down
2 changes: 2 additions & 0 deletions Zend/Optimizer/zend_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#ifndef ZEND_CFG_H
#define ZEND_CFG_H

#include "zend_arena.h"

/* zend_basic_block.flags */
#define ZEND_BB_START (1<<0) /* first block */
#define ZEND_BB_FOLLOW (1<<1) /* follows the next block */
Expand Down
1 change: 0 additions & 1 deletion Zend/Optimizer/zend_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "zend_cfg.h"
#include "zend_ssa.h"
#include "zend_inference.h"
#include "zend_func_info.h"
#include "zend_call_graph.h"
#include "zend_dump.h"

Expand Down
4 changes: 0 additions & 4 deletions Zend/Optimizer/zend_func_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
#define ZEND_FUNC_JIT_ON_HOT_COUNTERS (1<<15) /* used by JIT */
#define ZEND_FUNC_JIT_ON_HOT_TRACE (1<<16) /* used by JIT */


typedef struct _zend_func_info zend_func_info;
typedef struct _zend_call_info zend_call_info;

#define ZEND_FUNC_INFO(op_array) \
((zend_func_info*)((op_array)->reserved[zend_func_info_rid]))

Expand Down
2 changes: 1 addition & 1 deletion Zend/Optimizer/zend_inference.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#include "zend_compile.h"
#include "zend_generators.h"
#include "zend_inference.h"
#include "zend_func_info.h"
#include "zend_call_graph.h"
#include "zend_closures.h"
#include "zend_worklist.h"
#include "zend_optimizer_internal.h"
#include "zend_globals.h"

/* The used range inference algorithm is described in:
* V. Campos, R. Rodrigues, I. de Assis Costa and F. Pereira.
Expand Down
2 changes: 1 addition & 1 deletion Zend/Optimizer/zend_optimizer_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define ZEND_OPTIMIZER_INTERNAL_H

#include "zend_ssa.h"
#include "zend_func_info.h"
#include "zend_call_graph.h"

#define ZEND_OP1_LITERAL(opline) (op_array)->literals[(opline)->op1.constant]
#define ZEND_OP1_JMP_ADDR(opline) OP_JMP_ADDR(opline, (opline)->op1)
Expand Down
2 changes: 0 additions & 2 deletions Zend/zend_compile.h
Original file line number Diff line number Diff line change
Expand Up @@ -758,8 +758,6 @@ struct _zend_execute_data {

#define ZEND_EXTRA_VALUE 1

#include "zend_globals.h"

typedef enum _zend_compile_position {
ZEND_COMPILE_POSITION_AT_SHEBANG = 0,
ZEND_COMPILE_POSITION_AT_OPEN_TAG,
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include "zend_observer.h"
#include "zend_system_id.h"
#include "zend_call_stack.h"
#include "Optimizer/zend_func_info.h"
#include "Optimizer/zend_call_graph.h"

/* Virtual current working directory support */
#include "zend_virtual_cwd.h"
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_execute.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "zend_hash.h"
#include "zend_operators.h"
#include "zend_variables.h"
#include "zend_globals.h"

BEGIN_EXTERN_C()
struct _zend_fcall_info;
Expand Down Expand Up @@ -186,6 +187,7 @@ ZEND_API zend_result ZEND_FASTCALL zval_update_constant_ex(zval *pp, zend_class_
ZEND_API zend_result ZEND_FASTCALL zval_update_constant_with_ctx(zval *pp, zend_class_entry *scope, zend_ast_evaluate_ctx *ctx);

/* dedicated Zend executor functions - do not use! */
typedef struct _zend_vm_stack *zend_vm_stack;
struct _zend_vm_stack {
zval *top;
zval *end;
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "zend_extensions.h"
#include "zend_system_id.h"
#include "zend_globals.h"

ZEND_API zend_llist zend_extensions;
ZEND_API uint32_t zend_extension_flags = 0;
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_float.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "zend.h"
#include "zend_compile.h"
#include "zend_float.h"
#include "zend_globals.h"

ZEND_API void zend_init_fpu(void) /* {{{ */
{
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "zend_multiply.h"
#include "zend_arena.h"
#include "zend_call_stack.h"
#include "zend_ini.h"

/* Define ZTS if you want a thread-safe Zend */
/*#undef ZTS*/
Expand Down Expand Up @@ -66,7 +67,6 @@ END_EXTERN_C()
#undef function_table

typedef struct _zend_vm_stack *zend_vm_stack;
typedef struct _zend_ini_entry zend_ini_entry;
typedef struct _zend_fiber_context zend_fiber_context;
typedef struct _zend_fiber zend_fiber;

Expand Down
3 changes: 3 additions & 0 deletions Zend/zend_ini.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifndef ZEND_INI_H
#define ZEND_INI_H

#include "zend_modules.h"
#include "zend_result.h"

#define ZEND_INI_USER (1<<0)
Expand All @@ -30,6 +31,8 @@
#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, zend_string *new_value, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage)
#define ZEND_INI_DISP(name) ZEND_COLD void name(zend_ini_entry *ini_entry, int type)

typedef struct _zend_ini_entry zend_ini_entry;

typedef struct _zend_ini_entry_def {
const char *name;
ZEND_INI_MH((*on_modify));
Expand Down
5 changes: 5 additions & 0 deletions Zend/zend_language_scanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
#ifndef ZEND_SCANNER_H
#define ZEND_SCANNER_H

#include "zend_stack.h"
#include "zend_ptr_stack.h"
#include "zend_multibyte.h"
#include "zend_globals.h"

typedef struct _zend_lex_state {
unsigned int yy_leng;
unsigned char *yy_start;
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_multibyte.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "zend_operators.h"
#include "zend_multibyte.h"
#include "zend_ini.h"
#include "zend_globals.h"

static const zend_encoding *dummy_encoding_fetcher(const char *encoding_name)
{
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "zend.h"
#include "zend_compile.h"
#include "zend_stream.h"
#include "zend_globals.h"

ZEND_DLIMPORT int isatty(int fd);

Expand Down
2 changes: 2 additions & 0 deletions ext/opcache/ZendAccelerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@

#include "zend_extensions.h"
#include "zend_compile.h"
#include "zend_types.h"
#include "zend_modules.h"

#include "Optimizer/zend_optimizer.h"
#include "zend_accelerator_hash.h"
Expand Down
1 change: 0 additions & 1 deletion ext/opcache/jit/zend_jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

#ifdef HAVE_JIT

#include "Optimizer/zend_func_info.h"
#include "Optimizer/zend_ssa.h"
#include "Optimizer/zend_inference.h"
#include "Optimizer/zend_call_graph.h"
Expand Down
1 change: 0 additions & 1 deletion ext/opcache/jit/zend_jit_vm_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "Zend/zend_API.h"

#include <ZendAccelerator.h>
#include "Optimizer/zend_func_info.h"
#include "Optimizer/zend_call_graph.h"
#include "zend_jit.h"
#if ZEND_JIT_TARGET_X86
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/zend_persist.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "zend_attributes.h"

#ifdef HAVE_JIT
# include "Optimizer/zend_func_info.h"
# include "Optimizer/zend_call_graph.h"
# include "jit/zend_jit.h"
#endif

Expand Down