diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-format.c | 2 | ||||
-rw-r--r-- | gcc/c/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c/c-objc-common.c | 4 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/error.c | 4 | ||||
-rw-r--r-- | gcc/gcc-rich-location.c | 2 | ||||
-rw-r--r-- | gcc/gcc-rich-location.h | 2 |
9 files changed, 30 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 704403d..42ae999 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2019-12-09 David Malcolm <dmalcolm@redhat.com> + * gcc-rich-location.c + (maybe_range_label_for_tree_type_mismatch::get_text): Replace + label_text ctor call with label_text::borrow. + * gcc-rich-location.h (text_range_label::get_text): Replace + label_text ctor called with false with label_text::borrow. + +2019-12-09 David Malcolm <dmalcolm@redhat.com> + * diagnostic-show-locus.c (diagnostic_show_locus): Remove initial newline. (selftest::test_diagnostic_show_locus_unknown_location): Remove diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 09d7a04..9d48855 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,5 +1,10 @@ 2019-12-09 David Malcolm <dmalcolm@redhat.com> + * c-format.c (range_label_for_format_type_mismatch::get_text): + Replace label_text ctor called with true with label_text::take. + +2019-12-09 David Malcolm <dmalcolm@redhat.com> + * c-format.c (selftest::test_type_mismatch_range_labels): Remove initial newline from expected outputs. * c-opts.c (c_diagnostic_finalizer): Add pp_newline call before diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c index 0be1349..c5fefd5 100644 --- a/gcc/c-family/c-format.c +++ b/gcc/c-family/c-format.c @@ -4629,7 +4629,7 @@ class range_label_for_format_type_mismatch char *result = concat (text.m_buffer, p, NULL); text.maybe_free (); - return label_text (result, true); + return label_text::take (result); } private: diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index f9c6293..5371e9c 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2019-12-09 David Malcolm <dmalcolm@redhat.com> + + * c-objc-common.c (range_label_for_type_mismatch::get_text): + Replace label_text ctor calls. + 2019-12-04 Joseph Myers <joseph@codesourcery.com> PR c/36941 diff --git a/gcc/c/c-objc-common.c b/gcc/c/c-objc-common.c index 10d72c5..665c7a6 100644 --- a/gcc/c/c-objc-common.c +++ b/gcc/c/c-objc-common.c @@ -340,12 +340,12 @@ label_text range_label_for_type_mismatch::get_text (unsigned /*range_idx*/) const { if (m_labelled_type == NULL_TREE) - return label_text (NULL, false); + return label_text::borrow (NULL); c_pretty_printer cpp; bool quoted = false; print_type (&cpp, m_labelled_type, "ed); - return label_text (xstrdup (pp_formatted_text (&cpp)), true); + return label_text::take (xstrdup (pp_formatted_text (&cpp))); } diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b39a304..5140787 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2019-12-09 David Malcolm <dmalcolm@redhat.com> + + * error.c (range_label_for_type_mismatch::get_text): Replace + label_text ctor calls with label_text::borrow. + 2019-12-09 Paolo Carlini <paolo.carlini@oracle.com> * typeck.c (check_for_casting_away_constness): Add location_t diff --git a/gcc/cp/error.c b/gcc/cp/error.c index a15230a..7c46c17 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -4528,7 +4528,7 @@ label_text range_label_for_type_mismatch::get_text (unsigned /*range_idx*/) const { if (m_labelled_type == NULL_TREE) - return label_text (NULL, false); + return label_text::borrow (NULL); const bool verbose = false; const bool show_color = false; @@ -4543,5 +4543,5 @@ range_label_for_type_mismatch::get_text (unsigned /*range_idx*/) const /* Both of the above return GC-allocated buffers, so the caller mustn't free them. */ - return label_text (const_cast <char *> (result), false); + return label_text::borrow (result); } diff --git a/gcc/gcc-rich-location.c b/gcc/gcc-rich-location.c index 82d4f52..071463e 100644 --- a/gcc/gcc-rich-location.c +++ b/gcc/gcc-rich-location.c @@ -196,7 +196,7 @@ maybe_range_label_for_tree_type_mismatch::get_text (unsigned range_idx) const { if (m_expr == NULL_TREE || !EXPR_P (m_expr)) - return label_text (NULL, false); + return label_text::borrow (NULL); tree expr_type = TREE_TYPE (m_expr); tree other_type = NULL_TREE; diff --git a/gcc/gcc-rich-location.h b/gcc/gcc-rich-location.h index 3bee2e8..71f4f3d 100644 --- a/gcc/gcc-rich-location.h +++ b/gcc/gcc-rich-location.h @@ -111,7 +111,7 @@ class text_range_label : public range_label label_text get_text (unsigned /*range_idx*/) const FINAL OVERRIDE { - return label_text (const_cast <char *> (m_text), false); + return label_text::borrow (m_text); } private: |