Argyrios Kyrtzidis
8db67df663
Add the location of the interface reference to IBOutletCollectionAttr.
...
Depends on a llvm tablegen commit.
llvm-svn: 139618
2011-09-13 18:41:59 +00:00
John McCall
4319286337
Refactoring, mostly to give ObjCPropertyDecls stronger invariants for
...
their semantic attributes and then to take advantage of that.
llvm-svn: 139615
2011-09-13 18:31:23 +00:00
Caitlin Sadowski
427f42e04a
Thread safety: Initializing var before exhaustive switch statement to deal with extraneous warning produced by gcc but not clang
...
llvm-svn: 139611
2011-09-13 18:01:58 +00:00
Douglas Gregor
79a91418bd
Switch LangOptions over to a .def file that describes header of the
...
language options. Use that .def file to declare the LangOptions class
and initialize all of its members, eliminating a source of annoying
initialization bugs.
AST serialization changes are next up.
llvm-svn: 139605
2011-09-13 17:21:33 +00:00
Argyrios Kyrtzidis
309b4c49e4
Keep the source range of attributes. Depends on a llvm tablegen commit.
...
llvm-svn: 139600
2011-09-13 16:05:58 +00:00
Argyrios Kyrtzidis
635a9b4dcf
Record the full source range of an attribute.
...
llvm-svn: 139599
2011-09-13 16:05:53 +00:00
Francois Pichet
051f5e5cba
In Microsoft mode, downgrade "goto into protected scope" from error to warning if we are jumping over a variable initialization via a goto.
...
This fixes a few errors when parsing MFC code with clang.
llvm-svn: 139595
2011-09-13 10:26:51 +00:00
Chandler Carruth
03faf78953
Switch -Wreturn-type to completely rely on the CFG model of no-return.
...
This deletes a bunch of crufty code, and allows more logic sharing
between the analyzer and the warnings.
llvm-svn: 139594
2011-09-13 09:53:58 +00:00
Douglas Gregor
7bfedd69c5
Kill off an irrelevant FIXME
...
llvm-svn: 139523
2011-09-12 18:58:37 +00:00
Richard Trieu
b420bcaeb0
Refactor CheckAdditionOperands() to use early return for pointer addition.
...
llvm-svn: 139520
2011-09-12 18:37:54 +00:00
Douglas Gregor
41866816ce
Diagnose attempt to mark function-local declarations as __module_private__.
...
llvm-svn: 139519
2011-09-12 18:37:38 +00:00
Richard Trieu
993f3ab07b
Fix two comments from warn to emit error to match the actual diagnostic used.
...
llvm-svn: 139510
2011-09-12 18:08:02 +00:00
Douglas Gregor
3baa6702ab
Allow __module_private__ on fields
...
llvm-svn: 139499
2011-09-12 16:11:24 +00:00
Douglas Gregor
fc33bcfc4a
Remove the restriction on module-private friends. Since the friend
...
declaration may be the first declaration, we want the ability to that
declaration to be marked module-private.
llvm-svn: 139497
2011-09-12 15:48:15 +00:00
Hans Wennborg
be207b3c74
Silence ?: precendence warning when parenthesis are present.
...
Fixes PR10898. The warning should be silent when there are parenthesis
around the condition expression.
llvm-svn: 139492
2011-09-12 12:07:30 +00:00
Benjamin Kramer
8a8051f2cd
Silence "end of non-void function" warnings with llvm_unreachable and add an assert.
...
llvm-svn: 139474
2011-09-10 21:52:04 +00:00
John McCall
2d637d2e79
Rename the ARC cast kinds to start with "ARC".
...
llvm-svn: 139466
2011-09-10 06:18:15 +00:00
David Blaikie
e5f9a9e603
Show either a location or a fixit note, not both, for uninitialized variable warnings.
...
llvm-svn: 139463
2011-09-10 05:35:08 +00:00
John McCall
cd78e805e9
When converting a block pointer to an Objective-C pointer type, extend
...
the lifetime of the block by copying it to the heap, or else we'll get
a dangling reference because the code working with the non-block-typed
object will not know it needs to copy.
There is some danger here, e.g. with assigning a block literal to an
unsafe variable, but, well, it's an unsafe variable.
llvm-svn: 139451
2011-09-10 01:16:55 +00:00
Douglas Gregor
97e3590a6e
Fix a diagnostics crasher with -Wmissing-noreturn in Objective-C
...
methods, and improve the diagnostic slightly along the way. Fixes
<rdar://problem/10098695>.
llvm-svn: 139446
2011-09-10 00:56:20 +00:00
Chandler Carruth
73fddfe1b0
Fix a -Wreturn-type warning due to this field not explicitly having the
...
enumeration type.
llvm-svn: 139445
2011-09-10 00:51:24 +00:00
Julien Lerouge
5a6b6987dc
Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: can
...
annotate global, local variables, struct fields, or arbitrary statements (using
the __builtin_annotation), rdar://8037476.
llvm-svn: 139423
2011-09-09 22:41:49 +00:00
Kaelyn Uhrain
45e9370a24
Add smarter sorting of overload candidates that failed template deduction.
...
llvm-svn: 139417
2011-09-09 21:58:49 +00:00
Douglas Gregor
6422642a1d
Friends cannot be declared module-private
...
llvm-svn: 139411
2011-09-09 21:14:29 +00:00
Douglas Gregor
3c7cd6a0c4
Specializations cannot be module-hidden. Diagnose attempts to do so.
...
llvm-svn: 139406
2011-09-09 20:53:38 +00:00
Douglas Gregor
64910ca9d5
Don't produce 'instancetype' as the type of a message send expression. Map it down to 'id'.
...
llvm-svn: 139394
2011-09-09 20:05:21 +00:00
Douglas Gregor
2820e6923a
__module_private__ is inherited by redeclarations of an entity, and
...
must also be present of the first declaration of that entity.
llvm-svn: 139384
2011-09-09 19:05:14 +00:00
Douglas Gregor
ef15bdbe1a
Propagate __module_private__ from previous declarations to later
...
declarations.
llvm-svn: 139380
2011-09-09 18:32:39 +00:00
Douglas Gregor
6b3bcf29f5
When type-checking a call to an overloaded, builtin atomic operation,
...
construct a new DeclRefExpr rather than re-using the existing
DeclRefExpr. Patch by Likai Liu, fixes PR8345.
llvm-svn: 139373
2011-09-09 16:51:10 +00:00
Caitlin Sadowski
ff2f3f8105
Thread safety: This patch deals with previously unhandled cases when building lock expressions. We now resolve this expressions, avoid crashing when encountering cast expressions, and have a diagnostic for unresolved lock expressions
...
llvm-svn: 139370
2011-09-09 16:21:55 +00:00
Caitlin Sadowski
33208340bd
Thread Safety: Moving the analysis to a new file
...
llvm-svn: 139369
2011-09-09 16:11:56 +00:00
Caitlin Sadowski
a2fd6e0473
Thread safety: refactoring test cases
...
llvm-svn: 139368
2011-09-09 16:07:55 +00:00
Caitlin Sadowski
0b3501c5e2
Thread safety: refactoring to use an error handler
...
llvm-svn: 139367
2011-09-09 16:04:02 +00:00
Francois Pichet
2731b7ded3
Update comment because JumpDiagnostics.cpp is not just about VLA scope.
...
llvm-svn: 139364
2011-09-09 11:02:57 +00:00
John McCall
b46f287e48
Clean up the sentinel-attribute checking code a lot. Document
...
what 'nullPos' is supposed to mean, at least at this one site.
Use closed forms for the arithmetic. Rip out some clever but
ultimately pointless code that was trying to use 0 or 0L depending
the size of a pointer vs. the size of int; first, it didn't work
on LLP64 systems, and second, the sentinel checking code requires
a pointer-typed value anyway, so this fixit would not have actually
removed the warning.
llvm-svn: 139361
2011-09-09 07:56:05 +00:00
John McCall
9c3467e26c
Code formatting; no functionality change.
...
llvm-svn: 139355
2011-09-09 06:12:06 +00:00
John McCall
fec112d50e
Contextually converting to 'id' is not a useful operation. Contextually
...
converting to an arbitrary Objective-C pointer type is. Without
significantly re-implementing anything, change the API to reflect this,
and as a minor optimization, strip the pointer conversion off before
potentially building it.
Mostly, this removes a really bizarre-looking bit of code from
BuildInstanceMessage.
llvm-svn: 139354
2011-09-09 06:11:02 +00:00
John McCall
9320b87cff
Give conversions of block pointers to ObjC pointers a different cast kind
...
than conversions of C pointers to ObjC pointers. In order to ensure that
we've caught every case, add asserts to CastExpr that strictly determine
which cast kind is used for which kind of bit cast.
llvm-svn: 139352
2011-09-09 05:25:32 +00:00
Richard Trieu
10162ab7ed
Clean up the RebuildUnknownAnyExpr visitor in SemaExpr.cpp. Mainly swapped around variable names so that this visitor be more like other visitors in clang.
...
llvm-svn: 139351
2011-09-09 03:59:41 +00:00
Richard Trieu
9becef691d
Changed references of BaseTy, MemInitTy, CXXScopeTy, TemplateParamsTy to CXXBaseSpecifier, CXXCtorInitializer, NestedNameSpecifier, TemplateParameterList and removed their typedefs.
...
llvm-svn: 139350
2011-09-09 03:18:59 +00:00
Douglas Gregor
26701a4371
Modules: introduce the __module_private__ declaration specifier, which
...
indicates that a declaration is only visible within the module it is
declared in.
llvm-svn: 139348
2011-09-09 02:06:17 +00:00
Richard Trieu
2bd0401b04
Change all references of type ExprTy to Expr and get rid of the typedefs.
...
llvm-svn: 139347
2011-09-09 02:00:50 +00:00
Richard Trieu
ba63ce6b7b
Capitialize paramater names in SemaExpr.cpp and resolve any parameter name conflicts between declarations and definitions from this and previous refactorings.
...
llvm-svn: 139346
2011-09-09 01:45:06 +00:00
Douglas Gregor
3168dcf134
The integer type of an enumeration type isn't always canonical
...
llvm-svn: 139334
2011-09-08 23:29:05 +00:00
Caitlin Sadowski
b4d24a9054
Thread safety: small edit to unused variation on warning left in by accident from earlier commit
...
llvm-svn: 139331
2011-09-08 23:17:03 +00:00
Matt Beaumont-Gay
042ce8e9d8
Extend -Wliteral-conversion to catch "int i = -1.234"
...
llvm-svn: 139326
2011-09-08 22:30:47 +00:00
Caitlin Sadowski
ee5db8b5c4
Thread Safety: In C++0x Mutexes are the objects that control access to shared variables, while Locks are the objects that acquire and release Mutexes. We switch to this new terminology.
...
llvm-svn: 139321
2011-09-08 21:52:50 +00:00
Caitlin Sadowski
2d3f70ac1c
Thread Safety: adding basic no thread safety analysis option
...
llvm-svn: 139310
2011-09-08 18:35:21 +00:00
Caitlin Sadowski
69b367af17
Thread safety: Adding basic support for locks required and excluded attributes
...
llvm-svn: 139308
2011-09-08 18:27:31 +00:00
Caitlin Sadowski
46b057681a
Thread safety: shared vs. exclusive locks
...
llvm-svn: 139307
2011-09-08 18:19:38 +00:00