[Supersize] Add bcanalyzer.py to process LLVM Bitcode (BC) Files.

This CL adds code to that parses llvm-bcanalyzer output to extract
strings in BC .o files. This is needed for LLD-LTO support. Integration
code will be follow-up CLs. Details:
- Add bcanalyzer.py, which has:
  - IsBitcodeFile(): Decides whether a .o file is BC by file magic.
  - ParseTag(): Heuristic tag parser, exposed for testing.
  - RunBcAnalyzerOnIntermediates(): BulkForAndCall() target that will
    be the main interface to extract strings from BC files.
  - Stand-alone main(), to test string extraction on stand-alone BC
    files.
- Add bcanalyzer_test.py: Unit tests.
  - Test ParseTag() since it's rather error prone, but not the other
    low-level parse routines.
  - Test string extraction based on mock data (see below).
- Add mock_bcanalyzer.py (with wrapper llvm-bcanalyzer): Test case
  generated from a sample C++ file with string data in various form.
  The embedded llvm-bcanalyzer dump is extensively annotated to
  document the data format.

Bug: 723798
Change-Id: I8a9ff659031afa3391f0bbeb22804c3da8578c94
Reviewed-on: https://chromium-review.googlesource.com/1140685
Reviewed-by: Samuel Huang <huangs@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: Samuel Huang <huangs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576630}
5 files changed