diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-10-13 13:20:00 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-10-13 13:20:00 -0300 |
commit | 8d2e166dd3d168d9e0bb18bace815dfb0529a757 (patch) | |
tree | a3f31e2bb8e56cc518b8206b8fefbd3f82c011d1 | |
parent | 8c2b37ec71423067b028eeaea8a450abe99a601c (diff) | |
download | pahole-8d2e166dd3d168d9e0bb18bace815dfb0529a757.tar.gz |
emit: Optionally pass a conf_fprintf struct to type_emissions__init
For later to use it to toggle some features, such as emitting the
atomic_ types as _Atomic typedefs.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | ctracer.c | 2 | ||||
-rw-r--r-- | dwarves_emit.c | 3 | ||||
-rw-r--r-- | dwarves_emit.h | 4 | ||||
-rw-r--r-- | pahole.c | 2 | ||||
-rw-r--r-- | pfunct.c | 4 |
5 files changed, 9 insertions, 6 deletions
@@ -960,7 +960,7 @@ failure: goto out; } - type_emissions__init(&emissions); + type_emissions__init(&emissions, NULL); /* * Create the methods_cus (Compilation Units) object where we will diff --git a/dwarves_emit.c b/dwarves_emit.c index 04b3de4b..ce252c95 100644 --- a/dwarves_emit.c +++ b/dwarves_emit.c @@ -13,11 +13,12 @@ #include "dwarves_emit.h" #include "dwarves.h" -void type_emissions__init(struct type_emissions *emissions) +void type_emissions__init(struct type_emissions *emissions, struct conf_fprintf *conf_fprintf) { INIT_LIST_HEAD(&emissions->base_type_definitions); INIT_LIST_HEAD(&emissions->definitions); INIT_LIST_HEAD(&emissions->fwd_decls); + emissions->conf_fprintf = conf_fprintf; } static void type_emissions__add_definition(struct type_emissions *emissions, diff --git a/dwarves_emit.h b/dwarves_emit.h index 58af2dd1..6022beea 100644 --- a/dwarves_emit.h +++ b/dwarves_emit.h @@ -16,14 +16,16 @@ struct cu; struct ftype; struct tag; struct type; +struct conf_fprintf; struct type_emissions { struct list_head definitions; /* struct type entries */ struct list_head base_type_definitions; /* struct base_type entries */ struct list_head fwd_decls; /* struct class entries */ + struct conf_fprintf *conf_fprintf; }; -void type_emissions__init(struct type_emissions *temissions); +void type_emissions__init(struct type_emissions *temissions, struct conf_fprintf *conf_fprintf); int ftype__emit_definitions(struct ftype *ftype, struct cu *cu, struct type_emissions *emissions, FILE *fp); @@ -1716,7 +1716,7 @@ static error_t pahole__options_parser(int key, char *arg, // case 'Z': ctf_encode = 1; break; // FIXME: Disabled case ARGP_compile: compilable = true; - type_emissions__init(&emissions); + type_emissions__init(&emissions, &conf); conf.no_semicolon = true; conf.strip_inline = true; break; @@ -658,7 +658,7 @@ static error_t pfunct__options_parser(int key, char *arg, case 'a': addr = strtoull(arg, NULL, 0); conf_load.get_addr_info = true; break; case 'b': expand_types = true; - type_emissions__init(&emissions); break; + type_emissions__init(&emissions, &conf); break; case 'c': class_name = arg; break; case 'f': function_name = arg; break; case 'F': conf_load.format_path = arg; break; @@ -689,7 +689,7 @@ static error_t pfunct__options_parser(int key, char *arg, case ARGP_no_parm_names: conf.no_parm_names = 1; break; case ARGP_compile: expand_types = true; - type_emissions__init(&emissions); + type_emissions__init(&emissions, &conf); compilable_output = true; conf.no_semicolon = true; conf.strip_inline = true; |