Richard Trieu
481037f01b
Moves calls of checkArithmeticNull() from CreateBuiltinBinOp() into the individual Check*Operands() functions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139895 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-16 00:53:10 +00:00
Caitlin Sadowski
1748b12566
Thread safety: Adding FIXMEs and a couple cleanups
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139894 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-16 00:35:54 +00:00
Richard Trieu
c3ba24f8af
Remove no longer needed LHSType and RHSType from checkArithmeticNull()
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139879 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 23:57:21 +00:00
Richard Trieu
5e3a23585f
Change checkArithmeticNull() to use a NonNullType, instead of checking both the
...
LHSType and RHSType for everything.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139878 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 23:51:29 +00:00
Richard Trieu
dd22509c82
Finish the lex->LHS and rex->RHS cleanup in Sema.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139856 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 21:56:47 +00:00
Fariborz Jahanian
412a49641c
reverse patch in r139818 to focus on 'self'
...
instead of 'Class'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139834 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 20:40:18 +00:00
Fariborz Jahanian
7d7ef8298d
Objective-c: Conversion from type Class to any root class type is allowed
...
in class methods with no warning. //rdar://10109725
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139818 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 18:30:22 +00:00
Caitlin Sadowski
69f5d14bae
Thread safety: cleaning up FIXME for trylocks
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139805 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 17:50:19 +00:00
Caitlin Sadowski
4e4bc75d35
Thread safety: refactoring various out of scope warnings to use the same inteface. This eliminates a lot of unnecessary duplicated code.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139801 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 17:25:19 +00:00
Caitlin Sadowski
df8327c28d
Thread safety: reverting to use separate warning for requirement to hold any lock
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139723 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 20:09:09 +00:00
Kaelyn Uhrain
7c24334bed
Plug an abstraction leak and fix a crasher in DiagnoseInvalidRedeclaration
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139718 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 19:37:32 +00:00
Eli Friedman
f45b357c0d
PR10864: make sure we correctly delay type-checking for inline asm tied operands with dependent type. Patch by Likai Liu.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139716 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 19:20:00 +00:00
Fariborz Jahanian
528a499eb8
objc-arc: warn when a 'retain' block property is
...
declared which does not force a 'copy' of the block literal
object. // rdar://9829425
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139706 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 18:03:46 +00:00
Argyrios Kyrtzidis
f1e7af36d6
Add the location of the interface reference to IBOutletCollectionAttr.
...
Depends on a llvm tablegen commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139618 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 18:41:59 +00:00
John McCall
265941bc30
Refactoring, mostly to give ObjCPropertyDecls stronger invariants for
...
their semantic attributes and then to take advantage of that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139615 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 18:31:23 +00:00
Caitlin Sadowski
e87158dfbc
Thread safety: Initializing var before exhaustive switch statement to deal with extraneous warning produced by gcc but not clang
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139611 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 18:01:58 +00:00
Douglas Gregor
e289d81369
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139605 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 17:21:33 +00:00
Argyrios Kyrtzidis
768d6cae40
Keep the source range of attributes. Depends on a llvm tablegen commit.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139600 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 16:05:58 +00:00
Argyrios Kyrtzidis
ffcc3105d2
Record the full source range of an attribute.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139599 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 16:05:53 +00:00
Francois Pichet
c985b88efc
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139595 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 10:26:51 +00:00
Chandler Carruth
e05ee6df35
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139594 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 09:53:58 +00:00
Douglas Gregor
48822fbd08
Kill off an irrelevant FIXME
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139523 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-12 18:58:37 +00:00
Richard Trieu
6eef9fb34c
Refactor CheckAdditionOperands() to use early return for pointer addition.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139520 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-12 18:37:54 +00:00
Douglas Gregor
e389585f8a
Diagnose attempt to mark function-local declarations as __module_private__.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139519 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-12 18:37:38 +00:00
Richard Trieu
d9f1934bd0
Fix two comments from warn to emit error to match the actual diagnostic used.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139510 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-12 18:08:02 +00:00
Douglas Gregor
591dc84101
Allow __module_private__ on fields
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139499 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-12 16:11:24 +00:00
Douglas Gregor
f3a762a8de
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139497 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-12 15:48:15 +00:00
Hans Wennborg
cb4d7c202e
Silence ?: precendence warning when parenthesis are present.
...
Fixes PR10898. The warning should be silent when there are parenthesis
around the condition expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139492 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-12 12:07:30 +00:00
Benjamin Kramer
afc5b15022
Silence "end of non-void function" warnings with llvm_unreachable and add an assert.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139474 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-10 21:52:04 +00:00
John McCall
33e56f3273
Rename the ARC cast kinds to start with "ARC".
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139466 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-10 06:18:15 +00:00
David Blaikie
4f4f349208
Show either a location or a fixit note, not both, for uninitialized variable warnings.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139463 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-10 05:35:08 +00:00
John McCall
dc05b11c67
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139451 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-10 01:16:55 +00:00
Douglas Gregor
b3321093f6
Fix a diagnostics crasher with -Wmissing-noreturn in Objective-C
...
methods, and improve the diagnostic slightly along the way. Fixes
<rdar://problem/10098695>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139446 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-10 00:56:20 +00:00
Chandler Carruth
78bf680ddf
Fix a -Wreturn-type warning due to this field not explicitly having the
...
enumeration type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139445 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-10 00:51:24 +00:00
Julien Lerouge
77f68bb90a
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139423 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 22:41:49 +00:00
Kaelyn Uhrain
fd641f943a
Add smarter sorting of overload candidates that failed template deduction.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139417 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 21:58:49 +00:00
Douglas Gregor
6274d30d77
Friends cannot be declared module-private
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139411 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 21:14:29 +00:00
Douglas Gregor
d023aec890
Specializations cannot be module-hidden. Diagnose attempts to do so.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139406 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 20:53:38 +00:00
Douglas Gregor
5c16d635ff
Don't produce 'instancetype' as the type of a message send expression. Map it down to 'id'.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139394 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 20:05:21 +00:00
Douglas Gregor
e761230ae3
__module_private__ is inherited by redeclarations of an entity, and
...
must also be present of the first declaration of that entity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139384 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 19:05:14 +00:00
Douglas Gregor
6311d2bb3d
Propagate __module_private__ from previous declarations to later
...
declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139380 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 18:32:39 +00:00
Douglas Gregor
bbcb7ea8a0
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139373 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 16:51:10 +00:00
Caitlin Sadowski
99107ebc0a
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
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139370 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 16:21:55 +00:00
Caitlin Sadowski
402aa0698f
Thread Safety: Moving the analysis to a new file
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139369 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 16:11:56 +00:00
Caitlin Sadowski
a49d1d8a34
Thread safety: refactoring test cases
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139368 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 16:07:55 +00:00
Caitlin Sadowski
75f23aeb1c
Thread safety: refactoring to use an error handler
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139367 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 16:04:02 +00:00
Francois Pichet
67bc6071d7
Update comment because JumpDiagnostics.cpp is not just about VLA scope.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139364 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 11:02:57 +00:00
John McCall
3323fad09e
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139361 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 07:56:05 +00:00
John McCall
7f3a6d37ba
Code formatting; no functionality change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139355 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 06:12:06 +00:00
John McCall
0bcc9bc6cd
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139354 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 06:11:02 +00:00