From f313b75e7b2c1a2d38804656e925c7568a75f2eb Mon Sep 17 00:00:00 2001 From: Julien Chevalier Date: Fri, 14 Aug 2009 13:16:22 -0400 Subject: [PATCH] compile: traces know REG variables Also: ask gccx to not warn about missing initializers. Signed-off-by: Julien Chevalier Signed-off-by: Jean Privat --- bin/gccx | 2 +- clib/nit_common.h | 2 ++ src/compiling/compiling_icode.nit | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/gccx b/bin/gccx index 5cafc01..f13a8fe 100755 --- a/bin/gccx +++ b/bin/gccx @@ -19,7 +19,7 @@ OPTS="-g" # option for compiler call objs="" # List of .o files -CC="gcc --ansi --pedantic -Wall -Wextra -Wformat-security -Wcast-align -Wno-uninitialized -Wno-unused-variable -Wno-unused-label -Wno-unused-parameter" # Default compiler call +CC="gcc --ansi --pedantic -Wall -Wextra -Wformat-security -Wcast-align -Wno-uninitialized -Wno-unused-variable -Wno-unused-label -Wno-unused-parameter -Wno-missing-field-initializers" # Default compiler call ext="_savo _sav" # Default flavor to reuse out="a.out" # Default output binary filename dir="" # Default tmp dir diff --git a/clib/nit_common.h b/clib/nit_common.h index f489205..2d4f9df 100644 --- a/clib/nit_common.h +++ b/clib/nit_common.h @@ -131,6 +131,8 @@ struct trace_t { const char *file; /* source filename */ int line; /* line number */ const char *meth; /* method name */ + int REG_size; + val_t **REG_pointer; }; extern struct trace_t *tracehead; typedef enum {true = (1==1),false = (0==1)} bool; diff --git a/src/compiling/compiling_icode.nit b/src/compiling/compiling_icode.nit index 7902aea..e41e277 100644 --- a/src/compiling/compiling_icode.nit +++ b/src/compiling/compiling_icode.nit @@ -264,9 +264,10 @@ redef class IRoutine if location != null then ll = location.line_start end - v.add_decl("struct trace_t trace = \{NULL, NULL, {ll}, LOCATE_{v.basecname}\};") + v.add_decl("struct trace_t trace = \{NULL, NULL, {ll}, LOCATE_{v.basecname}, {std_slots_nb}\};") v.add_instr("trace.prev = tracehead; tracehead = &trace;") v.add_instr("trace.file = LOCATE_{v.visitor.module.name};") + v.add_instr("trace.REG_pointer = (val_t **)®") # Add local variables if std_slots_nb == 0 then -- 1.7.9.5