abg-writer: Refactor write_corpus API
authorMatthias Maennich <maennich@google.com>
Tue, 21 May 2019 04:39:16 +0000 (05:39 +0100)
committerDodji Seketeli <dodji@redhat.com>
Wed, 22 May 2019 12:33:45 +0000 (14:33 +0200)
commit948f27480fce83ae8de3ca77ca1179646aa07728
tree84a3b58b6a270e85e6903c3cb4060dfb90626102
parentf5907c7e7417b6cb34c71790650feed7d5a7139f
abg-writer: Refactor write_corpus API

Introduce a new overload for write_corpus that follows the parameter
order context, object (i.e. corpus), indent.

Deprecate all other overloads that were part of the API and mostly
forward them to the new overload. That effort is made to ensure
write_context is always provided. write_context allows access to all
options that influence the output format.

* include/abg-writer.h (write_corpus): Introduce new overload
write_corpus(ctxt, corpus, indent) and deprecate all others.
* src/abg-writer.cc (write_corpus): Likewise for the definitions
and adjust.
* tests/test-read-dwarf.cc (test_task::perform): Use the new
write_corpus which requires a write_context.
* tools/abidw.cc (load_corpus_and_write_abixml, ): Likewise.
* tools/abilint.cc (main): Likewise. Also simplify logic around the
locations as they now can be expressed with less code.

Signed-off-by: Matthias Maennich <maennich@google.com>
include/abg-writer.h
src/abg-writer.cc
tests/test-read-dwarf.cc
tools/abidw.cc
tools/abilint.cc