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

43341 Коммитов

Автор SHA1 Сообщение Дата
Reid Kleckner edd2cb381e [sema] Remove unused variable from r178283
Wouldn't it be cool if we had a compiler for Windows that could warn
about these things?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178289 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 20:54:13 +00:00
Reid Kleckner 84e9ab44af [ms-cxxabi] Correctly compute the size of member pointers
Summary:
This also relaxes the requirement on Windows that the member pointer
class type be a complete type (http://llvm.org/PR12070).  We still ask
for a complete type to instantiate any templates (MSVC does this), but
if that fails we continue as normal, relying on any inheritance
attributes on the declaration.

Reviewers: rjmccall

CC: triton, timurrrr, cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D568

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178283 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 20:02:56 +00:00
Fariborz Jahanian ec8deba768 Objective-C: Provide fixit suggestions when class object
is accessed via accessing 'isa' ivar to use
object_getClass/object_setClass apis.
// rdar://13503456


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178282 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 19:50:55 +00:00
Jordan Rose 5fd1fac010 Provide a fixit to static_cast for reinterpret_casts within a class hierarchy.
The suggestion was already in the text of the note; this just adds the
actual fixit and the appropriate test cases.

Patch by Alexander Zinenko!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178274 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 19:09:40 +00:00
Sam Panzer 25ffbef844 Implemented a warning when an input several bitwise operations are
likely be implicitly truncated:

  * All forms of Bitwise-and, bitwise-or, and integer multiplication.
  * The assignment form of integer addition, subtraction, and exclusive-or
  * The RHS of the comma operator
  * The LHS of left shifts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178273 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 19:07:11 +00:00
Thomas Schwinge 577bb0a233 Rename clang::driver::tools::linuxtools to clang::driver::tools::gnutools.
This is about the GNU Binutils' assembler and linker, so reflect that in the
name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178272 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 19:04:25 +00:00
Thomas Schwinge d52b4a9924 Rename LinuxDistro to Distro.
The concept of such a software distribution is not tied to the Linux kernel;
for example Debian GNU/Linux, Debian GNU/Hurd, and Debian GNU/kFreeBSD all
share the same source packages and generally the same user-space configuration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178270 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 19:02:48 +00:00
Ted Kremenek 65a0892ff5 Use early return in printing logic. Minor cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178264 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 18:43:18 +00:00
Ted Kremenek fbd4b5dc7f Add CFG logic to create a conditional branch for modeling static initializers.
This is an optional variant of the CFG.  This allows analyses to model whether
or not a static initializer has run, e.g.:

  static Foo x = bar();

For basic dataflow analysis in Sema we will just assume that the initializer
always runs.  For the static analyzer we can use this branch to accurately
track whether or not initializers are on.

This patch just adds the (opt-in) functionality to the CFG.  The
static analyzer still needs to be modified to adopt this feature.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178263 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 18:43:15 +00:00
Alexander Kornienko 9fdc00a237 Fixed handling of comments before preprocessor directives.
Comments before preprocessor directives used to be stored with InPPDirective
flag set, which prevented correct comment splitting in this case. Fixed by
flushing comments before switching on InPPDirective. Added a new test and fixed
one of the existing tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178261 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 18:40:55 +00:00
Eric Christopher 03852c8717 Fix order of initialization warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178255 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 18:22:58 +00:00
Anton Yartsev 849c7bf718 [analyzer] These implements unix.MismatchedDeallocatorChecker checker.
+ Improved display names for allocators and deallocators

The checker checks if a deallocation function matches allocation one. ('free' for 'malloc', 'delete' for 'new' etc.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178250 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 17:05:19 +00:00
Rafael Espindola 94cf910ac2 These are all simple pointer wrappers. Pass them by value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178247 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 16:26:16 +00:00
Anton Yartsev 697462881c [analyzer] For now assume all standard global 'operator new' functions allocate memory in heap.
+ Improved test coverage for cplusplus.NewDelete checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178244 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 16:10:38 +00:00
Hal Finkel 829d187e21 Add support for gcc-compatible -mpopcntd -mno-popcntd PPC options
gcc provides -mpopcntd and -mno-popcntd for controlling the popcntd target
feature; support these options as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178235 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 13:51:36 +00:00
Edwin Vane 8203d9f049 Updating LibASTMatchersReference
The generator for LibASTMatchersReference.html didn't get run last time
ASTMatchers changes were made. Here are up-to-date docs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178234 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 13:50:22 +00:00
Simon Atanasyan 286f3e638f [Mips] Handle pseudo-target flags '-EL' and '-EB' and properly adjust
toolchain flags for MIPS targets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178232 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 11:36:22 +00:00
Hal Finkel f4320ab08d Add support for gcc-compatible -mmfcrf -mno-mfcrf PPC options
gcc provides -mmfcrf and -mno-mfcrf for controlling what we call
the mfocrf target feature. Also, PPC is now making use of the
static function AddTargetFeature used by the Mips Driver code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178227 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 08:38:53 +00:00
Evgeniy Stepanov edaf281379 Define __SIZE_MAX__ preprocessor macro.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178226 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 08:36:54 +00:00
Richard Smith eb82a53aaa For -Wignored-qualifiers, don't warn on qualifiers which we acquire via a
typedef. Also don't warn on the _Atomic type specifier, just on the _Atomic
type qualifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178218 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 03:27:52 +00:00
Richard Smith 8c952cd40c Teach -Wigored-qualifiers about exotic flavors of declarator and the _Atomic type qualifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178217 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 02:51:21 +00:00
David Blaikie 372ed5c3c3 Revert "Update debug info test for schema change made to LLVM."
This reverts commit 5035c483b7.

This schema change wasn't necessary after all. I'm going ith a different
solution that will hopefully use space more conservatively.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178213 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 02:44:15 +00:00
Richard Smith 47681531ce Remove outdated FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178211 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 01:56:34 +00:00
Richard Smith 4cf4a5e96a Support C11 _Atomic type qualifier. This is more-or-less just syntactic sugar for the _Atomic type specifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178210 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 01:55:44 +00:00
Richard Smith 93d6b07cd7 Fold together the two implementations of 6.7.3p2 in SemaType. Fix two bugs, each of which was only present in one version:
* Give the right diagnostic for 'restrict' applied to a non-pointer, non-reference type.
 * Don't reject 'restrict' applied indirectly to an Objective-C object pointer type (eg, through template instantiation).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178200 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 00:03:10 +00:00
Argyrios Kyrtzidis ab2d09b628 [Parser] Don't code-complete twice.
When we are consuming the current token just to enter a new token stream, we push
the current token in the back of the stream so that we get it again.

Unfortunately this had the effect where if the current token is a code-completion one,
we would code-complete once during consuming it and another time after the stream ended.

Fix this by making sure that, in this case, ConsumeAnyToken() will consume a code-completion
token without invoking code-completion.

rdar://12842503

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178199 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 23:58:17 +00:00
Richard Smith 9807a2e0dd Don't reject __restrict applied to a dependent type; it might instantiate to a pointer or reference type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178198 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 23:36:39 +00:00
Bill Wendling cbd739410b Simplify test to use a count for the number of notes expected.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178196 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 23:26:09 +00:00
Richard Smith 508764518d UBSan: Don't diagnose inf/nan conversions between floating-point types. It's far from clear whether these have undefined behavior, and these checks are helping no-one. Keep the double->float overflow warnings, though, since those are useful in practice, even though it's unclear whether such operations have defined behavior.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178194 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 23:20:25 +00:00
Chad Rosier 87d2a37bde Remove unnecessary attributes from test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178188 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 21:54:09 +00:00
Chad Rosier 5e5ca1b7ed Add a front-end test case for r178186.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178187 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 21:50:39 +00:00
Fariborz Jahanian 0353b70b6a Fixes a typo in my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178184 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 21:33:52 +00:00
Argyrios Kyrtzidis 04f5db699e Revert "[lib/Headers] Define NULL as __DARWIN_NULL when on __APPLE__."
Per feedback by Doug, we should avoid platform-specific implementations
in lib/Headers as much as possible.

This reverts commit r178110.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178181 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 21:22:45 +00:00
Fariborz Jahanian 7e35274df4 Objective-C: Issue more precise warning when user
is accessing 'isa' as an object pointer.
// rdar://13503456. FixIt to follow in another patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178179 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 21:19:25 +00:00
Rafael Espindola e81fdb1fdd Cleanup clang's specializations of simplify_type.
Now that the basic implementation in llvm has been fixed, simplify the
specializations in clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178173 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 19:38:14 +00:00
Chad Rosier 9083628fec Update the error handing static functions for r178161.
Part of rdar://13296693


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178162 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 18:28:23 +00:00
Jordan Rose b061720ddf [analyzer] Use evalBind for C++ new of scalar types.
These types will not have a CXXConstructExpr to do the initialization for
them. Previously we just used a simple call to ProgramState::bindLoc, but
that doesn't trigger proper checker callbacks (like pointer escape).

Found by Anton Yartsev.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178160 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 18:10:35 +00:00
Anna Zaks 3655119ab1 [analyzer] Cleanup: only get the PostStmt when we need the underlying Stmt + comment
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178153 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 17:36:01 +00:00
Anna Zaks 4a49df3be9 [analyzer] Ensure that the node NilReceiverBRVisitor is looking for is not reclaimed
The visitor should look for the PreStmt node as the receiver is nil in the PreStmt and this is the node. Also, tag the nil
receiver nodes with a special tag for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178152 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 17:35:58 +00:00
Argyrios Kyrtzidis ea744ab5f3 [modules] Make sure enabled diagnostic pragmas inside the module don't affect the translation unit that
imports the module.

Getting diagnostic sections from modules properly working is a fixme.

rdar://13516663

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 17:17:23 +00:00
Alexander Kornienko 94b748ff16 Insert extra new line before access specifiers.
Summary: Insert extra new line before access specifiers.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D581

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178149 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 17:08:02 +00:00
Douglas Gregor c544ba0969 <rdar://problem/13509689> Introduce -module-file-info option that provides information about a particular module file.
This option can be useful for end users who want to know why they
ended up with a ton of different variants of the "std" module in their
module cache. This problem should go away over time, as we reduce the
need for module variants, but it will never go away entirely.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178148 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 16:47:18 +00:00
Rafael Espindola 8343f8e00a Add const in preparation for a simplify_type change in llvm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178146 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 15:37:54 +00:00
Tim Northover 3d91ddb9a9 Add another expected note. Two errors => two notes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178143 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 13:50:57 +00:00
Evgeniy Stepanov 6ddfe4e067 Disable ASan/MSan symbolization of reports in tests.
It was using an instrumented symbolizer binary, which is a potential fork bomb.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178140 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 13:11:46 +00:00
Evgeniy Stepanov c528aa2e23 Mark comment-to-html-xml-conversion test as XFAIL:msan, in addition to valgrind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178138 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 13:05:40 +00:00
Douglas Gregor 6bed88e9d2 <rdar://problem/13317030> Consider using directives when performing unqualified name lookup into declarations contexts represented by the qualified-id but not in the actual scope hierarchy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178136 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 12:51:49 +00:00
Alexander Kornienko 5262dd909a Split line comments
Summary:
Split line comments that exceed column limit + fixed leading whitespace
handling when splitting block comments.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D577

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178133 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 11:52:18 +00:00
Bill Wendling f2ff5bdef0 Fix testcase to add expected note.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178122 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 06:45:37 +00:00
Bill Wendling d835d9496c Pass the diagnostic in for better error messages.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178120 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 06:06:26 +00:00