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

40142 Коммитов

Автор SHA1 Сообщение Дата
Simon Atanasyan e015754476 Extend -Bprefix functionality and make it closer to gcc. If the "prefix"
is not a directory, Driver::GetProgramPath() routine does not try to append
the program name as a "path component" to it. It just joins the "prefix" with
the program name and checks the resulting path existence.

The patch reviewed by Rafael Espindola.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167114 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31 12:01:53 +00:00
Rafael Espindola 986af6fe38 Remove empty directories.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167100 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31 02:34:48 +00:00
Anna Zaks 32133cfb33 [analyzer] SimpleStreamChecker - remove evalAssume and other refinements
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167099 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31 02:32:41 +00:00
Rafael Espindola af6f612af4 Remove really old benchmark data.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167098 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31 02:29:15 +00:00
Rafael Espindola 8c610b075c Remove the -ccc-no-clang option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167093 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31 01:21:20 +00:00
Anna Zaks 3719ed248b [analyzer]Don't invalidate const arguments when there is no
IdentifierInfo.

Ee: C++ copy constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167092 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31 01:18:26 +00:00
Anna Zaks e63aedd0cb Address Jordan's review: comments, spaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167091 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31 01:18:22 +00:00
Seth Cantrell 399f2c4003 add test for r167063
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167089 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31 01:03:35 +00:00
Seth Cantrell 31ba273ef8 isLegalUTF8() was giving the wrong answer
invalid but not caught by isLegalUTF8(): 0xED 0x75 0x84

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167063 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 23:50:26 +00:00
Rafael Espindola e6c3458723 Remove ccc-no-clang-cpp, which is also dead now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167062 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 23:49:11 +00:00
David Blaikie 82c6dc72ad Handle string encoding diagnostics when there are too many invalid ranges.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167059 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 23:22:22 +00:00
Manman Ren b3fa55f18d ARM AAPCS-VFP: fix handling of homogeneous aggreate.
If HA can only partially fit into VFP registers, we add padding to make sure
HA will be on stack and later VFP CPRCs will be on stack as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167058 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 23:21:41 +00:00
Chad Rosier 89aa2ce6d6 [driver] Older versions of ld expect '-L<dir>' not '-L <dir>'. In Xcode4 and
later, '-L <dir>' is allowed, but rewrite these in the driver as '-L<dir>' to
maintain backward compatibility.  The same is true for the -I option.
rdar://12366753

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167054 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 21:42:09 +00:00
Fariborz Jahanian c6abe9e0d9 objective-C arc/mrr: Another patch for the new captured block variable
layout meta-data.  It is currently off (so no tests). This is wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167047 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 20:05:29 +00:00
Quentin Colombet 356d9cccd7 Change ForceSizeOpt attribute into MinSize attribute
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167021 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 16:33:19 +00:00
Daniel Jasper d1ce3c178b Implement descendant matchers for NestedNamespecifiers
This implements has(), hasDescendant(), forEach() and
forEachDescendant() for NestedNameSpecifier and NestedNameSpecifierLoc
matchers.

Review: http://llvm-reviews.chandlerc.com/D86

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167017 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 15:42:00 +00:00
Seth Cantrell 0d1e645bbf remove duplicate data array
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167007 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 06:13:52 +00:00
Seth Cantrell c6a2f6e2dd fix calculation of end pointer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167006 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 06:13:50 +00:00
Ted Kremenek c39a2b0577 Update test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167005 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 05:28:33 +00:00
Kostya Serebryany ecf7cc18ce [asan docs] explain why asan exits on the first error
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167004 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 05:07:05 +00:00
Ted Kremenek 4a131e1c63 Change -Wcompare-distinct-pointer-type to -Wcompare-distinct-pointer-types, as
the warning is about comparing different types (plural).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167003 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 04:43:57 +00:00
Ted Kremenek 19948ac84f Trim #includes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167002 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 04:43:51 +00:00
Anna Zaks bdbb17b81c [analyzer]SimpleStreamChecker: add a TODO for better leak report.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167001 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 04:18:21 +00:00
Anna Zaks 360b29c52a [analyzer] Fix a bug in REGISTER_MAP_WITH_PROGRAMSTATE
The ImmutableMap should not be the key into the GDM map as there could
be several entries with the same map type. Thanks, Jordan.

This complicates the usage of the macro a bit. When we want to retrieve
the whole map, we need to use another name. Currently, I set it to be
Name ## Ty as in "type of the map we are storing in the ProgramState".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167000 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 04:17:40 +00:00
Anna Zaks ac150f2619 [analyzer] Rename REGISTER_MAP_WITH_GDM ->REGISTER_MAP_WITH_PROGRAMSTATE
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166999 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 04:17:18 +00:00
Rafael Espindola 942fbddccc Remove leftover const.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166996 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 01:49:46 +00:00
Jordan Rose eafaad279f [analyzer] Warn about reallocf with an allocation size of 0, like realloc.
Patch by Sean McBride!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166995 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 01:37:16 +00:00
Jordan Rose 3cf9a72743 [analyzer] New checker for missing super calls in UIViewController subclasses.
This is a syntactic checker aimed at helping iOS programmers correctly
subclass and override the methods of UIViewController. While this should
eventually be covered by the 'objc_requires_super' attribute, this
checker can be used with the existing iOS SDKs without any header changes.

This new checker is currently named 'alpha.osx.cocoa.MissingSuperCall'.
Patch by Julian Mayer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166993 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 01:21:35 +00:00
Eli Friedman ee1ea80a90 Don't crash on bad atomic operations. PR14176.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166992 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 01:15:28 +00:00
Rafael Espindola 848bc3a5db getOriginalSourceFileName and getOriginalSourceFile can return a StringRef.
MaybeAddSystemRootToFilename doesn't need to return anything, it modifies
its argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166988 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 00:38:13 +00:00
Argyrios Kyrtzidis 33e1576ef8 [PCH] The diagnostic state points can refer to previously created
diagnostic states; make sure the ASTReader sets the diagnostic state
properly instead of always recreating it.

Fixes rdar://12581618 & http://llvm.org/PR14181

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166987 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 00:27:21 +00:00
Rafael Espindola d2d4d68a58 In the past "production" clang builds would not be used for c++, and
we had the -ccc-clang-cxx and -ccc-no-clang-cxx options to force them
on or off for testing.

Clang c++ support is now production quality and these options are dead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166986 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 00:13:16 +00:00
Argyrios Kyrtzidis bf69d7146a [libclang] Bump the version number of the libclang API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166984 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 23:53:52 +00:00
Rafael Espindola 2902829d27 Remove a bit of dead code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166983 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 23:41:43 +00:00
Rafael Espindola badb3f6971 Move getOriginalSourceFileName inline. Patch by Laszlo Nagy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166981 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 23:26:40 +00:00
Argyrios Kyrtzidis ca9805a79d [libclang] Introduce a version constant for the libclang API.
rdar://12587974

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166980 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 23:24:44 +00:00
Anna Zaks 54458707b2 [analyzer] Malloc checker cleanup/refactor
No need for the auxiliary flag. No need to generate a leak node when
there is no error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166977 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 22:51:54 +00:00
Anna Zaks d65e55d691 [analyzer] Add SimpleStreamChecker.
This is an example checker for catching fopen fclose API misuses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166976 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 22:51:50 +00:00
Anna Zaks 5ac1df3e15 [analyzer] Add checker helpers to CheckerContext.
- Adding Immutable Map to GDM and getIdentifierInfo helper method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166975 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 22:51:44 +00:00
Quentin Colombet 8e68ef0e4c Revert commit r166946
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166957 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 18:28:57 +00:00
Richard Smith 9568f0c13a Partially roll back r166898; it exposed a bug in the standard.
The problem is as follows: C++11 has contexts which are not
potentially-evaluated, and yet in which we are required or encouraged to
perform constant evaluation. In such contexts, we are not permitted to
implicitly define special member functions for literal types, therefore
we cannot evalaute those constant expressions.

Punt on this in one more context for now by skipping checking constexpr
variable initializers if they occur in dependent contexts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166956 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 18:26:47 +00:00
Quentin Colombet ba927d9b26 Make forcesizeopt attribute available to the end user
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166946 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 17:56:23 +00:00
Jordan Rose c0e44454bd -Warc-repeated-use-of-weak: allow single reads in loops from local variables.
Previously, the warning would erroneously fire on this:

for (Test *a in someArray)
  use(a.weakProp);

...because it looks like the same property is being accessed over and over.
However, clearly this is not the case. We now ignore loops like this for
local variables, but continue to warn if the base object is a parameter,
global variable, or instance variable, on the assumption that these are
not repeatedly usually assigned to within loops.

Additionally, do-while loops where the condition is 'false' are not really
loops at all; usually they're just used for semicolon-swallowing macros or
using "break" like "goto".

<rdar://problem/12578785&12578849>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166942 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 17:46:47 +00:00
Jordan Rose 6a329ee756 [analyzer] New option to not suppress null return paths if an argument is null.
Our one basic suppression heuristic is to assume that functions do not
usually return NULL. However, when one of the arguments is NULL it is
suddenly much more likely that NULL is a valid return value. In this case,
we don't suppress the report here, but we do attach /another/ visitor to
go find out if this NULL argument also comes from an inlined function's
error path.

This new behavior, controlled by the 'avoid-suppressing-null-argument-paths'
analyzer-config option, is turned off by default. Turning it on produced
two false positives and no new true positives when running over LLVM/Clang.

This is one of the possible refinements to our suppression heuristics.
<rdar://problem/12350829>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166941 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 17:31:59 +00:00
Jordan Rose 09f7bf14d2 [analyzer] Use the CallEnter node to get a value for tracked null arguments.
Additionally, don't collect PostStore nodes -- they are often used in
path diagnostics.

Previously, we tried to track null arguments in the same way as any other
null values, but in many cases the necessary nodes had already been
collected (a memory optimization in ExplodedGraph). Now, we fall back to
using the value of the argument at the time of the call, which may not
always match the actual contents of the region, but often will.

This is a precursor to improving our suppression heuristic.
<rdar://problem/12350829>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166940 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 17:31:53 +00:00
Bill Schmidt dbaf4bc586 This patch adds alignment information for long double to the 64-bit PowerPC
ELF subtarget.

The existing description string is moved from PPC64TargetInfo to its
DarwinTargetInfo subclass, to avoid any changes to the Darwin ABI.
PPC64TargetInfo now has two possible description strings: one for FreeBSD,
which requires 8-byte alignment, and a default string that requires
16-byte alignment.

I've added a test for PPC64 Linux to verify the 16-byte alignment.  If
somebody wants to add a separate test for FreeBSD, that would be great.

Note that there is a companion patch to update the alignment information
in LLVM, which I am committing now as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166927 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 14:59:24 +00:00
Ulrich Weigand e6b3dbae38 Handle '*' and '#' asm constraint modifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166924 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 12:20:54 +00:00
Daniel Jasper 452abbc76b Fix ASTMatchersTests to not create an overloaded-virtual warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166921 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 10:48:25 +00:00
Daniel Jasper a267cf6f87 Implement has(), hasDescendant(), forEach() and forEachDescendant() for
Types, QualTypes and TypeLocs.

Review: http://llvm-reviews.chandlerc.com/D83

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166917 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 10:14:44 +00:00
Nick Lewycky b201e93f01 Remove spurious mode marker from .cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166915 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 06:05:01 +00:00