From ad9623449fc51f238b3cda89590d861b9d7770a9 Mon Sep 17 00:00:00 2001 From: Hongce Zhang Date: Sat, 15 Dec 2018 21:10:56 -0500 Subject: [PATCH 1/3] remove global variable meta It seems that it is never used anywhere. --- src/verilog_ast.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/verilog_ast.h b/src/verilog_ast.h index af33722..8bde55a 100644 --- a/src/verilog_ast.h +++ b/src/verilog_ast.h @@ -1092,7 +1092,6 @@ typedef enum ast_event_expression_type_e{ //! Describes a single event expression typedef struct ast_event_expression_t ast_event_expression; - ast_metadata meta; //!< Node metadata. struct ast_event_expression_t { ast_event_expression_type type; union{ From ac99972a3ad23e0b7b272c67108d6fc86c47773a Mon Sep 17 00:00:00 2001 From: Hongce Zhang Date: Sat, 15 Dec 2018 21:20:19 -0500 Subject: [PATCH 2/3] add ast_strdup for copying `digits` in building AST --- src/verilog_ast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/verilog_ast.c b/src/verilog_ast.c index ec19e19..1d5006c 100644 --- a/src/verilog_ast.c +++ b/src/verilog_ast.c @@ -2840,7 +2840,7 @@ ast_number * ast_new_number( tr -> base = base; tr -> representation = representation; - tr -> as_bits = digits; + tr -> as_bits = ast_strdup(digits); return tr; } From f7c01b683b0dd3cd62dc38ec8a7480f3e62ae302 Mon Sep 17 00:00:00 2001 From: Hongce Zhang Date: Sun, 16 Dec 2018 18:28:36 -0500 Subject: [PATCH 3/3] Use the range info in port_declaration_l --- src/verilog_parser.y | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/verilog_parser.y b/src/verilog_parser.y index fcea1f6..cc602af 100644 --- a/src/verilog_parser.y +++ b/src/verilog_parser.y @@ -1137,19 +1137,19 @@ port_declaration_l: ast_list * names = ast_list_new(); ast_list_append(names, $4); $$ = ast_new_port_declaration(PORT_NONE, $1, $2, - AST_FALSE,AST_FALSE,NULL,names); + AST_FALSE,AST_FALSE,$3,names); } | signed_o range_o port_identifier{ ast_list * names = ast_list_new(); ast_list_append(names, $3); $$ = ast_new_port_declaration(PORT_NONE, NET_TYPE_NONE, $1, - AST_FALSE,AST_FALSE,NULL,names); + AST_FALSE,AST_FALSE,$2,names); } | KW_REG signed_o range_o port_identifier eq_const_exp_o{ ast_list * names = ast_list_new(); ast_list_append(names, $4); $$ = ast_new_port_declaration(PORT_NONE, NET_TYPE_NONE, AST_FALSE, - AST_TRUE,AST_FALSE,NULL,names); + AST_TRUE,AST_FALSE,$3,names); } | output_variable_type_o port_identifier{ ast_list * names = ast_list_new();