From e2adeb35a775167671a87a00a0b0013c6cb2c699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Wed, 24 Jan 2024 15:04:36 -0700 Subject: [PATCH] Rename --show-ast to --show-clang-ast --- .github/workflows/CI.yml | 2 +- src/bin/lc.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1f4f1b4..61345e4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -51,7 +51,7 @@ jobs: if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') run: | export CPATH=$CONDA_PREFIX/include:$CPATH - lc --show-ast tests/test.cpp + lc --show-clang-ast tests/test.cpp lc examples/expr2.c --show-asr ./run_tests.py diff --git a/src/bin/lc.cpp b/src/bin/lc.cpp index 86fce9b..beb36ca 100644 --- a/src/bin/lc.cpp +++ b/src/bin/lc.cpp @@ -95,18 +95,18 @@ class ClangCheckActionFactory { public: std::string infile, ast_dump_file, ast_dump_filter; - bool ast_list, ast_print, show_ast; + bool ast_list, ast_print, show_clang_ast; ClangCheckActionFactory(std::string infile_, std::string ast_dump_file, std::string ast_dump_filter, bool ast_list, - bool ast_print, bool show_ast): infile(infile_), + bool ast_print, bool show_clang_ast): infile(infile_), ast_dump_file(ast_dump_file), ast_dump_filter(ast_dump_filter), - ast_list(ast_list), ast_print(ast_print), show_ast(show_ast) {} + ast_list(ast_list), ast_print(ast_print), show_clang_ast(show_clang_ast) {} std::unique_ptr newASTConsumer() { if (ast_list) { return clang::CreateASTDeclNodeLister(); - } else if ( show_ast ) { + } else if ( show_clang_ast ) { llvm::raw_fd_ostream* llvm_fd_ostream = nullptr; if ( ast_dump_file.size() > 0 ) { std::error_code errorCode; @@ -689,7 +689,7 @@ int mainApp(int argc, const char **argv) { bool ast_list = false; bool ast_print = false; std::string ast_dump_filter = ""; - bool show_ast = false; + bool show_clang_ast = false; bool show_asr = false; bool arg_no_indent = false; bool arg_no_color = false; @@ -713,7 +713,7 @@ int mainApp(int argc, const char **argv) { app.add_flag("--ast-print", ast_print, "Build ASTs and then pretty-print them"); app.add_flag("--ast-dump-filter", ast_dump_filter, "Use with -ast-dump or -ast-print to dump/print" " only AST declaration nodes having a certain substring in a qualified name."); - app.add_flag("--show-ast", show_ast, "Show AST for the given file and exit"); + app.add_flag("--show-clang-ast", show_clang_ast, "Show AST for the given file and exit"); app.add_flag("--show-asr", show_asr, "Show ASR for the given file and exit"); app.add_flag("--no-indent", arg_no_indent, "Turn off Indented print ASR/AST"); app.add_flag("--no-color", arg_no_color, "Turn off colored AST/ASR"); @@ -762,9 +762,9 @@ int mainApp(int argc, const char **argv) { std::string infile = sourcePaths[0]; // Handle Clang related options in the following - if (show_ast || ast_list || ast_print) { + if (show_clang_ast || ast_list || ast_print) { ClangCheckActionFactory CheckFactory(infile, ast_dump_file, - ast_dump_filter, ast_list, ast_print, show_ast); + ast_dump_filter, ast_list, ast_print, show_clang_ast); int status = Tool.run(newFrontendActionFactory(&CheckFactory).get()); return status; }