Files
Léo Creuse b9f2c631f3 Add support for external insturmenter annotations
This includes support for buffer dump/reset and the Cov_On/Cov_Off
annotations.

External annotations are processed differently between Ada and C-like
languages:

For Ada, we need to materialize buffer the annotations before the first
instrumentation of a source file, as the annotations are given via
absolute source locations, which we do not track when instrumenting
the sources. Thus the instrumenter inserts the corresponding
pragma Annotate for each external annotation for the source being
instrumented. the pragmas are then replaced by the "in-source" buffer
annotation processing mechanism.

If a file is not a unit of interest but still has external annotations
attached to it, then the analysis tree is first rewritten to add the
annotations pragmas.

For C/C++, the external buffer annotations are processed at the same time
as in-source annotations, as this is done prior to instrumentation, and
are directly transformed into the proper buffer management function call.

External Cov_Off/Cov_On annotations for C/C++ are loaded as we traverse the
AST, as we do not have an a-priori list of the files which need to be
processed.

(cherry picked from commit c65217e615)
2024-09-24 14:59:43 +00:00

9 lines
97 B
C++

extern "C"
{
void
do_cpp_dump ()
{
int x = 0; // generate a SCO to check reports
}
}