Commit Graph

30 Commits

Author SHA1 Message Date
Serge Guelton 3331b6eab3 [tools] Fix python DeprecationWarning: invalid escape sequence
The python documentation says "it’s highly recommended that you use raw strings for all but the simplest expressions." (https://docs.python.org/3/library/re.html)

So do that with the attached patch generated by

    sed -i -e "s/re.search('/re.search(r'/g" $(git grep -l 're.search(')

The warning can be seen in e.g. python3.7:

    $ python3.7 -Wd
    >>> import re; re.search('\s', '')
    <stdin>:1: DeprecationWarning: invalid escape sequence \s

Commited on behalf of Marco Falke.
Differential Revision: https://reviews.llvm.org/D57528

llvm-svn: 353707
2019-02-11 15:03:17 +00:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Rafael Stahl 8c48705a19 [analyzer][CrossTU][NFC] Generalize to external definitions instead of external functions
Summary: This is just changing naming and documentation to be general about external definitions that can be imported for cross translation unit analysis. There is at least a plan to add VarDecls: D46421

Reviewers: NoQ, xazax.hun, martong, a.sidorin, george.karpenkov, serge-sans-paille

Reviewed By: xazax.hun, martong

Subscribers: mgorny, whisperity, baloghadamsoftware, szepet, rnkovacs, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits

Differential Revision: https://reviews.llvm.org/D56441

llvm-svn: 350852
2019-01-10 17:44:04 +00:00
Serge Guelton b748c0e696 Portable Python script across Python version
Make scripts more future-proof by importing most __future__ stuff.

Differential Revision: https://reviews.llvm.org/D55208

llvm-svn: 349504
2018-12-18 16:07:37 +00:00
Serge Guelton c0ebe773cd Portable Python script across Python version
Using from __future__ import print_function it is possible to have a compatible behavior of `print(...)` across Python version.

Differential Revision: https://reviews.llvm.org/D55213

llvm-svn: 349454
2018-12-18 08:36:33 +00:00
George Karpenkov 95363e378a [analyzer] Remove traces of ubigraph visualization
Ubigraph project has been dead since about 2008, and to the best of my
knowledge, no one was using it.
Previously, I wasn't able to launch the existing binary at all.

Differential Revision: https://reviews.llvm.org/D51655

llvm-svn: 341601
2018-09-06 23:07:47 +00:00
Alexander Kornienko 2a8c18d991 Fix typos in clang
Found via codespell -q 3 -I ../clang-whitelist.txt
Where whitelist consists of:

  archtype
  cas
  classs
  checkk
  compres
  definit
  frome
  iff
  inteval
  ith
  lod
  methode
  nd
  optin
  ot
  pres
  statics
  te
  thru

Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few
files that have dubious fixes reverted.)

Differential revision: https://reviews.llvm.org/D44188

llvm-svn: 329399
2018-04-06 15:14:32 +00:00
Ilya Biryukov 8b9b3bd07c Resubmit [analyzer] Support for naive cross translation unit analysis
Originally submitted as r326323 and r326324.
Reverted in r326432.

Reverting the commit was a mistake.
The breakage was due to invalid build files in our internal buildsystem,
CMakeLists did not have any cyclic dependencies.

llvm-svn: 326439
2018-03-01 14:54:16 +00:00
Ilya Biryukov d49e75afbd Revert "[analyzer] Support for naive cross translation unit analysis"
Also revert "[analyzer] Fix a compiler warning"
This reverts commits r326323 and r326324.

Reason: the commits introduced a cyclic dependency in the build graph.
This happens to work with cmake, but breaks out internal integrate.

llvm-svn: 326432
2018-03-01 12:43:39 +00:00
Gabor Horvath eb0584bee4 [analyzer] Support for naive cross translation unit analysis
The aim of this patch is to be minimal to enable incremental development of
the feature on the top of the tree. This patch should be an NFC when the
feature is turned off. It is turned off by default and still considered as
experimental.

Technical details are available in the EuroLLVM Talk: 
http://llvm.org/devmtg/2017-03//2017/02/20/accepted-sessions.html#7

Note that the initial prototype was done by A. Sidorin et al.: http://lists.llvm.org/pipermail/cfe-dev/2015-October/045730.html

Contributions to the measurements and the new version of the code: Peter Szecsi, Zoltan Gera, Daniel Krupp, Kareem Khazem.

Differential Revision: https://reviews.llvm.org/D30691

llvm-svn: 326323
2018-02-28 13:23:10 +00:00
Malcolm Parsons 51d3fb045e Fix typos of occurred and occurrence
llvm-svn: 323316
2018-01-24 10:26:09 +00:00
Petr Hosek 5518d189ee [scan-build-py] Patch to fix "-analyzer-config" option
I noticed that when I use "-analyze-config" option in scan-build-py, it
behaves differently from original perl based scan-build.

For example, command:

$ scan-build -analyzer-config ipa=basic-inlining make

Will work without any issues on perl version of scan-build. But on
scan-build-py it will throw an error message "error reading
'ipa=basic-inlining'".

After debugging, it turns out that the scan-build-py does not put
"-analyzer-config" flag in front of the analyzer config flags (in this
case is the "ipa=basic-inlining") in the final clang command line. This
patch fixes this issue.

Patch by Haowei Wu

Differential Revision: https://reviews.llvm.org/D34489

llvm-svn: 308401
2017-07-19 00:29:41 +00:00
Laszlo Nagy 6d9a7e8aaf [scan-build-py] merge runner module to analyzer
Differential Revision: https://reviews.llvm.org/D31237

llvm-svn: 299759
2017-04-07 11:04:49 +00:00
Laszlo Nagy 57db7c6860 [scan-build-py] reuse command line output parameter for report directory
Differential Revision: https://reviews.llvm.org/D30861

llvm-svn: 298355
2017-03-21 10:15:18 +00:00
Laszlo Nagy 0d9be63001 [scan-build-py] use python tempfile for tempdir
Differential Revision: https://reviews.llvm.org/D30862

llvm-svn: 298238
2017-03-20 09:03:24 +00:00
Laszlo Nagy 908ed4c90a [scan-build-py] move argument parsing into separate module
Forgot to add the new module.

llvm-svn: 297308
2017-03-08 21:22:32 +00:00
Laszlo Nagy 5270bb978f [scan-build-py] move argument parsing into separate module
Differential Revision: https://reviews.llvm.org/D30601

llvm-svn: 297307
2017-03-08 21:18:51 +00:00
Laszlo Nagy ed739d902d [scan-build-py] fix some line separator issues
Differential Revision: https://reviews.llvm.org/D30600

llvm-svn: 297266
2017-03-08 09:27:53 +00:00
Laszlo Nagy 2e9c9220b6 [scan-build-py] create decorator for compiler wrapper methods
Differential Revision: https://reviews.llvm.org/D29260

llvm-svn: 296937
2017-03-04 01:08:05 +00:00
Laszlo Nagy 258ff25bbc [scan-build-py] move function report_directory from report module to analyze module
Differential Revision: https://reviews.llvm.org/D29255

llvm-svn: 295045
2017-02-14 10:43:38 +00:00
Laszlo Nagy 52c1d7eb11 [scan-build-py] use subprocess wrapper to execute build
llvm-svn: 295043
2017-02-14 10:30:50 +00:00
Laszlo Nagy 3a556111b9 [scan-build-py] remove not used flag
llvm-svn: 293418
2017-01-29 04:59:32 +00:00
Laszlo Nagy 46fc18a9a9 [scan-build-py] use subprocess wrapper
llvm-svn: 293396
2017-01-28 22:48:26 +00:00
Laszlo Nagy 4f6a175f10 [analyzer][scan-build-py] subprocess output handling reviewed in clang module
llvm-svn: 282317
2016-09-24 00:20:59 +00:00
Devin Coughlin aed7b8ae86 [analyzer] scan-build-py: Remove relative path hack for SATestsBuild.py
Remove the relative path hack in scan-build-py that converts a fully qualified
directory name and a fully qualified file path to a relative path before running
the analyzer on a file.

This hack is not needed: the bad interaction with SATestsBuild.py it was
intended to address is actually the same underlying problem that r280768 fixed.
Further, because the hack would always relativize paths, it caused
SATestBuild.py to be unable to properly line up issues when the build system
changed directory and then built a source file in a child directory but used a
fully-qualified path for the source file.

Differential Revision: https://reviews.llvm.org/D24470

llvm-svn: 281516
2016-09-14 18:14:11 +00:00
Devin Coughlin 80e74cdc68 [scan-build-py] Increase precision of timestamp in report directory name
This commit improves compatibility with the perl version of scan-build.

The perl version of scan-build produces output report directories with
increasing lexicographic ordering. This ordering is relied on by the CmpRuns.py
tool in utils/analyzer when comparing results for build commands with multiple
steps. That tool tries to line up the output directory for each step between
different runs of the analyzer based on the increasing directory name.

The python version of scan-build uses file.mkdtemp() with a time stamp
prefix to create report directories. The timestamp has a 1-second precision.
This means that when analysis of a single build step takes less than a second
the ordering property that CmpRuns.py expects will sometimes not hold,
depending on the timing and the random suffix generated by mkdtemp(). Ultimately
this causes CmpRuns to incorrectly correlate results from build steps and report
spurious differences between runs.

This commit increases the precision of the timestamp used in scan-build-py to
the microsecond level. This approach still has the same underlying issue -- but
in practice analysis of any build step is unlikely to take less than a
millisecond.

Differential Revision: https://reviews.llvm.org/D24163

llvm-svn: 280768
2016-09-06 23:42:51 +00:00
Laszlo Nagy 8bd63e5518 D17487: [analyzer][scan-build-py] flag filter modification for compilation database creation
llvm-svn: 266726
2016-04-19 12:03:03 +00:00
Anton Yartsev 6e135f45a8 [analyzer][scan-build] Non-existing directory for scan-build output.
Makes scan-build successfully accept non-existing output directories provided via "-o" option. The directory is created in this case. This behavior is conforming to the old perl scan-build implementation.
(http://reviews.llvm.org/D17091)

llvm-svn: 261480
2016-02-21 17:04:26 +00:00
Yury Gribov a6560ebe4c [analyzer] Add --force-analyze-debug-code option to scan-build
to force debug build and hopefully enable more precise warnings.

Static Analyzer is much more efficient when built in debug mode
(-UNDEBUG) so we advice users to enable it manually. This may be
inconvenient in case of large complex projects (think about Linux
distros e.g. Android or Tizen). This patch adds a flag to scan-build
which inserts -UNDEBUG automatically.

Differential Revision: http://reviews.llvm.org/D16200

llvm-svn: 261204
2016-02-18 11:08:46 +00:00
Laszlo Nagy bc68758dd5 D9600: Add scan-build python implementation
llvm-svn: 257533
2016-01-12 22:38:41 +00:00