Kaydet (Commit) f58bca9d authored tarafından Caolán McNamara's avatar Caolán McNamara

drop findunusedcode

Change-Id: If17801c57d8333322985e36f09a022d6c317ba6d
Reviewed-on: https://gerrit.libreoffice.org/39663Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst bc29aa9f
......@@ -9,7 +9,7 @@
gb_Top_MODULE_CHECK_TARGETS := slowcheck unitcheck subsequentcheck perfcheck uicheck screenshot
.PHONY : all check-if-root bootstrap gbuild build build-non-l10n-only build-l10n-only check clean clean-build clean-host test-install distclean distro-pack-install distro-pack-install-strip docs download etags fetch findunusedcode get-submodules id install install-strip tags debugrun help showmodules translations packageinfo internal.clean $(gb_Top_MODULE_CHECK_TARGETS)
.PHONY : all check-if-root bootstrap gbuild build build-non-l10n-only build-l10n-only check clean clean-build clean-host test-install distclean distro-pack-install distro-pack-install-strip docs download etags fetch get-submodules id install install-strip tags debugrun help showmodules translations packageinfo internal.clean $(gb_Top_MODULE_CHECK_TARGETS)
MAKECMDGOALS?=all
build_goal:=$(if $(filter build check,$(MAKECMDGOALS)),all)\
......@@ -395,9 +395,6 @@ etags:
docs:
@$(SRCDIR)/solenv/bin/mkdocs.sh $(SRCDIR)/docs $(SRCDIR)/solenv/inc/doxygen.cfg
findunusedcode:
@$(SRCDIR)/bin/findunusedcode $(SRCDIR) $(MAKE)
findunusedheaders:
$(SRCDIR)/bin/find-unusedheaders.py
......
#!/bin/bash
set -e
SRCDIR=$1
GNUMAKE=$2
cd ${SRCDIR}
which callcatcher > /dev/null 2>&1 || \
(echo "callcatcher not installed" && false)
mkdir -p ${SRCDIR}/callcatcher
cd ${SRCDIR}/callcatcher
echo "--without-doxygen
--enable-verbose
--enable-gio
--enable-packagekit
--enable-extension-integration
--enable-evolution2
--enable-online-update
--enable-dbgutil
--enable-werror
--enable-gtk3
--enable-kde4
--enable-dbus
--enable-gstreamer-1-0
--disable-gstreamer-0-10" \
> autogen.input
export CC="callcatcher ${CC:-gcc}"
export CXX="callcatcher ${CXX:-g++}"
export AR="callarchive ${AR:-ar}"
/bin/env -i CC="$CC" CXX="$CXX" AR="$AR" /bin/bash -l ../autogen.sh
export dbglevel=2
make clean && make check
callanalyse \
instdir/program/* \
instdir/sdk/bin/* \
workdir/LinkTarget/*/* workdir/LinkTarget/*/*/* \
workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit.so* \
> unusedcode.all
grep ::.*\( unusedcode.all \
| grep -v ^Atom \
| grep -v ^atom:: \
| grep -v ^boost:: \
| grep -v ^CIcc \
| grep -v ^CLuceneError:: \
| grep -v ^cppu:: \
| grep -v ^CppUnit:: \
| grep -v ^Dde \
| grep -v ^graphite2:: \
| grep -v ^jvmaccess:: \
| grep -v ^Json:: \
| grep -v ^libcdr:: \
| grep -v ^libcmis:: \
| grep -v ^libgltf:: \
| grep -v ^libmspub:: \
| grep -v ^libvisio:: \
| grep -v ^libwpg:: \
| grep -v ^libwps_tools_win:: \
| grep -v ^lucene:: \
| grep -v ^Matrix3d:: \
| grep -v ^RelatedMultipart:: \
| grep -v ^salhelper:: \
| grep -v ^VSDInternalStream:: \
| grep -v ^WP1 \
| grep -v ^WP3 \
| grep -v ^WP42 \
| grep -v ^WP6 \
| grep -v ^WPG \
| grep -v ^WPS \
| grep -v WPX \
| grep -v ^WSObject \
| grep -v ^OAuth2Handler \
| grep -v ^COLLADABU:: \
| grep -v ^COLLADAFW:: \
| grep -v ^COLLADASaxFWL14:: \
| grep -v ^COLLADASaxFWL15:: \
| grep -v ^COLLADASaxFWL:: \
| grep -v ^o3dgc:: \
| grep -v ^MathML:: \
| grep -v ^GeneratedSaxParser:: \
| grep -v ^GLTF:: \
| grep -v ^OneDrive \
| grep -v ^SharePoint \
| grep -v ^VersioningService:: \
| grep -v ^WSSession:: \
| grep -v ^NavigationService:: \
| grep -v ^ObjectService:: \
| grep -v ^RepositoryService:: \
| grep -v ^GDriveDocument:: \
| grep -v ^GDriveFolder:: \
| grep -v ^GDriveProperty:: \
| grep -v ^GDriveSession:: \
> ../unusedcode.easy
unusedcode.easy is generated via callcatcher[1] and filtered to remove some
tricky edge-cases (see Makefile), e.g. anything which could plausibly be
dlsymed or any symbol defined in an external library bundled into LibreOffice
which doesn't happen to get used by LibreOffice.
unusedcode.easy is generated on an x86_64 --enable-debug --enable-dbgutil
configuration.
Code listed as unused is code that gcc outputs but that nothing calls
(or takes the address of).
a) It's possible that some other platform or configuration uses the code,
so manual inspection is always required.
b) callcatcher ignores virtuals. But implementations of "pure virtuals"
are not actually virtual methods. If something is declared pure virtual
and provides an impl and that base-class impl is not explicitly called
anywhere, then that impl can go away.
c) gcc will only emit code for inlines if those inlines are used, so
sometimes something is listed correctly as unused but some inline
code takes a pointer or reference to something which cannot be
instantiated so removal of some method/class fails at build time because
gcc never emits any code for the unused inline but trips over it at
compile time after an attempt at removal. i.e. generally the inline method
can go as well because nothing calls it either, a double win.
d) if a constructor is listed as unused, and it's the *only* ctor in the class,
then no object of that class can be constructed, so the whole thing is
unused, which can lead to a whole cascade of tricky but logical fallout.
e) if a destructor is listed as unused, and a constructor isn't, then there's
a leak somewhere, and the destructor most likely *should* be called.
f) there's more actually unused code then what's listed. The idea is that what's
listed is definitely unused under the generation configuration, not that
it's a list of all unused code. If the count of unused easy hits 0 then
we can have a look at the non-easy and if that hits 0, then strip out
code from the "release" binaries which only makes sense in debug/dbgutil
configurations, and then tackle unused virtual method slots :-)
Symbols that are known to be false alarms are listed in: unusedcode.exclude
[1] http://www.skynet.ie/~caolan/Packages/callcatcher.html
BigInt::BigInt(unsigned int)
OpenGLContext::init(_XDisplay*, unsigned long, unsigned int, unsigned int, int)
OpenGLContext::renderToFile()
OpenGLContext::requestSingleBufferedRendering()
OpenGLContext::requestVirtualDevice()
OpenGLRender::CreateTextTexture(rtl::OUString const&, vcl::Font, long, com::sun::star::awt::Point, com::sun::star::awt::Size, long)
OpenGLTexture::Draw()
ScCellValue::set(ScRefCellValue const&)
ScImportExport::ImportData(rtl::OUString const&, com::sun::star::uno::Any const&)
ScImportExport::ScImportExport(ScDocument*, rtl::OUString const&)
ScPrivatSplit::GetDeltaX()
ScTbxInsertCtrl::Select(bool)
ScTokenArray::GetWeight() const
ScVbaFormat<ooo::vba::excel::XStyle>::getAddIndent()
ScVbaFormat<ooo::vba::excel::XStyle>::setAddIndent(com::sun::star::uno::Any const&)
SdrUndoObjList::SetOrdNum(unsigned int)
SecurityEnvironment_NssImpl::getCertificate(rtl::OUString const&, rtl::OUString const&)
StylePool::getCount() const
SvpSalInstance::PostedEventsInQueue()
SvtAccessibilityOptions::IsModified() const
SvtListener::IsListening(SvtBroadcaster&) const
SwUnoTableCrsr::Clone() const
SwXParaFrameEnumerationImpl::PurgeFrameClients()::{lambda(std::shared_ptr<sw::FrameClient>&)#1}::_FUN(std::shared_ptr<sw::FrameClient>&)
Test::testCopyPasteSkipEmptyConditionalFormatting()
Test::testPerf()
Test::testSharedFormulaMoveBlock()
XclXmlUtils::ToOString(XclRange const&)
apitest::XCellRangesQuery::testQueryFormulaCells()
apitest::XDataPilotDescriptor::testGetHiddenFields()
apitest::XDataPilotFieldGrouping::testCreateDateGroup()
apitest::XElementAccess::testGetElementType()
apitest::XElementAccess::testHasElements()
apitest::XIndexAccess::XIndexAccess(int)
apitest::XIndexAccess::testGetByIndex()
apitest::XIndexAccess::testGetByIndexException()
apitest::XIndexAccess::testGetCount()
apitest::XNameContainer::XNameContainer()
apitest::XNameReplace::testReplaceByName()
apitest::XNamedRanges::XNamedRanges(rtl::OUString const&)
apitest::XNamedRanges::testRemoveByName()
apitest::XSpreadsheetDocument::testGetSheets()
basegfx::tools::containsOnlyHorizontalAndVerticalEdges(basegfx::B2DPolyPolygon const&)
canvas::createSurfaceProxyManager(boost::shared_ptr<canvas::IRenderModule> const&)
chart::DataBrowser::SetCellModifiedHdl(Link<void*, long> const&)
comphelper::detail::ConfigurationWrapper::getGroupReadWrite(std::shared_ptr<comphelper::ConfigurationChanges> const&, rtl::OUString const&)
comphelper::detail::ConfigurationWrapper::getLocalizedPropertyValue(rtl::OUString const&) const
comphelper::detail::ConfigurationWrapper::setLocalizedPropertyValue(std::shared_ptr<comphelper::ConfigurationChanges> const&, rtl::OUString const&, com::sun::star::uno::Any const&)
connectivity::firebird::release(int&, cppu::OBroadcastHelperVar<cppu::OMultiTypeInterfaceContainerHelper, com::sun::star::uno::Type>&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&, com::sun::star::lang::XComponent*)
connectivity::sdbcx::OGroup::OGroup(bool)
connectivity::sdbcx::OGroup::OGroup(rtl::OUString const&, bool)
dbaccess::OBookmarkContainer::dispose()
dbaccess::StorageInputStream::close()
oglcanvas::CanvasHelper::drawPoint(com::sun::star::rendering::XCanvas const*, com::sun::star::geometry::RealPoint2D const&, com::sun::star::rendering::ViewState const&, com::sun::star::rendering::RenderState const&)
oglcanvas::TextLayout::draw(com::sun::star::rendering::ViewState const&, com::sun::star::rendering::RenderState const&, com::sun::star::uno::Reference<com::sun::star::rendering::XGraphicDevice> const&) const
oox::drawingml::TextListStyle::dump() const
oox::xls::DefinedName::getTokens()
sc::CellValues::transferTo(ScColumn&, int)
sc::ColumnSpanSet::swap(sc::ColumnSpanSet&)
sc::FormulaGroupAreaListener::getGroupLength() const
sc::FormulaGroupAreaListener::getRange() const
sc::FormulaGroupAreaListener::getTopCellPos() const
sc_apitest::main()
sd::LeftDrawPaneShell::RegisterInterface(SfxModule*)
sd::LeftImpressPaneShell::RegisterInterface(SfxModule*)
std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, (anonymous namespace)::TemplateId>, std::_Select1st<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> >, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> > >::_M_move_data(std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, (anonymous namespace)::TemplateId>, std::_Select1st<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> >, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> > >&, std::integral_constant<bool, true>)
std::__cxx1998::vector<rtl::Reference<oox::xls::(anonymous namespace)::WorkerThread>, std::allocator<rtl::Reference<oox::xls::(anonymous namespace)::WorkerThread> > >::reserve(unsigned long)
vcl::MapChar(vcl::TrueTypeFont*, unsigned short, bool)
vcl::Region::IsInside(Rectangle const&) const
vcl::Window::DrawGradientWallpaper(OutputDevice&, long, long, long, long, Wallpaper const&)
vcl::Window::DrawSelectionBackground(Rectangle const&, unsigned short, bool, bool, bool, Color*)
vcl::Window::SetDoubleBuffering(bool)
vclcanvas::CanvasBitmapHelper::setData(com::sun::star::uno::Sequence<signed char> const&, com::sun::star::rendering::IntegerBitmapLayout const&, com::sun::star::geometry::IntegerRectangle2D const&)
vclcanvas::CanvasBitmapHelper::setPixel(com::sun::star::uno::Sequence<signed char> const&, com::sun::star::rendering::IntegerBitmapLayout const&, com::sun::star::geometry::IntegerPoint2D const&)
vclcanvas::CanvasHelper::drawPoint(com::sun::star::rendering::XCanvas const*, com::sun::star::geometry::RealPoint2D const&, com::sun::star::rendering::ViewState const&, com::sun::star::rendering::RenderState const&)
vclcanvas::CanvasHelper::setData(com::sun::star::uno::Sequence<signed char> const&, com::sun::star::rendering::IntegerBitmapLayout const&, com::sun::star::geometry::IntegerRectangle2D const&)
vclcanvas::CanvasHelper::setPixel(com::sun::star::uno::Sequence<signed char> const&, com::sun::star::rendering::IntegerBitmapLayout const&, com::sun::star::geometry::IntegerPoint2D const&)
#
# list of symbols that should not be dropped, even they're not
# referenced in current (linux) builds
#
# test functions that aren't used yet, but will be in near future
# https://gerrit.libreoffice.org/#/c/1077/
ScFiltersTest::testColorScaleODS()
ScFiltersTest::testColorScaleXLSX()
apitest::XCellRangesQuery::testQueryFormulaCells()
apitest::XDataPilotDescriptor::testGetHiddenFields()
apitest::XDataPilotFieldGrouping::testCreateDateGroup()
apitest::XCellRangesQuery::testQueryFormulaCells()
apitest::XElementAccess::testGetElementType()
apitest::XElementAccess::testHasElements()
apitest::XIndexAccess::XIndexAccess(int)
apitest::XIndexAccess::testGetByIndex()
apitest::XIndexAccess::testGetByIndexException()
apitest::XIndexAccess::testGetCount()
apitest::XNameReplace::testReplaceByName()
apitest::XPropertySet::testAddPropertyChangeListener()
apitest::XPropertySet::testAddVetoableChangeListener()
apitest::XPropertySet::testRemovePropertyChangeListener()
apitest::XPropertySet::testRemoveVetoableChangeListener()
apitest::XSpreadsheetDocument::testGetSheets()
comphelper::detail::ConfigurationWrapper::getGroupReadWrite(boost::shared_ptr<comphelper::ConfigurationChanges> const&, rtl::OUString const&) const
comphelper::detail::ConfigurationWrapper::getLocalizedPropertyValue(rtl::OUString const&) const
comphelper::detail::ConfigurationWrapper::setLocalizedPropertyValue(boost::shared_ptr<comphelper::ConfigurationChanges> const&, rtl::OUString const&, com::sun::star::uno::Any const&) const
FontCharMap::GetDefaultMap(bool)
OutputDevice::LogicToLogic(basegfx::B2DPolyPolygon const&, MapMode const&, MapMode const&)
SvpSalFrame::enableDamageTracker(bool)
SalGraphics::drawTransformedBitmap(basegfx::B2DPoint const&, basegfx::B2DPoint const&, basegfx::B2DPoint const&, SalBitmap const&, SalBitmap const*)
StyleSettings::SetAlternatingRowColor(Color const&)
StyleSettings::SetCursorSize(long)
StyleSettings::SetFloatTitleHeight(long)
StyleSettings::SetHideDisabledMenuItems(bool)
StyleSettings::SetSpinSize(long)
StyleSettings::SetTitleHeight(long)
StyleSettings::SetUseFlatBorders(bool)
StyleSettings::SetUseFlatMenus(bool)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment