[PATCH] D69565: [update_cc_test_checks.py] Use -ast-dump=json to get mangled name
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 29 14:56:40 PDT 2019
MaskRay added inline comments.
================
Comment at: llvm/utils/update_cc_test_checks.py:46
+ # Use clang's JSON AST dump to get the mangled name
+ json_dump_args = [args.clang, *clang_args]
+ json_dump_args += ['-fsyntax-only', '-o', '-']
----------------
`json_dump_args = [args.clang, *clang_args, '-fsyntax-only', '-o', '-']`
================
Comment at: llvm/utils/update_cc_test_checks.py:55
+ status = subprocess.run(json_dump_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ if status.returncode:
+ sys.stderr.write('Failed to run ' + ' '.join(json_dump_args) + '\n')
----------------
`!= 0`
Make the type clear
================
Comment at: llvm/utils/update_cc_test_checks.py:60
+ sys.exit(2)
+ output = status.stdout.decode()
+ ast = json.loads(output)
----------------
Delete the variable `output`
================
Comment at: llvm/utils/update_cc_test_checks.py:212
clang_args = shlex.split(commands[0])
+ if args.verbose:
+ print('Before subst:', clang_args, file=sys.stderr)
----------------
Delete unrelated changes.
================
Comment at: llvm/utils/update_cc_test_checks.py:224
print('WARNING: Skipping non-clang RUN line: ' + l, file=sys.stderr)
-
+ if args.verbose:
+ print('After subst:', clang_args, file=sys.stderr)
----------------
ditto
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69565/new/
https://reviews.llvm.org/D69565
More information about the llvm-commits
mailing list