gcc/libcpp
David Malcolm d68f5d458d Replace label_text ctor with "borrow" and "take"
libcpp's label_text class wraps a text buffer, along with a flag to
determine if it "owns" the buffer.

The existing ctor exposed this directly, but I found it difficult
to remember the sense of flag, so this patch hides the ctor, in
favor of static member functions "borrow" and "take", to make
the effect on ownership explicit in the name.

gcc/c-family/ChangeLog:
	* c-format.c (range_label_for_format_type_mismatch::get_text):
	Replace label_text ctor called with true with label_text::take.

gcc/c/ChangeLog:
	* c-objc-common.c (range_label_for_type_mismatch::get_text):
	Replace label_text ctor calls.

gcc/cp/ChangeLog:
	* error.c (range_label_for_type_mismatch::get_text): Replace
	label_text ctor calls with label_text::borrow.

gcc/ChangeLog:
	* 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.

libcpp/ChangeLog:
	* include/line-map.h (label_text::label_text): Make private.
	(label_text::borrow): New.
	(label_text::take): New.
	(label_text::take_or_copy): New.

From-SVN: r279153
2019-12-10 02:02:38 +00:00
..
include Replace label_text ctor with "borrow" and "take" 2019-12-10 02:02:38 +00:00
po
aclocal.m4
ChangeLog Replace label_text ctor with "borrow" and "take" 2019-12-10 02:02:38 +00:00
ChangeLog.jit
charset.c Byte vs column awareness for diagnostic-show-locus.c (PR 49973) 2019-12-09 20:03:47 +00:00
config.in
configure
configure.ac
directives-only.c
directives.c re PR preprocessor/92296 (internal compiler error: Segmentation fault #pragma push_macro("__LINE__")) 2019-10-31 18:38:44 +01:00
errors.c
expr.c Support decimal floating-point constants in C2x. 2019-10-11 23:22:52 +01:00
files.c [preprocessor/91639] #includes at EOF 2019-09-05 11:23:48 +00:00
generated_cpp_wcwidth.h Byte vs column awareness for diagnostic-show-locus.c (PR 49973) 2019-12-09 20:03:47 +00:00
identifiers.c
init.c Support UTF-8 character constants for C2x. 2019-11-14 20:18:33 +00:00
internal.h re PR preprocessor/92296 (internal compiler error: Segmentation fault #pragma push_macro("__LINE__")) 2019-10-31 18:38:44 +01:00
lex.c Implement C++20 operator<=>. 2019-11-05 18:56:18 -05:00
line-map.c [linemap PATCH] Constify lookup 2019-10-15 12:03:04 +00:00
location-example.txt
macro.c PR c/66970 - Add __has_builtin() macro 2019-10-28 16:46:28 -06:00
Makefile.in
makeucnid.c
mkdeps.c
pch.c
symtab.c
system.h
traditional.c PR c/66970 - Add __has_builtin() macro 2019-10-28 16:46:28 -06:00
ucnid.h
ucnid.tab