Internals: In astgen text output, pickup missing node references

This commit is contained in:
Wilson Snyder 2022-01-02 20:54:39 -05:00
parent 7e355e211c
commit ebf5c11e03
1 changed files with 7 additions and 1 deletions

View File

@ -382,7 +382,7 @@ def read_stages(filename):
line = re.sub(r'//.*$', '', line)
if re.match(r'^\s*$', line):
continue
match = re.match(r'^\s*([A-Za-z0-9]+)::', line)
match = re.search(r'\s([A-Za-z0-9]+)::', line)
if match:
stage = match.group(1) + ".cpp"
if stage not in Stages:
@ -405,6 +405,12 @@ def read_refs(filename):
if ref not in ClassRefs:
ClassRefs[ref] = {'newed': {}, 'used': {}}
ClassRefs[ref]['used'][basename] = 1
for match in re.finditer(
r'(VN_IS|VN_AS|VN_CAST)\([^.]+, ([A-Za-z0-9_]+)', line):
ref = "Ast" + match.group(2)
if ref not in ClassRefs:
ClassRefs[ref] = {'newed': {}, 'used': {}}
ClassRefs[ref]['used'][basename] = 1
def open_file(filename):