diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-06 11:54:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-06 17:50:30 +0100 |
commit | bf71fe152b8e04be92def48c9aecec98d57f5f35 (patch) | |
tree | e916628135f5faf54cf154cbbfc215a2c7b2a030 /bin | |
parent | b5d1c3c8519308d610a37e29eea300ad654cd371 (diff) |
mark some more classes hidden in --enable-mergelibs mode
and speed up the script using python's multiprocessing module
Change-Id: I01e1350937a0531e26603d6357982c91f3bcef0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90107
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/find-mergedlib-can-be-private.classes.results | 22 | ||||
-rwxr-xr-x | bin/find-mergedlib-can-be-private.py | 19 |
2 files changed, 8 insertions, 33 deletions
diff --git a/bin/find-mergedlib-can-be-private.classes.results b/bin/find-mergedlib-can-be-private.classes.results index 0d8f9b808e15..b75fe09fb821 100644 --- a/bin/find-mergedlib-can-be-private.classes.results +++ b/bin/find-mergedlib-can-be-private.classes.results @@ -53,8 +53,6 @@ GroupBox HelpLinker Hunspell Hunzip -INetMIMEMessage -INetMIMEMessageStream ImageControl ImplJobSetup IndexerPreProcessor @@ -119,7 +117,6 @@ PatternField PatternFormatter PhysicalFontFamily PlaceEditDialog -Point PrinterOptions ProgressBar QueueInfo @@ -163,7 +160,6 @@ SkiaPackedSurfaceAtlasManager SkiaZone SpinButton SpinListenerMultiplexer -Storage SvParser<HtmlTokenId>::TokenStackType SvParser<int>::TokenStackType SvtBasePrintOptions @@ -180,8 +176,6 @@ Svx3DTextureProjectionXItem Svx3DTextureProjectionYItem SvxCurrencyToolBoxControl SvxEditSourceAdapter -SvxGraphicObject -SvxMetricField SvxPasswordDialog SvxPropertySetInfoPool SvxTPage @@ -195,9 +189,6 @@ TextListenerMultiplexer Throbber TimeBox TimeFormatter -TreeEditListenerMultiplexer -TreeExpansionListenerMultiplexer -TreeSelectionListenerMultiplexer UFlowChainedText UnoEditControl UnoWrapperBase @@ -214,7 +205,6 @@ VclBuilder::sortIntoBestTabTraversalOrder VclDrawingArea VclGrid VclWindowEvent -VersionCompat XMLDashStyleExport XMLDashStyleImport XMLGradientStyleExport @@ -361,9 +351,6 @@ framework::StatusBarConfiguration framework::ToolBoxConfiguration framework::TransactionManager framework::UIConfigurationImporterOOo1x -i18nutil::casefolding -i18nutil::oneToOneMapping -i18nutil::widthfolding legacy::CntInt32 legacy::SfxBool legacy::SvxAdjust @@ -379,14 +366,6 @@ legacy::SvxPosture legacy::SvxTextLine legacy::SvxVerJustify legacy::SvxWeight -linguistic::HyphenatedWord -linguistic::PossibleHyphens -linguistic::PropertyChgHelper -linguistic::PropertyHelper_Hyphenation -linguistic::PropertyHelper_Spell -linguistic::PropertyHelper_Spelling -linguistic::PropertyHelper_Thesaurus -linguistic::SpellAlternatives psp::PrintFontManager::PrintFont sdr::SelectionController sdr::ViewSelection @@ -421,7 +400,6 @@ svxform::OLocalExchange svxform::OLocalExchangeHelper svxform::OSQLParserClient toolkitform -tools::WeakBase ucbhelper::ActiveDataSink ucbhelper::InteractionApprove ucbhelper::InteractionDisapprove diff --git a/bin/find-mergedlib-can-be-private.py b/bin/find-mergedlib-can-be-private.py index 572cd1c8e005..ba09996b4757 100755 --- a/bin/find-mergedlib-can-be-private.py +++ b/bin/find-mergedlib-can-be-private.py @@ -8,6 +8,7 @@ import subprocess import sys import re +import multiprocessing exported_symbols = set() imported_symbols = set() @@ -75,9 +76,6 @@ merged_libs = { \ ,"xo" \ ,"xstor" } -classes_with_exported_symbols = set() -classes_with_imported_symbols = set() - # look for symbols exported by libmerged subprocess_nm = subprocess.Popen("nm -D instdir/program/libmergedlo.so", stdout=subprocess.PIPE, shell=True) with subprocess_nm.stdout as txt: @@ -124,12 +122,11 @@ print("no symbols that can be made internal = " + str(len(intersec_symbols))) # Now look for classes where none of the class symbols are imported, # i.e. we can mark the whole class as hidden -def extract_class(sym, add_to_set): +def extract_class(sym): filtered_sym = subprocess.check_output(["c++filt", sym]).strip() if filtered_sym.startswith("vtable for "): classname = filtered_sym[11:] - add_to_set.add(classname) - return + return classname if filtered_sym.startswith("non-virtual thunk to "): filtered_sym = filtered_sym[21:] elif filtered_sym.startswith("virtual thunk to "): @@ -139,12 +136,12 @@ def extract_class(sym, add_to_set): i = filtered_sym.rfind("::", 0, i) if i != -1: classname = filtered_sym[:i] - add_to_set.add(classname) + return classname + return "" -for sym in exported_symbols: - extract_class(sym, classes_with_exported_symbols) -for sym in imported_symbols: - extract_class(sym, classes_with_imported_symbols) +pool = multiprocessing.Pool(multiprocessing.cpu_count()) +classes_with_exported_symbols = set(pool.map(extract_class, list(exported_symbols))) +classes_with_imported_symbols = set(pool.map(extract_class, list(imported_symbols))) with open("bin/find-mergedlib-can-be-private.classes.results", "wt") as f: for sym in sorted(classes_with_exported_symbols - classes_with_imported_symbols): |