Skip to content
Snippets Groups Projects
Commit 070944fd authored by David Malcolm's avatar David Malcolm
Browse files

json: reduce use of naked new in json-building code


No functional change intended.

gcc/ChangeLog:
	* diagnostic-format-json.cc: Use type-specific "set_*" functions
	of json::object to avoid naked new of json value subclasses.
	* diagnostic-format-sarif.cc: Likewise.
	* gcov.cc: Likewise.
	* json.cc (object::set_string): New.
	(object::set_integer): New.
	(object::set_float): New.
	(object::set_bool): New.
	(selftest::test_writing_objects): Use object::set_string.
	* json.h (object::set_string): New decl.
	(object::set_integer): New decl.
	(object::set_float): New decl.
	(object::set_bool): New decl.
	* optinfo-emit-json.cc: Use type-specific "set_*" functions of
	json::object to avoid naked new of json value subclasses.
	* timevar.cc: Likewise.
	* tree-diagnostic-path.cc: Likewise.

Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
parent 4db82092
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment