summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* ObjectiveC. Remove warning diagnostic which checksFariborz Jahanian2013-11-231-67/+0
| | | | | | | | | | | | | | attribute on method declaration and implementation match. This makes no sense. Most annotations are meant for declarations only and one is for implementation. This has been constant source of regresions and hackery to get around special cases. I am removing this check. Such checks must be done on a case by case basis and when it makes sense. For example, it makes sense for availability/deprecated and I will file a radar for that. // rdar://15531984 llvm-svn: 195524
* Whitespace. No functional change intended.Aaron Ballman2013-11-221-4/+4
| | | | llvm-svn: 195503
* Add class-specific operator new to Decl hierarchy. This guarantees that DeclsRichard Smith2013-11-222-9/+5
| | | | | | | | | | | | | can't accidentally be allocated the wrong way (missing prefix data for decls from AST files, for instance) and simplifies the CreateDeserialized functions a little. An extra DeclContext* parameter to the not-from-AST-file operator new allows us to ensure that we don't accidentally call the wrong one when deserializing (when we don't have a DeclContext), allows some extra checks, and prepares for some planned modules-related changes to Decl allocation. No functionality change intended. llvm-svn: 195426
* ObjectiveC migrator. Improve on definition, useFariborz Jahanian2013-11-221-6/+2
| | | | | | | | and testing of objc_bridgmutable attribute per Aaron Ballman's comments. // rdar://15498044 llvm-svn: 195396
* PR18013: Don't assert diagnosing a bad std::initializer_list construction.Richard Smith2013-11-211-7/+25
| | | | llvm-svn: 195384
* ObjectiveC. Implement attribute 'objc_bridge_mutable'Fariborz Jahanian2013-11-212-11/+47
| | | | | | | | whose semantic is currently identical to objc_bridge, but their differences may manifest down the road with further enhancements. // rdar://15498044 llvm-svn: 195376
* Revert "Add new attribute 'objc_suppress_protocol' to suppress protocol ↵Ted Kremenek2013-11-212-37/+5
| | | | | | | | | | | conformance for a class." After implementing this patch, a few concerns about the language feature itself emerged in my head that I had previously not considered. I want to resolve those design concerns first before having a half-designed language feature in the tree. llvm-svn: 195328
* Add new attribute 'objc_suppress_protocol' to suppress protocol conformance ↵Ted Kremenek2013-11-212-5/+37
| | | | | | | | | | | | | | | | | | | | | | | for a class. The idea is to allow a class to stipulate that its methods (and those of its parents) cannot be used for protocol conformance in a subclass. A subclass is then explicitly required to re-implement those methods of they are present in the class marked with this attribute. Currently the attribute can only be applied to an @interface, and not a category or class extension. This is by design. Unlike protocol conformance, where a category can add explicit conformance of a protocol to class, this anti-conformance really needs to be observed uniformly by all clients of the class. That's because the absence of the attribute implies more permissive checking of protocol conformance. This unfortunately required changing method lookup in ObjCInterfaceDecl to take an optional protocol parameter. This should not slow down method lookup in most cases, and is just used for protocol conformance. llvm-svn: 195323
* Refactor some of handleObjCBridgeAttr to make it more concise and the ↵Ted Kremenek2013-11-211-8/+7
| | | | | | diagnostic reusable. llvm-svn: 195322
* Provide better diagnostic wording for initializers on staticHans Wennborg2013-11-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | data member definitions when the variable has an initializer in its declaration. For the following code: struct S { static const int x = 42; }; const int S::x = 42; This patch changes the diagnostic from: a.cc:4:14: error: redefinition of 'x' const int S::x = 42; ^ a.cc:2:20: note: previous definition is here static const int x = 42; ^ to: a.cc:4:18: error: static data member 'x' already has an initializer const int S::x = 42; ^ a.cc:2:24: note: previous initialization is here static const int x = 42; ^ Differential Revision: http://llvm-reviews.chandlerc.com/D2235 llvm-svn: 195306
* PR10837: Warn if a null pointer constant is formed by a zero integer constantRichard Smith2013-11-211-6/+8
| | | | | | | expression that is not a zero literal, in C. This is a different, and more targeted, approach than that in r194540. llvm-svn: 195303
* Refactored integer argument checking code into a helper method. Removes a ↵Aaron Ballman2013-11-211-111/+61
| | | | | | considerable amount of duplicated code. llvm-svn: 195302
* ObjectiveC. Allow toll free bridge cast warnings outsideFariborz Jahanian2013-11-212-9/+17
| | | | | | | ARC and in objectiveC/ObjectiveC++ MRR mode as well. // rdar://15454846 llvm-svn: 195288
* Implemented DefaultIntArgument in the table generator and start using it in ↵Aaron Ballman2013-11-211-4/+4
| | | | | | semantic analysis. Removes some magic numbers. llvm-svn: 195287
* ObjectiveC ARC. warn in presense of __bridge casting to Fariborz Jahanian2013-11-201-0/+9
| | | | | | or from a toll free bridge cast. // rdar://15454846 llvm-svn: 195278
* There is no such thing as __declspec(ms_struct), this is a GNU attribute. ↵Aaron Ballman2013-11-201-1/+2
| | | | | | Switched the attribute to have the proper spelling, gave it a subject, updated the warning to be more accurate, and updated the test case as appropriate. llvm-svn: 195277
* Removed a duplicate diagnostic related to attribute subjects for thread ↵Aaron Ballman2013-11-201-28/+22
| | | | | | safety annotations, and replaced it with the more general attribute diagnostic. Updated the test case in the one instance where wording changed. No functional change intended. llvm-svn: 195275
* Refine 'deprecated' checking for Objective-C classes/methods.Ted Kremenek2013-11-202-1/+19
| | | | | | | | | - If a deprecated class refers to another deprecated class, do not warn. - @implementations of a deprecated class can refer to other deprecated things. Fixes <rdar://problem/15407366> and <rdar://problem/15466783>. llvm-svn: 195259
* When wrapping lazily generated builtins in an extern "C" context,Enea Zaffanella2013-11-201-0/+1
| | | | | | flag the LinkageSpecDecl as being implicitly generated too. llvm-svn: 195255
* Removing a custom error diagnostic and replacing it with a stock one. Added ↵Aaron Ballman2013-11-201-2/+4
| | | | | | a test case to ensure the diagnostic was firing properly. llvm-svn: 195188
* ObjectiveC ARC. validate toll free bridge castingFariborz Jahanian2013-11-201-5/+23
| | | | | | | to or from 'id' and qualified-id types. // rdar://15454846 llvm-svn: 195178
* PR9547: If we're parsing a simple-declaration that contains a tag definition,Richard Smith2013-11-192-4/+9
| | | | | | | | and we see an ill-formed declarator that would probably be well-formed if the tag definition were just missing a semicolon, use that as the diagnostic instead of producing some other mysterious error. llvm-svn: 195163
* Switching some string literals to be generated by the AttributeList object ↵Aaron Ballman2013-11-191-5/+5
| | | | | | itself. llvm-svn: 195160
* Further fixes when thiscall is the default for methods.Rafael Espindola2013-11-193-162/+153
| | | | | | | | | | | | | | | | | | The previous patches tried to deduce the correct function type. I now realize this is not possible in general. Consider class foo { template <typename T> static void bar(T v); }; extern template void foo::bar(const void *); We will only know that bar is static after a lookup, so we have to handle this in the template instantiation code. This patch reverts my previous two changes (but not the tests) and instead handles the issue in DeduceTemplateArguments. llvm-svn: 195154
* ObjectiveC ARC. Removes a bogus warning when a weak Fariborz Jahanian2013-11-191-1/+3
| | | | | | | property is redeclared as 'weak' in class extension. // rdar://15465916 llvm-svn: 195146
* bjectiveC. Use a uniform diagnostic forFariborz Jahanian2013-11-191-3/+7
| | | | | | 'objc_bridge' attribute. // rdar://15454846. llvm-svn: 195135
* Revert r194540, it breaks various C++ programs.Joerg Sonnenberger2013-11-191-11/+2
| | | | llvm-svn: 195126
* Rename an extension warning to ext_...Richard Smith2013-11-191-1/+3
| | | | llvm-svn: 195095
* ObjectiveC objc_bridge. Minor refactoring.Fariborz Jahanian2013-11-191-2/+2
| | | | | | // rdar://15454846 llvm-svn: 195070
* ObjectiveC 'objc_bridging'. Assorment of improvements Fariborz Jahanian2013-11-193-31/+5
| | | | | | per Doug/Jordan comments. // rdar://15454846. llvm-svn: 195066
* ObjectiveC ARC. Adopt objc_bridge attributeFariborz Jahanian2013-11-193-43/+47
| | | | | | | on struct/union/class instead of typedef of such types. // rdar://15454846 llvm-svn: 195061
* The attached patch is a follow up from my previous one. The existingRafael Espindola2013-11-181-3/+5
| | | | | | | | | | logic was not handling typedefs as free functions. This was not causing problems with the existing tests, but does with the microsoft abi where they have to get a different calling convention. I will try to refactor this into a method on Declarator in a second. llvm-svn: 195050
* Use the default method CC in GetFullTypeForDeclarator.Rafael Espindola2013-11-181-130/+141
| | | | | | | | | | | | | Before this patch explicit template instatiations of member function templates were failing with the microsoft abi and 32 bits. This was happening because the expected and computed function types had different calling conventions. This patch fixes it by considering the default calling convention in GetFullTypeForDeclarator. This fixes pr17973. llvm-svn: 195032
* ObjectiveC ARC. More validation of toll-free bridging ofFariborz Jahanian2013-11-161-1/+10
| | | | | | | CF objects with objc_bridge'ing annotaiton. // rdar://15454846 llvm-svn: 194938
* ObjectiveC ARC. Validate toll free bridge castingFariborz Jahanian2013-11-161-3/+51
| | | | | | | of ObjectiveC objects to CF types when CF type has the objc_bridge attribute. llvm-svn: 194930
* If a replaceable global operator new/delete is marked inline, don't warn ifRichard Smith2013-11-161-9/+14
| | | | | | | it's also __attribute__((used)), since that undoes the problematic part of 'inline'. llvm-svn: 194916
* ObjetiveC ARC. Start diagnosing invalid toll free bridging.Fariborz Jahanian2013-11-161-10/+19
| | | | | | // rdar://15454846. llvm-svn: 194915
* Downgrade the Error on an 'inline' operator new or delete to an ExtWarn. SomeRichard Smith2013-11-161-1/+1
| | | | | | | projects are relying on such (questionable) practices, so we should give them a way to opt out of this diagnostic. llvm-svn: 194905
* ObjectiveC ARC. Only briding of pointer to struct CF object is allowed.Fariborz Jahanian2013-11-152-5/+10
| | | | | | | Improve on wording on illegal objc_bridge argumment. // rdar://15454846 llvm-svn: 194881
* ObjectiveC ARC. Lookup type associated with objc_bridage atFariborz Jahanian2013-11-151-0/+38
| | | | | | | | the point of CF object type-cast and issue diagnostic if it is not a valid ObjectiveC class. // rdar//15454846. This is wip. llvm-svn: 194861
* ObjectiveC. Fixes a bogus warning of unused backingFariborz Jahanian2013-11-151-1/+10
| | | | | | | | ivar when property belongs to a super class and currnt class happens to have a method with same name as property. // rdar//15473432 llvm-svn: 194830
* When we hit a #include directive that maps to a module import, emit a tokenRichard Smith2013-11-151-0/+6
| | | | | | | | | | | | representing the module import rather than making the module immediately visible. This serves two goals: * It avoids making declarations in the module visible prematurely, if we walk past the #include during a tentative parse, for instance, and * It gives a diagnostic (although, admittedly, not a very nice one) if a header with a corresponding module is included anywhere other than at the top level. llvm-svn: 194782
* PR17533 and duplicates: don't compute the return type of an overloaded operatorRichard Smith2013-11-152-16/+20
| | | | | | | until after we've referenced the operator; otherwise, we might pick up a not-yet-deduced type. llvm-svn: 194775
* Don't reject dependent range-based for loops in constexpr functions. The loopRichard Smith2013-11-151-1/+1
| | | | | | variable isn't really uninitialized, it's just not initialized yet. llvm-svn: 194767
* [OpenCL] Make sure we put string literals in the constant address space.Joey Gouly2013-11-141-0/+5
| | | | llvm-svn: 194717
* Revert r194663 and r194647.Ted Kremenek2013-11-141-12/+0
| | | | | | Per feedback from Jordan Rose I realized this wasn't the right way to go. llvm-svn: 194664
* Refine -Wunused-variable to only suppress warning for __bridge_transfer, not ↵Ted Kremenek2013-11-141-14/+4
| | | | | | | | | all bridge casts. Also refine test case to capture the intention of this suppression. Essentially some developers use __bridge_transfer as if it were a safe CFRelease. llvm-svn: 194663
* [AArch64 neon] support poly64 and relevant intrinsic functions.Kevin Qin2013-11-142-8/+13
| | | | llvm-svn: 194660
* Added warning on structures/unions that are empty or contain onlySerge Pavlov2013-11-141-13/+29
| | | | | | | | | | bit fields of zero size. Warnings are generated in C++ mode and if only such type is defined inside extern "C" block. The patch fixed PR5065. Differential Revision: http://llvm-reviews.chandlerc.com/D2151 llvm-svn: 194653
* Suppress -Wunused-variable when initializer uses bridge casts for memory ↵Ted Kremenek2013-11-141-0/+22
| | | | | | | | management. Fixes <rdar://problem/15432770>. llvm-svn: 194647
OpenPOWER on IntegriCloud