aboutsummaryrefslogtreecommitdiff
path: root/gdb/parser-defs.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-03-24 09:01:18 -0600
committerTom Tromey <tom@tromey.com>2019-04-04 19:55:10 -0600
commit73923d7eedc7ab52144308ef7e9c12cbe4341bca (patch)
treefcee1ced0863bbfbe10f7ac06a670188b21da165 /gdb/parser-defs.h
parentfa9f5be6830e9245ee1ad1eab9725cc039d45d07 (diff)
downloadfsf-binutils-gdb-73923d7eedc7ab52144308ef7e9c12cbe4341bca.zip
fsf-binutils-gdb-73923d7eedc7ab52144308ef7e9c12cbe4341bca.tar.gz
fsf-binutils-gdb-73923d7eedc7ab52144308ef7e9c12cbe4341bca.tar.bz2
Turn parse_language into a method
This changes parse_language into a method of parser_state. This patch was written by a script. gdb/ChangeLog 2019-04-04 Tom Tromey <tom@tromey.com> * rust-exp.y: Replace "parse_language" with method call. * p-exp.y: (yylex): Replace "parse_language" with method call. * m2-exp.y: (yylex): Replace "parse_language" with method call. * go-exp.y (classify_name): Replace "parse_language" with method call. * f-exp.y (yylex): Replace "parse_language" with method call. * d-exp.y (lex_one_token): Replace "parse_language" with method call. * c-exp.y: (lex_one_token, classify_name, yylex): Replace "parse_language" with method call. * ada-exp.y (find_primitive_type, type_char) (type_system_address): Replace "parse_language" with method call.
Diffstat (limited to 'gdb/parser-defs.h')
-rw-r--r--gdb/parser-defs.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index 1aa5f1f..8fcbca3 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -32,8 +32,6 @@ struct internalvar;
extern int parser_debug;
-#define parse_language(ps) ((ps)->expout->language_defn)
-
struct parser_state
{
/* Constructor. LANG is the language used to parse the expression.
@@ -55,6 +53,13 @@ struct parser_state
return expout->gdbarch;
}
+ /* Return the language that was passed to the constructor. */
+
+ const struct language_defn *language ()
+ {
+ return expout->language_defn;
+ }
+
/* The size of the expression above. */
size_t expout_size;