assembler: Add the input filename to the error/warning messages
authorDamien Lespiau <damien.lespiau@intel.com>
Sun, 27 Jan 2013 01:32:52 +0000 (01:32 +0000)
committerDamien Lespiau <damien.lespiau@intel.com>
Mon, 4 Mar 2013 15:54:40 +0000 (15:54 +0000)
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
assembler/gen4asm.h
assembler/gram.y

index 1e67c1c..9558a29 100644 (file)
@@ -47,6 +47,8 @@ extern long int gen_level;
 #define WARN_ALL       (1 << 31)
 extern unsigned int warning_flags;
 
+extern char *input_filename;
+
 extern struct brw_context genasm_context;
 extern struct brw_compile genasm_compile;
 
index b3578e8..93d3bd5 100644 (file)
@@ -120,10 +120,10 @@ static void message(enum message_level level, YYLTYPE *location,
     va_list args;
 
     if (location)
-       fprintf(stderr, "%d:%d: %s: ", location->first_line,
+       fprintf(stderr, "%s:%d:%d: %s: ", input_filename, location->first_line,
                location->first_column, level_str[level]);
     else
-       fprintf(stderr, "%s: ", level_str[level]);
+       fprintf(stderr, "%s:%s: ", input_filename, level_str[level]);
 
     va_start(args, fmt);
     vfprintf(stderr, fmt, args);