On Wed, 2026-02-11 at 23:11 +0800, Yangyu Chen wrote: > > > On 9/2/2026 23:09, David Malcolm wrote: > > > > FWIW I > > have some code in libsarifreplay.cc that has various helper > > functions > > for doing a similar thing (albeit using libgdiagnostics, rather > > then > > the diagnostics layer directly), and I see similar helpers in > > gcc/config/aarch64/aarch64-json-tunings-parser.cc. To my knowledge > > these are the only places so far in the codebase where we currently > > parse JSON (other than selftests). > > > > We should probably have a shared set of helpers for this, and > > support > > locations within the json file so that we can have good location- > > reporting for diagnostics involving bad json inputs - it's a bad UX > > to > > be told you have an error *somewhere* in a file you wrote without > > showing line/column etc - but that's probably out-of-scope for this > > patch series (especially given the simplicity of your format). I > > have > > somewhere an old patch that integrated the json-parsing with > > location_t > > so that we can have good location-reporting on malformed/invalid > > json > > inputs (perhaps generating the location_t entries on demand if > > we're > > emitting an error about them); do you want me to try to dig it up? > > Thanks for your offer! I would like to see that good location- > reporting > to improve this code. Maybe I can use it for the follow-up patch > after > yours is merged, or maybe in the next revision if yours is merged > first.
I'm tracking this as PR target/124094 [1], and am testing a patch kit for it; I hope to post it soon. Dave [1] re the existing -muser-provided-CPU=FILENAME.json option added to aarch64 in this release by Soumya AR [CCed]
