PandA-2024.02
|
Main class for wrapping the frontend compiler. More...
#include <compiler_wrapper.hpp>
Data Structures | |
class | Compiler |
Class storing information of a compiler. More... | |
Public Member Functions | |
CompilerWrapper (const ParameterConstRef Param, const CompilerWrapper_CompilerTarget _compiler_target, const CompilerWrapper_OptimizationSet OS) | |
Constructor. More... | |
~CompilerWrapper () | |
Destructor. More... | |
Compiler | GetCompiler () const |
Return the compiler for a given target. More... | |
void | FillTreeManager (const tree_managerRef TM, std::vector< std::string > &source_files, const std::string &costTable) |
This function fills the tree manager with the nodes created from a set of source files. More... | |
void | GetSystemIncludes (std::vector< std::string > &includes) const |
Return the list of the frontend compiler system includes. More... | |
void | GetCompilerConfig () const |
Dump the frontend compiler configuration. More... | |
void | QueryCompilerConfig (const std::string &compiler_option) const |
Function that print of stdout some useful information passing the given option. More... | |
std::string | GetCompilerParameters (const std::string &extra_compiler_options, bool no_frontend_compiler_parameters=false) const |
void | CreateExecutable (const std::list< std::string > &file_names, const std::string &executable_name, const std::string &extra_compiler_options, bool no_frontend_compiler_parameters=false) const |
Create an executable starting from source code. More... | |
void | CreateExecutable (const CustomSet< std::string > &file_names, const std::string &executable_name, const std::string &extra_compiler_options, bool no_frontend_compiler_parameters=false) const |
Create an executable starting from source code. More... | |
void | ReadXml (const std::string &file_name) |
Read the frontend compiler configuration from file. More... | |
void | WriteXml (const std::string &file_name) const |
Write the frontend compiler configuration on file. More... | |
Static Public Member Functions | |
static std::string | WriteOptimizationLevel (const CompilerWrapper_OptimizationSet optimization_level) |
Writes the optimization level as a string. More... | |
static size_t | CGetPointerSize (const ParameterConstRef parameters) |
Return the size of the pointer in bit. More... | |
static bool | isCurrentOrNewer (CompilerWrapper_CompilerTarget ct, CompilerWrapper_CompilerTarget compare) |
static bool | isClangCheck (CompilerWrapper_CompilerTarget ct) |
static bool | isGccCheck (CompilerWrapper_CompilerTarget ct) |
static int | getCompatibleCompilers () |
static int | getDefaultCompiler () |
static std::string | getCompilerSuffix (CompilerWrapper_CompilerTarget pc) |
static bool | hasCompilerM64 (CompilerWrapper_CompilerTarget ct) |
static bool | hasCompilerMX32 (CompilerWrapper_CompilerTarget ct) |
static bool | hasCompilerGCCM32 (CompilerWrapper_CompilerTarget ct) |
static bool | hasCompilerCLANGM32 (CompilerWrapper_CompilerTarget ct) |
static std::string | getCompilerVersion (int ct) |
Static Public Attributes | |
static std::string | bambu_ir_info |
The version of the frontend compiler. More... | |
Private Member Functions | |
void | CompileFile (std::string &input_filename, const std::string &output_file, const std::string ¶meters_line, int cm, const std::string &costTable) |
Invoke the frontend compiler to compile file(s) More... | |
std::string | GetAnalyzeCompiler () const |
void | InitializeCompilerParameters () |
Initialize the frontend compiler parameters line. More... | |
void | ReadParameters () |
Analyze the command line options. More... | |
void | SetCompilerDefault () |
Set the default options for the frontend compiler. More... | |
void | SetBambuDefault () |
Set the default options for the frontend compiler in bambu. More... | |
std::string | WriteOptimizationsString () |
Write the string containing the frontend compiler optimization options. More... | |
const std::string | AddSourceCodeIncludes (const std::list< std::string > &source_files) const |
Add includes of source file directories. More... | |
std::string | readExternalSymbols (const std::string &filename) const |
std::string | clang_recipes (const CompilerWrapper_OptimizationSet optimization_level, const std::string &fname) const |
std::string | load_plugin (const std::string &plugin_obj, CompilerWrapper_CompilerTarget target) const |
std::string | load_plugin_opt (std::string plugin_obj, CompilerWrapper_CompilerTarget target) const |
std::string | add_plugin_prefix (CompilerWrapper_CompilerTarget target, std::string O_level="") const |
Private Attributes | |
const ParameterConstRef | Param |
The set of input parameters. More... | |
const CompilerWrapper_CompilerTarget | compiler_target |
The target compiler to be used. More... | |
const CompilerWrapper_OptimizationSet | OS |
The set of optimizations to be applied. More... | |
std::string | frontend_compiler_parameters |
The frontend compiler parameters line for compiling a file. More... | |
std::string | compiler_linking_parameters |
The compiler parameters for executable creation. More... | |
CustomSet< std::string > | already_processed_files |
The set of files for which tree manager has already been computed. More... | |
int | output_level |
debug level More... | |
int | debug_level |
debug level More... | |
std::map< std::string, int > | parameter_values |
The values of optimizations parameters. More... | |
std::map< std::string, bool > | optimization_flags |
The set of activated optimizations. More... | |
std::map< std::string, int > | optimization_values |
The value of parametric activate optimizations. More... | |
Main class for wrapping the frontend compiler.
It allows an XML configuration file to be specified where the parameters and the related values are stored.
Definition at line 110 of file compiler_wrapper.hpp.
CompilerWrapper::CompilerWrapper | ( | const ParameterConstRef | Param, |
const CompilerWrapper_CompilerTarget | _compiler_target, | ||
const CompilerWrapper_OptimizationSet | OS | ||
) |
Constructor.
Param | is the set of parameters |
compiler | is the compiler to be used |
OS | is the optimization set |
Definition at line 380 of file compiler_wrapper.cpp.
References InitializeCompilerParameters(), Param, WriteXml(), and ~CompilerWrapper().
|
default |
|
private |
Definition at line 3500 of file compiler_wrapper.cpp.
References CT_I386_CLANG16.
Referenced by clang_recipes(), and FillTreeManager().
|
private |
Add includes of source file directories.
source_files | are the source files to be considered |
Adding includes of original source code files
Definition at line 2705 of file compiler_wrapper.cpp.
References frontend_compiler_parameters.
Referenced by CreateExecutable().
|
static |
Return the size of the pointer in bit.
parameters | is the set of input parameters |
Definition at line 2913 of file compiler_wrapper.cpp.
References THROW_ERROR.
Referenced by Bit_Value::pointer_resizing(), and InterfaceInfer::interface_info::update().
|
private |
Definition at line 2725 of file compiler_wrapper.cpp.
References add_plugin_prefix(), compiler_target, CT_I386_CLANG10, CT_I386_CLANG11, CT_I386_CLANG12, CT_I386_CLANG13, CT_I386_CLANG16, CT_I386_CLANG4, CT_I386_CLANG5, CT_I386_CLANG6, CT_I386_CLANG7, CT_I386_CLANG8, CT_I386_CLANG9, CT_I386_CLANGVVD, GetCompiler(), load_plugin_opt(), O0, O1, O2, O3, lenet_tvm::opt_level, Param, STR, THROW_ERROR, and WriteOptimizationLevel().
Referenced by FillTreeManager().
|
private |
Invoke the frontend compiler to compile file(s)
input_filename | is the source file name (is modified in case of empty file compilation) |
output_filename | is the output file name |
parameters_line | are the parameters to be passed to the frontend compiler |
multiple_files | is the true in case multiple files are considered. |
cm | is the mode in which we compile |
needed to avoid problem with glibc inlines
remove some extra option not compatible with clang
LTO not yet supported with GCC
assembler files are not allowed so in some cases we pass a C file renamed with extension .S
Definition at line 398 of file compiler_wrapper.cpp.
References test_panda::arg, CM_ANALYZER_ALL, CM_ANALYZER_INTERFACE, CM_ANALYZER_OPTIMIZE, CM_COMPILER_LTO, CM_COMPILER_OPT, CM_COMPILER_STD, CM_EMPTY, CM_LTO_FLAG, CM_OPT_ALL, CM_OPT_DUMPGIMPLE, CM_OPT_EXPANDMEMOPS, CM_OPT_INTERNALIZE, test_panda::command, compiler_target, COMPILING_EC, CopyFile(), CopyStdout(), CT_I386_CLANGVVD, debug_level, DEBUG_LEVEL_VERBOSE, DEBUG_LEVEL_VERY_PEDANTIC, dump_exec_time(), GetAnalyzeCompiler(), GetCompiler(), INDENT_DBG_MEX, INFERRED_INTERFACE_GENERATION, IsError(), load_plugin(), load_plugin_opt(), output_level, OUTPUT_LEVEL_NONE, OUTPUT_LEVEL_VERBOSE, PandaSystem(), Param, PRINT_OUT_MEX, readExternalSymbols(), START_TIME, STOP_TIME, STR, STR_CST_gcc_obj_file, STR_CST_gcc_output, STR_CST_panda_sizeof, STR_CST_string_separator, STR_CST_string_sizeof, THROW_ASSERT, THROW_ERROR, THROW_ERROR_CODE, and unique_path().
Referenced by FillTreeManager().
void CompilerWrapper::CreateExecutable | ( | const std::list< std::string > & | file_names, |
const std::string & | executable_name, | ||
const std::string & | extra_compiler_options, | ||
bool | no_frontend_compiler_parameters = false |
||
) | const |
Create an executable starting from source code.
file_names | is the list of string; it must be a list since in some cases the order matters |
executable_name | is the name of the executable |
extra_compiler_options | is extra options to be used only for this compilation |
Definition at line 2227 of file compiler_wrapper.cpp.
References AddSourceCodeIncludes(), test_panda::command, COMPILING_EC, CopyStdout(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GetCompiler(), GetCompilerParameters(), INDENT_DBG_MEX, IsError(), output_level, OUTPUT_LEVEL_VERBOSE, PandaSystem(), Param, STR_CST_gcc_output, and THROW_ERROR_CODE.
Referenced by CreateExecutable().
void CompilerWrapper::CreateExecutable | ( | const CustomSet< std::string > & | file_names, |
const std::string & | executable_name, | ||
const std::string & | extra_compiler_options, | ||
bool | no_frontend_compiler_parameters = false |
||
) | const |
Create an executable starting from source code.
file_names | is the set of filename |
executable_name | is the name of the executable |
extra_compiler_options | is extra options to be used only for this compilation |
Definition at line 2215 of file compiler_wrapper.cpp.
References CreateExecutable().
void CompilerWrapper::FillTreeManager | ( | const tree_managerRef | TM, |
std::vector< std::string > & | source_files, | ||
const std::string & | costTable | ||
) |
This function fills the tree manager with the nodes created from a set of source files.
TM | is where tree_manager will be stored |
source_files | are the source files to be compiled; key is the original source code file, value is the transformed source code file |
check for aligned option
Definition at line 710 of file compiler_wrapper.cpp.
References __escape_define(), add_plugin_prefix(), clang_recipes(), CM_ANALYZER_ALL, CM_ANALYZER_INTERFACE, CM_COMPILER_LTO, CM_COMPILER_OPT, CM_COMPILER_STD, CM_EMPTY, CM_LTO_FLAG, CM_OPT_ALL, CM_OPT_DUMPGIMPLE, CM_OPT_INTERNALIZE, CompileFile(), compiler_target, container_to_string(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, dump_exec_time(), flopoco::filename, frontend_compiler_parameters, GetCompiler(), INDENT_DBG_MEX, INDENT_OUT_MEX, tree_manager::merge_tree_managers(), O3, O4, O5, optimization_flags, output_level, OUTPUT_LEVEL_MINIMUM, OUTPUT_LEVEL_VERBOSE, Param, ParseTreeFile(), START_TIME, STOP_TIME, STR_CST_bambu_ir_suffix, STR_CST_string_separator, THROW_ASSERT, THROW_ERROR, THROW_WARNING, and unique_path().
|
private |
Definition at line 2082 of file compiler_wrapper.cpp.
References Param, relocate_compiler_path(), and THROW_ERROR.
Referenced by CompileFile().
|
static |
Definition at line 2967 of file compiler_wrapper.cpp.
References CT_I386_CLANG10, CT_I386_CLANG11, CT_I386_CLANG12, CT_I386_CLANG13, CT_I386_CLANG16, CT_I386_CLANG4, CT_I386_CLANG5, CT_I386_CLANG6, CT_I386_CLANG7, CT_I386_CLANG8, CT_I386_CLANG9, CT_I386_CLANGVVD, CT_I386_GCC49, CT_I386_GCC5, CT_I386_GCC6, CT_I386_GCC7, and CT_I386_GCC8.
Referenced by tree_panda_gcc_parameter::SetDefaults(), and BambuParameter::SetDefaults().
CompilerWrapper::Compiler CompilerWrapper::GetCompiler | ( | ) | const |
Return the compiler for a given target.
Definition at line 1485 of file compiler_wrapper.cpp.
References CompilerWrapper::Compiler::ASTAnalyzer_plugin_name, CompilerWrapper::Compiler::ASTAnalyzer_plugin_obj, compiler_target, CompilerWrapper::Compiler::cpp, CompilerWrapper::Compiler::CSROA_plugin_name, CompilerWrapper::Compiler::CSROA_plugin_obj, CT_I386_CLANG10, CT_I386_CLANG11, CT_I386_CLANG12, CT_I386_CLANG13, CT_I386_CLANG16, CT_I386_CLANG4, CT_I386_CLANG5, CT_I386_CLANG6, CT_I386_CLANG7, CT_I386_CLANG8, CT_I386_CLANG9, CT_I386_CLANGVVD, CT_I386_GCC49, CT_I386_GCC5, CT_I386_GCC6, CT_I386_GCC7, CT_I386_GCC8, CT_NO_COMPILER, CompilerWrapper::Compiler::empty_plugin_name, CompilerWrapper::Compiler::empty_plugin_obj, CompilerWrapper::Compiler::expandMemOps_plugin_name, CompilerWrapper::Compiler::expandMemOps_plugin_obj, CompilerWrapper::Compiler::extra_options, CompilerWrapper::Compiler::gcc, CompilerWrapper::Compiler::GepiCanon_plugin_name, CompilerWrapper::Compiler::GepiCanon_plugin_obj, CompilerWrapper::Compiler::is_clang, CompilerWrapper::Compiler::llvm_link, CompilerWrapper::Compiler::llvm_opt, optimization_flags, Param, relocate_compiler_path(), CompilerWrapper::Compiler::ssa_plugin_name, CompilerWrapper::Compiler::ssa_plugin_obj, STR, THROW_ASSERT, THROW_ERROR, CompilerWrapper::Compiler::topfname_plugin_name, and CompilerWrapper::Compiler::topfname_plugin_obj.
Referenced by clang_recipes(), CompileFile(), CreateExecutable(), FillTreeManager(), GetCompilerParameters(), GetSystemIncludes(), and QueryCompilerConfig().
void CompilerWrapper::GetCompilerConfig | ( | ) | const |
Dump the frontend compiler configuration.
Definition at line 2168 of file compiler_wrapper.cpp.
References QueryCompilerConfig().
std::string CompilerWrapper::GetCompilerParameters | ( | const std::string & | extra_compiler_options, |
bool | no_frontend_compiler_parameters = false |
||
) | const |
needed to avoid problem with glibc inlines
Definition at line 2187 of file compiler_wrapper.cpp.
References test_panda::command, compiler_linking_parameters, debug_level, DEBUG_LEVEL_VERY_PEDANTIC, frontend_compiler_parameters, GetCompiler(), and INDENT_DBG_MEX.
Referenced by CreateExecutable().
|
static |
Definition at line 3069 of file compiler_wrapper.cpp.
References CT_I386_CLANG10, CT_I386_CLANG11, CT_I386_CLANG12, CT_I386_CLANG13, CT_I386_CLANG16, CT_I386_CLANG4, CT_I386_CLANG5, CT_I386_CLANG6, CT_I386_CLANG7, CT_I386_CLANG8, CT_I386_CLANG9, CT_I386_CLANGVVD, CT_I386_GCC49, CT_I386_GCC5, CT_I386_GCC6, CT_I386_GCC7, CT_I386_GCC8, CT_NO_COMPILER, and THROW_ERROR.
Referenced by BambuParameter::add_bambu_library(), and Parameter::CheckParameters().
|
static |
Definition at line 3296 of file compiler_wrapper.cpp.
References CT_I386_CLANG10, CT_I386_CLANG11, CT_I386_CLANG12, CT_I386_CLANG13, CT_I386_CLANG16, CT_I386_CLANG4, CT_I386_CLANG5, CT_I386_CLANG6, CT_I386_CLANG7, CT_I386_CLANG8, CT_I386_CLANG9, CT_I386_CLANGVVD, CT_I386_GCC49, CT_I386_GCC5, CT_I386_GCC6, CT_I386_GCC7, CT_I386_GCC8, and THROW_ERROR.
Referenced by Parameter::ManageDefaultOptions().
|
static |
Definition at line 3024 of file compiler_wrapper.cpp.
References CT_I386_CLANG10, CT_I386_CLANG11, CT_I386_CLANG12, CT_I386_CLANG13, CT_I386_CLANG16, CT_I386_CLANG4, CT_I386_CLANG5, CT_I386_CLANG6, CT_I386_CLANG7, CT_I386_CLANG8, CT_I386_CLANG9, CT_I386_CLANGVVD, CT_I386_GCC49, CT_I386_GCC5, CT_I386_GCC6, CT_I386_GCC7, CT_I386_GCC8, and THROW_ERROR.
Referenced by tree_panda_gcc_parameter::SetDefaults(), and BambuParameter::SetDefaults().
void CompilerWrapper::GetSystemIncludes | ( | std::vector< std::string > & | includes | ) | const |
Return the list of the frontend compiler system includes.
includes | is where result will be stored |
This string contains the path and name of the compiler to be invoked
Definition at line 2119 of file compiler_wrapper.cpp.
References test_panda::command, CompilerWrapper::Compiler::cpp, GetCompiler(), GetPath(), IsError(), line(), output_level, OUTPUT_LEVEL_PEDANTIC, PandaSystem(), Param, PRINT_OUT_MEX, SplitString(), STR_CST_gcc_include, THROW_ERROR, and util_print_cpu_stats().
|
static |
Definition at line 3252 of file compiler_wrapper.cpp.
References CT_I386_CLANG10, CT_I386_CLANG11, CT_I386_CLANG12, CT_I386_CLANG13, CT_I386_CLANG16, CT_I386_CLANG4, CT_I386_CLANG5, CT_I386_CLANG6, CT_I386_CLANG7, CT_I386_CLANG8, CT_I386_CLANG9, and CT_I386_CLANGVVD.
Referenced by BambuParameter::add_experimental_setup_compiler_options(), and Parameter::CheckParameters().
|
static |
Definition at line 3231 of file compiler_wrapper.cpp.
References CT_I386_GCC49, CT_I386_GCC5, CT_I386_GCC6, CT_I386_GCC7, and CT_I386_GCC8.
Referenced by BambuParameter::add_experimental_setup_compiler_options(), and Parameter::CheckParameters().
|
static |
Definition at line 3117 of file compiler_wrapper.cpp.
References CT_I386_CLANG10, CT_I386_CLANG11, CT_I386_CLANG12, CT_I386_CLANG13, CT_I386_CLANG16, CT_I386_CLANG4, CT_I386_CLANG5, CT_I386_CLANG6, CT_I386_CLANG7, CT_I386_CLANG8, CT_I386_CLANG9, CT_I386_CLANGVVD, CT_I386_GCC49, CT_I386_GCC5, CT_I386_GCC6, CT_I386_GCC7, and CT_I386_GCC8.
Referenced by BambuParameter::add_experimental_setup_compiler_options(), and Parameter::CheckParameters().
|
static |
Definition at line 3174 of file compiler_wrapper.cpp.
References CT_I386_CLANG10, CT_I386_CLANG11, CT_I386_CLANG12, CT_I386_CLANG13, CT_I386_CLANG16, CT_I386_CLANG4, CT_I386_CLANG5, CT_I386_CLANG6, CT_I386_CLANG7, CT_I386_CLANG8, CT_I386_CLANG9, CT_I386_CLANGVVD, CT_I386_GCC49, CT_I386_GCC5, CT_I386_GCC6, CT_I386_GCC7, and CT_I386_GCC8.
Referenced by BambuParameter::add_experimental_setup_compiler_options(), and Parameter::CheckParameters().
|
private |
Initialize the frontend compiler parameters line.
OS | is the optimizations set to be considered |
Filling optimizations map
Adding standard
Adding defines
Adding undefines
Adding warnings
Adding includes
Adding libraries
Adding library directories
Definition at line 927 of file compiler_wrapper.cpp.
References __escape_define(), compiler_linking_parameters, debug_level, DEBUG_LEVEL_VERY_PEDANTIC, frontend_compiler_parameters, INDENT_DBG_MEX, isClangCheck(), O0, O1, O2, O3, O4, O5, OBAMBU, Ofast, Og, optimization_flags, Os, OS, OSF, Oz, Param, ReadParameters(), ReadXml(), SetBambuDefault(), SetCompilerDefault(), THROW_UNREACHABLE, WriteOptimizationLevel(), and WriteOptimizationsString().
Referenced by CompilerWrapper().
|
static |
Definition at line 2944 of file compiler_wrapper.cpp.
References CT_I386_CLANG10, CT_I386_CLANG11, CT_I386_CLANG12, CT_I386_CLANG13, CT_I386_CLANG16, CT_I386_CLANG4, CT_I386_CLANG5, CT_I386_CLANG6, CT_I386_CLANG7, CT_I386_CLANG8, CT_I386_CLANG9, and CT_I386_CLANGVVD.
Referenced by BambuParameter::CheckParameters(), CTestbenchExecution::Exec(), InitializeCompilerParameters(), and SetCompilerDefault().
|
static |
Definition at line 2935 of file compiler_wrapper.cpp.
References isGccCheck(), and THROW_ERROR.
Referenced by tree_panda_gcc_parameter::CheckParameters(), BambuParameter::CheckParameters(), and CTestbenchExecution::Exec().
|
static |
Definition at line 2960 of file compiler_wrapper.cpp.
References CT_I386_GCC49, CT_I386_GCC5, CT_I386_GCC6, CT_I386_GCC7, and CT_I386_GCC8.
Referenced by tree_panda_gcc_parameter::CheckParameters(), BambuParameter::CheckParameters(), isCurrentOrNewer(), and SetBambuDefault().
|
private |
Definition at line 3478 of file compiler_wrapper.cpp.
References CT_I386_CLANG13, and CT_I386_CLANG16.
Referenced by CompileFile().
|
private |
Definition at line 3488 of file compiler_wrapper.cpp.
References CT_I386_CLANG13, and CT_I386_CLANG16.
Referenced by clang_recipes(), and CompileFile().
void CompilerWrapper::QueryCompilerConfig | ( | const std::string & | compiler_option | ) | const |
Function that print of stdout some useful information passing the given option.
Definition at line 2173 of file compiler_wrapper.cpp.
References test_panda::command, CopyStdout(), CompilerWrapper::Compiler::gcc, GetCompiler(), IsError(), PandaSystem(), Param, STR_CST_file_IO_shell_output_file, and THROW_ERROR.
Referenced by GetCompilerConfig().
|
private |
load xml memory allocation file
Definition at line 3404 of file compiler_wrapper.cpp.
References CE_XVM, debug_level, DEBUG_LEVEL_VERY_PEDANTIC, XMLDomParser::Exec(), xml_child::get_children(), XMLDomParser::get_document(), INDENT_DBG_MEX, LOAD_XVM, Param, test_panda::parser, and THROW_ERROR.
Referenced by CompileFile().
|
private |
Analyze the command line options.
Definition at line 2278 of file compiler_wrapper.cpp.
References debug_level, DEBUG_LEVEL_VERY_PEDANTIC, INDENT_DBG_MEX, key, optimization_flags, Param, parameter_values, test_panda::parameters, str, THROW_ASSERT, THROW_ERROR, and symmetry::value.
Referenced by InitializeCompilerParameters().
void CompilerWrapper::ReadXml | ( | const std::string & | file_name | ) |
Read the frontend compiler configuration from file.
file_name | is the name of the file |
Definition at line 2420 of file compiler_wrapper.cpp.
References compiler_linking_parameters, XMLDomParser::Exec(), frontend_compiler_parameters, attribute_sequence::get_attribute(), xml_child::get_children(), XMLDomParser::get_document(), xml_attribute::get_value(), optimization_flags, optimization_values, parameter_values, test_panda::parser, STR_XML_gcc_defines, STR_XML_gcc_includes, STR_XML_gcc_libraries, STR_XML_gcc_library_directories, STR_XML_gcc_name, STR_XML_gcc_optimization_flags, STR_XML_gcc_optimization_values, STR_XML_gcc_optimizations, STR_XML_gcc_parameter_values, STR_XML_gcc_standard, STR_XML_gcc_undefines, STR_XML_gcc_value, STR_XML_gcc_warnings, THROW_ERROR, and WriteOptimizationsString().
Referenced by InitializeCompilerParameters().
|
private |
Set the default options for the frontend compiler in bambu.
parameters with enable
bambu assumes twos complement arithmetic
builtin function;
FIXME: this has been always active with gcc >= 4.6; produced c code in bambu for example
gcc_regression_simple/20040307-1.c when disabled
artificial functions are not analyzed by the plugin
-f option with values
-param option with with values
Disable duplication of loop headers to preserve openmp for structure
Disable optimizations which break loops patterns
Definition at line 1111 of file compiler_wrapper.cpp.
References CT_I386_CLANG10, CT_I386_CLANG11, CT_I386_CLANG12, CT_I386_CLANG13, CT_I386_CLANG16, CT_I386_CLANG4, CT_I386_CLANG5, CT_I386_CLANG6, CT_I386_CLANG7, CT_I386_CLANG8, CT_I386_CLANG9, CT_I386_CLANGVVD, CT_I386_GCC49, CT_I386_GCC5, CT_I386_GCC6, CT_I386_GCC7, CT_I386_GCC8, debug_level, DEBUG_LEVEL_VERBOSE, INDENT_DBG_MEX, INFERRED_INTERFACE_GENERATION, isGccCheck(), O3, O4, O5, Ofast, lenet_tvm::opt_level, optimization_flags, OSF, Param, and parameter_values.
Referenced by InitializeCompilerParameters().
|
private |
Set the default options for the frontend compiler.
In the gcc documentation is not clear if unit-at-a-time is activated or not at O0; However it has to be activated to manage empty files
optimization_flags["unit-at-a-time"] = false;
required by PandA
needed to correctly manage global variables
needed to remove unnecessary computations
disable vectorization
disable superword-level parallelism vectorization
in case we are compiling C++ code
Definition at line 1274 of file compiler_wrapper.cpp.
References compiler_target, CT_I386_CLANG10, CT_I386_CLANG11, CT_I386_CLANG12, CT_I386_CLANG13, CT_I386_CLANG16, CT_I386_CLANG4, CT_I386_CLANG5, CT_I386_CLANG6, CT_I386_CLANG7, CT_I386_CLANG8, CT_I386_CLANG9, CT_I386_CLANGVVD, CT_I386_GCC49, CT_I386_GCC5, CT_I386_GCC6, CT_I386_GCC7, CT_I386_GCC8, CT_NO_COMPILER, debug_level, DEBUG_LEVEL_VERBOSE, frontend_compiler_parameters, INDENT_DBG_MEX, isClangCheck(), O0, O1, O2, O3, O4, O5, OBAMBU, Ofast, Og, optimization_flags, Os, OSF, Oz, Param, THROW_UNREACHABLE, and WriteOptimizationLevel().
Referenced by InitializeCompilerParameters().
|
static |
Writes the optimization level as a string.
optimization_level | is the optimization level to be printed |
Definition at line 2318 of file compiler_wrapper.cpp.
References O0, O1, O2, O3, O4, O5, OBAMBU, Ofast, Og, Os, OSF, Oz, and THROW_UNREACHABLE.
Referenced by clang_recipes(), InitializeCompilerParameters(), and SetCompilerDefault().
|
private |
Write the string containing the frontend compiler optimization options.
Preparing optimizations string
Definition at line 2354 of file compiler_wrapper.cpp.
References optimization_flags, optimization_values, parameter_values, and THROW_ASSERT.
Referenced by InitializeCompilerParameters(), and ReadXml().
void CompilerWrapper::WriteXml | ( | const std::string & | file_name | ) | const |
Write the frontend compiler configuration on file.
file_name | is the name of the file |
Definition at line 2669 of file compiler_wrapper.cpp.
References xml_child::add_child_element(), xml_document::create_root_node(), optimization_flags, optimization_values, parameter_values, attribute_sequence::set_attribute(), STR, STR_XML_gcc_name, STR_XML_gcc_optimization_flag, STR_XML_gcc_optimization_value, STR_XML_gcc_optimizations, STR_XML_gcc_parameter_value, STR_XML_gcc_parameter_values, STR_XML_gcc_root, STR_XML_gcc_value, and xml_document::write_to_file_formatted().
Referenced by CompilerWrapper().
|
private |
The set of files for which tree manager has already been computed.
Definition at line 184 of file compiler_wrapper.hpp.
|
static |
The version of the frontend compiler.
Definition at line 261 of file compiler_wrapper.hpp.
Referenced by __escape_define(), and tree_manager::print().
|
private |
The compiler parameters for executable creation.
Definition at line 181 of file compiler_wrapper.hpp.
Referenced by GetCompilerParameters(), InitializeCompilerParameters(), and ReadXml().
|
private |
The target compiler to be used.
Definition at line 172 of file compiler_wrapper.hpp.
Referenced by clang_recipes(), CompileFile(), FillTreeManager(), GetCompiler(), and SetCompilerDefault().
|
private |
debug level
Definition at line 190 of file compiler_wrapper.hpp.
Referenced by CompileFile(), CreateExecutable(), FillTreeManager(), GetCompilerParameters(), InitializeCompilerParameters(), readExternalSymbols(), ReadParameters(), SetBambuDefault(), and SetCompilerDefault().
|
private |
The frontend compiler parameters line for compiling a file.
Definition at line 178 of file compiler_wrapper.hpp.
Referenced by AddSourceCodeIncludes(), FillTreeManager(), GetCompilerParameters(), InitializeCompilerParameters(), ReadXml(), and SetCompilerDefault().
The set of activated optimizations.
Definition at line 196 of file compiler_wrapper.hpp.
Referenced by FillTreeManager(), GetCompiler(), InitializeCompilerParameters(), ReadParameters(), ReadXml(), SetBambuDefault(), SetCompilerDefault(), WriteOptimizationsString(), and WriteXml().
|
private |
The value of parametric activate optimizations.
Definition at line 199 of file compiler_wrapper.hpp.
Referenced by ReadXml(), WriteOptimizationsString(), and WriteXml().
|
private |
The set of optimizations to be applied.
Definition at line 175 of file compiler_wrapper.hpp.
Referenced by InitializeCompilerParameters().
|
private |
debug level
Definition at line 187 of file compiler_wrapper.hpp.
Referenced by CompileFile(), CreateExecutable(), FillTreeManager(), and GetSystemIncludes().
|
private |
The set of input parameters.
Definition at line 169 of file compiler_wrapper.hpp.
Referenced by clang_recipes(), CompileFile(), CompilerWrapper(), CreateExecutable(), FillTreeManager(), GetAnalyzeCompiler(), GetCompiler(), GetSystemIncludes(), InitializeCompilerParameters(), QueryCompilerConfig(), readExternalSymbols(), ReadParameters(), SetBambuDefault(), and SetCompilerDefault().
|
private |
The values of optimizations parameters.
Definition at line 193 of file compiler_wrapper.hpp.
Referenced by ReadParameters(), ReadXml(), SetBambuDefault(), WriteOptimizationsString(), and WriteXml().