summaryrefslogtreecommitdiff
path: root/bridges/README
AgeCommit message (Expand)Author
2012-02-06Added READMEs for modules related to URE, with content from the wikiJosh Heidenreich
str) override; > | ^~~~~~~~ > include/svx/svxdlg.hxx:380:116: note: TODO: second argument is here [loplugin:overrideparam] > 380 | const OUString& rName, const OUString& rDesc, const OUString& rTitle = u""_ustr ) = 0; > | ^~~~~~~~ > MaterializeTemporaryExpr 0x1732504d0 'const OUString':'const class rtl::OUString' lvalue > `-ImplicitCastExpr 0x1732504b8 'const OUString':'const class rtl::OUString' <NoOp> > `-CXXBindTemporaryExpr 0x173250498 'OUString':'class rtl::OUString' (CXXTemporary 0x173250498) > `-UserDefinedLiteral 0x173250468 'OUString':'class rtl::OUString' > `-ImplicitCastExpr 0x173250450 'OUString (*)(void)' <FunctionToPointerDecay> > `-DeclRefExpr 0x173250430 'OUString (void)' lvalue Function 0x14a24f188 'operator""_ustr' 'OUString (void)' > MaterializeTemporaryExpr 0x14a250658 'const OUString':'const class rtl::OUString' lvalue > `-ImplicitCastExpr 0x14a250640 'const OUString':'const class rtl::OUString' <NoOp> > `-CXXBindTemporaryExpr 0x14a250620 'OUString':'class rtl::OUString' (CXXTemporary 0x14a250620) > `-UserDefinedLiteral 0x14a2505f0 'OUString':'class rtl::OUString' > `-ImplicitCastExpr 0x14a2505d8 'OUString (*)(void)' <FunctionToPointerDecay> > `-DeclRefExpr 0x14a24f298 'OUString (void)' lvalue Function 0x14a24f188 'operator""_ustr' 'OUString (void)' (Unfortunately, there appears to be no way to get at the actual string literal content here to check it for equality, so keep returning Maybe for now.) Change-Id: I4beac3c7f17a689488a41efe5da0554af7beff65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168246 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Tested-by: Jenkins 2023-12-18-Werror,-Wdeprecated-declarationsStephan Bergmann > compilerplugins/clang/casttovoid.cxx:452:18: error: 'endswith' is deprecated: Use ends_with instead [-Werror,-Wdeprecated-declarations] > .endswith(".h")); > ^~~~~~~~ > ends_with > ~/llvm/inst/include/llvm/ADT/StringRef.h:276:19: note: 'endswith' has been explicitly marked deprecated here > [[nodiscard]] LLVM_DEPRECATED( > ^ etc. after <https://github.com/llvm/llvm-project/commit/5ac12951b4e9bbfcc5791282d0961ec2b65575e9> "[ADT] Deprecate StringRef::{starts,ends}with (#75491)" on Clang 18 trunk, where <https://github.com/llvm/llvm-project/commit/1b97645e56bf321b06d1353024339958b64fd242> "[ADT] Introduce StringRef::{starts,ends}_width{,_insensitive}" had been added towards Clang 16 Change-Id: Icb3e43b7d6be6f877815285913d846f766eddebf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160919 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> 2023-11-04Adapt to Clang 18 trunk Linkage reworkStephan Bergmann <https://github.com/llvm/llvm-project/commit/8775947633bf189e1847707932b1015f04640ea0> "[clang][NFC] Refactor clang::Linkage" Change-Id: I35e3a3c7e3de29e4f3b9ee8dfc34e39ba2aa1c70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158919 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2023-09-14Improve Plugin::checkIdenticalDefaultArgumentsStephan Bergmann ...to avoid > In file included from /home/sbergman/lo/core/cui/source/factory/cuiexp.cxx:20: > /home/sbergman/lo/core/cui/source/factory/dlgfact.hxx:524:116: fatal error: TODO: Unexpected 'IdenticalDefaultArgumentsResult::Maybe' [loplugin:overrideparam] > 524 | const OUString& rName, const OUString& rDesc, const OUString& rTitle = "") override; > | ^~ > /home/sbergman/lo/core/include/svx/svxdlg.hxx:380:116: note: TODO: second argument is here [loplugin:overrideparam] > 380 | const OUString& rName, const OUString& rDesc, const OUString& rTitle = "" ) = 0; > | ^~ > MaterializeTemporaryExpr 0x7f6fd76d4218 'const OUString':'const class rtl::OUString' lvalue > `-CXXBindTemporaryExpr 0x7f6fd76d41f8 'const OUString':'const class rtl::OUString' (CXXTemporary 0x7f6fd76d41f8) > `-CXXConstructExpr 0x7f6fd76d41b8 'const OUString':'const class rtl::OUString' 'void (const char &[1], typename libreoffice_internal::ConstCharArrayDetector<const char[1], libreoffice_internal::Dummy>::Type)' > |-StringLiteral 0x7f6fd76d3e48 'const char[1]' lvalue "" > `-CXXDefaultArgExpr 0x7f6fd76d4170 'libreoffice_internal::Dummy':'struct rtl::libreoffice_internal::Dummy' > MaterializeTemporaryExpr 0x7f6fe30b5f58 'const OUString':'const class rtl::OUString' lvalue > `-CXXBindTemporaryExpr 0x7f6fe30b5f38 'const OUString':'const class rtl::OUString' (CXXTemporary 0x7f6fe30b5f38) > `-CXXConstructExpr 0x7f6fe30b5ef8 'const OUString':'const class rtl::OUString' 'void (const char &[1], typename libreoffice_internal::ConstCharArrayDetector<const char[1], libreoffice_internal::Dummy>::Type)' > |-StringLiteral 0x7f6fe30b48f8 'const char[1]' lvalue "" > `-CXXDefaultArgExpr 0x7f6fe30b5ea8 'libreoffice_internal::Dummy':'struct rtl::libreoffice_internal::Dummy' after c7a608a6691c790783c63f504010bc796c36af25 "tdf#155503 Add title to document title dialog" in an --enable-compiler-plugins=debug build. (Instead of trying to inspect deeper into the code that compares two StringLiteral directly in Plugin::checkIdenticalDefaultArguments, it looked simpler to just extend structurallyIdentical.) Change-Id: Ie1eecff210413f0a29213d867aad249420c1c278 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156916 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2023-04-06loplugin:stringadd also check O[U]StringBuffersNoel Grandin For similar code sequences that can be improved. Also move containsComment from collapseif plugin code to plugin.cxx so we can use it from stringadd. Change-Id: Ie07d9aedf2c31cb0b2080e1b8584294d7046a8e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149217 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2022-04-25Introduce a better mechanism to suppress false loplugin warningsStephan Bergmann ...by annotating occurrences of false warnings with [-loplugin:<name>] comments in source files and letting individual plugins opt-in to watch out for such suppression annotations, rather than maintaining lists of excluded source files in the individual plugins. (See the new loplugin::Plugin::suppressWarningsAt.) Instead of making all calls to loplugin::Plugin::report check for suppression annotations, the intent is that this check will only be added opt-in to those places in the plugins that are prone to emitting false warnings. In general it is better to have plugins that don't produce false warnings in the first place, or at least let those warnings be addressed with trivial and harmless source code modifications, avoiding the need for any suppression mechanism. As a proof of concept, I have removed the exclude list from loplugin:redundantfcast and instead annotated the relevant source code. (And thereby found that three of the six originally excluded files didn't need to be excluded any more at all?) For now, this mechanism looks for comments (both //... and /*...*/, even documentation-style /**...*/) that overlap the current and/or the preceding line, because at least for code controlled by clang-format it is often easier to move comments to a line of their own, preceding the commented code. Looking also at the current line (and not only at the preceding one) opens the door for erroneous over-eager annotation, where an annotation that was meant to address a false warning on the current line would also silence a potentially true warning on the following line. This probably doesn't cause much trouble in practice, but is up for potential change. Change-Id: I91ce7a0e5248886a60b471b1a153867f16bb5cea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133365 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2022-02-17Bump compiler plugins Clang baseline to 12.0.1Stephan Bergmann ...as discussed in the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2020-November/086234.html> "Bump --enable-compiler-plugins Clang baseline?" (and now picked up again at <https://lists.freedesktop.org/archives/libreoffice/2022-February/088459.html> "Re: Bump --enable-compiler-plugins Clang baseline?"), and clean up compilerplugins/clang/ accordingly Change-Id: I5e81c6fdcc363aeefd6227606225b526fdf7ac16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129989 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2022-01-19Let CppunitTest_odk_checkapi build against the SDK include directoryStephan Bergmann ...which contains only the URE include files, rather than against the SRCDIR one which contains many more. This would have prevented 148536afc9838398100ca2267b99ab349dcbb38c "Drop config_global.h from osl/module.h", where an URE include file had accidentally started to include a non-URE file. (The way $(INCLUDE) is now set up in odk/CppunitTest_odk_checkapi.mk is a bit hacky, and this change required teaching compilerplugins about SDKDIR to avoid false warnings. Another approach would be to make the test compile in the SDK build environment, similarly to CustomTarget_odk/build-examples, but setting up the SDK build environment from within gbuild is not supported at least on Windows for now. A smaller improvement would be to drop the need to include any CppUnit include directories, by turning the test into some kind of compile-only test similar to a gb_CompilerTest.) Change-Id: If79761909c67c3162d01f847dfb5d4f538f91ca1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128591 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2021-12-17loplugin:unusedvariablecheck improveNoel Grandin to find unused smart pointer variables Change-Id: I200bdd8949032a0e061de61f7903a156651793e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127006 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2021-09-03remove debugging leftoverNoel Grandin from commit 8a54339fc83fe9abaaace6f9f374697e6923d684 loplugin:referencecasting look through more clang Types Change-Id: I6a8a4bbce04d6f53d8e02961c0917bb57fb69a9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121601 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2021-08-23loplugin:referencecasting look through more clang TypesNoel Grandin Note that because of where the fix resides, loplugin:redundantcast also notices a few more things. Change-Id: I0b66047fadfff2c5ceafcbd3eab085de00d861a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120865 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2021-03-25compilerplugins: fix clang plugin allowlists for sccache-distMichael Stahl While icecream passes preprocessed (via -frewrite-includes) input to the compiler on stdin, sccache-dist writes it to a file at the same location as the source file in its sandbox. So we need a new heuristic to detect that the input has -frewrite-includes applied; there is not any variable that sccache sets, users could have SCCACHE_CACHE_SIZE set but only if they use the disk cache, so check CXX for now. Also set SCCACHE_EXTRAFILES to include log-areas.dox required by plugin. Change-Id: I4e00bfb0db7dab28f228fc0e85d753506e2c86b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112480 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> 2021-03-16systools is no longer part of the URE interfaceStephan Bergmann ...since de030cd7a234fd9191364647deb1a4836ca992cb "gbuild: Remove MSVC 2013 legacy code", so no longer treat it as such in compilerplugins. (Which caused a few loplugin:includeform and loplugin:nullptr warnings.) Change-Id: I99b42e76992e31aff56b417c05738d4d29e3faf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112575 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2020-08-03Revert "Adapt to changed clang::ASTContext::getParents behavior on Clang 11 ↵Stephan Bergmann trunk" This reverts commit 09aa5a9be8b9b3c88cf25b85e0eda28c5ef19aa4, now that <https://github.com/llvm/llvm-project/commit/ 551092bc3dfb86f1e11a55f3bee0c8ee1be6fdd6> "Revert AST Matchers default to AsIs mode" reverted the Clang commit that prompted this compilerplugins change. Change-Id: I75c8b4cb2894cd67a791db460f2886a783856c73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100026 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2020-06-05add boost::intrusive_ptr to list of smart points in pluginsNoel Grandin and fix some loplugin:simplifypointertobool warnings Change-Id: I3644c390a3339a4cb8d66d6d034a0f043de9320c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95572 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-05-27Further fixing of loplugin:simplifypointertobool for libstdc++ std::shared_ptrStephan Bergmann ...after fe6cce01c88d045a1fcf09acf049c34c22299b02 "Fix loplugin:simplifypointertobool for libstdc++ std::shared_ptr", this time for uses of oox::drawingml::chart::ModelRef, which derives from std::shared_ptr. Change-Id: I7e9620da52b3f6d26c6fe6d7909888c3a221c164 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94975 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2020-05-26Fix loplugin:simplifypointertobool for libstdc++ std::shared_ptrStephan Bergmann ...where the get member function is defined on a std::__shared_ptr base class, so loplugin:simplifypointertobool used to miss those until now. (While e.g. using libc++ on macOS found those cases.) 366d08f2f6d4de922f6099c62bb81b49d89e0a68 "new loplugin:simplifypointertobool" was mistaken in breaking isSmartPointerType(const clang::Type* t) out of isSmartPointerType(const Expr* e); c874294ad9fb178df47c66875bfbdec466e39763 "Fix detection of std::unique_ptr/shared_ptr in loplugin:redundantpointerops" had introduced that indivisible two-step algorithm on purpose. The amount of additional hits (on Linux) apparently asked for turning loplugin:simplifypointertobool into a rewriting plugin. Which in turn showed that the naive adivce to just "drop the get()" is not sufficient in places that are not contextually converted to bool, as those places need to be wrapped in a bool(...) functional cast now. If the expression was already wrapped in parentheses, those could be reused as part of the functional cast, but implementing that showed that such cases are not yet found at all by the existing loplugin:simplifypointertobool. Lets leave that TODO for another commit. Besides the changes to compilerplugins/ itself, this change has been generated fully automatically with the rewriting plugin on Linux. Change-Id: I83107d6f634fc9ac232986f49044d7017df83e2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94888 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins 2020-05-25Adapt to changed clang::ASTContext::getParents behavior on Clang 11 trunkStephan Bergmann ...since <https://github.com/llvm/llvm-project/commit/ d0da5d2bbe8305d06dc01a98706fd73e11e24a9f> "Change default traversal in AST Matchers to ignore invisible nodes". This caused failures > [CPT] compilerplugins/clang/test/constparams.cxx > ParmVarDecl 0x11d76c730 <compilerplugins/clang/test/constparams.cxx:15:12, col:18> col:18 used f1 'int *' > DeclRefExpr 0x11d76c948 'int *' lvalue ParmVar 0x11d76c730 'f1' 'int *' > ParmVarDecl 0x11d76cc80 <compilerplugins/clang/test/constparams.cxx:21:12, col:18> col:18 used f2 'int *' > DeclRefExpr 0x11d76ce60 'int *' lvalue ParmVar 0x11d76cc80 'f2' 'int *' > error: 'error' diagnostics expected but not seen: > File compilerplugins/clang/test/constparams.cxx Line 15: this parameter can be const Class1::Class1 [loplugin:constparams] > error: 'error' diagnostics seen but not expected: > File compilerplugins/clang/test/constparams.cxx Line 15: no parent? [loplugin:constparams] > File compilerplugins/clang/test/constparams.cxx Line 21: no parent? [loplugin:constparams] > 3 errors generated. [...] > [CPT] compilerplugins/clang/test/unusedenumconstants.cxx > error: 'error' diagnostics expected but not seen: > File compilerplugins/clang/test/unusedenumconstants.cxx Line 30: read Bottom [loplugin:unusedenumconstants] > error: 'error' diagnostics seen but not expected: > File compilerplugins/clang/test/unusedenumconstants.cxx Line 30: write Bottom [loplugin:unusedenumconstants] > 2 errors generated. [...] > [CPT] compilerplugins/clang/test/unusedfields.cxx > error: 'error' diagnostics expected but not seen: > File compilerplugins/clang/test/unusedfields.cxx Line 156 (directive at compilerplugins/clang/test/unusedfields.cxx:164): write m_f5 [loplugin:unusedfields] > File compilerplugins/clang/test/unusedfields.cxx Line 210 (directive at compilerplugins/clang/test/unusedfields.cxx:211): read m_f1 [loplugin:unusedfields] > 2 errors generated. For compilerplugins/clang/test/constparams.cxx at least it would have worked to fix that locally with > diff --git a/compilerplugins/clang/constparams.cxx b/compilerplugins/clang/constparams.cxx > index 95c8184009d7..70f056fa5a69 100644 > --- a/compilerplugins/clang/constparams.cxx > +++ b/compilerplugins/clang/constparams.cxx > @@ -274,7 +274,7 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt, const ParmVarDecl* parmVar > { > for ( auto cxxCtorInitializer : cxxConstructorDecl->inits()) > { > - if ( cxxCtorInitializer->getInit() == stmt) > + if ( cxxCtorInitializer->getInit()->IgnoreImpCasts() == stmt) > { > if (cxxCtorInitializer->isAnyMemberInitializer()) > { (somewhat unintuitively, given the Clang change is apparently about ignoring more implicit nodes), but overall it appears better---at least for now---to use a getParents variant that keeps the old traversal behavior. For that, instead of using the clang::ASTContext::ParentMapCtx, we create our own loplugin::Plugin::parentMapContext_. There appear to be no uses of ASTContext::getParent across the Clang codebase itself, outside of ASTMatcher code, so it looks unlikely that creating our own ParentMapContext instance would degrade performance by no longer sharing cached data between Clang's internals and our plugin. (And given that ASTContext::getParents is deprecated with the note "New callers should use ParentMapContext::getParents() directly", this may well be the correct way in the long run, anyway.) Change-Id: I46c7912f2737e7c224fd45ab41441f69e2f10bd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94795 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2020-05-25Code duplicationStephan Bergmann Change-Id: I1af2948e0332044ef88bc7dbd837e8c7afe7af19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94785 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2020-05-10new loplugin:simplifypointertoboolNoel Grandin Change-Id: Iff68e8f379614a6ab6a6e0d1bad18e70bc76d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-03-10Deref of DynTypedNode* must not outlive owning DynTypedNodeListStephan Bergmann Change-Id: I8ac4a2f1e442446384b88f38bdef21644409f8a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90303 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2020-03-09compilerplugins: remove unused getDeclContext()Miklos Vajna Change-Id: I523cc2195be5f200b3e416d1ec3b282e3245ebbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90214 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> 2020-03-09improve loplugin:unusedfieldsNoel Grandin noticed something that wasn't being picked up, wrote some tests, and found an unhandled case in Plugin::getParentFunctionDecl Change-Id: I52b4ea273be6614e197392dfc4d6053bbc1704de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90141 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>