Граф коммитов

157 Коммитов

Автор SHA1 Сообщение Дата
Bill Wendling 9ed87fbdad Merging r215229:
------------------------------------------------------------------------
r215229 | sylvestre | 2014-08-08 10:15:13 -0700 (Fri, 08 Aug 2014) | 11 lines

Fix a bug when scan-build is used in a cross-compilation environment with
the --use-cc option.

Instead, we will search in the PATH
For example:
 scan-build --use-cc=arm-none-eabi-gcc -o out make -e

Initially reported as a Debian Bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748777


------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_35@215427 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12 05:38:53 +00:00
Sylvestre Ledru fc48dfdc97 Consistency on the tab/space
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213236 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17 08:40:35 +00:00
Sylvestre Ledru f29418df13 Fix Bug 14061 - scan-build crashes during postprocessing if BUGFILE no longer exists
Experienced with Thunderbird build

Patch by Matti Niemenmaa



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213235 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17 08:39:04 +00:00
Alp Toker c7645b9266 Fix typos
Also consolidate 'backward compatibility'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212974 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-14 19:42:55 +00:00
Sylvestre Ledru 0421d5e4cc actually, just check if it is a file (including directory or symlink)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211053 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-16 20:51:40 +00:00
Sylvestre Ledru 4a2040bc0e Check that the directory does not exist.
Otherwise, it could allows local users to obtain sensitive information or
overwrite arbitrary files via a symlink attack on temporary directories with
predictable names. 

Reported as CVE-2014-2893 ( https://security-tracker.debian.org/tracker/CVE-2014-2893 )
Found by Jakub Wilk



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211051 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-16 20:31:15 +00:00
Sylvestre Ledru e6f5c37aab List the function/method name in the index page of scan-build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210971 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-14 08:49:40 +00:00
Sylvestre Ledru b78303a715 With the option '-analyzer-config stable-report-filename=true',
instead of report-XXXXXX.html, scan-build/clang analyzer generate
report-<filename>-<function, method name>-<function position>-<id>.html.
(id = i++ for several issues found in the same function/method)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210970 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-14 08:45:32 +00:00
Sylvestre Ledru 5f630f2489 revert "r209526 List the function/method name in the index page of scan-build "
Depends on http://reviews.llvm.org/D3762



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209527 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-23 16:47:42 +00:00
Sylvestre Ledru 32f41f2308 List the function/method name in the index page of scan-build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209526 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-23 16:40:46 +00:00
Sylvestre Ledru 2ae856647b Replace system() by native perl calls
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209524 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-23 16:10:00 +00:00
Sylvestre Ledru bcfa4536b8 Improve a scan-build message
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208951 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 07:03:15 +00:00
Jordan Rose 2b84dd3d77 [scan-build] Pass --sysroot through for both compilation and linking.
PR19704

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208595 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-12 17:04:44 +00:00
Jordan Rose 31557758c6 scan-build: Don't use realpath when the user provides an explicit path.
PR19583

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207484 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-29 01:37:19 +00:00
Ted Kremenek f9d2832618 Handle possible trailing '/' in xcode-select output. Patch by Jeff Olson.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206752 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-21 14:13:22 +00:00
Jordan Rose e896106ae0 [analyzer] scan-build: allow quotes around "-cc1" when looking at -### output.
Third time's the charm. Patch by Brennan Shacklett!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204362 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 17:43:54 +00:00
Jordan Rose 4b7a75dd65 [analyzer] scan-build: match whitespace instead of word boundaries around flags.
Because neither ' ' nor '-' is alphanumeric, \b won't match between them!
Since in this case we know our output is coming from a -### invocation,
we should always have spaces on both sides of the flag we're trying to match,
"-cc1".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204356 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 16:37:54 +00:00
Jordan Rose 63a1a88464 [analyzer] scan-build: when matching flags, make sure the - is the first letter.
PR19191

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204253 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-19 17:42:26 +00:00
Ted Kremenek 59aeb1aa14 Add preprocessed output to ccc-analyzer's accepted language map.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202182 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 19:16:33 +00:00
Sylvestre Ledru bd0d2c6ff8 In some cases (for example, the Firefox build system), the CLANG_CXX variable is defined but empty.
Extend the test (like it is done in scan-build) to check also if the variable 
is empty or not.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201586 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18 17:45:06 +00:00
Sylvestre Ledru d70502c3b9 Remove trailing spaces (no other change). Bikeshed #2
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201584 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18 17:21:45 +00:00
Sylvestre Ledru fb51566d05 Remove trailing spaces (no other change)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201570 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18 12:59:51 +00:00
Sylvestre Ledru a3d14a90eb update of the clang version (should probably managed in the configure)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201182 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-11 21:37:27 +00:00
Anton Yartsev 7950014000 [analyzer] Strip trailing whitespace characters from input.
More universal way of removing trailing whitespace characters then 'chomp' does. Chomp "removes any trailing string that corresponds to the current value of $/" (quote from perldoc). In my case an input ended with '\r\r\n', chomp left '\r' at the end of input and the script ended up with an error "Use of uninitialized value in concatenation (.) or string"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199892 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-23 14:12:48 +00:00
Jordan Rose d758e07517 [analyzer] Files with .c extensions are still C++ files if the compiler is CXX.
PR18339

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198711 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-07 21:39:51 +00:00
Jordan Rose 071d77afb1 [analyzer] Add -analyzer-config to scan-build.
-analyzer-config options are now passed from scan-build through to
ccc-analyzer and then to clang.

Patch by Daniel Connelly!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197246 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 17:16:28 +00:00
Alp Toker 0fb7888788 Fix a tranche of comment, test and doc typos
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196510 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 16:25:25 +00:00
Jordan Rose e233eea67c [analyzer] scan-build: Handle -m* option wildcard after compiler/linker flags.
Some of the shared compiler/linker flags start with -m, so they've been
getting passed to the compiler only since r180073. Now, the -m* wildcard
is processed after the shared flags and the ignored flags.

Found by Laszlo Nagy!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193184 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-22 18:55:18 +00:00
Jordan Rose f55e36a9d8 [analyzer] scan-build: add missing semicolon
Patch by Kevin Zheng!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190789 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-16 16:17:18 +00:00
Jordan Rose f8a89ce9f0 [analyzer] Put more uniqueness in scan-build's temporary directory names.
This is necessary when running two scan-build processes in parallel. The
directory naming scheme is now:

  yyyy-MM-dd-HHmmss-PID-N
  2013-09-13-174210-123-1

where "PID" is the scan-build process ID, and "N" is a sequential counter
(not likely to be needed now that seconds are mangled in, but just in case).

PR17196, using a suggested fix from Greg Czajkowski!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190735 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-14 00:41:32 +00:00
Jordan Rose 33881620f4 scan-build: Set CC and CXX as make variables when wrapping make builds.
Variables set in a makefile are not overridden by environment variables.
Make sure we actually override CC and CXX when using scan-build.

Patch by Steve McCoy!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189372 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 16:59:33 +00:00
Anton Yartsev 4415a4b58b + make scan-build work with Strawberry Perl, ActiveState Perl, cygwin perl and msys perl ports.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188607 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-17 15:43:19 +00:00
Jordan Rose ce4aa85993 scan-build: pass -target through to analyzer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187989 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-08 16:06:26 +00:00
Jordan Rose de1860de53 [scan-build] Add missing comma to ccc-analyzer.
Thanks, Dmitry!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186167 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-12 16:07:33 +00:00
Jordan Rose 4aaedf03f5 [scan-build] Pass through all -f and -O flags, along with -Wwrite-strings.
These flags control language options and user-visible macros, so it's
important to preserve them when analyzing. Rather than try to keep up
with all the -f flags, we'll pass them all through and then ban the ones
we don't want (like -fsyntax-only).

-Wwrite-strings is really an f-flag in disguise: it implies -fconst-strings.

Patch by Keaton Mowry, modified by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186138 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-11 23:56:12 +00:00
Jordan Rose 98137aa8c5 [scan-build] Log compiler invocation to stderr, not stdout.
This is important for preprocessing steps, which may output to stdout.

Also, change ENV accesses using barewords to use string keys instead.

PR16414

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185555 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 16:42:02 +00:00
Anna Zaks 3ee2ad876a [analyzer] Add --override-compiler option to scan-build.
The new advanced option ensures ccc-analyze is used even when better
interposition methods are available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182981 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-31 02:31:07 +00:00
Jordan Rose c810bff508 scan-build: use the xcodebuild specified by the user.
This is important if the user has multiple Xcodes installed on their
system -- we use xcodebuild to do a version check, and therefore we need
to make sure we match the actual build command.

Reported by Howard Ling!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182498 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-22 18:09:57 +00:00
Anton Yartsev 27200ad4a6 [analyzer] Finally make c++-analyzer 'executable' again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180905 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02 01:57:58 +00:00
Anton Yartsev 96d63a2731 [analyzer] Recreated as a file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180903 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02 01:41:51 +00:00
Anton Yartsev 6a22d399f1 [analyzer] Temporary remove c++analyzer to recreate it as a separate file, not a symlink.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180902 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02 01:36:41 +00:00
Anton Yartsev ceb791ccd2 [analyzer] scan-build for Windows
The patch allows Windows users to launch scan-build without any additional preparations in the same way as it described in http://clang-analyzer.llvm.org/scan-build.html. The only thing that should be done to make scan-build work from an arbitrary location is to add scan-build folder to the PATH environment variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180900 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02 00:52:46 +00:00
Jordan Rose 40ebe3dac2 [analyzer] scan-build: support -enable-checker with new Xcode integration.
<rdar://problem/13772094>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180812 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30 22:00:04 +00:00
Ted Kremenek 11a90ed93f [scan-build] Whitelist all -mXXXX options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180073 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-23 00:10:55 +00:00
Jordan Rose f190f6b88e [analyzer] scan-build: emit errors on stderr, and exit(1) instead of exit(0).
PR14963

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177678 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-21 23:14:26 +00:00
Jordan Rose 4a374f9a58 [analyzer] Fix scan-build's -stats mode.
We were failing to match the output line, which led to us collecting no
stats at all, which led to a divide-by-zero error.

Fixes PR15510.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177084 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14 17:18:30 +00:00
Jordan Rose e09b8c41d0 scan-build: explicitly say "No bugs found" if there are no reports.
Patch by Martin Storsjo!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176472 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-05 02:33:08 +00:00
Benjamin Kramer 9672b90e6c scan-build: Remove debug print.
PR15329.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175889 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22 12:07:39 +00:00
Ted Kremenek 47135fe346 [scan-build] Add quotes around clang executable name to handle path withs spaces. Fixes <rdar://problem/13254727>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175790 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21 20:28:59 +00:00
Ted Kremenek c73dcba918 [scan-build] fix xcode version parsing to handle dot releases. Fixes <rdar://problem/13265300>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175781 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21 19:33:30 +00:00