错拼 rowptr 改为 rawptr
This commit is contained in:
1 parent
7cba4cbc95
commit
9a191daa8d
70 files changed
+585
-585
No files matched your search
@@ -271,7 +271,7 @@ def _LoadAndAppendStub(temp_dir: str, td_len: sizet, dep_sha1: str,
|
||||
dep_path: str = StubMergerCollect._sliced_path(temp_dir, td_len, dep_sha1, "stub.ll")
|
||||
if dep_path is None:
|
||||
return out_pos
|
||||
df_ls: rowptr[fileio.File] = fileio.File(dep_path, fileio.MODE.R)
|
||||
df_ls: rawptr[fileio.File] = fileio.File(dep_path, fileio.MODE.R)
|
||||
if df_ls.closed:
|
||||
stdlib.free(dep_path)
|
||||
# 依赖 stub 缺失:includes 映射内的模块缺失属编译错误(fail-fast),
|
||||
@@ -466,7 +466,7 @@ def _LoadAndAppendTextDeclares(temp_dir: str, td_len: sizet, dep_sha1: str,
|
||||
text_path: str = StubMergerCollect._sliced_path(temp_dir, td_len, dep_sha1, "text.ll")
|
||||
if text_path is None:
|
||||
return out_pos
|
||||
tf_lt: rowptr[fileio.File] = fileio.File(text_path, fileio.MODE.R)
|
||||
tf_lt: rawptr[fileio.File] = fileio.File(text_path, fileio.MODE.R)
|
||||
if tf_lt.closed:
|
||||
stdlib.free(text_path)
|
||||
# 依赖 text 缺失:includes 映射内的模块缺失属编译错误(fail-fast),
|
||||
@@ -764,7 +764,7 @@ def _AppendDepsToWorklist(worklist: bytes, wl_len: sizet,
|
||||
# Args: mb 内存池;source_dir App 源文件目录(Config.SourceDir);temp_dir 临时目录(deps.txt 所在位置);reachable_set 输出参数,可达 SHA1 集合缓冲区(MAX_INCLUDES_SHA1 * 17 字节);app_deps App 源文件直接依赖模块名(空格分隔),非空则跳过 App 扫描;includes_dirs includes 根目录(空格分隔)
|
||||
# Returns: 可达 SHA1 数量(>0 成功;0 无 includes 依赖;<0 失败)
|
||||
# ============================================================
|
||||
def _BuildReachableSha1Set(mb: rowptr[memhub.MemBuddy], source_dir: str,
|
||||
def _BuildReachableSha1Set(mb: rawptr[memhub.MemBuddy], source_dir: str,
|
||||
temp_dir: str,
|
||||
reachable_set: str,
|
||||
app_deps: str = None,
|
||||
@@ -1138,7 +1138,7 @@ def _BuildReachableSha1Set(mb: rowptr[memhub.MemBuddy], source_dir: str,
|
||||
td_len_w: sizet = string.strlen(temp_dir)
|
||||
deps_path_w: str = StubMergerCollect._sliced_path(temp_dir, td_len_w, sha1_r2, "deps.txt")
|
||||
if deps_path_w is not None:
|
||||
df_w: rowptr[fileio.File] = fileio.File(deps_path_w, fileio.MODE.W)
|
||||
df_w: rawptr[fileio.File] = fileio.File(deps_path_w, fileio.MODE.W)
|
||||
if not df_w.closed:
|
||||
dl_w: sizet = string.strlen(deps_r2)
|
||||
if dl_w > 0:
|
||||
@@ -1369,7 +1369,7 @@ def BuildCombinedIR(temp_dir: str, local_sha1: str,
|
||||
stub_path: str = StubMergerCollect._sliced_path(temp_dir, td_len, local_sha1, "stub.ll")
|
||||
if stub_path is None:
|
||||
return 0
|
||||
sf: rowptr[fileio.File] = fileio.File(stub_path, fileio.MODE.R)
|
||||
sf: rawptr[fileio.File] = fileio.File(stub_path, fileio.MODE.R)
|
||||
if sf.closed:
|
||||
stdlib.free(stub_path)
|
||||
return 0
|
||||
@@ -1434,7 +1434,7 @@ def BuildCombinedIR(temp_dir: str, local_sha1: str,
|
||||
deps_loaded: int = 0
|
||||
deps_path: str = StubMergerCollect._sliced_path(temp_dir, td_len, local_sha1, "deps.txt")
|
||||
if deps_path is not None:
|
||||
df_deps: rowptr[fileio.File] = fileio.File(deps_path, fileio.MODE.R)
|
||||
df_deps: rawptr[fileio.File] = fileio.File(deps_path, fileio.MODE.R)
|
||||
if not df_deps.closed:
|
||||
deps_buf = stdlib.malloc(4096)
|
||||
if deps_buf is not None:
|
||||
@@ -1576,7 +1576,7 @@ def BuildCombinedIR(temp_dir: str, local_sha1: str,
|
||||
# 检查 stub 文件是否存在
|
||||
chk_path: str = StubMergerCollect._sliced_path(temp_dir, td_len, found_s, "stub.ll")
|
||||
if chk_path is not None:
|
||||
chk_f: rowptr[fileio.File] = fileio.File(chk_path, fileio.MODE.R)
|
||||
chk_f: rawptr[fileio.File] = fileio.File(chk_path, fileio.MODE.R)
|
||||
if chk_f.closed:
|
||||
VLogger.error(f"依赖模块 '{mod_nm}' (sha1={found_s}) 的 stub 文件不存在: {chk_path},立即终止编译", "BuildCombinedIR")
|
||||
chk_f.close()
|
||||
@@ -1587,7 +1587,7 @@ def BuildCombinedIR(temp_dir: str, local_sha1: str,
|
||||
text_path: str = StubMergerCollect._sliced_path(temp_dir, td_len, local_sha1, "text.ll")
|
||||
if text_path is None:
|
||||
return out_pos
|
||||
tf: rowptr[fileio.File] = fileio.File(text_path, fileio.MODE.R)
|
||||
tf: rawptr[fileio.File] = fileio.File(text_path, fileio.MODE.R)
|
||||
if tf.closed:
|
||||
# 本地 text.ll 缺失:合并 IR 无法生成定义块,fail-fast 终止
|
||||
VLogger.error(f"本地 text.ll 缺失: {text_path}", "StubMerger")
|
||||
@@ -1764,7 +1764,7 @@ def BuildCombinedIR(temp_dir: str, local_sha1: str,
|
||||
# Args: pool 内存池;mod 当前 LLVM 模块;imported_modules 已导入模块名字符串(空格分隔);from_imports from-import 映射字符串("name:module name:module" 格式);temp_dir temp 目录路径;trans 翻译器对象
|
||||
# Returns: 成功加载的 .vpi 文件数
|
||||
# ============================================================
|
||||
def LoadDepVpiIntoModule(pool: rowptr[memhub.MemBuddy],
|
||||
def LoadDepVpiIntoModule(pool: rawptr[memhub.MemBuddy],
|
||||
mod: llvmlite.LLVMModule | t.CPtr,
|
||||
imported_modules: str,
|
||||
from_imports: str,
|
||||
@@ -1829,7 +1829,7 @@ def LoadDepVpiIntoModule(pool: rowptr[memhub.MemBuddy],
|
||||
vpi_path: str = StubMergerCollect._sliced_path(temp_dir, td_len, sha1_val, "vpi")
|
||||
if vpi_path is not None:
|
||||
# 检查 .vpi 文件是否存在(可读)
|
||||
vf: rowptr[fileio.File] = fileio.File(vpi_path, fileio.MODE.R)
|
||||
vf: rawptr[fileio.File] = fileio.File(vpi_path, fileio.MODE.R)
|
||||
if not vf.closed:
|
||||
vf.close()
|
||||
# 调用 VpiReader 解析 .vpi 并注入 declare
|
||||
|
||||
Reference in new issue
Block a user