feat(compiler): 添加PHP编译器基础类和调试符号支持

- 添加CompilerBase核心编译器类,支持PHP到C++代码转换
- 实现AST节点解析和表达式处理功能
- 添加跨平台编译器检测和配置支持
- 集成PhpParser进行PHP语法树解析
- 实现类型系统和变量管理功能
- 添加调试信息和错误处理机制
- 扩展.gitignore文件以忽略调试符号文件
pull/1/head
韩天峰 4 months ago
parent b5ef65edc2
commit c4c46bf3f0
  1. 1
      .gitignore
  2. 11
      src/Php/CompilerBase.php

1
.gitignore vendored

@ -16,3 +16,4 @@
*.dll
*.exe
*.obj
*.pdb

@ -2530,7 +2530,6 @@ class CompilerBase extends \PhpAot\Core\Translator
if ($this->debugInfo) {
$cmd .= ' /Od'; // 禁用优化(类似 gcc -O0)
$cmd .= ' /Zi'; // 生成完整调试信息(类似 gcc -g)
$cmd .= ' /DEBUG'; // 链接时生成 PDB 文件
$this->climate->info('Debug mode enabled: optimizations disabled, debug info generated');
} else {
// 非调试模式:使用用户指定的优化级别
@ -2587,6 +2586,11 @@ class CompilerBase extends \PhpAot\Core\Translator
if ($link) {
$cmd .= ' ' . $this->parseWindowsLdflags();
// 调试模式:链接时生成 PDB 文件
if ($this->debugInfo) {
$cmd .= ' /DEBUG'; // 生成 PDB 调试信息文件
}
// 对于 bin 模式且指定了 --no-console,使用 Windows 子系统(不显示控制台窗口)
if ($this->buildMode === 'bin' && $this->noConsole) {
$cmd .= ' /SUBSYSTEM:WINDOWS';
@ -2698,6 +2702,11 @@ class CompilerBase extends \PhpAot\Core\Translator
if ($link) {
$cmd .= ' ' . $this->parseWindowsLdflags();
// 调试模式:链接时生成 PDB 文件(Clang + lld-link/link.exe)
if ($this->debugInfo) {
$cmd .= ' /DEBUG'; // 生成 PDB 调试信息文件
}
// 对于 bin 模式且指定了 --no-console,使用 Windows 子系统
if ($this->buildMode === 'bin' && $this->noConsole) {
$cmd .= ' /SUBSYSTEM:WINDOWS';

Loading…
Cancel
Save