summaryrefslogtreecommitdiff
path: root/test/SemaObjC
Commit message (Collapse)AuthorAge
* Objective-C. When we use @selector(save:), etc. there may be more Fariborz Jahanian2014-06-24
| | | | | | | | | | | | | | than one method with mismatched type of same selector name. clang issues a warning to point this out since it may cause undefined behavior. There are cases though that some APIs don't care about user methods and such warnings are perceived as noise. This patch allows users to add paren delimiters around selector name to turn off such warnings. So, @selector((save:)) will turn off the warning. It also provides 'fixit' so user knows what to do. // rdar://16458579 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211611 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C qoi. When Objective-C pointer mismatches withFariborz Jahanian2014-06-19
| | | | | | | | | a qualified-id type because pointer is object of a forward class declaration, include this info in a diagnostic note. // rdar://10751015 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211324 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C ARC. Allow conversion of (void*) pointers toFariborz Jahanian2014-06-18
| | | | | | | | | retainable ObjC pointers without requiring a bridge-cast in the context of pointer comparison as this is in effect a +0 context. // rdar://16627903 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211243 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Revert my patch in r211234.Fariborz Jahanian2014-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211237 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C ARC. Allow conversion of (void*) pointers toFariborz Jahanian2014-06-18
| | | | | | | | retainable ObjC pointers without requiring a bridge-cast by recognizing this as a +0 context. // rdar://16627903 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211234 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Check for integer overflow in Objective-C'sFariborz Jahanian2014-06-18
| | | | | | | boxed expression. // rdar://16417427 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211215 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Try to fix the test in buildbot in my last patch.Fariborz Jahanian2014-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211197 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Attributes on class declarations carry overFariborz Jahanian2014-06-18
| | | | | | | | to forward class declarations for diagnosis. // rdar://16681279 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211195 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C ARC. Do not warn about properties with bothFariborz Jahanian2014-06-17
| | | | | | | | | | IBOutlet and weak attributes when accessed being unpredictably set to nil because usage of such properties are always single threaded and its ivar cannot be set to nil asynchronously. // rdar://15885642 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211132 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Diagnose when property access is using declaredFariborz Jahanian2014-06-16
| | | | | | | | property accessor methods which have become deprecated or available. // rdar://15951801 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211039 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C ARC. Blocks that strongly capture themselvesFariborz Jahanian2014-06-12
| | | | | | | | | | | | to call themselves will get the warning: "Capturing <itself> strongly in this block is likely to lead to a retain cycle". Cut down on the amount of noise by noticing that user at some point sets the captured variable to null in order to release it (and break the cycle). // rdar://16944538 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210823 91177308-0d34-0410-b5e6-96231b3b80d8
* More tests for // rdar://17259812Fariborz Jahanian2014-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210798 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Accept '__attribute__((__ns_returns_retained__))' Fariborz Jahanian2014-06-11
| | | | | | | | for function/methods returning block in MRR mode as well. // rdar://17259812 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210706 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. More tests for both bridging attributes andFariborz Jahanian2014-06-11
| | | | | | | | a fix to make it work when CFStructs have no definition. // rdar://17238954. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210690 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Patch to handle bridge attribute warningsFariborz Jahanian2014-06-11
| | | | | | | | | correctly when both NSAttributedString and NSMutableAttributedString are specified on the same CFStruct via different typedefs. // rdar://17238954 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210660 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Don't ignore availability attribute whenFariborz Jahanian2014-06-10
| | | | | | | | doing Objective-C subscript access. // rdar://16842487 PR19682. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210565 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Consider block pointer as NSObject as well as conforming toFariborz Jahanian2014-06-09
| | | | | | | | 'NSCopying' protocol when diagnosing block to ObjC pointer conversion. // rdar://16739120 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210491 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Diagnose assigning a block pointer type toFariborz Jahanian2014-05-30
| | | | | | | | an Objective-C object type other than 'id'. // rdar://16739120 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209906 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Diagnose use of properties in functions nested in, Fariborz Jahanian2014-05-28
| | | | | | | | now deprecated, ObjC containers instead of crashing. // rdar://16859666 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209758 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Deprecate use of function definitionsFariborz Jahanian2014-05-28
| | | | | | | | in Objective-C container declarations (but not in their definitions. // rdar://10414277 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209751 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Fixes an obscuer crash caused by multiple inclusion ofFariborz Jahanian2014-05-27
| | | | | | | | same framework after complaining about duplicate class definition. // rdar://17024681 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209672 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Reduce false positive warnings with -Wselector by issuing warning Fariborz Jahanian2014-05-09
| | | | | | | | only when named selector is declared in TU and it is not declared in a system header. rdar://16600230 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208443 91177308-0d34-0410-b5e6-96231b3b80d8
* ThreadSafetyAnalysis: Don't crash when trying to analyze objc methods.Benjamin Kramer2014-05-09
| | | | | | | | | | | The thread safety analysis isn't very useful in ObjC (you can't annotate ObjC classes or methods) but we can still analyze the actual code and show violations in usage of C/C++ functions. Fixes PR19541, which does not use thread safety attributes but crashes with -Weverything. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208436 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename "secondary initializer" -> "convenience initializer" in the warnings, ↵Argyrios Kyrtzidis2014-05-06
| | | | | | which is a more correct and consistent term. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208142 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Improve diagnosis of bridging types.Fariborz Jahanian2014-04-29
| | | | | | | // rdar://16737117 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207542 91177308-0d34-0410-b5e6-96231b3b80d8
* [SemaObjC] Fix ObjCInterfaceDecl::inheritsDesignatedInitializers(), if there ↵Argyrios Kyrtzidis2014-04-26
| | | | | | | | | | are no designated initializers in the super class hierarchy then it should return false. rdar://16692535 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207332 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C [IRGen]. Fixes a crash in IRGen involving use ofFariborz Jahanian2014-04-23
| | | | | | | | 'typeof' to extract type of an @encode expression used in an initializer. // rdar://16655340 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207004 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C ARC. Under ARC, addition of 'bridge' attributeFariborz Jahanian2014-04-22
| | | | | | | | | on CF type is not sufficient and bridge casting is still required for proper ownership semantics. // rdar://16650445 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206910 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Patch to allow use of dot syntax on classFariborz Jahanian2014-04-21
| | | | | | | | objects to fund root class's instance methods. // rdar://16650575 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206781 91177308-0d34-0410-b5e6-96231b3b80d8
* Move ObjC Cocoa.h header test to HeadersAlp Toker2014-04-19
| | | | | | | This tests for broad compatibility with platform SDK headers using the clang driver and so belongs alongside the other header ingtegration tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206687 91177308-0d34-0410-b5e6-96231b3b80d8
* [objc] -[NSObject init] is documented to not do anything, don't warn if ↵Argyrios Kyrtzidis2014-04-16
| | | | | | | | subclasses do not call [super init] on their initializers. Part of rdar://16568441 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206410 91177308-0d34-0410-b5e6-96231b3b80d8
* [objc] Consider new initializers inside @implementation when determining if ↵Argyrios Kyrtzidis2014-04-16
| | | | | | | | | | the class introduces new initializers. Part of rdar://16568441 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206409 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C arc [Sema]. Allow bridge cast of a qualified-id expressionFariborz Jahanian2014-04-04
| | | | | | | | when bridged Objective-C type conforms to the protocols in CF types's Objective-C class. // rdar://16393330 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205659 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the 'optnone' attribute, which suppresses most optimizationsPaul Robinson2014-03-31
| | | | | | | on a function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205255 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM64: initial clang support commit.Tim Northover2014-03-29
| | | | | | | | | | | This adds Clang support for the ARM64 backend. There are definitely still some rough edges, so please bring up any issues you see with this patch. As with the LLVM commit though, we think it'll be more useful for merging with AArch64 from within the tree. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205100 91177308-0d34-0410-b5e6-96231b3b80d8
* [-Wunreachable-code] Expand paren-suppression heuristic to C++/ObjC bools.Ted Kremenek2014-03-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205074 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Make -Wselector-type-mismatch off byFariborz Jahanian2014-03-28
| | | | | | | | default until we provide a work-around for warning suppression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205066 91177308-0d34-0410-b5e6-96231b3b80d8
* [SemaObjC] For the semantics of the designated-initializer attribute, ↵Argyrios Kyrtzidis2014-03-28
| | | | | | | | | | consider that the ObjC interface of the class includes its class extensions. This is follow-up for rdar://16305347 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205065 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. revert r204965. This will makeFariborz Jahanian2014-03-28
| | | | | | | | | | | | -Wselector-type-mismatch default again. After internal discussions, we think that in most cases it has helped our developers find hard to detect undefined behaviors. We are going to provide a syntax (and fix-it) to suppress the warning in remaining of false positive cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205024 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Make multiple selector warningFariborz Jahanian2014-03-27
| | | | | | | | an opt-in option under -Wselector-type-mismatch. // rdar://16445728 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204965 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Fixes a bogus warning on unimplementedFariborz Jahanian2014-03-26
| | | | | | | | | selectors because we were not going through entire elements in list of all implemented selectors. // rdar://16428638 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204852 91177308-0d34-0410-b5e6-96231b3b80d8
* [-Wunreachable-code] add a specialized diagnostic for unreachable increment ↵Ted Kremenek2014-03-21
| | | | | | expressions of loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204430 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. No need to issue deprecated warning if deprecated method Fariborz Jahanian2014-03-18
| | | | | | | | | in class extension is being implemented in primary class implementation (no overriding is involved). // rdar://16249335 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204093 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Consider blocks for designated initializerFariborz Jahanian2014-03-17
| | | | | | | | | warnings (warning or lack there of) as well since blocks are another pattern for envoking other designated initializers. // rdar://16323233 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204081 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Do not warn when an instance method andFariborz Jahanian2014-03-17
| | | | | | | | | class method with the same selctor but different argument types having one of them in class extension. // rdar://16312105 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204065 91177308-0d34-0410-b5e6-96231b3b80d8
* Start breaking -Wunreachable-code up into different diagnostic groups.Ted Kremenek2014-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent work on -Wunreachable-code has focused on suppressing uninteresting unreachable code that center around "configuration values", but there are still some set of cases that are sometimes interesting or uninteresting depending on the codebase. For example, a dead "break" statement may not be interesting for a particular codebase, potentially because it is auto-generated or simply because code is written defensively. To address these workflow differences, -Wunreachable-code is now broken into several diagnostic groups: -Wunreachable-code: intended to be a reasonable "default" for most users. and then other groups that turn on more aggressive checking: -Wunreachable-code-break: warn about dead break statements -Wunreachable-code-trivial-return: warn about dead return statements that return "trivial" values (e.g., return 0). Other return statements that return non-trivial values are still reported under -Wunreachable-code (this is an area subject to more refinement). -Wunreachable-code-aggressive: supergroup that enables all these groups. The goal is to eventually make -Wunreachable-code good enough to either be in -Wall or on-by-default, thus finessing these warnings into different groups helps achieve maximum signal for more users. TODO: the tests need to be updated to reflect this extra control via diagnostic flags. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203994 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Turn off designated initialization warnings onFariborz Jahanian2014-03-14
| | | | | | | | | 'init' methods which are unavailable. Subclasses of NSObject have to implement such methods as a common pattern to prevent user's own implementation. // rdar://16305460 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203966 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Allow objc_designated_initializer for private Fariborz Jahanian2014-03-14
| | | | | | | | initializers; but only those declared in class extensions (not in implementations). // rdar://16305347 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203954 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Issue diagnostics on mismatched methods when their selector is usedFariborz Jahanian2014-03-12
| | | | | | | in an @selector expression. // rdar://15794055 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203693 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Prevent an assertion crash due to buggy codeFariborz Jahanian2014-03-11
| | | | | | | | as it can commonly happen. // rdar://16261494 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203598 91177308-0d34-0410-b5e6-96231b3b80d8