feat(vpc): binary .vpb stub companion and str->char* migration in call gen
- add VpiStub: fixed-layout blob written next to every .vpi (dual write at all writers, Ensure() backfills a missing or stale companion on cache reuse) - serve arity/signature queries for top-level functions from the blob, with a silent fallback to the text scanner (methods, varargs, duplicates, corrupt file) - prefer the injected declare over the text arity in the cross-module check - CDefine/type text indexes and in-place SSA renumbering and bulk appends - WIP: char* conversion in CallGenBase and CallGenLeafKit
This commit is contained in:
1 parent
451d89b39a
commit
4bf04c2452
15 files changed
+1697
-463
No files matched your search
@@ -98,6 +98,19 @@ def string_use() -> int:
|
||||
return len("hello")
|
||||
|
||||
|
||||
def negative_use() -> int:
|
||||
return -128
|
||||
|
||||
|
||||
def negative_float_use() -> float:
|
||||
return -3.5
|
||||
|
||||
|
||||
def subtract_use() -> int:
|
||||
x: int = 5
|
||||
return x - 1
|
||||
|
||||
|
||||
def else_block(flag: int) -> int:
|
||||
if flag != 0:
|
||||
return 1
|
||||
|
||||
@@ -1885,6 +1885,20 @@ def gate10(exe: str) -> int:
|
||||
for piece in ("type str", "length 5 bytes"):
|
||||
if piece not in string_hover:
|
||||
raise AssertionError(f"string hover lacks {piece!r}: {string_hover}")
|
||||
neg_hover = hover_text(at("return -128", len("return -")))
|
||||
for piece in ("dec -128", "hex -0x80", "binary -0b1000_0000",
|
||||
"bits 8 signed", "uint n/a (negative)", "int i8",
|
||||
"float f16 exact, f32 exact, f64 exact"):
|
||||
if piece not in neg_hover:
|
||||
raise AssertionError(f"negative hover lacks {piece!r}: {neg_hover}")
|
||||
neg_float_hover = hover_text(at("return -3.5", len("return -")))
|
||||
if "hex 0xC00C000000000000" not in neg_float_hover:
|
||||
raise AssertionError(f"negative float bit pattern is wrong: {neg_float_hover}")
|
||||
if "f16 exact, f32 exact, f64 exact" not in neg_float_hover:
|
||||
raise AssertionError(f"negative float exactness is wrong: {neg_float_hover}")
|
||||
minus_hover = hover_text(at("return x - 1", len("return x - ")))
|
||||
if "dec 1" not in minus_hover:
|
||||
raise AssertionError(f"binary minus was treated as unary: {minus_hover}")
|
||||
|
||||
def reference_ranges(pos: dict[str, int]) -> list[tuple[str, int, int]]:
|
||||
result = request("textDocument/references", pos,
|
||||
|
||||
Reference in new issue
Block a user