Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REFACTOR] Move parse_options.cpp and cmdline.cpp under src/cli_utils/. #7784

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ cprover_default_properties(
big-int
cbmc
cbmc-lib
cli-utils
cpp
cprover-api-cpp
cprover
Expand Down
1 change: 1 addition & 0 deletions jbmc/src/janalyzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ generic_includes(janalyzer-lib)
target_link_libraries(janalyzer-lib
ansi-c
java_bytecode
cli-utils
linking
big-int
goto-analyzer-lib
Expand Down
5 changes: 2 additions & 3 deletions jbmc/src/janalyzer/janalyzer_parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,14 @@ Author: Daniel Kroening, [email protected]
#ifndef CPROVER_JANALYZER_JANALYZER_PARSE_OPTIONS_H
#define CPROVER_JANALYZER_JANALYZER_PARSE_OPTIONS_H

#include <util/parse_options.h>
#include <util/timestamper.h>

#include <langapi/language.h>

#include <goto-programs/show_goto_functions.h>
#include <goto-programs/show_properties.h>

#include <cli-utils/parse_options.h>
#include <java_bytecode/java_bytecode_language.h>
#include <langapi/language.h>

class abstract_goto_modelt;
class ai_baset;
Expand Down
20 changes: 9 additions & 11 deletions jbmc/src/java_bytecode/java_bytecode_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ Author: Daniel Kroening, [email protected]

\*******************************************************************/

#include "java_bytecode_convert_class.h"
#include "java_bytecode_language.h"

#include <fstream>
#include <string>

#include <linking/static_lifetime_init.h>

#include <util/cmdline.h>
#include <util/config.h>
#include <util/expr_iterator.h>
#include <util/invariant.h>
Expand All @@ -23,14 +18,16 @@ Author: Daniel Kroening, [email protected]
#include <util/suffix.h>
#include <util/symbol_table_builder.h>

#include <json/json_parser.h>

#include <goto-programs/class_hierarchy.h>

#include <cli-utils/cmdline.h>
#include <json/json_parser.h>
#include <linking/static_lifetime_init.h>

#include "ci_lazy_methods.h"
#include "create_array_with_type_intrinsic.h"
#include "expr2java.h"
#include "java_bytecode_concurrency_instrumentation.h"
#include "java_bytecode_convert_class.h"
#include "java_bytecode_convert_method.h"
#include "java_bytecode_instrument.h"
#include "java_bytecode_internal_additions.h"
Expand All @@ -44,10 +41,11 @@ Author: Daniel Kroening, [email protected]
#include "java_utils.h"
#include "lambda_synthesis.h"
#include "lift_clinit_calls.h"

#include "expr2java.h"
#include "load_method_by_regex.h"

#include <fstream>
#include <string>

/// Parse options that are java bytecode specific.
/// \param cmd: Command line
/// \param [out] options: The options object that will be updated.
Expand Down
3 changes: 2 additions & 1 deletion jbmc/src/java_bytecode/java_object_factory_parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ Author: Daniel Poetzl

#include "java_object_factory_parameters.h"

#include <util/cmdline.h>
#include <util/exception_utils.h>
#include <util/options.h>

#include <cli-utils/cmdline.h>

void java_object_factory_parameterst::set(const optionst &options)
{
object_factory_parameterst::set(options);
Expand Down
1 change: 1 addition & 0 deletions jbmc/src/jbmc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ target_link_libraries(jbmc-lib
ansi-c
big-int
cbmc-lib
cli-utils
goto-checker
goto-instrument-lib
goto-programs
Expand Down
12 changes: 4 additions & 8 deletions jbmc/src/jbmc/jbmc_parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,21 @@ Author: Daniel Kroening, [email protected]
#ifndef CPROVER_JBMC_JBMC_PARSE_OPTIONS_H
#define CPROVER_JBMC_JBMC_PARSE_OPTIONS_H

#include <util/parse_options.h>
#include <util/timestamper.h>
#include <util/ui_message.h>
#include <util/validation_interface.h>

#include <langapi/language.h>

#include <goto-checker/bmc_util.h>

#include <goto-programs/class_hierarchy.h>
#include <goto-programs/goto_trace.h>
#include <goto-programs/show_properties.h>

#include <solvers/strings/string_refinement.h>

#include <cli-utils/parse_options.h>
#include <goto-checker/bmc_util.h>
#include <java_bytecode/java_bytecode_language.h>
#include <java_bytecode/java_trace_validation.h>

#include <json/json_interface.h>
#include <langapi/language.h>
#include <solvers/strings/string_refinement.h>
#include <xmllang/xml_interface.h>

class goto_functiont;
Expand Down
1 change: 1 addition & 0 deletions jbmc/src/jdiff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ generic_includes(jdiff-lib)
target_link_libraries(jdiff-lib
ansi-c
linking
cli-utils
big-int
pointer-analysis
goto-diff-lib
Expand Down
2 changes: 1 addition & 1 deletion jbmc/src/jdiff/jdiff_parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Author: Peter Schrammel
#ifndef CPROVER_JDIFF_JDIFF_PARSE_OPTIONS_H
#define CPROVER_JDIFF_JDIFF_PARSE_OPTIONS_H

#include <util/parse_options.h>
#include <util/timestamper.h>

#include <goto-programs/show_goto_functions.h>
#include <goto-programs/show_properties.h>

#include <cli-utils/parse_options.h>
#include <goto-instrument/cover.h>

class goto_modelt;
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ add_subdirectory(linking)
add_subdirectory(pointer-analysis)
add_subdirectory(solvers)
add_subdirectory(statement-list)
add_subdirectory(cli-utils)
add_subdirectory(util)

add_subdirectory(cbmc)
Expand Down
1 change: 1 addition & 0 deletions src/cbmc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ target_link_libraries(cbmc-lib
ansi-c
assembler
big-int
cli-utils
cpp
goto-checker
goto-instrument-lib
Expand Down
2 changes: 1 addition & 1 deletion src/cbmc/cbmc_parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Author: Daniel Kroening, [email protected]
#ifndef CPROVER_CBMC_CBMC_PARSE_OPTIONS_H
#define CPROVER_CBMC_CBMC_PARSE_OPTIONS_H

#include <util/parse_options.h>
#include <util/timestamper.h>
#include <util/ui_message.h>
#include <util/validation_interface.h>
Expand All @@ -22,6 +21,7 @@ Author: Daniel Kroening, [email protected]

#include <ansi-c/ansi_c_language.h>
#include <ansi-c/goto_check_c.h>
#include <cli-utils/parse_options.h>
#include <goto-checker/bmc_util.h>
#include <goto-instrument/cover.h>
#include <json/json_interface.h>
Expand Down
10 changes: 10 additions & 0 deletions src/cli-utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
file(GLOB_RECURSE sources "*.cpp" "*.h")

add_library(cli-utils
${sources})

add_dependencies(cli-utils util)

generic_includes(cli-utils)

target_link_libraries(cli-utils util)
File renamed without changes.
2 changes: 1 addition & 1 deletion src/util/cmdline.h → src/cli-utils/cmdline.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Author: Daniel Kroening, [email protected]
#include <string>
#include <vector>

#include "optional.h"
#include <util/optional.h>

class cmdlinet
{
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/util/parse_options.h → src/cli-utils/parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Author: Daniel Kroening, [email protected]
#include <string>

#include "cmdline.h"
#include "message.h"
#include "ui_message.h"
#include "util/message.h"
#include "util/ui_message.h"

class parse_options_baset
{
Expand Down
1 change: 1 addition & 0 deletions src/cprover/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ target_link_libraries(cprover-lib
assembler
big-int
cpp
cli-utils
goto-checker
goto-instrument-lib
goto-programs
Expand Down
3 changes: 2 additions & 1 deletion src/cprover/cprover_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ Author: Daniel Kroening, [email protected]
#include <util/exit_codes.h>
#include <util/help_formatter.h>
#include <util/options.h>
#include <util/parse_options.h>
#include <util/signal_catcher.h>
#include <util/ui_message.h>
#include <util/version.h>

#include <cli-utils/parse_options.h>

#ifdef _WIN32
# include <util/unicode.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions src/crangler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ target_link_libraries(crangler-lib
big-int
util
json
cli-utils
)

# Executable
Expand Down
2 changes: 1 addition & 1 deletion src/crangler/crangler_parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Author: Daniel Kroening, [email protected]
#ifndef CPROVER_CRANGLER_CRANGLER_PARSE_OPTIONS_H
#define CPROVER_CRANGLER_CRANGLER_PARSE_OPTIONS_H

#include <util/parse_options.h>
#include <cli-utils/parse_options.h>

class crangler_parse_optionst : public parse_options_baset
{
Expand Down
1 change: 1 addition & 0 deletions src/goto-analyzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ generic_includes(goto-analyzer-lib)
target_link_libraries(goto-analyzer-lib
ansi-c
cpp
cli-utils
linking
big-int
goto-checker
Expand Down
2 changes: 1 addition & 1 deletion src/goto-analyzer/goto_analyzer_parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ Author: Daniel Kroening, [email protected]
#ifndef CPROVER_GOTO_ANALYZER_GOTO_ANALYZER_PARSE_OPTIONS_H
#define CPROVER_GOTO_ANALYZER_GOTO_ANALYZER_PARSE_OPTIONS_H

#include <util/parse_options.h>
#include <util/timestamper.h>
#include <util/ui_message.h>
#include <util/validation_interface.h>
Expand All @@ -100,6 +99,7 @@ Author: Daniel Kroening, [email protected]

#include <analyses/variable-sensitivity/variable_sensitivity_domain.h>
#include <ansi-c/goto_check_c.h>
#include <cli-utils/parse_options.h>
#include <langapi/language.h>

class optionst;
Expand Down
1 change: 1 addition & 0 deletions src/goto-cc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ target_link_libraries(goto-cc-lib
big-int
goto-programs
util
cli-utils
json
linking
ansi-c
Expand Down
3 changes: 2 additions & 1 deletion src/goto-cc/as_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ Author: Michael Tautschnig
#include <sysexits.h>
#endif

#include <util/cmdline.h>
#include <util/config.h>
#include <util/file_util.h>
#include <util/get_base_name.h>
#include <util/run.h>
#include <util/tempdir.h>
#include <util/version.h>

#include <cli-utils/cmdline.h>

#include "compile.h"
#include "goto_cc_cmdline.h"
#include "hybrid_binary.h"
Expand Down
11 changes: 6 additions & 5 deletions src/goto-cc/compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ Date: June 2006

#include "compile.h"

#include <cstring>
#include <fstream>
#include <iostream>

#include <util/cmdline.h>
#include <util/config.h>
#include <util/file_util.h>
#include <util/get_base_name.h>
Expand All @@ -28,6 +23,12 @@ Date: June 2006
#include <util/tempfile.h>
#include <util/version.h>

#include <cli-utils/cmdline.h>

#include <cstring>
#include <fstream>
#include <iostream>

#ifdef _MSC_VER
# include <util/unicode.h>
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/goto-cc/gcc_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Author: CM Wintersteiger, 2006
#include <sysexits.h>
#endif

#include <util/cmdline.h>
#include <util/config.h>
#include <util/file_util.h>
#include <util/get_base_name.h>
Expand All @@ -30,6 +29,8 @@ Author: CM Wintersteiger, 2006
#include <util/tempdir.h>
#include <util/version.h>

#include <cli-utils/cmdline.h>

#include "compile.h"
#include "goto_cc_cmdline.h"
#include "hybrid_binary.h"
Expand Down
2 changes: 1 addition & 1 deletion src/goto-cc/goto_cc_cmdline.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Date: April 2010
#ifndef CPROVER_GOTO_CC_GOTO_CC_CMDLINE_H
#define CPROVER_GOTO_CC_GOTO_CC_CMDLINE_H

#include <util/cmdline.h>
#include <cli-utils/cmdline.h>

class goto_cc_cmdlinet:public cmdlinet
{
Expand Down
3 changes: 2 additions & 1 deletion src/goto-cc/goto_cc_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ Author: CM Wintersteiger, 2006

#include <util/exception_utils.h>
#include <util/message.h>
#include <util/parse_options.h>
#include <util/version.h>

#include <cli-utils/parse_options.h>

#include "goto_cc_cmdline.h"

/// constructor
Expand Down
11 changes: 6 additions & 5 deletions src/goto-cc/ld_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,22 @@ Author: CM Wintersteiger, 2006
#include <sysexits.h>
#endif

#include <cstring>
#include <fstream>
#include <iostream>

#include <util/cmdline.h>
#include <util/config.h>
#include <util/file_util.h>
#include <util/invariant.h>
#include <util/run.h>

#include <cli-utils/cmdline.h>

#include "compile.h"
#include "goto_cc_cmdline.h"
#include "hybrid_binary.h"
#include "linker_script_merge.h"

#include <cstring>
#include <fstream>
#include <iostream>

static std::string
linker_name(const cmdlinet &cmdline, const std::string &base_name)
{
Expand Down
Loading