ctf, ir: escape and unescape enumeration FT labels starting with `_`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 2 Oct 2017 16:57:12 +0000 (12:57 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 2 Nov 2017 19:49:38 +0000 (15:49 -0400)
commitf4cc9a214ceca8dc8b4e81264850d1255107b01b
treeed1349a10303b5397683be04362cfedac6a702aa
parent8ed0bf1041490e214247a7ad8cb013f0f36c7f2c
ctf, ir: escape and unescape enumeration FT labels starting with `_`

This is a solution to work with TSDL 1.8 which asks identifiers starting
with `_` to be named without the `_` for viewing and analysis purposes.
Since a variant FT can refer to an enumeration FT tag which also has its
labels starting with `_`, we systematically remove leading `_` in
enumeration FT labels too.

For example:

    enum {
        _salut,
        hello,
        __zoom,
        _integer,
    } tag;

    variant <tag> {
        A _salut;
        B hello;
        C __zoom;
        D _integer;
    } var;

Once in CTF IR, the equivalent is:

    enum {
        salut,
        hello,
        _zoom,
        integer,
    } tag;

    variant <tag> {
        A salut;
        B hello;
        C _zoom;
        D integer;
    } var;

Once back to TSDL (through CTF writer), it is:

    enum {
        salut,
        hello,
        __zoom,
        _integer,
    } tag;

    variant <tag> {
        A salut;
        B hello;
        C __zoom;
        D _integer;
    } var;

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/ctf-ir/clock-class.c
lib/ctf-ir/event-class.c
lib/ctf-ir/field-types.c
lib/ctf-ir/trace.c
lib/ctf-ir/utils.c
plugins/ctf/common/metadata/visitor-generate-ir.c
This page took 0.025677 seconds and 4 git commands to generate.