diff mbox

[61/90] assembler: Add the input filename to the error/warning messages

Message ID 1359991705-5254-62-git-send-email-damien.lespiau@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lespiau, Damien Feb. 4, 2013, 3:27 p.m. UTC
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 assembler/gen4asm.h |    2 ++
 assembler/gram.y    |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/assembler/gen4asm.h b/assembler/gen4asm.h
index 1e67c1c..9558a29 100644
--- a/assembler/gen4asm.h
+++ b/assembler/gen4asm.h
@@ -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;
 
diff --git a/assembler/gram.y b/assembler/gram.y
index b3578e8..93d3bd5 100644
--- a/assembler/gram.y
+++ b/assembler/gram.y
@@ -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);