BuildCache
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
bcache::ti_common_wrapper_t Class Reference

A base wrapper for the TI compilers. More...

#include <ti_common_wrapper.hpp>

Inheritance diagram for bcache::ti_common_wrapper_t:
bcache::program_wrapper_t bcache::ti_arm_cgt_wrapper_t bcache::ti_arp32_wrapper_t bcache::ti_c6x_wrapper_t

Public Member Functions

 ti_common_wrapper_t (const file::exe_path_t &exe_path, const string_list_t &args)
 
- Public Member Functions inherited from bcache::program_wrapper_t
bool handle_command (int &return_code)
 Try to wrap a program command. More...
 
virtual bool can_handle_command ()=0
 Check if this class implements a wrapper for the given command. More...
 

Protected Member Functions

void resolve_args () override
 Resolve arguments on the command line. More...
 
std::map< std::string, expected_file_tget_build_files () override
 Get the paths to the files that are to be generated by the command. More...
 
std::string get_program_id () override
 Get a string that uniquely identifies the program. More...
 
string_list_t get_relevant_arguments () override
 Get relevant command line arguments for hashing. More...
 
std::string preprocess_source () override
 Generate the preprocessed source text. More...
 
- Protected Member Functions inherited from bcache::program_wrapper_t
 program_wrapper_t (const file::exe_path_t &exe_path, const string_list_t &args)
 
virtual string_list_t get_capabilities ()
 Generate a list of supported capabilites. More...
 
virtual std::map< std::string, std::string > get_relevant_env_vars ()
 Get relevant environment variables for hashing. More...
 
virtual string_list_t get_input_files ()
 Get the paths to the input files for the command. More...
 
virtual string_list_t get_implicit_input_files ()
 Get a list of paths to implicit input files. More...
 
virtual sys::run_result_t run_for_miss ()
 Run the actual command (when there is a cache miss). More...
 

Protected Attributes

string_list_t m_resolved_args
 
- Protected Attributes inherited from bcache::program_wrapper_t
const file::exe_path_tm_exe_path
 
const string_list_tm_args
 
capabilities_t m_active_capabilities
 Active capabilities. More...
 

Private Member Functions

void append_response_file (const std::string &response_file)
 

Detailed Description

A base wrapper for the TI compilers.

Member Function Documentation

◆ get_build_files()

std::map< std::string, expected_file_t > bcache::ti_common_wrapper_t::get_build_files ( )
overrideprotectedvirtual

Get the paths to the files that are to be generated by the command.

Returns
the files that are expected to be generated by this command.
Exceptions
runtime_errorif the request could not be completed.

Reimplemented from bcache::program_wrapper_t.

◆ get_program_id()

std::string bcache::ti_common_wrapper_t::get_program_id ( )
overrideprotectedvirtual

Get a string that uniquely identifies the program.

Returns
a program ID string.
Exceptions
runtime_errorif the request could not be completed.

Reimplemented from bcache::program_wrapper_t.

◆ get_relevant_arguments()

string_list_t bcache::ti_common_wrapper_t::get_relevant_arguments ( )
overrideprotectedvirtual

Get relevant command line arguments for hashing.

Returns
filtered command line arguments.
Exceptions
runtime_errorif the request could not be completed.
Note
The purpose of this function is to create a list of arguments that is suitable for hashing (i.e. uniquely identifying) the program options. As such, things like absolute file paths and compilation defines should be excluded (since they are resolved in the preprocess step).

Reimplemented from bcache::program_wrapper_t.

◆ preprocess_source()

std::string bcache::ti_common_wrapper_t::preprocess_source ( )
overrideprotectedvirtual

Generate the preprocessed source text.

Returns
the preprocessed source code file as a string, or an empty string if the operation failed.
Exceptions
runtime_errorif the request could not be completed.

Reimplemented from bcache::program_wrapper_t.

◆ resolve_args()

void bcache::ti_common_wrapper_t::resolve_args ( )
overrideprotectedvirtual

Resolve arguments on the command line.

This method is called after can_handle_command, but before calling other methods that rely on the command line arguments. This gives a wrapper the opportunity to resolve special arguments so that they can be properly interpretade by later steps.

The primary use case of this method is to implement support for so called response files, which contain further command line arguments (this is common on Windows to work around the relativlely small command line length limit).

Exceptions
runtime_errorif the request could not be completed.

Reimplemented from bcache::program_wrapper_t.


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