From cTuning.org
Navigation: cTuning.org > CTools > ICI
"Functionality levels" of the ICI API, current and planned
Environment dependences
Several environment variables are used to control the behaviour of ICI from outside the binaries and the command line. These variables are
Variable | Description |
---|---|
ICI_USE | Force GCC to use ICI extensions even if no -fici was specified on the command line |
ICI_VERBOSE | Print informational messages about ICI actions |
ICI_PLUGIN | name of the plugin shared library - either a pathname, or a dynamic library name to be resolved by the dynamic loader |
Global variables
None... so far.
API functions by category
Plugin management
ici_load: load and initialise a plugin
| Description
Load and initialise the ICI plugin specified by the contents of environment variable ICI_PLUGIN. Exit if the plugin could not be loaded. Prerequisites
Outputs Diagnostics message(s) explaining the reason of the failure. See also |
ici_unload: stop the currently loaded ICI plugin
| Description
Stops the currently loaded plugin, if any, calling the termination function of the plugin (stop()). Prerequisites none. Outputs none. See also |
Event (callback) management
ici_register_event: register an ICI event handler
| Description
Register an event handler (a callback function) to be invoked whenever the named event occurs during compilation. Trigger an internal compiler error if name is either NULL or an empty string. Prerequisites
Outputs Informational message if name was invalid (either NULL or empty string). See also ici_call_event |
ici_call_event: trigger an ICI event handler
| Description
Trigger the event handler (callback function) associated with the named event. Return silently if no event named name was found. Prerequisites None. Outputs None. See also |
Feature management
ici_init_features: initialise the list of features exposed by ICI
| Description
Build the initial set of features which are available for use by plugins. Currently, the basic set consists of:
[In addition, need at least "current_file" to enable the reporting of the name of the current file] Prerequisites None. Outputs See also |
[NOT IMPLEMENTED] ici_get_available_features: get the list of features currently available in ICI
| Description
Prerequisites Outputs See also |
ici_get_feature: get the value of an ICI feature
| Description
Get the pointer to the data or the callback of feature feature_name. If the feature has a non-NULL data field, return the pointer to the internal data of the feature. If not, return the result of calling the callback function of the feature. Return silently if the feature could not found. Prerequisites None. Outputs None. Example const char **list_of_params; /* will hold the array of compiler parameter names */ list_of_params = (const char **) ici_get_feature ("compiler_params"); See also |
ici_get_feature_size: get the size of an ICI feature
| Description
Get the size in bytes of the data pointed to by the data pointer of feature feature_name if the feature has a non-NULL data field. Return -1 if the feature could not found. Prerequisites None. Outputs None. Example int param_count; /* will hold the total number of parameter names */ /* Do not forget to convert number of bytes to number of elements (pointers) in array */ param_count = ici_get_feature_size ("compiler_params") / sizeof (const char **); See also |
ici_get_subfeature: get the value of an element of an ICI feature
| Description
Get the pointer to the data of a subfeature named subfeat_name which must be an element of feature feature_name. Return NULL if feature feature_name does not exist or has no member named subfeat_name. Prerequisites None. Outputs None. Example int crnt_large_function_insns; /* store current value of large-function-insns */ crnt_large_function_insns = (int) ici_get_subfeature ("compiler_params", "large-function-insns"); See also |
Parameter management
ici_register_parameter: register a new ICI parameter
| Description
Define a new ICI parameter named name intialised to value. Trigger an internal compiler error (failed assertion) if name is invalid. Prerequisites name can be neither NULL nor an empty string. Outputs See also |
ici_unregister_parameter: unregister a previously registered ICI parameter
| Description
Unregister a previously registered ICI parameter named name. Trigger an internal compiler error (failed assertion) if no parameters were registered prior to calling this function. Return silently without failure if the parameter was not found. Prerequisites At least one parameter must have been registered before calling this function. Outputs Informational message if no parameters were registered prior to calling this function. See also |
ici_get_parameter: get the value of an ICI parameter
| Description
Get the value of an ICI parameter. Trigger an internal compiler error if no parameters were registered prior to calling this function. Prerequisites At least one parameter must have been registered prior to calling this function. Outputs Informative message if no parameters were registered prior to calling this function. See also |
Further reading
Sample function description
| Description
Prerequisites Outputs See also |