commit | 3f2f4b462643ab0396ef208ab773e418df52da65 | [log] [tgz] |
---|---|---|
author | Samuel Huang <huangs@chromium.org> | Thu Jul 19 21:14:54 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Jul 19 21:14:54 2018 |
tree | a042bf4446976eb226083a5adcb7899a1ae82fe0 | |
parent | 2a20abecf7b0957393948f74e1eee907b68547d6 [diff] |
[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}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .