aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog16
-rw-r--r--libcpp/directives.c8
-rw-r--r--libcpp/errors.c36
-rw-r--r--libcpp/include/cpplib.h6
4 files changed, 33 insertions, 33 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 785be4f..39e12bd 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,19 @@
+2017-10-31 David Malcolm <dmalcolm@redhat.com>
+
+ * directives.c (_cpp_handle_directive): Update for renaming of
+ cpp_error_at_richloc to cpp_error_at.
+ * errors.c (cpp_diagnostic_at_richloc): Rename to...
+ (cpp_diagnostic_at): ...this, dropping the location_t-based
+ implementation.
+ (cpp_diagnostic): Update for removal of location_t-based
+ cpp_diagnostic_at.
+ (cpp_error_at): Likewise.
+ (cpp_error_at_richloc): Rename to...
+ (cpp_error_at): ...this, and update for renaming of
+ cpp_diagnostic_at_richloc.
+ * include/cpplib.h (cpp_error_at_richloc): Rename to...
+ (cpp_error_at): ...this.
+
2017-10-30 Joseph Myers <joseph@codesourcery.com>
* include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
diff --git a/libcpp/directives.c b/libcpp/directives.c
index 7cac653..e295221 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -527,10 +527,10 @@ _cpp_handle_directive (cpp_reader *pfile, int indented)
source_range misspelled_token_range
= get_range_from_loc (pfile->line_table, dname->src_loc);
richloc.add_fixit_replace (misspelled_token_range, hint);
- cpp_error_at_richloc (pfile, CPP_DL_ERROR, &richloc,
- "invalid preprocessing directive #%s;"
- " did you mean #%s?",
- unrecognized, hint);
+ cpp_error_at (pfile, CPP_DL_ERROR, &richloc,
+ "invalid preprocessing directive #%s;"
+ " did you mean #%s?",
+ unrecognized, hint);
}
else
cpp_error (pfile, CPP_DL_ERROR,
diff --git a/libcpp/errors.c b/libcpp/errors.c
index 7fdee3c..d49c853 100644
--- a/libcpp/errors.c
+++ b/libcpp/errors.c
@@ -31,33 +31,15 @@ along with this program; see the file COPYING3. If not see
ATTRIBUTE_FPTR_PRINTF(5,0)
static bool
-cpp_diagnostic_at_richloc (cpp_reader * pfile, int level, int reason,
- rich_location *richloc,
- const char *msgid, va_list *ap)
-{
- bool ret;
-
- if (!pfile->cb.error)
- abort ();
- ret = pfile->cb.error (pfile, level, reason, richloc, _(msgid), ap);
-
- return ret;
-}
-
-/* Print a diagnostic at the given location. */
-
-ATTRIBUTE_FPTR_PRINTF(5,0)
-static bool
cpp_diagnostic_at (cpp_reader * pfile, int level, int reason,
- source_location src_loc,
+ rich_location *richloc,
const char *msgid, va_list *ap)
{
bool ret;
if (!pfile->cb.error)
abort ();
- rich_location richloc (pfile->line_table, src_loc);
- ret = pfile->cb.error (pfile, level, reason, &richloc, _(msgid), ap);
+ ret = pfile->cb.error (pfile, level, reason, richloc, _(msgid), ap);
return ret;
}
@@ -88,7 +70,8 @@ cpp_diagnostic (cpp_reader * pfile, int level, int reason,
{
src_loc = pfile->cur_token[-1].src_loc;
}
- return cpp_diagnostic_at (pfile, level, reason, src_loc, msgid, ap);
+ rich_location richloc (pfile->line_table, src_loc);
+ return cpp_diagnostic_at (pfile, level, reason, &richloc, msgid, ap);
}
/* Print a warning or error, depending on the value of LEVEL. */
@@ -265,7 +248,8 @@ cpp_error_at (cpp_reader * pfile, int level, source_location src_loc,
va_start (ap, msgid);
- ret = cpp_diagnostic_at (pfile, level, CPP_W_NONE, src_loc,
+ rich_location richloc (pfile->line_table, src_loc);
+ ret = cpp_diagnostic_at (pfile, level, CPP_W_NONE, &richloc,
msgid, &ap);
va_end (ap);
@@ -276,16 +260,16 @@ cpp_error_at (cpp_reader * pfile, int level, source_location src_loc,
a column override. */
bool
-cpp_error_at_richloc (cpp_reader * pfile, int level, rich_location *richloc,
- const char *msgid, ...)
+cpp_error_at (cpp_reader * pfile, int level, rich_location *richloc,
+ const char *msgid, ...)
{
va_list ap;
bool ret;
va_start (ap, msgid);
- ret = cpp_diagnostic_at_richloc (pfile, level, CPP_W_NONE, richloc,
- msgid, &ap);
+ ret = cpp_diagnostic_at (pfile, level, CPP_W_NONE, richloc,
+ msgid, &ap);
va_end (ap);
return ret;
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index a2dc93d..5a14858 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -1096,9 +1096,9 @@ extern bool cpp_error_at (cpp_reader * pfile, int level,
source_location src_loc, const char *msgid, ...)
ATTRIBUTE_PRINTF_4;
-extern bool cpp_error_at_richloc (cpp_reader * pfile, int level,
- rich_location *richloc, const char *msgid,
- ...)
+extern bool cpp_error_at (cpp_reader * pfile, int level,
+ rich_location *richloc, const char *msgid,
+ ...)
ATTRIBUTE_PRINTF_4;
/* In lex.c */