cprover
gcc_modet Class Reference

#include <gcc_mode.h>

Inheritance diagram for gcc_modet:
[legend]
Collaboration diagram for gcc_modet:
[legend]

Public Member Functions

int doit () final
 does it. More...
 
void help_mode () final
 display command line help More...
 
 gcc_modet (goto_cc_cmdlinet &_cmdline, const std::string &_base_name, bool _produce_hybrid_binary)
 
- Public Member Functions inherited from goto_cc_modet
virtual int main (int argc, const char **argv)
 starts the compiler More...
 
virtual void help ()
 display command line help More...
 
virtual void usage_error ()
 prints a message informing the user about incorrect options More...
 
 goto_cc_modet (goto_cc_cmdlinet &, const std::string &_base_name, message_handlert &)
 constructor More...
 
 ~goto_cc_modet ()
 constructor More...
 
- Public Member Functions inherited from messaget
virtual void set_message_handler (message_handlert &_message_handler)
 
message_handlertget_message_handler ()
 
 messaget ()
 
 messaget (const messaget &other)
 
messagetoperator= (const messaget &other)
 
 messaget (message_handlert &_message_handler)
 
virtual ~messaget ()
 
mstreamtget_mstream (unsigned message_level) const
 
mstreamterror () const
 
mstreamtwarning () const
 
mstreamtresult () const
 
mstreamtstatus () const
 
mstreamtstatistics () const
 
mstreamtprogress () const
 
mstreamtdebug () const
 
void conditional_output (mstreamt &mstream, const std::function< void(mstreamt &)> &output_generator) const
 Generate output to mstream using output_generator if the configured verbosity is at least as high as that of mstream. More...
 

Protected Member Functions

int preprocess (const std::string &language, const std::string &src, const std::string &dest, bool act_as_bcc)
 call gcc for preprocessing More...
 
int run_gcc (const compilet &compiler)
 call gcc with original command line More...
 
int gcc_hybrid_binary (compilet &compiler)
 
int asm_output (bool act_as_bcc, const std::list< std::string > &preprocessed_source_files, const compilet &compiler)
 
- Protected Member Functions inherited from goto_cc_modet
void register_languages ()
 

Static Protected Member Functions

static bool needs_preprocessing (const std::string &)
 

Protected Attributes

gcc_message_handlert gcc_message_handler
 
const bool produce_hybrid_binary
 
std::string native_tool_name
 
const std::string goto_binary_tmp_suffix
 
const std::map< std::string, std::set< std::string > > arch_map
 Associate CBMC architectures with processor names. More...
 
gcc_versiont gcc_version
 
- Protected Attributes inherited from goto_cc_modet
goto_cc_cmdlinetcmdline
 
const std::string base_name
 
- Protected Attributes inherited from messaget
message_handlertmessage_handler
 
mstreamt mstream
 

Additional Inherited Members

- Public Types inherited from messaget
enum  message_levelt {
  M_ERROR =1, M_WARNING =2, M_RESULT =4, M_STATUS =6,
  M_STATISTICS =8, M_PROGRESS =9, M_DEBUG =10
}
 
- Static Public Member Functions inherited from messaget
static unsigned eval_verbosity (const std::string &user_input, const message_levelt default_verbosity, message_handlert &dest)
 Parse a (user-)provided string as a verbosity level and set it as the verbosity of dest. More...
 
static mstreamteom (mstreamt &m)
 
static mstreamtendl (mstreamt &m)
 

Detailed Description

Definition at line 25 of file gcc_mode.h.

Constructor & Destructor Documentation

◆ gcc_modet()

gcc_modet::gcc_modet ( goto_cc_cmdlinet _cmdline,
const std::string &  _base_name,
bool  _produce_hybrid_binary 
)

Definition at line 106 of file gcc_mode.cpp.

Member Function Documentation

◆ asm_output()

int gcc_modet::asm_output ( bool  act_as_bcc,
const std::list< std::string > &  preprocessed_source_files,
const compilet compiler 
)
protected

◆ doit()

int gcc_modet::doit ( )
finalvirtual

does it.

Implements goto_cc_modet.

Definition at line 320 of file gcc_mode.cpp.

References configt::ansi_c, configt::ansi_ct::arch, arch_map, asm_output(), compilet::ASSEMBLE_ONLY, goto_cc_modet::base_name, configt::ansi_ct::c_standard, CBMC_VERSION, configt::ansi_ct::char_is_unsigned, gcc_versiont::CLANG, configt::ansi_ct::CLANG, goto_cc_modet::cmdline, compilet::COMPILE_LINK, compilet::COMPILE_LINK_EXECUTABLE, compilet::COMPILE_ONLY, compiler_name(), config, configt::cpp, configt::cppt::cpp_standard, messaget::debug(), gcc_versiont::default_c_standard, gcc_versiont::default_cxx_standard, configt::ansi_ct::double_width, configt::ansi_ct::endianness, messaget::eom(), messaget::error(), messaget::eval_verbosity(), gcc_versiont::flavor, configt::ansi_ct::Float128_type, gcc_versiont::GCC, configt::ansi_ct::GCC, gcc_hybrid_binary(), gcc_message_handler, gcc_version, gcc_versiont::get(), get_base_name(), cmdlinet::get_value(), cmdlinet::get_values(), has_prefix(), has_suffix(), goto_cc_cmdlinet::have_infile_arg(), goto_cc_modet::help(), gcc_versiont::is_at_least(), configt::ansi_ct::IS_BIG_ENDIAN, configt::ansi_ct::IS_LITTLE_ENDIAN, cmdlinet::isset(), compilet::LINK_LIBRARY, messaget::M_ERROR, messaget::M_WARNING, configt::ansi_ct::mode, native_tool_name, needs_preprocessing(), goto_cc_cmdlinet::parsed_argv, preprocess(), compilet::PREPROCESS_ONLY, configt::ansi_ct::preprocessor_options, produce_hybrid_binary, run_gcc(), configt::set(), configt::set_arch(), configt::ansi_ct::set_arch_spec_arm(), configt::ansi_ct::set_arch_spec_i386(), configt::ansi_ct::set_arch_spec_x86_64(), configt::ansi_ct::set_c11(), configt::ansi_ct::set_c89(), configt::ansi_ct::set_c99(), configt::cppt::set_cpp11(), configt::cppt::set_cpp14(), configt::ansi_ct::short_int_width, configt::ansi_ct::single_precision_constant, configt::ansi_ct::single_width, configt::this_architecture(), configt::this_operating_system(), configt::ansi_ct::ts_18661_3_Floatn_types, configt::ansi_ct::undefines, configt::ansi_ct::VISUAL_STUDIO, configt::ansi_ct::wchar_t_is_unsigned, and configt::ansi_ct::wchar_t_width.

◆ gcc_hybrid_binary()

◆ help_mode()

void gcc_modet::help_mode ( )
finalvirtual

display command line help

Implements goto_cc_modet.

Definition at line 1077 of file gcc_mode.cpp.

◆ needs_preprocessing()

bool gcc_modet::needs_preprocessing ( const std::string &  file)
staticprotected

Definition at line 305 of file gcc_mode.cpp.

References has_suffix().

Referenced by doit(), and gcc_hybrid_binary().

◆ preprocess()

int gcc_modet::preprocess ( const std::string &  language,
const std::string &  src,
const std::string &  dest,
bool  act_as_bcc 
)
protected

◆ run_gcc()

Member Data Documentation

◆ arch_map

const std::map<std::string, std::set<std::string> > gcc_modet::arch_map
protected

Associate CBMC architectures with processor names.

Definition at line 46 of file gcc_mode.h.

Referenced by doit().

◆ gcc_message_handler

gcc_message_handlert gcc_modet::gcc_message_handler
protected

Definition at line 37 of file gcc_mode.h.

Referenced by doit(), and gcc_hybrid_binary().

◆ gcc_version

gcc_versiont gcc_modet::gcc_version
protected

Definition at line 66 of file gcc_mode.h.

Referenced by doit().

◆ goto_binary_tmp_suffix

const std::string gcc_modet::goto_binary_tmp_suffix
protected

Definition at line 43 of file gcc_mode.h.

Referenced by gcc_hybrid_binary().

◆ native_tool_name

std::string gcc_modet::native_tool_name
protected

Definition at line 41 of file gcc_mode.h.

Referenced by asm_output(), doit(), gcc_hybrid_binary(), preprocess(), and run_gcc().

◆ produce_hybrid_binary

const bool gcc_modet::produce_hybrid_binary
protected

Definition at line 39 of file gcc_mode.h.

Referenced by asm_output(), and doit().


The documentation for this class was generated from the following files: