diff mbox

[6/7] diet: squeeze struct symbol's members

Message ID 20170629051646.35988-7-luc.vanoostenryck@gmail.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Luc Van Oostenryck June 29, 2017, 5:16 a.m. UTC
struct symbol::arguments is only used for functions, while
struct symbol::initializer is never used for functions.

Put both of them in an union in order to make the structure
a bit more lightweight.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 symbol.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/symbol.h b/symbol.h
index 1bedc75c3..d8733e99f 100644
--- a/symbol.h
+++ b/symbol.h
@@ -175,12 +175,14 @@  struct symbol {
 					transparent_union:1;
 			struct expression *array_size;
 			struct ctype ctype;
-			struct symbol_list *arguments;
 			struct statement *stmt;
+			union {
+				struct symbol_list *arguments;
+				struct expression *initializer;
+			};
 			struct symbol_list *symbol_list;
 			struct statement *inline_stmt;
 			struct symbol_list *inline_symbol_list;
-			struct expression *initializer;
 			struct entrypoint *ep;
 			struct symbol *definition;
 		};