comparison gcc/rtl-error.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* RTL specific diagnostic subroutines for GCC 1 /* RTL specific diagnostic subroutines for GCC
2 Copyright (C) 2001, 2002, 2003, 2004, 2007, 2008, 2010 2 Copyright (C) 2001-2017 Free Software Foundation, Inc.
3 Free Software Foundation, Inc.
4 Contributed by Gabriel Dos Reis <gdr@codesourcery.com> 3 Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
5 4
6 This file is part of GCC. 5 This file is part of GCC.
7 6
8 GCC is free software; you can redistribute it and/or modify 7 GCC is free software; you can redistribute it and/or modify
22 #include "config.h" 21 #include "config.h"
23 #include "system.h" 22 #include "system.h"
24 #include "coretypes.h" 23 #include "coretypes.h"
25 #include "tm.h" 24 #include "tm.h"
26 #include "rtl-error.h" 25 #include "rtl-error.h"
27 #include "insn-attr.h" 26 #include "diagnostic.h"
28 #include "insn-config.h"
29 #include "input.h"
30 #include "intl.h" 27 #include "intl.h"
31 #include "diagnostic.h"
32 28
33 static location_t location_for_asm (const_rtx); 29 static location_t location_for_asm (const rtx_insn *);
34 static void diagnostic_for_asm (const_rtx, const char *, va_list *, diagnostic_t) ATTRIBUTE_GCC_DIAG(2,0); 30 static void diagnostic_for_asm (const rtx_insn *, const char *, va_list *,
31 diagnostic_t) ATTRIBUTE_GCC_DIAG(2,0);
35 32
36 /* Figure the location of the given INSN. */ 33 /* Figure the location of the given INSN. */
37 static location_t 34 static location_t
38 location_for_asm (const_rtx insn) 35 location_for_asm (const rtx_insn *insn)
39 { 36 {
40 rtx body = PATTERN (insn); 37 rtx body = PATTERN (insn);
41 rtx asmop; 38 rtx asmop;
42 location_t loc; 39 location_t loc;
43 40
64 61
65 /* Report a diagnostic MESSAGE (an error or a WARNING) at the line number 62 /* Report a diagnostic MESSAGE (an error or a WARNING) at the line number
66 of the insn INSN. This is used only when INSN is an `asm' with operands, 63 of the insn INSN. This is used only when INSN is an `asm' with operands,
67 and each ASM_OPERANDS records its own source file and line. */ 64 and each ASM_OPERANDS records its own source file and line. */
68 static void 65 static void
69 diagnostic_for_asm (const_rtx insn, const char *msg, va_list *args_ptr, 66 diagnostic_for_asm (const rtx_insn *insn, const char *msg, va_list *args_ptr,
70 diagnostic_t kind) 67 diagnostic_t kind)
71 { 68 {
72 diagnostic_info diagnostic; 69 diagnostic_info diagnostic;
70 rich_location richloc (line_table, location_for_asm (insn));
73 71
74 diagnostic_set_info (&diagnostic, msg, args_ptr, 72 diagnostic_set_info (&diagnostic, msg, args_ptr,
75 location_for_asm (insn), kind); 73 &richloc, kind);
76 report_diagnostic (&diagnostic); 74 diagnostic_report_diagnostic (global_dc, &diagnostic);
77 } 75 }
78 76
79 void 77 void
80 error_for_asm (const_rtx insn, const char *gmsgid, ...) 78 error_for_asm (const rtx_insn *insn, const char *gmsgid, ...)
81 { 79 {
82 va_list ap; 80 va_list ap;
83 81
84 va_start (ap, gmsgid); 82 va_start (ap, gmsgid);
85 diagnostic_for_asm (insn, gmsgid, &ap, DK_ERROR); 83 diagnostic_for_asm (insn, gmsgid, &ap, DK_ERROR);
86 va_end (ap); 84 va_end (ap);
87 } 85 }
88 86
89 void 87 void
90 warning_for_asm (const_rtx insn, const char *gmsgid, ...) 88 warning_for_asm (const rtx_insn *insn, const char *gmsgid, ...)
91 { 89 {
92 va_list ap; 90 va_list ap;
93 91
94 va_start (ap, gmsgid); 92 va_start (ap, gmsgid);
95 diagnostic_for_asm (insn, gmsgid, &ap, DK_WARNING); 93 diagnostic_for_asm (insn, gmsgid, &ap, DK_WARNING);