php-src/Zend/Optimizer
Calvin Buckley 76791e90b9
Use win32 glob implementation on all platforms (#18164)
* Move glob to main/ from win32/

In preparation to make the Win32 reimplementation the standard
cross-platform one. Currently, it doesn't do that and just passes
through the original glob implementation. We could consider also having
an option to use the standard glob for systems that have a sufficient
one.

* Enable building with win32 glob on non-windows

Kind of broken. We're namespacing the function and struct, but not yet
the GLOB_* defines. There are a lot of places callers check if i.e.
NOMATCH is defined that would likely become redundant.

Currently it also has php_glob and #defines glob php_glob (etc.) - I
suspect doing the opposite and changing the callers would make more
sense, just doing MVP to geet it to build (even if it fails tests).

* Massive first pass at conversion to internal glob

Have not tested yet. the big things are:

- Should be invisible to userland PHP code.
- A lot of :%s/GLOB_/PHP_GLOB_/g; the diff can be noisy as a result,
  especially in comments.
- Prefixes everything with PHP_ to avoid conflicts with system glob in
  case it gets included transitively.
- A lot of weird shared definitions that were sprawled out to other
  headers are now included in php_glob.h.
- A lot of (but not yet all cases) of HAVE_GLOB are removed, since we
  can always fall back to php_glob.
- Using the system glob is not wired up yet; it'll need more shim
  ifdefs for each flag type than just glob_t/glob/globfree defs.

* Fix inclusion of GLOB_ONLYDIR

This is a GNU extension, but we don't need to implement it, as the GNU
implementation is flawed enough that callers have to manually filter it
anyways; just provide a stub definition for the constant.

We could consideer implementing this properly later. For now, fixes the
basic glob constant tests.

* Remove HAVE_GLOBs

We now always have a glob implementation that works. HAVE_GLOB should
only be used to check if we have a system implementation, for if we
decide to wrap the system implementation instead.

* We don't need to care about being POSIXly correct for internal glob

* Check for reallocarray

Ideally temporary until GH-17433.

* Forgot to move this file from win32/ to main/

* Check for issetugid (BSD function)

* Allow using the system glob with --enable-system-glob

* Style fix after removing ifdef

* Remove empty case for system glob
2025-05-20 16:20:59 -03:00
..
block_pass.c Optimize match(true) (#18423) 2025-04-29 21:39:12 +02:00
compact_literals.c Remove cache slot from ZEND_VERIFY_TYPE and arg RECV opcodes (#18258) 2025-04-07 19:50:48 +02:00
compact_vars.c Fix GH-13817: Segmentation fault for enabled observers after pass 4 2024-07-22 18:28:03 +02:00
dce.c Add (void) cast 2025-03-24 19:35:30 +01:00
dfa_pass.c Zend: Add MUTABLE zend_type foreach macros and const qualifiers 2025-04-07 12:52:40 +01:00
escape_analysis.c Merge branch 'PHP-8.2' into PHP-8.3 2024-07-19 14:59:44 +02:00
nop_removal.c
optimize_func_calls.c RFC: Marking return values as important (#[\NoDiscard]) (#17599) 2025-04-02 09:35:29 +02:00
optimize_temp_vars_5.c Fix GH-13817: Segmentation fault for enabled observers after pass 4 2024-07-22 18:28:03 +02:00
pass1.c Merge branch 'PHP-8.3' into PHP-8.4 2024-10-14 13:25:31 +02:00
pass3.c [RFC] Convert exit (and die) from language constructs to functions (#13483) 2024-08-14 12:44:12 +01:00
sccp.c Implement stackless internal function calls 2024-02-06 17:42:28 +01:00
scdf.c Revert GH-10279 2023-01-16 12:25:59 +01:00
scdf.h Make various pointers const in Zend/ (#10608) 2023-02-20 14:00:59 +00:00
ssa_integrity.c Merge branch 'PHP-8.2' into PHP-8.3 2023-12-18 13:15:19 +01:00
zend_call_graph.c Fix building of callgraph including preloaded symbols (GH-15545) 2024-08-26 17:22:04 +02:00
zend_call_graph.h Implement stackless internal function calls 2024-02-06 17:42:28 +01:00
zend_cfg.c Merge branch 'PHP-8.3' into PHP-8.4 2025-03-21 13:57:16 +01:00
zend_cfg.h Revert GH-10279 2023-01-16 12:25:59 +01:00
zend_dfg.c Implement stackless internal function calls 2024-02-06 17:42:28 +01:00
zend_dfg.h
zend_dump.c Implement GH-15680: Enhance zend_dump_op_array to Properly Represent Non-Printable Characters in String Literals 2024-12-27 12:53:02 +01:00
zend_dump.h Zend/Optimizer: Fix some [-Wsign-compare] warnings 2024-06-08 17:15:01 +01:00
zend_func_info.c Fix opline argument for getting the function info for range() 2024-04-01 22:42:18 +02:00
zend_func_info.h
zend_func_infos.h Use win32 glob implementation on all platforms (#18164) 2025-05-20 16:20:59 -03:00
zend_inference.c Fix RC inference of op1 of FETCH_OBJ and INIT_METHOD_CALL 2024-12-18 19:08:51 +01:00
zend_inference.h Fix GH-13834: Applying non-zero offset 36 to null pointer in zend_jit.c (#13846) 2024-04-01 13:37:15 +02:00
zend_optimizer.c Merge branch 'PHP-8.4' 2025-05-19 19:22:16 +02:00
zend_optimizer.h Revert GH-10279 2023-01-16 12:25:59 +01:00
zend_optimizer_internal.h Improve optimizer support for class constants (#13438) 2024-03-18 07:30:44 +01:00
zend_ssa.c Implement stackless internal function calls 2024-02-06 17:42:28 +01:00
zend_ssa.h zend_ssa minor struct changes. (#13387) 2024-02-14 07:41:52 +00:00
zend_worklist.h Make various pointers const in Zend/ (#10608) 2023-02-20 14:00:59 +00:00