This is an archive of the discontinued LLVM Phabricator instance.

[json] Provide a means to delegate writing a value to another API
ClosedPublic

Authored by sammccall on Oct 6 2020, 7:44 AM.

Details

Summary

(Based on D87170 by dsanders)

I recently had need to call out to an external API to emit a JSON object as part
of one an LLVM tool was emitting. However, our JSON support didn't provide a way
to delegate part of the JSON output to that API.

Add rawValueBegin() and rawValueEnd() to maintain and check the internal state
while something else is writing to the stream. It's the users responsibility to
ensure that the resulting JSON output is still valid.

Diff Detail

Event Timeline

sammccall created this revision.Oct 6 2020, 7:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 6 2020, 7:44 AM
sammccall requested review of this revision.Oct 6 2020, 7:44 AM
kadircet accepted this revision.Oct 6 2020, 11:37 AM

So that's how you hit function_ref being constructable from anything :D

Thanks, LGTM! It is amazing how fast that FIXME got cleaned up

This revision is now accepted and ready to land.Oct 6 2020, 11:37 AM
This revision was landed with ongoing or failed builds.Oct 7 2020, 9:35 AM
This revision was automatically updated to reflect the committed changes.