Commit Graph

17839 Commits

Author SHA1 Message Date
Anton Yartsev 0578959981 [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.)

llvm-svn: 178250
2013-03-28 17:05:19 +00:00
Anton Yartsev 8b662704dc [analyzer] For now assume all standard global 'operator new' functions allocate memory in heap.
+ Improved test coverage for cplusplus.NewDelete checker.

llvm-svn: 178244
2013-03-28 16:10:38 +00:00
Hal Finkel 1fe8b3dd4b 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.

llvm-svn: 178235
2013-03-28 13:51:36 +00:00
Simon Atanasyan 66ceaa439a [Mips] Handle pseudo-target flags '-EL' and '-EB' and properly adjust
toolchain flags for MIPS targets.

llvm-svn: 178232
2013-03-28 11:36:22 +00:00
Hal Finkel 279ca4d608 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.

llvm-svn: 178227
2013-03-28 08:38:53 +00:00
Evgeniy Stepanov c3c725aae3 Define __SIZE_MAX__ preprocessor macro.
llvm-svn: 178226
2013-03-28 08:36:54 +00:00
Richard Smith 8ea9720b90 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.

llvm-svn: 178218
2013-03-28 03:27:52 +00:00
Richard Smith 8bff9616ef Teach -Wigored-qualifiers about exotic flavors of declarator and the _Atomic type qualifier.
llvm-svn: 178217
2013-03-28 02:51:21 +00:00
David Blaikie 8663941068 Revert "Update debug info test for schema change made to LLVM."
This reverts commit 5035c483b7fcbf0fa2a7afba24fa35a10995d195.

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

llvm-svn: 178213
2013-03-28 02:44:15 +00:00
Richard Smith 8e1ac33ec7 Support C11 _Atomic type qualifier. This is more-or-less just syntactic sugar for the _Atomic type specifier.
llvm-svn: 178210
2013-03-28 01:55:44 +00:00
Richard Smith 89b466c603 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).

llvm-svn: 178200
2013-03-28 00:03:10 +00:00
Argyrios Kyrtzidis c36633c47a [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

llvm-svn: 178199
2013-03-27 23:58:17 +00:00
Richard Smith deec07403c Don't reject __restrict applied to a dependent type; it might instantiate to a pointer or reference type.
llvm-svn: 178198
2013-03-27 23:36:39 +00:00
Bill Wendling 55ab0c5438 Simplify test to use a count for the number of notes expected.
llvm-svn: 178196
2013-03-27 23:26:09 +00:00
Richard Smith 2b01d5089b 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.
llvm-svn: 178194
2013-03-27 23:20:25 +00:00
Chad Rosier 459d3ee1dd Remove unnecessary attributes from test case.
llvm-svn: 178188
2013-03-27 21:54:09 +00:00
Chad Rosier a0ef404973 Add a front-end test case for r178186.
llvm-svn: 178187
2013-03-27 21:50:39 +00:00
Fariborz Jahanian 7e1eae004c Fixes a typo in my last patch.
llvm-svn: 178184
2013-03-27 21:33:52 +00:00
Fariborz Jahanian 84510744d9 Objective-C: Issue more precise warning when user
is accessing 'isa' as an object pointer.
// rdar://13503456. FixIt to follow in another patch.

llvm-svn: 178179
2013-03-27 21:19:25 +00:00
Jordan Rose 3503cb3572 [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.

llvm-svn: 178160
2013-03-27 18:10:35 +00:00
Argyrios Kyrtzidis 0f06b98387 [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

llvm-svn: 178151
2013-03-27 17:17:23 +00:00
Douglas Gregor bf7fc9c542 <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.

llvm-svn: 178148
2013-03-27 16:47:18 +00:00
Tim Northover c1ec2dbbd2 Add another expected note. Two errors => two notes.
llvm-svn: 178143
2013-03-27 13:50:57 +00:00
Evgeniy Stepanov 8d7d1b5377 Disable ASan/MSan symbolization of reports in tests.
It was using an instrumented symbolizer binary, which is a potential fork bomb.

llvm-svn: 178140
2013-03-27 13:11:46 +00:00
Evgeniy Stepanov dff0255270 Mark comment-to-html-xml-conversion test as XFAIL:msan, in addition to valgrind.
llvm-svn: 178138
2013-03-27 13:05:40 +00:00
Douglas Gregor b0d0aa5cdc <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.
llvm-svn: 178136
2013-03-27 12:51:49 +00:00
Bill Wendling 953c701b8b Fix testcase to add expected note.
llvm-svn: 178122
2013-03-27 06:45:37 +00:00
Joao Matos c9523d4f44 Implement compiler intrinsics needed for compatibility with MSVC 2012 <type_traits>.
Patch by me and Ryan Molden.

llvm-svn: 178111
2013-03-27 01:34:16 +00:00
Argyrios Kyrtzidis 09796b9a23 [modules] Re-enable the "ambiguous expansion of macro" warning.
Also update "test/Modules/macros.c" to test modified semantics:
-When there is an ambiguous macro, expand using the latest introduced version, not the first one.
-#undefs in submodules cause the macro to not be exported by that submodule, it doesn't cause
 undefining of macros in the translation unit that imported that submodule.
 This reduces macro namespace interference across modules.

llvm-svn: 178105
2013-03-27 01:25:19 +00:00
Richard Smith 3901dfe431 PR15597: Fix a confusion between the implicit exception specification and the
uninstantiated exception specification when a special member within a class
template is both defaulted and given an exception specification on its first
declaration.

llvm-svn: 178103
2013-03-27 00:22:47 +00:00
David Blaikie 2398f30115 Update debug info test for schema change made to LLVM.
This accounts for the addition of another field to DIScopes that will be used
to store a list of DIImportedModules in the future.

llvm-svn: 178100
2013-03-27 00:08:24 +00:00
John McCall f2abe19dbb Make the -Wreinterpret-base-class logic safe against invalid
declarations at any point. Patch by Alexander Zinenko, and
report by Richard Smith.

llvm-svn: 178098
2013-03-27 00:03:48 +00:00
Ted Kremenek 65d635775d Split "incomplete implementation" warnings for ObjC into separate warnings.
Previously all unimplemented methods for a class were grouped under
a single warning, with all the unimplemented methods mentioned
as notes.  Based on feedback from users, most users would like
a separate warning for each method, with a note pointing back to
the original method declaration.

Implements <rdar://problem/13350414>

llvm-svn: 178097
2013-03-27 00:02:21 +00:00
Douglas Gregor 6fa6ab0675 <rdar://problem/13278115> Improve diagnostic when failing to bind an rvalue reference to an lvalue of compatible type.
llvm-svn: 178095
2013-03-26 23:59:23 +00:00
Anna Zaks fb0a6329bd [analyzer] Better test for r178063.
Jordan pointed out that my previously committed test was bogus.

llvm-svn: 178094
2013-03-26 23:58:52 +00:00
Anna Zaks bd8f60d6d1 [analyzer] Make sure IDC works for ‘NSContainer value/key is nil’ checks.
Register the nil tracking visitors with the region and refactor trackNullOrUndefValue a bit.

Also adds the cast and paren stripping before checking if the value is an OpaqueValueExpr
or ExprWithCleanups.

llvm-svn: 178093
2013-03-26 23:58:49 +00:00
Douglas Gregor 45bb4834e9 <rdar://problem/13267210> Ensure that Sema::CompareReferenceRelationship returns consistent results with invalid types.
When Sema::RequireCompleteType() is given a class template
specialization type that then fails to instantiate, it returns
'true'. On subsequent invocations, it can return false. Make sure that
this difference doesn't change the result of
Sema::CompareReferenceRelationship, which is expected to remain stable
while we're checking an initialization sequence.

llvm-svn: 178088
2013-03-26 23:36:30 +00:00
Douglas Gregor 89c0a914ec <rdar://problem/13473493> Handle 'this->' insertion recovery within trailing return types.
llvm-svn: 178081
2013-03-26 22:43:55 +00:00
Anna Zaks b13d21b6e1 [analyzer] Change inlining policy to inline small functions when reanalyzing ObjC methods as top level.
This allows us to better reason about(inline) small wrapper functions.

llvm-svn: 178063
2013-03-26 18:57:58 +00:00
NAKAMURA Takumi 719f8584f2 clang/test/CodeGenCXX/debug-info-namespace.cpp: Disable it on non-bash lit for now.
With dosish filename, it misgenerates an improper extra entry.

!1 = metadata !{metadata !"E:\5Cllvm\5Cllvm-project\5Cclang\5Ctest\5CCodeGenCXX/debug-info-namespace.cpp", metadata !"E:\5Cllvm\5Cbuild\5Cninja-win32-vs11\5Ctools\5Cclang\5Ctest\5CCodeGenCXX"}

!8 = metadata !{metadata !"E:\5Cllvm\5Cllvm-project\5Cclang\5Ctest\5CCodeGenCXX\5Cdebug-info-namespace.cpp", metadata !"E:\5Cllvm\5Cbuild\5Cninja-win32-vs11\5Ctools\5Cclang\5Ctest\5CCodeGenCXX"}

!8 is unexpected.

llvm-svn: 178061
2013-03-26 18:57:40 +00:00
Michael Liao 74f4eaf4dc Add PRFCHW intrinsic support
- Add head 'prfchwintrin.h' to define '_m_prefetchw' which is mapped to
  LLVM/clang prefetch builtin
- Add option '-mprfchw' to enable PRFCHW feature and pre-define '__PRFCHW__'
  macro

llvm-svn: 178041
2013-03-26 17:52:08 +00:00
Reid Kleckner e7e64d8a7b [ms-cxxabi] Mangle vector types
Summary:
The only vector types a user can pass from MSVC code to clang code are
the ones from *mmintrin.h, so we only have to match the MSVC mangling
for these types.  MSVC mangles the __m128 family of types as tag types,
which we match.  For other vector types, we emit a unique tag type
mangling that won't match anything produced by MSVC.

Reviewers: rjmccall

CC: chandlerc, timurrrr, cfe-commits

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

llvm-svn: 178036
2013-03-26 16:56:59 +00:00
Alexey Samsonov 9d8043b4cc Actually mark ASan-unfriendly test as XFAIL
llvm-svn: 177997
2013-03-26 08:45:29 +00:00
Alexey Samsonov 55b688f062 Add asan/msan to the list of available features in LIT test runner. Mark ASan-unfriendly test as XFAIL.
llvm-svn: 177995
2013-03-26 08:28:18 +00:00
Richard Trieu 8fbd91d445 Handle CXXOperatorCallExpr when checking self referrnce during initialization of
class types.

llvm-svn: 177987
2013-03-26 03:41:40 +00:00
Richard Smith b2bfad2355 Remove FIXMEs: these are covered by a core issue which we don't yet implement
(but we happen to get this part right).

llvm-svn: 177958
2013-03-26 01:17:18 +00:00
Richard Smith 7447af48b1 Implement special-case name lookup for inheriting constructors: member
using-declarations with names which look constructor-like are interpreted as
constructor names.

llvm-svn: 177957
2013-03-26 01:15:19 +00:00
Fariborz Jahanian 36b1e5ce82 Objective-C: Property declaration overiding one in
its super class or protocols inherit their 
availability/deprecated attribute. // rdar://13467644

llvm-svn: 177948
2013-03-25 23:59:42 +00:00
NAKAMURA Takumi f759061908 clang/test/Index/crash-recovery-code-complete.c: Mark it as XFAIL:win32 for now.
I know MemoryBuffer might affect this. Still investigating.

llvm-svn: 177946
2013-03-25 23:49:11 +00:00
Douglas Gregor a3890528d6 <rdar://problem/13395022> Strip references when extracting an initializer_list's element type during application of an initialization sequence.
llvm-svn: 177944
2013-03-25 23:47:01 +00:00