gn2bp: Add sanitize API to the BaseActionSanitizer

Currently, Sanitizer modifies target attributes in the get APIs.
However, some sanitize methods are not idempotent (e.g.
_add_location_tag).
Also, get API could depends on the same target attributes, at this
point, get_srcs and get_tool_files will depends on target.sources and
target.inputs.
This could easily cause issue by calling non idempotent sanitize methods
multiple times.
This CL introduces sanitize API to prevent this issue.
sanitize API modifies all the required target attributes and other get
APIs only read the sanitized target attributes.
This makes it easy to guarantee that sanitization is done only once.

Test: ./update_results.sh
Change-Id: I1b4033ae161284ef07153b56e05217b8557b4cba
1 file changed