Skip to content

Commit

Permalink
Revert "Feat: add disgonostic printing for codegen (alibaba#45)"
Browse files Browse the repository at this point in the history
This reverts commit bc07e09.
  • Loading branch information
lixin-wei committed Aug 16, 2024
1 parent e207214 commit 29a1600
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions codegen/actor_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@ def process_actor_groups(process_args):
p.close()
p.join()

def check_diagnostics_and_print(unit):
if unit.diagnostics:
parse_success = False
for diag in unit.diagnostics:
if diag.severity > clang.cindex.Diagnostic.Warning:
print(f"Error: {diag.spelling}")
print(f" File: {diag.location.file.name}")
print(f" Line: {diag.location.line}")
print(f" Column: {diag.location.column}")
print(f" Severity: {diag.severity}")
else:
parse_success = True
return parse_success

def process_one_actor_group(arg: ActorGroupProcessArgument):
include_path = os.path.relpath(arg.filepath, arg.source_dir)
Expand All @@ -55,9 +42,6 @@ def process_one_actor_group(arg: ActorGroupProcessArgument):
index = clang.cindex.Index.create()
unit = index.parse(arg.filepath, ['-nostdinc++', '-x', 'c++', '-std=gnu++17'] + arg.include_list)

if not check_diagnostics_and_print(unit):
raise Exception("Failed to parse %s" % arg.filepath)

actg_list = []
ns_list = []
traverse_actor_group_types(unit.cursor, arg.filepath, actg_list, ns_list)
Expand Down Expand Up @@ -97,9 +81,6 @@ def process_one_actor(arg: ActorProcessArgument):
index = clang.cindex.Index.create()
unit = index.parse(arg.filepath, ['-nostdinc++', '-x', 'c++', '-std=gnu++17'] + arg.include_list)

if not check_diagnostics_and_print(unit):
raise Exception("Failed to parse %s" % arg.filepath)

act_list = []
ns_list = []
traverse_actor_types(unit.cursor, arg.filepath, act_list, ns_list)
Expand Down

0 comments on commit 29a1600

Please sign in to comment.