cprover
|
#include "c_preprocess.h"
#include <util/c_types.h>
#include <util/config.h>
#include <util/suffix.h>
#include <util/tempfile.h>
#include <util/unicode.h>
#include <fstream>
Go to the source code of this file.
Functions | |
static std::string | shell_quote (const std::string &src) |
quote a string for bash and CMD More... | |
static void | error_parse_line (const std::string &line, bool warning_only, messaget &message) |
static void | error_parse (std::istream &errors, bool warning_only, messaget &message) |
bool | c_preprocess (std::istream &instream, std::ostream &outstream, message_handlert &message_handler) |
ANSI-C preprocessing. More... | |
static bool | is_dot_i_file (const std::string &path) |
ANSI-C preprocessing. More... | |
bool | c_preprocess_codewarrior (const std::string &, std::ostream &, message_handlert &) |
ANSI-C preprocessing. More... | |
bool | c_preprocess_arm (const std::string &file, std::ostream &outstream, message_handlert &message_handler) |
ANSI-C preprocessing. More... | |
bool | c_preprocess_gcc_clang (const std::string &file, std::ostream &outstream, message_handlert &message_handler, configt::ansi_ct::preprocessort preprocessor) |
ANSI-C preprocessing. More... | |
bool | c_preprocess_none (const std::string &file, std::ostream &outstream, message_handlert &message_handler) |
ANSI-C preprocessing. More... | |
bool | c_preprocess_visual_studio (const std::string &file, std::ostream &outstream, message_handlert &message_handler) |
ANSI-C preprocessing. More... | |
bool | c_preprocess (const std::string &path, std::ostream &outstream, message_handlert &message_handler) |
void | postprocess_codewarrior (std::istream &instream, std::ostream &outstream) |
post-processing specifically for CodeWarrior More... | |
bool | test_c_preprocessor (message_handlert &message_handler) |
Variables | |
const char | c_test_program [] |
tests ANSI-C preprocessing More... | |
bool c_preprocess | ( | std::istream & | instream, |
std::ostream & | outstream, | ||
message_handlert & | message_handler | ||
) |
ANSI-C preprocessing.
Definition at line 225 of file c_preprocess.cpp.
References c_preprocess(), messaget::eom(), messaget::error(), and message_handler.
Referenced by c_preprocess(), ansi_c_languaget::preprocess(), cpp_languaget::preprocess(), and test_c_preprocessor().
bool c_preprocess | ( | const std::string & | path, |
std::ostream & | outstream, | ||
message_handlert & | message_handler | ||
) |
Definition at line 271 of file c_preprocess.cpp.
References configt::ansi_c, configt::ansi_ct::ARM, c_preprocess_arm(), c_preprocess_codewarrior(), c_preprocess_gcc_clang(), c_preprocess_none(), c_preprocess_visual_studio(), configt::ansi_ct::CLANG, configt::ansi_ct::CODEWARRIOR, config, configt::ansi_ct::GCC, message_handler, configt::ansi_ct::NONE, configt::ansi_ct::preprocessor, and configt::ansi_ct::VISUAL_STUDIO.
bool c_preprocess_arm | ( | const std::string & | file, |
std::ostream & | outstream, | ||
message_handlert & | message_handler | ||
) |
ANSI-C preprocessing.
Definition at line 696 of file c_preprocess.cpp.
References configt::ansi_c, configt::ansi_ct::C11, configt::ansi_ct::C89, configt::ansi_ct::C99, c_preprocess_none(), configt::ansi_ct::c_standard, configt::ansi_ct::char_is_unsigned, config, configt::ansi_ct::defines, configt::ansi_ct::endianness, messaget::eom(), messaget::error(), error_parse(), configt::ansi_ct::include_paths, configt::ansi_ct::IS_BIG_ENDIAN, is_dot_i_file(), message_handler, and shell_quote().
Referenced by c_preprocess().
bool c_preprocess_codewarrior | ( | const std::string & | file, |
std::ostream & | outstream, | ||
message_handlert & | message_handler | ||
) |
ANSI-C preprocessing.
Definition at line 452 of file c_preprocess.cpp.
References configt::ansi_c, c_preprocess_none(), config, configt::ansi_ct::defines, messaget::eom(), messaget::error(), error_parse(), configt::ansi_ct::include_files, configt::ansi_ct::include_paths, is_dot_i_file(), message_handler, postprocess_codewarrior(), configt::ansi_ct::preprocessor_options, and shell_quote().
Referenced by c_preprocess().
bool c_preprocess_gcc_clang | ( | const std::string & | file, |
std::ostream & | outstream, | ||
message_handlert & | message_handler, | ||
configt::ansi_ct::preprocessort | preprocessor | ||
) |
ANSI-C preprocessing.
Definition at line 520 of file c_preprocess.cpp.
References configt::ansi_c, configt::ansi_ct::C11, configt::ansi_ct::C89, configt::ansi_ct::C99, c_preprocess_none(), configt::ansi_ct::c_standard, configt::ansi_ct::char_is_unsigned, configt::ansi_ct::CLANG, config, configt::cpp, configt::cppt::CPP03, configt::cppt::CPP11, configt::cppt::CPP14, configt::cppt::CPP98, configt::cppt::cpp_standard, configt::ansi_ct::defines, messaget::eom(), messaget::error(), error_parse(), has_suffix(), configt::ansi_ct::include_files, configt::ansi_ct::include_paths, is_dot_i_file(), message_handler, configt::ansi_ct::mode, configt::ansi_ct::NO_OS, configt::ansi_ct::os, configt::ansi_ct::pointer_width, configt::ansi_ct::preprocessor_options, shell_quote(), configt::ansi_ct::short_int_width, and configt::ansi_ct::wchar_t_width.
Referenced by c_preprocess().
bool c_preprocess_none | ( | const std::string & | file, |
std::ostream & | outstream, | ||
message_handlert & | message_handler | ||
) |
ANSI-C preprocessing.
Definition at line 804 of file c_preprocess.cpp.
References configt::ansi_c, configt::ansi_ct::CODEWARRIOR, config, messaget::eom(), messaget::error(), message_handler, configt::ansi_ct::mode, postprocess_codewarrior(), and widen().
Referenced by c_preprocess(), c_preprocess_arm(), c_preprocess_codewarrior(), c_preprocess_gcc_clang(), and c_preprocess_visual_studio().
bool c_preprocess_visual_studio | ( | const std::string & | file, |
std::ostream & | outstream, | ||
message_handlert & | message_handler | ||
) |
ANSI-C preprocessing.
Definition at line 306 of file c_preprocess.cpp.
References configt::ansi_c, c_preprocess_none(), configt::ansi_ct::char_is_unsigned, config, DATA_INVARIANT, configt::ansi_ct::defines, messaget::eom(), messaget::error(), error_parse(), configt::ansi_ct::include_files, configt::ansi_ct::include_paths, configt::ansi_ct::int_width, is_dot_i_file(), message_handler, pointer_diff_type(), configt::ansi_ct::pointer_width, shell_quote(), signed_int_type(), signed_long_int_type(), and signed_long_long_int_type().
Referenced by c_preprocess().
|
static |
Definition at line 213 of file c_preprocess.cpp.
References error_parse_line().
Referenced by c_preprocess_arm(), c_preprocess_codewarrior(), c_preprocess_gcc_clang(), and c_preprocess_visual_studio().
|
static |
Definition at line 93 of file c_preprocess.cpp.
References messaget::eom(), messaget::error(), has_prefix(), source_locationt::set_column(), source_locationt::set_file(), source_locationt::set_function(), source_locationt::set_line(), messaget::mstreamt::source_location, and messaget::warning().
Referenced by error_parse().
|
static |
ANSI-C preprocessing.
Definition at line 251 of file c_preprocess.cpp.
References has_suffix().
Referenced by c_preprocess_arm(), c_preprocess_codewarrior(), c_preprocess_gcc_clang(), and c_preprocess_visual_studio().
void postprocess_codewarrior | ( | std::istream & | instream, |
std::ostream & | outstream | ||
) |
post-processing specifically for CodeWarrior
Definition at line 416 of file c_preprocess.cpp.
Referenced by c_preprocess_codewarrior(), and c_preprocess_none().
|
static |
quote a string for bash and CMD
Definition at line 20 of file c_preprocess.cpp.
Referenced by c_preprocess_arm(), c_preprocess_codewarrior(), c_preprocess_gcc_clang(), and c_preprocess_visual_studio().
bool test_c_preprocessor | ( | message_handlert & | message_handler | ) |
Definition at line 844 of file c_preprocess.cpp.
References c_preprocess(), c_test_program, and message_handler.
Referenced by cbmc_parse_optionst::doit().
const char c_test_program[] |
tests ANSI-C preprocessing
Definition at line 839 of file c_preprocess.cpp.
Referenced by test_c_preprocessor().