feat(tpc): includes 只认项目配置;ASan 改为显式链接 clang64 运行库
includes 目录不再回退仓库硬编码 TransPyCRoot/includes:Phase2Translator 新增 PROJECT_INCLUDE_DIRS(INCLUDE_DIRS 置空以兼容旧引用),Config.py 从 project.vpj 的 includes 同步;HandlesImports 的模块搜索、TypeAnnotationResolver._builtins_include_dirs 一律只读项目目录。 ASan:mingw64 clang 没有 x86_64-w64-windows-gnu 目标的 ASan runtime,新增 _FindAsanRuntimeDir 定位 clang64 运行库并按 -l: 显式链接(asan_dynamic-x86_64.dll.a + runtime_thunk),定位失败即报错退出。HandlesExprFormat:i32 不再写 'l' 长度修饰符(LP64 下 printf 会按 64 位读实参)。
This commit is contained in:
1 parent
ab3873b038
commit
cc2f5d34eb
122 files changed
+89
-31
No files matched your search
@@ -175,10 +175,10 @@ class ExprFormatHandle(BaseHandle):
|
||||
|
||||
length_mod: str = ''
|
||||
if isinstance(val.type, ir.IntType):
|
||||
# 32 位**不写**长度修饰符(N14):与 TPV 侧 ExprGenFstr 保持同步。
|
||||
# 写 'l' 会在 LP64(long=64 位)下让 printf 按 64 位读取 i32 实参。
|
||||
if val.type.width == 64:
|
||||
length_mod = 'll'
|
||||
elif val.type.width == 32:
|
||||
length_mod = 'l'
|
||||
elif val.type.width == 16:
|
||||
length_mod = 'h'
|
||||
elif val.type.width == 8:
|
||||
|
||||
@@ -581,8 +581,10 @@ class ImportHandle(BaseHandle):
|
||||
HandlesFile = os.path.abspath(inspect.getfile(self.__class__))
|
||||
TransPyCRoot = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(HandlesFile))))
|
||||
|
||||
FullModulePath = None
|
||||
SearchDirs = [os.path.join(TransPyCRoot, 'includes'), os.path.join(TransPyCRoot, 'lib', 'includes')] + list(self.Trans.LibraryPaths)
|
||||
FullModulePath = None
|
||||
# includes 只认项目(project.vpj includes → LibraryPaths)目录,禁止回退仓库硬编码
|
||||
# TransPyCRoot/includes:仓库副本缺失时回退会造成声明解析时序错乱(memhub 未注册→i32)。
|
||||
SearchDirs = list(self.Trans.LibraryPaths)
|
||||
|
||||
for LibPath in SearchDirs:
|
||||
SearchPath = os.path.join(ProjectRoot, LibPath) if not os.path.isabs(LibPath) else LibPath
|
||||
@@ -613,7 +615,7 @@ class ImportHandle(BaseHandle):
|
||||
if not FullModulePath:
|
||||
ModulePathPyBase = module_name.replace('.', os.sep)
|
||||
PackageInitPathPyBase = module_name.replace('.', os.sep) + os.sep + '__init__'
|
||||
SearchDirsForPy = [os.path.join(TransPyCRoot, 'includes'), os.path.join(TransPyCRoot, 'lib', 'includes')] + list(self.Trans.LibraryPaths)
|
||||
SearchDirsForPy = list(self.Trans.LibraryPaths)
|
||||
for LibPath in SearchDirsForPy:
|
||||
SearchPath = os.path.join(ProjectRoot, LibPath) if not os.path.isabs(LibPath) else LibPath
|
||||
# 优先尝试 .vp,回退 .py
|
||||
@@ -649,7 +651,7 @@ class ImportHandle(BaseHandle):
|
||||
SearchFromDirs = [CurrentFileDir, os.getcwd()]
|
||||
else:
|
||||
SearchFromDirs = [os.getcwd()]
|
||||
SearchDirsForSubmodule = SearchFromDirs + [os.path.join(TransPyCRoot, 'includes'), os.path.join(TransPyCRoot, 'lib', 'includes')] + list(self.Trans.LibraryPaths)
|
||||
SearchDirsForSubmodule = SearchFromDirs + list(self.Trans.LibraryPaths)
|
||||
for SearchPath in SearchDirsForSubmodule:
|
||||
if not os.path.isdir(SearchPath):
|
||||
continue
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user