Commit f331eab2 authored by Kunshan Wang's avatar Kunshan Wang

fixed typos and synchronised defs

parent c9666872
This diff is collapsed.
This diff is collapsed.
...@@ -50,8 +50,8 @@ _type_map = { ...@@ -50,8 +50,8 @@ _type_map = {
def to_mu_ty(cty): def to_mu_ty(cty):
if cty.endswith("*"): if cty.endswith("*"):
return "iref<{}>".format(to_mu_ty(cty[:-1])) return "iref<{}>".format(to_mu_ty(cty[:-1]))
elif cty.startswith("Mu") and cty.endswith("Node"): elif cty.startswith("Mu") and (cty.endswith("Node") or cty.endswith("Clause")):
return "irnoderef" return "int<32>"
elif cty in _type_map: elif cty in _type_map:
return _type_map[cty] return _type_map[cty]
else: else:
...@@ -59,17 +59,13 @@ def to_mu_ty(cty): ...@@ -59,17 +59,13 @@ def to_mu_ty(cty):
def get_comminst_defs(ast): def get_comminst_defs(ast):
muctx_methods = [s["methods"] for s in ast["structs"] muctx_methods = [s["methods"] for s in ast["structs"]
if s["name"] == "MuCtx"][0] if s["name"] == "MuIRBuilder"][0]
index_new_bundle = 0
while muctx_methods[index_new_bundle]["name"] != "new_bundle":
index_new_bundle += 1
next_id = start_id_comminst next_id = start_id_comminst
lines = ["", "::", ""] # start reStructuredText block lines = ["", "::", ""] # start reStructuredText block
for i in range(index_new_bundle, len(muctx_methods)): for i in range(len(muctx_methods)):
meth = muctx_methods[i] meth = muctx_methods[i]
name = meth["name"] name = meth["name"]
params = meth["params"] params = meth["params"]
......
...@@ -68,7 +68,7 @@ def extract_enums(text, typename, pattern): ...@@ -68,7 +68,7 @@ def extract_enums(text, typename, pattern):
"defs": defs, "defs": defs,
} }
_top_level_structs = ["MuVM", "MuCtx"] _top_level_structs = ["MuVM", "MuCtx", "MuIRBuilder"]
_enums = [(typename, re.compile(regex)) for typename, regex in [ _enums = [(typename, re.compile(regex)) for typename, regex in [
("MuTrapHandlerResult", r'^MU_(THREAD|REBIND)'), ("MuTrapHandlerResult", r'^MU_(THREAD|REBIND)'),
("MuDestKind", r'^MU_DEST_'), ("MuDestKind", r'^MU_DEST_'),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment