Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: tools/binary_size/libsupersize/archive.py

Issue 2885073002: supersize: Move [clone] from name -> flags & rewrite Cluster() (Closed)
Patch Set: review comment Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/binary_size/libsupersize/canned_queries.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/binary_size/libsupersize/archive.py
diff --git a/tools/binary_size/libsupersize/archive.py b/tools/binary_size/libsupersize/archive.py
index d8aa1a4bcc7143fe5ca2b80849769af0f0698b6b..129529842ac1b26434cfbfd656a5159e75dea2e4 100644
--- a/tools/binary_size/libsupersize/archive.py
+++ b/tools/binary_size/libsupersize/archive.py
@@ -92,6 +92,19 @@ def _NormalizeNames(raw_symbols):
symbol.name = symbol.full_name
continue
+ # Remove [clone] suffix, and set flag accordingly.
+ # Search from left-to-right, as multiple [clone]s can exist.
+ # Example name suffixes:
+ # [clone .part.322] # GCC
+ # [clone .isra.322] # GCC
+ # [clone .constprop.1064] # GCC
+ # [clone .11064] # clang
+ # http://unix.stackexchange.com/questions/223013/function-symbol-gets-part-suffix-after-compilation
+ idx = symbol.full_name.find(' [clone ')
+ if idx != -1:
+ symbol.full_name = symbol.full_name[:idx]
+ symbol.flags |= models.FLAG_CLONE
+
# E.g.: vtable for FOO
idx = symbol.full_name.find(' for ', 0, 30)
if idx != -1:
@@ -164,7 +177,6 @@ def _SourcePathForObjectPath(object_path, source_mapper):
def _ExtractSourcePaths(raw_symbols, source_mapper):
"""Fills in the |source_path| attribute."""
- logging.debug('Parsed %d .ninja files.', source_mapper.parsed_file_count)
for symbol in raw_symbols:
object_path = symbol.object_path
if object_path and not symbol.source_path:
@@ -425,6 +437,7 @@ def CreateSizeInfo(map_path, elf_path, tool_prefix, output_directory):
logging.info('Parsing ninja files.')
source_mapper, elf_object_paths = ninja_parser.Parse(
output_directory, elf_path)
+ logging.debug('Parsed %d .ninja files.', source_mapper.parsed_file_count)
assert not elf_path or elf_object_paths, (
'Failed to find link command in ninja files for ' +
os.path.relpath(elf_path, output_directory))
« no previous file with comments | « no previous file | tools/binary_size/libsupersize/canned_queries.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698