summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/useuniqueptr.cxx
AgeCommit message (Collapse)Author
2018-09-18loplugin:useuniqueptr check more local variablesNoel Grandin
Change-Id: I8387731747ee6eb7d74037c0eff7fc9ac0b884c8 Reviewed-on: https://gerrit.libreoffice.org/60619 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-03loplugin:useuniqueptr update exclusionsNoel Grandin
Change-Id: I9c741dbaba772550b4d68406fff50d8b0ac60874 Reviewed-on: https://gerrit.libreoffice.org/59923 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-30Fix typosAndrea Gelmini
Change-Id: Ia658776bce8744e7b771559ca12b94a20923fc52 Reviewed-on: https://gerrit.libreoffice.org/59782 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-08-23filter out AST in more pluginsNoel Grandin
I seem to have missed quite a few in commit 9f4d23c15115d64febd6bf01f870cc157badd350 filter out some of the AST in the plugins This nets me another 14% improvement Change-Id: I39b980b49ced560f768045dbedd3ddfef29306c1 Reviewed-on: https://gerrit.libreoffice.org/59501 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-22improvements to loplugin:useuniqueptrNoel Grandin
find more patterns of deleting member data Change-Id: I8913e364200dad8405bac30dd8cab2a68c8bee8f Reviewed-on: https://gerrit.libreoffice.org/59233 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-21loplugin useuniqueptr improvementNoel Grandin
passing owning pointers to constructors Change-Id: I4e64cabbf449393b77162a845b3138be415e2dc9 Reviewed-on: https://gerrit.libreoffice.org/59346 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-10Avoid -Werror=deprecated-declarations with recent Clang trunkStephan Bergmann
...which first added alternative names to and then deprecated getLocBegin/End Change-Id: Iaefb8ce259057abfa6cd20f0b63c0ef2949a96b2 Reviewed-on: https://gerrit.libreoffice.org/58820 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-30loplugin:useuniqueptr in SwGrfExtPageNoel Grandin
Change-Id: Ic71cf09b6a443f6918b074010fe53ea0843bf246 Reviewed-on: https://gerrit.libreoffice.org/58238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24loplugin:useuniqueptr in rptui::ConditionNoel Grandin
Change-Id: I1197be1f7ea8b621dedef41fdd0a664cb6d90374 Reviewed-on: https://gerrit.libreoffice.org/57879 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24loplugin:useuniqueptr fix check for DELETEZ inside compound stmtNoel Grandin
Change-Id: Id748b8b0c9cfe8c288dfafb5d0c2a83a8de2c91c Reviewed-on: https://gerrit.libreoffice.org/57871 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24loplugin:useuniqueptr in SwHTMLWriterNoel Grandin
Change-Id: I67f3dd615e798f8ac865b57332f6153530d81929 Reviewed-on: https://gerrit.libreoffice.org/57863 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-20loplugin:useuniqueptr in HTMLTableNoel Grandin
Change-Id: I46ece073659444e802bf480996a5797c9f1ec9e8 Reviewed-on: https://gerrit.libreoffice.org/57754 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-20loplugin:useuniqueptr in XclObjNoel Grandin
Change-Id: I2995dfe5fb39ae2e7f3c37992cb3e2147381784e Reviewed-on: https://gerrit.libreoffice.org/57753 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-19loplugin:useuniqueptr in SwUndoTableMergeNoel Grandin
Change-Id: I0c528c2b12d219f37a2c2fdf2211fce3c51ad9e4 Reviewed-on: https://gerrit.libreoffice.org/57688 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-17loplugin:useuniqueptr in ScTabViewNoel Grandin
Change-Id: Ic506f5d350abbbbb5912e3ebf753e02821c76841 Reviewed-on: https://gerrit.libreoffice.org/57523 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-17loplugin:useuniqueptr in SwHTMLWriterNoel Grandin
Change-Id: I4802e6502addce96bff4831598e852e4fe673af4 Reviewed-on: https://gerrit.libreoffice.org/57521 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-16loplugin:useuniqueptr in UndoTransliterate_DataNoel Grandin
Change-Id: I1c6e865a6f59ce7f31c42d28b2b463a577b3cc28 Reviewed-on: https://gerrit.libreoffice.org/57421 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-13loplugin:useuniqueptr in SbUnoStructRefObjectNoel Grandin
now that we have upgraded to VS2017, we can use std::unique_ptr in std::map Change-Id: Id01af07ccae7447405b8f0bc44b08043f453e54b Reviewed-on: https://gerrit.libreoffice.org/57384 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-13loplugin:useuniqueptr in SwGrammarContactNoel Grandin
Change-Id: I1e6a2ca8f00d6130cfa6d2c18139bf61ada10630 Reviewed-on: https://gerrit.libreoffice.org/57363 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-06compilerplugins: try to make these work with icecreamMichael Stahl
There are some problems here, this should fix one of them: the getFilename function returns "<stdin>" for spelling locations, because the input to clang is sort of preprocessed via -frewrite-includes if icecream is used and the file is built on a remote host (whereas it's apparently not preprocessed if the file is compiled locally by icecream). Using getPresumedLoc() uses the #line directives in the preprocessed input, which avoids the problem but is more expensive, so try to use it only when necessary. The getFileEntry(getMainFileID())->getName() pattern will also result in "<stdin>", but fortunately icecream passes -main-file-name, which oddly enough isn't used by the SourceManager's spelling locations, but is available separately via CodeGenOptions. This builds everything successfully with clang version 6.0.0: ICECC_PREFERRED_HOST=myremote make check gb_SUPPRESS_TESTS=t Change-Id: Ic121511683e5302d7b9d85186c8b9c4a5443fa1b Reviewed-on: https://gerrit.libreoffice.org/54993 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-07-04loplugin:useuniqueptr in ScSimpleEditSourceHelperNoel Grandin
Change-Id: Iebe62753d9e6f83f985e4c55fb938d5861613898 Reviewed-on: https://gerrit.libreoffice.org/56903 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-29loplugin:useuniqueptr in SwTextAPIObjectNoel Grandin
Change-Id: Ied235aefe2cc2ce5e88487503c17e1a54d25ac52 Reviewed-on: https://gerrit.libreoffice.org/56624 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-27loplugin:useuniqueptr in SwDocNoel Grandin
Change-Id: Ic895c7b79a25a0766cc6d352c5ed75873004fddb Reviewed-on: https://gerrit.libreoffice.org/56496 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-22teach useuniqueptr loplugin about calling delete on a paramNoel Grandin
which is often a useful indicator that the callers can be made to use std::unique_ptr Change-Id: Idb1745d1f58dbcf389c9f60f1a5728d7d092ade5 Reviewed-on: https://gerrit.libreoffice.org/56238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-28loplugin:useuniqueptr in ODbTypeWizDialogNoel Grandin
Change-Id: I4c364ddbad4881cc8a70a1827d7c51e7cc9313f1 Reviewed-on: https://gerrit.libreoffice.org/54850 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-28loplugin:useuniqueptr in GridWindowNoel Grandin
Change-Id: I9fd6d8ac159994c894739afbb3dccb72576dccfb Reviewed-on: https://gerrit.libreoffice.org/54844 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-23Fix typosAndrea Gelmini
Change-Id: Ibe94c7379a9389a0506c33666bf2bfb033f96f08 Reviewed-on: https://gerrit.libreoffice.org/54670 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-05-18loplugin:useuniqueptr in SvxAutoCorrectLanguageListsNoel Grandin
Change-Id: Ie433a336f9cd5133aefbe4ef88d214b5f5c63a0a Reviewed-on: https://gerrit.libreoffice.org/54182 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-16loplugin:useuniqueptr in SvxOutlinerForwarderNoel Grandin
Change-Id: Ie861132b43b0a01ee8b4f3bc201bbf12f8af9f36 Reviewed-on: https://gerrit.libreoffice.org/54181 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-14loplugin:useuniqueptr in SfxTabDialogNoel Grandin
Change-Id: I460bf5aac44e6fd08a5bd5ab8af217dedbcc3cf8 Reviewed-on: https://gerrit.libreoffice.org/54174 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-03make useuniqueptr loplugin check child compound statementsNoel Grandin
where the child compound statement is unconditional Change-Id: I755e7ee9134bde81811a694d42a996d3eaae3fc2 Reviewed-on: https://gerrit.libreoffice.org/53763 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-29loplugin:useuniqueptr look for DELETEZ expressionsNoel Grandin
can't believe I've been missing these Change-Id: If39827e1583cbcedfd5061a5059d6df53be0f9c8 Reviewed-on: https://gerrit.libreoffice.org/53598 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-23loplugin:useuniqueptr in Inflater,DeflaterNoel Grandin
Change-Id: I55833664a6e76d781908b8f1f721dd9a4946e35f Reviewed-on: https://gerrit.libreoffice.org/53224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-16loplugin:useuniqueptr in OStorePageBIOSNoel Grandin
update the plugin to check all methods for deleting fields. Also remove the dead checks for new failing here, can never have worked, because it is not calling the std::nothrow variant. Change-Id: I139410e42f83ae2db0cd38ceee81c8b4c310268c Reviewed-on: https://gerrit.libreoffice.org/52881 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-06loplugin:useuniqueptr in ScXMLTableRowCellContextNoel Grandin
Change-Id: Ie2c50b08eed674c129f0f66eae502c61e565a7f8 Reviewed-on: https://gerrit.libreoffice.org/52495 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-27Let prefix arguments to hasPathnamePrefix end in slashStephan Bergmann
...for better precision Change-Id: I5f273b7c66ba931647805c415622b5ac767ff987
2018-03-27Use isSamePathname instead of hasPathnamePrefix, where appropriateStephan Bergmann
Change-Id: I75f32fc66877c0fb1e71be3b5e8b6d6c1b9c4d36
2018-02-05loplugin:useuniqueptr in ImpEditEngineNoel Grandin
Change-Id: I5afc846c803f5191bb5e04590923059e88434b76 Reviewed-on: https://gerrit.libreoffice.org/49176 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-02loplugin:useuniqueptr in i18npoolNoel Grandin
Change-Id: Iff39b9298bfad474c5c011b6355b8ebf5be06318 Reviewed-on: https://gerrit.libreoffice.org/49091 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-02teach useuniqueptr loplugin about while loopsNoel Grandin
and reduce code duplication Change-Id: I292d7515b15fce4cf1714c3b11b947493706bc3c Reviewed-on: https://gerrit.libreoffice.org/49090 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-29loplugin:useuniqueptr in ModelData_ImplNoel Grandin
Change-Id: I66866ed1698fafe59ba31f99df09fb792da410e3 Reviewed-on: https://gerrit.libreoffice.org/48702 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-17loplugin:useuniqueptr in PPDParserNoel Grandin
Change-Id: Iafd63c276d430ea2a08286921f593bc56587e71c
2018-01-17loplugin:useuniqueptr expand search for ranged-loop-deleteNoel Grandin
Change-Id: I78955f4db9b4da2858dfb25e69a5502eb0280418
2018-01-15loplugin:useuniqueptr in CursorNoel Grandin
Change-Id: I5de300709409311b7a1d451ee1d314596cf2e879 Reviewed-on: https://gerrit.libreoffice.org/47836 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-12teach useuniqueptr loplugin about "if(field != null) delete field"Noel Grandin
Change-Id: I938deef90c8d6ceb0e72ab3f6ee2cbddc6f72b8d Reviewed-on: https://gerrit.libreoffice.org/47730 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-11loplugin:useuniqueptr in tools,stoc,unotoolsNoel Grandin
Change-Id: Ia72b65577143623cedc7a40bc34f7fb897add097 Reviewed-on: https://gerrit.libreoffice.org/47726 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-11loplugin:useuniqueptr in l10ntoolsNoel Grandin
update plugin to find all places where we are unconditionally deleting stuff in a destructor Change-Id: Ia0fedc2420c7717ed2bdd8d3bb00262d2a63e0bc Reviewed-on: https://gerrit.libreoffice.org/47724 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-20re-enable loplugin:useuniqueptrNoel Grandin
Change-Id: Ic1a7e5bd3a8002ac996a6af1d1d9a439d4153b0b Reviewed-on: https://gerrit.libreoffice.org/44864 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-07Clean away temporarily added using declarationsStephan Bergmann
Change-Id: I26734c13515394162d88351a1cbe2b20abdac865
2017-09-11More clang::*Type vs. llvm::*Type ambiguitiesStephan Bergmann
Change-Id: I21133976793ab018c633dda077029666308526db