Commit Graph

208 Commits

Author SHA1 Message Date
Masatoshi Kimura
9e78698153 Bug 1090497 - Re-enable warnings as errors on clang-cl. r=froydnj 2018-07-31 22:10:07 +09:00
Kartikaya Gupta
d42c2e4a54 Bug 1478097 - Follow-up to address review comments. r=me 2018-07-28 04:20:14 -04:00
Kartikaya Gupta
62fbd124c4 Bug 1478097 - Update indexer to visit implicit code inside constructors. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D2461
2018-07-27 16:05:26 +00:00
Mike Hommey
8925ceae94 Bug 1469091 - Build the clang plugin as a host shared library. r=ted
This adds just enough host shared library support for this one use case,
but also takes shortcuts, because fully supporting host shared library
is a deep rabbit hole I'm not ready to take just to fix --enable-lto
--enable-clang-plugin on mac builds.

One downside is that one my machine the plugin now takes > 80s to build,
instead of 15s before, thanks to the lack of unified sources.
2018-07-05 14:58:09 +09:00
Mike Hommey
18389e5a93 Bug 1470055 - Lift libstdc++ requirement relaxation when building clang-plugin. r=froydnj 2018-06-21 11:45:30 +09:00
Mike Hommey
78063245ba Bug 1467658 - Upgrade the default clang toolchain to clang 6. r=chmanchester
The linux64-clang toolchain alias is currently clang 5. Switch it to
clang 6, but keep the spidermonkey tsan builds on clang 5 because of
bug 1467673.

The LLVM headers that come with clang 6 contain a DEBUG define that
conflicts with our DEBUG define and breaks the clang-plugin build,
so force unset ours.
2018-06-08 10:36:07 +09:00
Mike Hommey
65a20a4ec9 Bug 1467658 - Allow the mozsearch-plugin code to build against clang 6. r=kats
Also work around https://bugs.llvm.org/show_bug.cgi?id=37746 by
explicitly handling ObjC interface variables separately. This actually
allows the searchfox macosx build to go much further than it used to (it
now fails during make package with apparently no output for rust code)
2018-06-08 13:18:53 +09:00
Sylvestre Ledru
b2210f87b1 bug 1463425 - Fix flake8/pep8 issue by hand in build/ r=gps
MozReview-Commit-ID: AZdcEWyVV6e
2018-05-21 23:58:19 +02:00
Sylvestre Ledru
5c11f87d6e bug 1463425 - autopep8 on build/ r=gps
MozReview-Commit-ID: ETzx4HsjbEF
2018-05-21 23:56:34 +02:00
Andi-Bogdan Postelnicu
6ccaba3974 Bug 1440886 - Implement a static analysis checker to detect usage of PR_LoadLibrary and LoadLibraryA/LoadLibraryExA/LoadLibrary/LoadLibraryEx. r=Nika
MozReview-Commit-ID: CUjfeBeOdsk
2018-03-07 14:36:44 +02:00
Jeff Walden
cdec17f171 Bug 1452754 - Add tests to TestMustReturnFromCaller.cpp that verify that RAII destruction after a must-return-after expression is permitted. r=mystor 2018-04-09 12:56:37 -07:00
Kartikaya Gupta
076edc983f Bug 1449291 - Use the macro expansion location for all tokens. r=emilio
MozReview-Commit-ID: 8lbpGSt6z4p
2018-04-04 08:53:16 -04:00
Nathan Froyd
1c5d4264f1 Bug 1448028 - use third-party path list for implicit constructor checks; r=andi
The check for whether an implicit constructor is in a third-party
directory currently has a homegrown list of directories to ignore.
Let's move this over to the (more complete!) list of third-party
directories maintained elsewhere.
2018-03-27 10:51:31 -04:00
Chris Manchester
17dc4465f7 Bug 1429875 - Remove expandlibs and instead generate list files in the mozbuild backend. r=glandium
MozReview-Commit-ID: 5eLwnh1HHGj
2018-03-20 16:31:05 -07:00
Emilio Cobos Álvarez
5da4f2106a Bug 1444416: Make the diagnostic point to the bogus argument. r=mystor
It's much easier to find that way, specially for functions with tons of
argument.

MozReview-Commit-ID: i3PMjDOcH7
2018-03-09 19:37:58 +01:00
Emilio Cobos Álvarez
7168a941f9 Bug 1444416: Handle references in the "can run script" checker. r=mystor
MozReview-Commit-ID: 8F9HjiFqbGN
2018-03-09 17:51:59 +01:00
Andi-Bogdan Postelnicu
bbaa86b52b Bug 1443438 - Modify matcher isInSystemHeader to be polymorphic. r=mystor
MozReview-Commit-ID: sA4XmHMkaR
2018-03-06 11:59:05 +02:00
Kartikaya Gupta
b8e81b4e3d Bug 1438866 - Mark empty filenames not interesting. r=emilio
In some cases we have SourceLocation objections that are isMacroId()
rather than isFileId() and so don't have a filename at all. In other
cases the filename is something clang-internal like "<scratch>". In
both of these situations we don't want to output any analysis data.
However, the code previously was taking the empty filename and resolving
it relative to the source folder, and then tried to write to the
source folder or create a file corresponding to a subfolder. This
resulted in general badness. This patch makes sure we ignore analysis
from places that don't have a corresponding file so that we don't
have this problem.

MozReview-Commit-ID: 7WluygY9Uy8
2018-02-18 22:18:57 -05:00
Kartikaya Gupta
95e9cab567 Bug 1438866 - Add some utility code to help with debugging. r=emilio
This adds an RAII class and macro that can be quickly added in functions
to log entry/exit from the function. This is useful to debugging.

MozReview-Commit-ID: 4Ud8jLOxI0R
2018-02-16 17:07:39 -05:00
Kartikaya Gupta
b059076342 Bug 1438866 - Use proper path separators for windows. r=emilio
The indexer has paths handed to it on Windows with the backslash path separator.
However it currently hard-codes the forward-slash Unix/macOS path separator,
so we need to generify that code appropriately.

MozReview-Commit-ID: Iy8bImt2BXW
2018-02-16 17:07:39 -05:00
Chris Peterson
767d8b1589 Bug 1436263 - Part 3: Remove virtual from final virtual function declarations. r=froydnj
MozReview-Commit-ID: 8pjYjEvQF42
2018-02-08 21:22:43 -08:00
Chris Peterson
6758bf6a84 Bug 1436263 - Part 1: Replace final override virtual function specifiers with just final. r=froydnj
MozReview-Commit-ID: DE5HkIhsZ6D
2018-02-05 22:46:57 -08:00
Kartikaya Gupta
cb4b0629fa Bug 1435345 - Part 1: Index use sites of overloaded C++ operators. r=emilio
MozReview-Commit-ID: 1nTIGliiQIz
2018-02-02 22:39:39 -05:00
Kartikaya Gupta
c593063066 Bug 1435345 - Part 0: sync change from searchfox repo. r=emilio
This change was made in the mozsearch/mozsearch repo at some point and wasn't
synced to m-c.

MozReview-Commit-ID: HnW80AIrGt7
2018-02-02 22:39:24 -05:00
Eric Rahm
f3daa54ad3 Bug 1434689 - Part 1: Add moz_temporary_class annotation. r=mystor
This adds a `moz_temporary_class` annotation that can be used to indicate
a class is intended to only be used as a temporary.
2018-01-31 15:03:26 -08:00
Emilio Cobos Álvarez
0b5da8167a Bug 1434326: Cleanup DiagnosticsMatcher constructor. r=mystor
Removing a bit of the ugly :)

MozReview-Commit-ID: ATf2b2oh1F1
2018-01-30 17:40:00 +01:00
Emilio Cobos Álvarez
67cc771136 Bug 1434001: Handle lambdas in CanRunScriptChecker. r=mystor
Such a shame that the functionDecl() matcher doesn't handle them. I didn't find
a cleaner way to handle them, but I'm a 100% noob with AST matchers, so there
may be a more elegant way to do this.

MozReview-Commit-ID: 3HJQdFpN4hy
2018-01-29 22:08:15 +01:00
Kartikaya Gupta
a9a5a58513 Bug 1430645 - Fix win64 compilation of mozsearch-plugin. r=emilio
MozReview-Commit-ID: 6xrnnZeYmFy
2018-01-15 14:33:04 -05:00
Chris Peterson
677bf4030c Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe
2017-11-05 19:37:28 -08:00
Emilio Cobos Álvarez
fcffd9cfcd Bug 1428864: Fix indexer plugin build with clang >= 5. r=kats
MozReview-Commit-ID: J1DKFkyXu0v
2018-01-08 20:21:53 +01:00
Julian Hector
350f7e02de Bug 1398874 - Add static analysis to reject ParamTraits specializations for enum types. r=mystor 2017-12-05 10:26:41 -05:00
Kartikaya Gupta
1f8a8688c8 Bug 1421768 - Fix overeager clang-tidy behaviour causing silent breakage in searchfox. r=me
This is an import of the change from https://github.com/mozsearch/mozsearch/pull/66
plus a correction in the README file. The change was reviewed in github.

MozReview-Commit-ID: A7gINlBubZ4
2017-11-30 16:52:51 -05:00
Nika Layzell
d6761ba97f Bug 1418465 - Add an opt-out to the MOZ_CAN_RUN_SCRIPT analysis, r=andi
MozReview-Commit-ID: 2YKncUdrT5p
2017-11-24 11:15:17 -05:00
Kartikaya Gupta
2c633c7925 Bug 1282172 - Detect enum constants generated by macros when generating the Searchfox index. r=billm
MozReview-Commit-ID: 5RUsVSMTU8
2017-11-18 20:05:53 -05:00
Bill McCloskey
ea98174011 Bug 1418434 - Fix return value warning in clang plugin (r=mystor)
MozReview-Commit-ID: 3p7Vs4hZtoO
2017-11-18 15:41:06 -08:00
Bill McCloskey
b3010255f3 Bug 1413738 - Mozsearch clang plugin (r=mystor)
MozReview-Commit-ID: 53zUQ0vDMpd
2017-11-16 15:06:32 -08:00
André Bargull
29e33e9012 Bug 1405993 - Part 1: Don't report warnings for sprintf calls in ICU. r=mystor 2017-11-01 11:47:59 -07:00
Chris Manchester
a874fd552c Bug 1411712 - Move ldflags munging by the clang-plugin to moz.build r=mshal
MozReview-Commit-ID: JTZlXscUvlX
2017-11-02 11:47:48 -07:00
Chris Manchester
46745a19ab Bug 1403346 - Implement clang-plugin cxxflags in moz.build. r=glandium
MozReview-Commit-ID: 9zSryJcTRGl
2017-10-25 15:12:10 -07:00
Sylvestre Ledru
173e982fb0 Bug 1410472 - clang-plugin follows the LLVM coding style for real r=mystor
MozReview-Commit-ID: AXrQEjWzxvg
2017-10-20 19:11:50 +02:00
Chris Manchester
d68e6d052c Bug 1386876 - Replace all uses of NO_VISIBILITY_FLAGS with a template and remove NO_VISIBILITY_FLAGS. r=glandium
MozReview-Commit-ID: 194U1WMCAM0
2017-05-01 18:12:35 -07:00
Chris Manchester
67a3d90503 Bug 1386876 - Replace all uses of DISABLE_STL_WRAPPING with a template, remove DISABLE_STL_WRAPPING. r=glandium
MozReview-Commit-ID: FMEtb5PY7iP
2017-09-11 11:33:26 -07:00
Tristan Bourvon
40e28142fc Bug 1380423 - Add static-analysis to enforce strict rules on functions which can run scripts. r=mystor
MozReview-Commit-ID: GGSyq0z5msB
2017-08-08 19:48:53 +03:00
Tristan Bourvon
dfbd406f3d Bug 1390064 - Fix IgnoreTrivials in Utils.h by changing cast to cast_or_null r=mystor
MozReview-Commit-ID: E1uMaMRrCuO
2017-08-14 11:40:36 +02:00
Tristan Bourvon
864ebf8c36 Bug 1374024 - apply clang-format on some files from static analysis. r=mystor
MozReview-Commit-ID: COh2u6PIeY
2017-07-13 12:00:06 +02:00
Tristan Bourvon
29342c4869 Bug 1374024 - add checker to prevent dangling pointers returned by method calls on temporaries. r=mystor
MozReview-Commit-ID: 9khNt59ONF
2017-07-05 16:14:21 +02:00
Carsten "Tomcat" Book
a24ea340b2 Backed out changeset 1a0693cc418b (bug 1374024) for bustage 2017-07-13 15:14:51 +02:00
Carsten "Tomcat" Book
63a12c36c7 Backed out changeset b4a4d8144010 (bug 1374024) 2017-07-13 15:14:36 +02:00
Tristan Bourvon
973c68d068 Bug 1374024 - clang-format on some files from static analysis directory. r=mystor
MozReview-Commit-ID: COh2u6PIeY
2017-07-12 14:32:09 +02:00
Tristan Bourvon
6a4126ce92 Bug 1374024 - add checker to prevent dangling pointers returned by method calls on temporaries. r=mystor
MozReview-Commit-ID: 9khNt59ONFE
2017-07-05 16:14:21 +02:00