PandA-2024.02
Data Structures | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
CompilerWrapper Class Reference

Main class for wrapping the frontend compiler. More...

#include <compiler_wrapper.hpp>

Collaboration diagram for CompilerWrapper:
Collaboration graph
[legend]

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 &parameters_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, booloptimization_flags
 The set of activated optimizations. More...
 
std::map< std::string, int > optimization_values
 The value of parametric activate optimizations. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CompilerWrapper()

CompilerWrapper::CompilerWrapper ( const ParameterConstRef  Param,
const CompilerWrapper_CompilerTarget  _compiler_target,
const CompilerWrapper_OptimizationSet  OS 
)

Constructor.

Parameters
Paramis the set of parameters
compileris the compiler to be used
OSis the optimization set

Definition at line 380 of file compiler_wrapper.cpp.

References InitializeCompilerParameters(), Param, WriteXml(), and ~CompilerWrapper().

Here is the call graph for this function:

◆ ~CompilerWrapper()

CompilerWrapper::~CompilerWrapper ( )
default

Destructor.

Referenced by CompilerWrapper().

Here is the caller graph for this function:

Member Function Documentation

◆ add_plugin_prefix()

std::string CompilerWrapper::add_plugin_prefix ( CompilerWrapper_CompilerTarget  target,
std::string  O_level = "" 
) const
private

Definition at line 3500 of file compiler_wrapper.cpp.

References CT_I386_CLANG16.

Referenced by clang_recipes(), and FillTreeManager().

Here is the caller graph for this function:

◆ AddSourceCodeIncludes()

const std::string CompilerWrapper::AddSourceCodeIncludes ( const std::list< std::string > &  source_files) const
private

Add includes of source file directories.

Parameters
source_filesare the source files to be considered
Returns
the string to be passed to the frontend compiler

Adding includes of original source code files

Definition at line 2705 of file compiler_wrapper.cpp.

References frontend_compiler_parameters.

Referenced by CreateExecutable().

Here is the caller graph for this function:

◆ CGetPointerSize()

size_t CompilerWrapper::CGetPointerSize ( const ParameterConstRef  parameters)
static

Return the size of the pointer in bit.

Parameters
parametersis the set of input parameters
Returns
the size of pointers in bit

Definition at line 2913 of file compiler_wrapper.cpp.

References THROW_ERROR.

Referenced by Bit_Value::pointer_resizing(), and InterfaceInfer::interface_info::update().

Here is the caller graph for this function:

◆ clang_recipes()

std::string CompilerWrapper::clang_recipes ( const CompilerWrapper_OptimizationSet  optimization_level,
const std::string &  fname 
) const
private

◆ CompileFile()

void CompilerWrapper::CompileFile ( std::string &  input_filename,
const std::string &  output_file,
const std::string &  parameters_line,
int  cm,
const std::string &  costTable 
)
private

Invoke the frontend compiler to compile file(s)

Parameters
input_filenameis the source file name (is modified in case of empty file compilation)
output_filenameis the output file name
parameters_lineare the parameters to be passed to the frontend compiler
multiple_filesis the true in case multiple files are considered.
cmis 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateExecutable() [1/2]

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.

Parameters
file_namesis the list of string; it must be a list since in some cases the order matters
executable_nameis the name of the executable
extra_compiler_optionsis 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateExecutable() [2/2]

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.

Parameters
file_namesis the set of filename
executable_nameis the name of the executable
extra_compiler_optionsis extra options to be used only for this compilation

Definition at line 2215 of file compiler_wrapper.cpp.

References CreateExecutable().

Here is the call graph for this function:

◆ FillTreeManager()

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.

Parameters
TMis where tree_manager will be stored
source_filesare 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().

Here is the call graph for this function:

◆ GetAnalyzeCompiler()

std::string CompilerWrapper::GetAnalyzeCompiler ( ) const
private

Definition at line 2082 of file compiler_wrapper.cpp.

References Param, relocate_compiler_path(), and THROW_ERROR.

Referenced by CompileFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCompatibleCompilers()

int CompilerWrapper::getCompatibleCompilers ( )
static

◆ GetCompiler()

CompilerWrapper::Compiler CompilerWrapper::GetCompiler ( ) const

Return the compiler for a given target.

Returns
a structure containing information about compiler

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCompilerConfig()

void CompilerWrapper::GetCompilerConfig ( ) const

Dump the frontend compiler configuration.

Definition at line 2168 of file compiler_wrapper.cpp.

References QueryCompilerConfig().

Here is the call graph for this function:

◆ GetCompilerParameters()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCompilerSuffix()

std::string CompilerWrapper::getCompilerSuffix ( CompilerWrapper_CompilerTarget  pc)
static

◆ getCompilerVersion()

std::string CompilerWrapper::getCompilerVersion ( int  ct)
static

◆ getDefaultCompiler()

int CompilerWrapper::getDefaultCompiler ( )
static

◆ GetSystemIncludes()

void CompilerWrapper::GetSystemIncludes ( std::vector< std::string > &  includes) const

Return the list of the frontend compiler system includes.

Parameters
includesis 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().

Here is the call graph for this function:

◆ hasCompilerCLANGM32()

bool CompilerWrapper::hasCompilerCLANGM32 ( CompilerWrapper_CompilerTarget  ct)
static

◆ hasCompilerGCCM32()

bool CompilerWrapper::hasCompilerGCCM32 ( CompilerWrapper_CompilerTarget  ct)
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().

Here is the caller graph for this function:

◆ hasCompilerM64()

bool CompilerWrapper::hasCompilerM64 ( CompilerWrapper_CompilerTarget  ct)
static

◆ hasCompilerMX32()

bool CompilerWrapper::hasCompilerMX32 ( CompilerWrapper_CompilerTarget  ct)
static

◆ InitializeCompilerParameters()

void CompilerWrapper::InitializeCompilerParameters ( )
private

Initialize the frontend compiler parameters line.

Parameters
OSis the optimizations set to be considered
Returns
the string with the parameters

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isClangCheck()

bool CompilerWrapper::isClangCheck ( CompilerWrapper_CompilerTarget  ct)
static

◆ isCurrentOrNewer()

bool CompilerWrapper::isCurrentOrNewer ( CompilerWrapper_CompilerTarget  ct,
CompilerWrapper_CompilerTarget  compare 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isGccCheck()

bool CompilerWrapper::isGccCheck ( CompilerWrapper_CompilerTarget  ct)
static

◆ load_plugin()

std::string CompilerWrapper::load_plugin ( const std::string &  plugin_obj,
CompilerWrapper_CompilerTarget  target 
) const
private

Definition at line 3478 of file compiler_wrapper.cpp.

References CT_I386_CLANG13, and CT_I386_CLANG16.

Referenced by CompileFile().

Here is the caller graph for this function:

◆ load_plugin_opt()

std::string CompilerWrapper::load_plugin_opt ( std::string  plugin_obj,
CompilerWrapper_CompilerTarget  target 
) const
private

Definition at line 3488 of file compiler_wrapper.cpp.

References CT_I386_CLANG13, and CT_I386_CLANG16.

Referenced by clang_recipes(), and CompileFile().

Here is the caller graph for this function:

◆ QueryCompilerConfig()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readExternalSymbols()

std::string CompilerWrapper::readExternalSymbols ( const std::string &  filename) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadParameters()

void CompilerWrapper::ReadParameters ( )
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().

Here is the caller graph for this function:

◆ ReadXml()

void CompilerWrapper::ReadXml ( const std::string &  file_name)

◆ SetBambuDefault()

void CompilerWrapper::SetBambuDefault ( )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCompilerDefault()

void CompilerWrapper::SetCompilerDefault ( )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteOptimizationLevel()

std::string CompilerWrapper::WriteOptimizationLevel ( const CompilerWrapper_OptimizationSet  optimization_level)
static

Writes the optimization level as a string.

Parameters
optimization_levelis the optimization level to be printed
Returns
the optimization level in string format

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().

Here is the caller graph for this function:

◆ WriteOptimizationsString()

std::string CompilerWrapper::WriteOptimizationsString ( )
private

Write the string containing the frontend compiler optimization options.

Returns
the string with optimization options to be passed to the frontend compiler

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().

Here is the caller graph for this function:

◆ WriteXml()

void CompilerWrapper::WriteXml ( const std::string &  file_name) const

Field Documentation

◆ already_processed_files

CustomSet<std::string> CompilerWrapper::already_processed_files
private

The set of files for which tree manager has already been computed.

Definition at line 184 of file compiler_wrapper.hpp.

◆ bambu_ir_info

std::string CompilerWrapper::bambu_ir_info
static

The version of the frontend compiler.

Definition at line 261 of file compiler_wrapper.hpp.

Referenced by __escape_define(), and tree_manager::print().

◆ compiler_linking_parameters

std::string CompilerWrapper::compiler_linking_parameters
private

The compiler parameters for executable creation.

Definition at line 181 of file compiler_wrapper.hpp.

Referenced by GetCompilerParameters(), InitializeCompilerParameters(), and ReadXml().

◆ compiler_target

const CompilerWrapper_CompilerTarget CompilerWrapper::compiler_target
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().

◆ debug_level

int CompilerWrapper::debug_level
private

◆ frontend_compiler_parameters

std::string CompilerWrapper::frontend_compiler_parameters
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().

◆ optimization_flags

std::map<std::string, bool> CompilerWrapper::optimization_flags
private

◆ optimization_values

std::map<std::string, int> CompilerWrapper::optimization_values
private

The value of parametric activate optimizations.

Definition at line 199 of file compiler_wrapper.hpp.

Referenced by ReadXml(), WriteOptimizationsString(), and WriteXml().

◆ OS

const CompilerWrapper_OptimizationSet CompilerWrapper::OS
private

The set of optimizations to be applied.

Definition at line 175 of file compiler_wrapper.hpp.

Referenced by InitializeCompilerParameters().

◆ output_level

int CompilerWrapper::output_level
private

debug level

Definition at line 187 of file compiler_wrapper.hpp.

Referenced by CompileFile(), CreateExecutable(), FillTreeManager(), and GetSystemIncludes().

◆ Param

const ParameterConstRef CompilerWrapper::Param
private

◆ parameter_values

std::map<std::string, int> CompilerWrapper::parameter_values
private

The values of optimizations parameters.

Definition at line 193 of file compiler_wrapper.hpp.

Referenced by ReadParameters(), ReadXml(), SetBambuDefault(), WriteOptimizationsString(), and WriteXml().


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

Generated on Mon Feb 12 2024 13:03:47 for PandA-2024.02 by doxygen 1.8.13