Commit Graph

344 Commits

Author SHA1 Message Date
Simon Giesecke
47a27132fa Bug 1614371 - Move mozilla-performance-temp-refptr check to alpha checker repo. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D65340

--HG--
rename : build/clang-plugin/TempRefPtrChecker.cpp => build/clang-plugin/alpha/TempRefPtrChecker.cpp
rename : build/clang-plugin/TempRefPtrChecker.h => build/clang-plugin/alpha/TempRefPtrChecker.h
rename : build/clang-plugin/tests/TestTempRefPtr.cpp => build/clang-plugin/alpha/tests/TestTempRefPtr.cpp
extra : moz-landing-system : lando
2020-03-19 14:19:15 +00:00
Andi-Bogdan Postelnicu
bc9dbe64a1 Bug 1619921 - enable clang-plugin with support for alpha checkers module. r=froydnj,sg
Differential Revision: https://phabricator.services.mozilla.com/D65314

--HG--
extra : moz-landing-system : lando
2020-03-17 07:01:09 +00:00
Andreea Pavel
a6b6afe578 Backed out changeset 780399392e20 (bug 1619921) for breaking toolchains on a CLOSED TREE 2020-03-16 18:27:17 +02:00
Andi-Bogdan Postelnicu
1ee04a1f77 Bug 1619921 - enable clang-plugin with support for alpha checkers module. r=froydnj,sg
Differential Revision: https://phabricator.services.mozilla.com/D65314

--HG--
extra : moz-landing-system : lando
2020-03-16 16:04:00 +00:00
Boris Zbarsky
c6c4a83796 Bug 1535530. Fix can-run-script analysis to not mishandle on-stack refs to RefPtrs. r=andi,masayuki
The key here is to test the type of the variable declaration for being a
smartptr type, instead of testing the type of the variable _use_.

Differential Revision: https://phabricator.services.mozilla.com/D65581

--HG--
extra : moz-landing-system : lando
2020-03-06 09:57:45 +00:00
june wilde
98d786b85d Bug 1617991 - Add folder structure to import external static checks; r=andi,static-analysis-reviewers,dmajor
Differential Revision: https://phabricator.services.mozilla.com/D64193

--HG--
extra : moz-landing-system : lando
2020-03-05 16:29:13 +00:00
Kershaw Chang
238044b4a9 Bug 1615335 - Add TRR Background to ThreadAllows.txt r=valentin,andi
Differential Revision: https://phabricator.services.mozilla.com/D64950

--HG--
extra : moz-landing-system : lando
2020-03-04 09:20:52 +00:00
Csoregi Natalia
f84d116559 Backed out 2 changesets (bug 1615335) for causing crashes (Bug 1619822). a=backout
Backed out changeset 521b0f9e84a3 (bug 1615335)
Backed out changeset a1dc4f624f16 (bug 1615335)
2020-03-04 09:20:18 +02:00
Sebastian Streich
882cb13c7b Bug 1611160 - Add Clang Plugin for nsIPrincipal r=ckerschb,andi
Differential Revision: https://phabricator.services.mozilla.com/D63082

--HG--
extra : moz-landing-system : lando
2020-03-03 14:30:36 +00:00
Kershaw Chang
fb1afad459 Bug 1615335 - Add TRR Background to ThreadAllows.txt r=valentin,andi
Differential Revision: https://phabricator.services.mozilla.com/D64950

--HG--
extra : moz-landing-system : lando
2020-03-03 13:16:21 +00:00
Rob Lemley
1c3caf3c4d Bug 1618935 - Add named threads used by Thunderbird to ThreadAllows.txt. r=KrisWright
This is to fix build bustage until Thunderbird engineers are able to migrate
these threads to use background tasks.

Differential Revision: https://phabricator.services.mozilla.com/D64795

--HG--
extra : moz-landing-system : lando
2020-02-28 18:23:15 +00:00
Mike Hommey
12dc985462 Bug 1618720 - Generate the ThreadAllow list deterministically. r=erahm,dmajor
Differential Revision: https://phabricator.services.mozilla.com/D64690

--HG--
extra : moz-landing-system : lando
2020-02-28 00:41:47 +00:00
kriswright
a9947c9768 Bug 1613440 - Add new clang plugin to deprecate NS_NewNamedThread r=andi
Creates a NoNewThreadsChecker plugin that looks for the function and checks to see if it's allowed.
-Creates two allowlists - `ThreadAllows.txt` is for thread names, while `ThreadFileAllows.txt` checks for entire files where instances of `NS_NewNamedThread` should be ignored.
-If an instance of `NS_NewNamedThread` is not listed in either list, then the checker throws an error with an additional note containing a more descriptive explanation of the failure.

Differential Revision: https://phabricator.services.mozilla.com/D62635

--HG--
extra : moz-landing-system : lando
2020-02-27 12:53:54 +00:00
Mike Hommey
06b9bd7de1 Bug 1617794 - Fix cross-building the clang-plugin for Windows targets. r=dmajor
Differential Revision: https://phabricator.services.mozilla.com/D64296

--HG--
extra : moz-landing-system : lando
2020-02-27 04:42:27 +00:00
Dorel Luca
da8c50fbdd Backed out changeset 459a77fff516 (bug 1613440) for Clang bustage on tools/extra/clang-tidy/mozilla/Utils.h. CLOSED TREE 2020-02-24 21:56:51 +02:00
kriswright
acd0e7d09c Bug 1613440 - Add new clang plugin to deprecate NS_NewNamedThread r=andi
Creates a NoNewThreadsChecker plugin that looks for the function and checks to see if it's allowed.
-Creates two allowlists - `ThreadAllows.txt` is for thread names, while `ThreadFileAllows.txt` checks for entire files where instances of `NS_NewNamedThread` should be ignored.
-If an instance of `NS_NewNamedThread` is not listed in either list, then the checker throws an error with an additional note containing a more descriptive explanation of the failure.

Differential Revision: https://phabricator.services.mozilla.com/D62635

--HG--
extra : moz-landing-system : lando
2020-02-22 00:35:40 +00:00
Mike Hommey
1b3a3daa80 Bug 1617131 - Sort the list of third party paths. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D63631

--HG--
extra : moz-landing-system : lando
2020-02-21 11:04:12 +00:00
Mike Shal
c8abdd68c2 Bug 1616630 - Use py3_action for GENERATED_FILES that already support it; r=firefox-build-system-reviewers,kvark,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D63438

--HG--
extra : moz-landing-system : lando
2020-02-21 00:05:17 +00:00
Csoregi Natalia
6360b24e80 Backed out 2 changesets (bug 1616630) for Android bustage. CLOSED TREE
Backed out changeset 15016546c954 (bug 1616630)
Backed out changeset dcb7dc51633b (bug 1616630)
2020-02-20 21:24:11 +02:00
Mike Shal
39492660f4 Bug 1616630 - Use py3_action for GENERATED_FILES that already support it; r=firefox-build-system-reviewers,kvark,rstewart
Depends on D63437

Differential Revision: https://phabricator.services.mozilla.com/D63438

--HG--
extra : moz-landing-system : lando
2020-02-20 16:21:55 +00:00
Mike Shal
d8e4653d19 Bug 1611326 - Default to py3_action, and add a py2 attribute to GENERATED_FILES; r=firefox-build-system-reviewers,rstewart
GENERATED_FILES now defaults to python3 unless py2=True is specified as
an argument. All existing GENERATED_FILES scripts and GeneratedFile
templates have the py2=True attribute added, so this patch should
effectively be a no-op.

Going forward, individual scripts can be converted to python3 and their
corresponding py2=True attribute can be deleted. In effect, this patch
will be backed out in pieces until all scripts run in python3, at which
point the py2 attribute itself can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D60919

--HG--
extra : moz-landing-system : lando
2020-02-14 13:22:46 +00:00
Andi-Bogdan Postelnicu
e67b41e3c7 Bug 1615826 - Reformat clang-plugin to LLVM standard. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63000

--HG--
extra : moz-landing-system : lando
2020-02-17 18:30:50 +00:00
Andreea Pavel
ff331ccbb6 Backed out changeset 517de066cc6f (bug 1615826) for linting failures at CustomAttributes.cpp on a CLOSED TREE 2020-02-17 20:16:08 +02:00
Andi-Bogdan Postelnicu
ac2806eae5 Bug 1615826 - Reformat clang-plugin to LLVM standard. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63000

--HG--
extra : moz-landing-system : lando
2020-02-17 17:23:16 +00:00
Andi-Bogdan Postelnicu
47700a0dea Bug 1615245 - checker fopen-usage should ignore some gtest include files. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D62997

--HG--
extra : moz-landing-system : lando
2020-02-15 17:56:39 +00:00
Razvan Maries
90c44816ea Backed out changeset e56af64a3199 (bug 1615245) for build bustages on CustomMatchers.h. 2020-02-15 19:48:06 +02:00
Andi-Bogdan Postelnicu
cadd1bc08a Bug 1615245 - checker fopen-usage should ignore some gtest include files. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D62997

--HG--
extra : moz-landing-system : lando
2020-02-15 17:36:32 +00:00
Cosmin Sabou
ff39f9206d Backed out 2 changesets (bug 1613263, bug 1611326) for presummably causing l10n langpack bustages. a=backout
Backed out changeset 77e54e76848a (bug 1611326)
Backed out changeset 36ba18ac3a68 (bug 1613263)
2020-02-14 15:02:21 +02:00
Mike Shal
ad0c283ab2 Bug 1611326 - Default to py3_action, and add a py2 attribute to GENERATED_FILES; r=firefox-build-system-reviewers,rstewart
GENERATED_FILES now defaults to python3 unless py2=True is specified as
an argument. All existing GENERATED_FILES scripts and GeneratedFile
templates have the py2=True attribute added, so this patch should
effectively be a no-op.

Going forward, individual scripts can be converted to python3 and their
corresponding py2=True attribute can be deleted. In effect, this patch
will be backed out in pieces until all scripts run in python3, at which
point the py2 attribute itself can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D60919

--HG--
extra : moz-landing-system : lando
2020-02-13 23:07:04 +00:00
Brindusan Cristian
e2fb6b8344 Backed out changeset 7fefed11f117 (bug 1611326) for build bustages at update-1.xpi.stub. CLOSED TREE 2020-02-13 23:33:34 +02:00
Mike Shal
e6464dd404 Bug 1611326 - Default to py3_action, and add a py2 attribute to GENERATED_FILES; r=firefox-build-system-reviewers,rstewart
GENERATED_FILES now defaults to python3 unless py2=True is specified as
an argument. All existing GENERATED_FILES scripts and GeneratedFile
templates have the py2=True attribute added, so this patch should
effectively be a no-op.

Going forward, individual scripts can be converted to python3 and their
corresponding py2=True attribute can be deleted. In effect, this patch
will be backed out in pieces until all scripts run in python3, at which
point the py2 attribute itself can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D60919

--HG--
extra : moz-landing-system : lando
2020-02-13 20:31:50 +00:00
Masatoshi Kimura
a5f89bc5bf Bug 1614840 - Fix fopen-usage checker so that it does not match wchar_t. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D62582

--HG--
extra : moz-landing-system : lando
2020-02-12 14:26:44 +00:00
Emilio Cobos Álvarez
42f94345f2 Bug 1613176 - Introduce NonTrivialTypeInFfiChecker. r=andi
This ensures that we don't pass non-trivially-copiable types through the FFI
boundary.

Differential Revision: https://phabricator.services.mozilla.com/D61626

--HG--
extra : moz-landing-system : lando
2020-02-11 13:11:29 +00:00
Andi-Bogdan Postelnicu
27d6c7c59b Bug 1391711 - Implement a static analysis checker to detect usages of fopen/ open like functions on win32 platform. r=sg
This is a re-work of `https://mzl.la/31Bkl47`, and because time passed and not all of the
issues reported by this checker were fixed and we want to land it, we've decided to move
from errors diagnostic messages to warnings.

Differential Revision: https://phabricator.services.mozilla.com/D61753

--HG--
extra : moz-landing-system : lando
2020-02-10 14:41:26 +00:00
Andi-Bogdan Postelnicu
eb2b106a8c Bug 1580260 - rework the logic for MustReturnFromCaller checker. r=froydnj
Starting with `Clang-10`, and in particular with `https://reviews.llvm.org/D66404`,
the `CFG` has been reflown in order to reduce discrepancies in destructor calls with
the actual codegen. This has also impacted the order of `CFGStmt` for `ReturnStmt`,
whereas now the AST children of the `ReturnStmt` have precedence other their parent
node.
The purpose of this patch is to fix this and add new supported cases for the `Expr`
that is generated from `ReturnStmt`.

Differential Revision: https://phabricator.services.mozilla.com/D61556

--HG--
extra : moz-landing-system : lando
2020-02-05 08:34:36 +00:00
Aaron Klotz
2977b8a690 Bug 1610678: Add check to clang plugin to raise error when using namespace mozilla::java is present in C++ source; r=andi
Differential Revision: https://phabricator.services.mozilla.com/D60611

--HG--
extra : moz-landing-system : lando
2020-01-22 18:47:04 +00:00
Simon Giesecke
b7487e7d51 Bug 1609638 - Add analysis identifying dereferences of temporary RefPtr objects. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D60167

--HG--
extra : moz-landing-system : lando
2020-01-20 14:11:21 +00:00
shravanrn@gmail.com
c9ff62b7ef Bug 1566288 - Port libGraphite usage in libThebes to use the RLBox API. r=froydnj,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D39593

--HG--
extra : moz-landing-system : lando
2019-12-19 16:05:35 +00:00
Brindusan Cristian
858cf4323e Backed out 2 changesets (bug 1569369, bug 1566288) for build bustages at rlbox_sandbox.hpp. CLOSED TREE
Backed out changeset 75d775daa792 (bug 1569369)
Backed out changeset 0bc20fd26ca0 (bug 1566288)
2019-12-18 13:53:56 +02:00
shravanrn@gmail.com
0eecffaee5 Bug 1566288 - Port libGraphite usage in libThebes to use the RLBox API. r=froydnj,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D39593

--HG--
extra : moz-landing-system : lando
2019-12-17 00:26:50 +00:00
Cosmin Sabou
1b479d118b Backed out changeset f5d00d265686 (bug 1566288) for causing build bustages.
--HG--
extra : amend_source : 4151f2dfb2775bbf1fa3255d47849a818eed5b6c
2019-12-12 20:57:57 +02:00
shravanrn@gmail.com
c32b58ae0e Bug 1566288 - Port libGraphite usage in libThebes to use the RLBox API. r=froydnj,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D39593

--HG--
extra : moz-landing-system : lando
2019-12-12 02:48:11 +00:00
Andi-Bogdan Postelnicu
e8a21331ce Bug 1598069 - make compliant with future clang 10 our clang based static analysis. r=froydnj
With clang 10 and up `getTemporary` has been replaced with the more versatile `getSubExpr`.
The commit that added this behaviour is: b0561b3346

Differential Revision: https://phabricator.services.mozilla.com/D54101

--HG--
extra : moz-landing-system : lando
2019-11-21 14:07:44 +00:00
Andi-Bogdan Postelnicu
5392090016 Bug 1589096 - add registerPPCallbacks to our version of clang-tidy due to a limitation in mozilla-must-override. r=sylvestre
In the future we should re-write this checker but for now this solution is acceptable.

Differential Revision: https://phabricator.services.mozilla.com/D51242

--HG--
extra : moz-landing-system : lando
2019-10-31 12:16:35 +00:00
Emilio Cobos Álvarez
25cb66e7e8 Bug 1332689 - Remove clang 3.9 compat code for the clang-plugin. r=andi
We require 4.0 to build since bug 1394825.

Differential Revision: https://phabricator.services.mozilla.com/D50647

--HG--
extra : moz-landing-system : lando
2019-10-28 06:55:00 +00:00
Emilio Cobos Álvarez
bd45fba301 Bug 1332689 - Remove clang 3.8 compat code. r=andi
This is just drive-by, but it confused me. We require at least clang 4 to build
nowadays.

Differential Revision: https://phabricator.services.mozilla.com/D50646

--HG--
extra : moz-landing-system : lando
2019-10-28 06:54:43 +00:00
Emilio Cobos Álvarez
ddabf6673b Bug 1591493 - Clang plugin should work with distributed builds. r=andi
sccache-dist / icecream preprocess the file and then send it to a builder.

That means that the file contains #line directives or equivalents in order for
diagnostics and such to work correctly.

Unfortunately our clang-plugin build fails catastrophically if you include a
third-party header, as it doesn't account for them.

Use SourceManager::getPresumedLoc to get filenames, as it accounts for them,
unlike just getFilename.

Differential Revision: https://phabricator.services.mozilla.com/D50633

--HG--
extra : moz-landing-system : lando
2019-10-28 06:54:25 +00:00
Ricky Stewart
c010710916 Bug 1586358 - Replace existing instances of GENERATED_FILES with references to the GeneratedFile template r=firefox-build-system-reviewers,mshal
(Same content as bad revision https://phabricator.services.mozilla.com/D48230, but with a very small change to config/external/icu/data/moz.build to fix the build breakage.)

Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=833f6a69fcac689488a640b43e8e0bdaa086a56c

Differential Revision: https://phabricator.services.mozilla.com/D48409

--HG--
extra : moz-landing-system : lando
2019-10-07 21:15:19 +00:00
Daniel Varga
052ef806b5 Backed out changeset 8d95f2c8867b (bug 1586358) for build bustage with FATAL ERROR PROCESSING MOZBUILD FILE. On a CLOSED TREE
--HG--
extra : rebase_source : 325fbad2455afc7f693087e75fa57dba79f4d86b
2019-10-07 20:22:08 +03:00
Ricky Stewart
940d91af38 Bug 1586358 - Replace existing instances of GENERATED_FILES with references to the GeneratedFile template r=nalexander
This patch doesn't remove all references to GENERATED_FILES, but does remove most of them, leaving only those which can't be trivially translated to the new template.

Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e4a25230c3992b9c5519ceb351fb37f6b2bf605e

Differential Revision: https://phabricator.services.mozilla.com/D48230

--HG--
extra : moz-landing-system : lando
2019-10-07 15:31:05 +00:00