summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-22 13:37:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-25 13:22:33 +0200
commit60694088231234f9c916fb6ea15067b1bf0b9cb2 (patch)
tree24d980eff2b96ea99a761ad11015620b0b617ef0 /compilerplugins
parentfacd0fc931468e82e50be3f7d8af48c6187dfa96 (diff)
convert excel filter in calc from shared_ptr to rtl::Reference
ref-counting traffic here accounts for 10% of the profile on some of my calc imports. Change-Id: I1b32e0e61d7bf5eb65780ec0e7fcb99f6576050a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92694 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/refcounting.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/compilerplugins/clang/refcounting.cxx b/compilerplugins/clang/refcounting.cxx
index ecd8aa3bfc51..31b1540d391e 100644
--- a/compilerplugins/clang/refcounting.cxx
+++ b/compilerplugins/clang/refcounting.cxx
@@ -255,6 +255,17 @@ bool containsSalhelperReferenceObjectSubclass(const clang::Type* pType0) {
// for performance reasons we sometimes allocate temporaries on the stack
if (loplugin::DeclCheck(pRecordDecl).Struct("ScSheetLimits").GlobalNamespace())
return false;
+
+ // the calc excel filter likes storing lots of classes either by reference or by value
+ if (loplugin::isDerivedFrom(pRecordDecl,
+ [](Decl const * decl) -> bool
+ {
+ return
+ bool(loplugin::DeclCheck(decl).Class("XclExpRecordBase").GlobalNamespace())
+ || bool(loplugin::DeclCheck(decl).Class("XclImpChLineFormat").GlobalNamespace());
+ }))
+ return false;
+
const ClassTemplateSpecializationDecl* pTemplate = dyn_cast<ClassTemplateSpecializationDecl>(pRecordDecl);
if (pTemplate) {
auto const dc = loplugin::DeclCheck(pTemplate);