From c9ffe751d126a302d0e7e53e645e44084e339dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Wed, 13 Nov 2019 12:41:39 +0900 Subject: delete unused functions Looking at the list of symbols inside of libruby-static.a, I found hundreds of functions that are defined, but used from nowhere. There can be reasons for each of them (e.g. some functions are specific to some platform, some are useful when debugging, etc). However it seems the functions deleted here exist for no reason. This changeset reduces the size of ruby binary from 26,671,456 bytes to 26,592,864 bytes on my machine. --- parse.y | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 099d55eeba..9eb7bedf34 100644 --- a/parse.y +++ b/parse.y @@ -6044,13 +6044,6 @@ parser_compile_string(VALUE vparser, VALUE fname, VALUE s, int line) return yycompile(vparser, p, fname, line); } -rb_ast_t* -rb_compile_string(const char *f, VALUE s, int line) -{ - must_be_ascii_compatible(s); - return parser_compile_string(rb_parser_new(), rb_filesystem_str_new_cstr(f), s, line); -} - rb_ast_t* rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line) { @@ -6064,20 +6057,6 @@ rb_parser_compile_string_path(VALUE vparser, VALUE f, VALUE s, int line) return parser_compile_string(vparser, f, s, line); } -rb_ast_t* -rb_compile_cstr(const char *f, const char *s, int len, int line) -{ - VALUE str = rb_str_new(s, len); - return parser_compile_string(rb_parser_new(), rb_filesystem_str_new_cstr(f), str, line); -} - -rb_ast_t* -rb_parser_compile_cstr(VALUE vparser, const char *f, const char *s, int len, int line) -{ - VALUE str = rb_str_new(s, len); - return parser_compile_string(vparser, rb_filesystem_str_new_cstr(f), str, line); -} - VALUE rb_io_gets_internal(VALUE io); static VALUE @@ -6086,20 +6065,6 @@ lex_io_gets(struct parser_params *p, VALUE io) return rb_io_gets_internal(io); } -rb_ast_t* -rb_compile_file(const char *f, VALUE file, int start) -{ - VALUE vparser = rb_parser_new(); - - return rb_parser_compile_file(vparser, f, file, start); -} - -rb_ast_t* -rb_parser_compile_file(VALUE vparser, const char *f, VALUE file, int start) -{ - return rb_parser_compile_file_path(vparser, rb_filesystem_str_new_cstr(f), file, start); -} - rb_ast_t* rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start) { @@ -12472,6 +12437,7 @@ rb_parser_encoding(VALUE vparser) return rb_enc_from_encoding(p->enc); } +#ifdef RIPPER /* * call-seq: * ripper.yydebug -> true or false @@ -12486,6 +12452,7 @@ rb_parser_get_yydebug(VALUE self) TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p); return p->debug ? Qtrue : Qfalse; } +#endif /* * call-seq: -- cgit v1.2.3