abitidy: add pass to limit location information
Location information - the attributes filepath, line and column - is
attached to various different ABI XML elements. While the information
can be useful, it can also contribute to large XML diffs if a line is
inserted, for example.
This commit adds a pass to limit the level of retained location
information. The most useful compromise is likely to be -L file.
* tools/abitidy.cc (LocationInfo): New enum to hold the level
of location information to retain.
(LOCATION_INFO_NAME): Map from string to enumerator.
(HAS_LOCATION): Set of XML elements with location info.
(limit_locations): New function to limit location info.
(main): Add locations option handling and action.
Bug: 193031982
Change-Id: Ieba3b5d61b840590de3155fe427b48ca7bd2fe8f
Signed-off-by: Giuliano Procida <gprocida@google.com>
1 file changed