aboutsummaryrefslogtreecommitdiff
path: root/gprof/sym_ids.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-03-31 10:29:52 +1030
committerAlan Modra <amodra@gmail.com>2021-03-31 10:49:23 +1030
commitfaa7a26040c617a6d29f601998b99a1da882c672 (patch)
tree704031231af1213b66d56395a5edaa65a043dd0b /gprof/sym_ids.c
parent9193bc4285c232400a26448ca75095c44c13f637 (diff)
downloadgdb-faa7a26040c617a6d29f601998b99a1da882c672.zip
gdb-faa7a26040c617a6d29f601998b99a1da882c672.tar.gz
gdb-faa7a26040c617a6d29f601998b99a1da882c672.tar.bz2
Use bool in gprof
* basic_blocks.c: Replace bfd_boolean with bool, FALSE with false, and TRUE with true throughout. * basic_blocks.h: Likewise. * cg_arcs.c: Likewise. * cg_dfn.c: Likewise. * cg_print.c: Likewise. * corefile.c: Likewise. * gmon_io.c: Likewise. * gprof.c: Likewise. * gprof.h: Likewise. * hist.c: Likewise. * mips.c: Likewise. * source.c: Likewise. * source.h: Likewise. * sym_ids.c: Likewise. * sym_ids.h: Likewise. * symtab.h: Likewise. * vax.c: Likewise.
Diffstat (limited to 'gprof/sym_ids.c')
-rw-r--r--gprof/sym_ids.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/gprof/sym_ids.c b/gprof/sym_ids.c
index c0c6740..d712d31 100644
--- a/gprof/sym_ids.c
+++ b/gprof/sym_ids.c
@@ -42,7 +42,7 @@ struct sym_id
struct sym_id *next;
char *spec; /* Parsing modifies this. */
Table_Id which_table;
- bfd_boolean has_right;
+ bool has_right;
struct match left, right;
};
@@ -53,10 +53,10 @@ static void parse_spec
(char *, Sym *);
static void parse_id
(struct sym_id *);
-static bfd_boolean match
+static bool match
(Sym *, Sym *);
static void extend_match
- (struct match *, Sym *, Sym_Table *, bfd_boolean);
+ (struct match *, Sym *, Sym_Table *, bool);
Sym_Table syms[NUM_TABLES];
@@ -181,7 +181,7 @@ parse_id (struct sym_id *id)
{
parse_spec (slash + 1, &id->right.sym);
*slash = '\0';
- id->has_right = TRUE;
+ id->has_right = true;
}
parse_spec (id->spec, &id->left.sym);
@@ -218,27 +218,27 @@ parse_id (struct sym_id *id)
/* Return TRUE iff PATTERN matches SYM. */
-static bfd_boolean
+static bool
match (Sym *pattern, Sym *sym)
{
if (pattern->file && pattern->file != sym->file)
- return FALSE;
+ return false;
if (pattern->line_num && pattern->line_num != sym->line_num)
- return FALSE;
+ return false;
if (pattern->name)
{
const char *sym_name = sym->name;
if (*sym_name && bfd_get_symbol_leading_char (core_bfd) == *sym_name)
sym_name++;
if (strcmp (pattern->name, sym_name) != 0)
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
static void
-extend_match (struct match *m, Sym *sym, Sym_Table *tab, bfd_boolean second_pass)
+extend_match (struct match *m, Sym *sym, Sym_Table *tab, bool second_pass)
{
if (m->prev_match != sym - 1)
{
@@ -289,10 +289,10 @@ sym_id_parse (void)
for (id = id_list; id; id = id->next)
{
if (match (&id->left.sym, sym))
- extend_match (&id->left, sym, &syms[id->which_table], FALSE);
+ extend_match (&id->left, sym, &syms[id->which_table], false);
if (id->has_right && match (&id->right.sym, sym))
- extend_match (&id->right, sym, &right_ids, FALSE);
+ extend_match (&id->right, sym, &right_ids, false);
}
}
@@ -320,10 +320,10 @@ sym_id_parse (void)
for (id = id_list; id; id = id->next)
{
if (match (&id->left.sym, sym))
- extend_match (&id->left, sym, &syms[id->which_table], TRUE);
+ extend_match (&id->left, sym, &syms[id->which_table], true);
if (id->has_right && match (&id->right.sym, sym))
- extend_match (&id->right, sym, &right_ids, TRUE);
+ extend_match (&id->right, sym, &right_ids, true);
}
}
@@ -371,7 +371,7 @@ sym_id_parse (void)
time requesting -k a/b. Fortunately, those symbol tables don't get
very big (the user has to type them!), so a linear search is probably
tolerable. */
-bfd_boolean
+bool
sym_id_arc_is_present (Sym_Table *sym_tab, Sym *from, Sym *to)
{
Sym *sym;
@@ -380,8 +380,8 @@ sym_id_arc_is_present (Sym_Table *sym_tab, Sym *from, Sym *to)
{
if (from->addr >= sym->addr && from->addr <= sym->end_addr
&& arc_lookup (sym, to))
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}