summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* ObjectiveC. typo fix in my last patch,Fariborz Jahanian2013-12-181-3/+1
| | | | | | per Jordan's review. llvm-svn: 197540
* Objctive-C. warn if dealloc is being overridden inFariborz Jahanian2013-12-171-0/+8
| | | | | | a category implementation. // rdar://15397430 llvm-svn: 197534
* Objective-C. Make diagnostics and fix-its consistent Fariborz Jahanian2013-12-172-11/+23
| | | | | | | | when diagnosing casting of a cstring literal to NSString in default and -fobjc-arc mode. // rdar://14106083 llvm-svn: 197515
* [ms-cxxabi] Don't do destructor check on declarations if the dtor is deletedHans Wennborg2013-12-172-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | We would previously emit redundant diagnostics for the following code: struct S { virtual ~S() = delete; void operator delete(void*, int); void operator delete(void*, double); } s; First we would check on ~S() and error about the ambigous delete functions, and then we would error about using the deleted destructor. If the destructor is deleted, there's no need to check it. Also, move the check from Sema::ActOnFields to CheckCompleteCXXClass. These are run at almost the same time, called from ActOnFinishCXXMemberSpecification. However, CHeckCompleteCXXClass may mark a defaulted destructor as deleted, and if that's the case we don't want to check it. Differential Revision: http://llvm-reviews.chandlerc.com/D2421 llvm-svn: 197509
* ObjectiveC. Further improvements of useFariborz Jahanian2013-12-164-23/+40
| | | | | | | | | | of objc_bridge_related attribute; eliminate unnecessary diagnostics which is issued elsewhere, fixit now produces a valid AST tree per convention. This results in some simplification in handling of this attribute as well. // rdar://15499111 llvm-svn: 197436
* Revert "Maybe add new warning for shadowing simple tag types"Kaelyn Uhrain2013-12-161-7/+1
| | | | | | | | | This reverts commit 2b43f500cfea10a8c59c986dcfc24fd08eecc77d. This was accidentally committed because I failed to notice my client wasn't clean prior to submitting a fix for a crasher. llvm-svn: 197410
* Make Sema::BuildCXXNestedNameSpecifier correctly clear the previousKaelyn Uhrain2013-12-161-0/+2
| | | | | | | | CXXScopeSpec when necessary while performing typo correction. This fixes the crash reported in PR18213 (the problem existed since r185487, and r193020 made it easier to hit). llvm-svn: 197409
* Maybe add new warning for shadowing simple tag typesKaelyn Uhrain2013-12-161-1/+7
| | | | llvm-svn: 197408
* Allow target-specific attributes to share a spelling between different ↵Aaron Ballman2013-12-151-23/+32
| | | | | | | | | | attributes via the ParseKind field. Attributes will be given a common parsed attribute identifier (the AttributeList::AT_* enum), but retain distinct Attr subclasses. This new functionality is used to implement the ARM and MSP430 interrupt attribute. Patch reviewed by Richard Smith over IRC. llvm-svn: 197343
* PR18246: When performing template argument deduction to decide which templateRichard Smith2013-12-141-3/+3
| | | | | | | | | | is specialized by an explicit specialization, start from the first declaration in case we've got a member of a class template (redeclarations might not number the template parameters the same way). Our recover here is still far from ideal. llvm-svn: 197305
* PR18232: implement instantiation for class-scope explicit specializations ofRichard Smith2013-12-141-2/+138
| | | | | | class templates (a Microsoft extension). llvm-svn: 197298
* Remove an unused parameter and include after r197273Alp Toker2013-12-131-2/+2
| | | | llvm-svn: 197274
* Eliminate BinaryTypeTraitExprAlp Toker2013-12-133-92/+31
| | | | | | | | | | | | | | | | | There's nothing special about type traits accepting two arguments. This commit eliminates BinaryTypeTraitExpr and switches all related handling over to TypeTraitExpr. Also fixes a CodeGen failure with variadic type traits appearing in a non-constant expression. The BTT/TT prefix and evaluation code is retained as-is for now but will soon be further cleaned up. This is part of the ongoing work to unify type traits. llvm-svn: 197273
* Objective-C. Do not issue warning when 'readonly'Fariborz Jahanian2013-12-131-30/+7
| | | | | | | | | | | | | | property declaration has a memory management attribute (retain, copy, etc.). Sich properties are usually overridden to become 'readwrite' via a class extension (which require the memory management attribute specified). In the absence of class extension override, memory management attribute is needed to produce correct Code Gen. for the property getter in any case and this warning becomes confusing to user. // rdar://15641300 llvm-svn: 197251
* [OpenCL] Produce an error when the work group and vec type hint attributesJoey Gouly2013-12-131-0/+19
| | | | | | | | are used on non-kernel functions. Reviewed by Aaron over IRC! llvm-svn: 197243
* Refine 'objc_protocol_requires_explicit_implementation' attribute to better ↵Ted Kremenek2013-12-131-3/+4
| | | | | | handle indirect protocols. llvm-svn: 197209
* Make 'CheckProtocolMethodDefs' a static function.Ted Kremenek2013-12-131-19/+21
| | | | llvm-svn: 197208
* Change 'method X in protocol not implemented' warning to include the name of ↵Ted Kremenek2013-12-131-8/+11
| | | | | | | | | the protocol. This removes an extra "note:", which wasn't really all that more useful and overall reduces the diagnostic spew for this case. llvm-svn: 197207
* Make 'WarnUndefinedMethod' a static function.Ted Kremenek2013-12-131-9/+10
| | | | llvm-svn: 197206
* [objc] If we don't know for sure what the designated initializers of the ↵Argyrios Kyrtzidis2013-12-131-1/+4
| | | | | | | | | superclass are, assume that a [super init..] inside a designated initializer also refers to a designated one and do not warn. llvm-svn: 197202
* Enhance "auto synthesis will not synthesize property in protocol" to include ↵Ted Kremenek2013-12-121-2/+4
| | | | | | | | property and protocol name. Implements <rdar://problem/15617839>. llvm-svn: 197187
* [ms-abi] Fixing bitfields sema arror for ms-modeWarren Hunt2013-12-121-1/+2
| | | | | | | | The check for bitfields that are longer than their base type needed to be checked in microsoft mode (cl.exe does not support the C++ extnetion for bitfields longer than their type). llvm-svn: 197186
* PR18229: Fix typo in assert condition.Richard Smith2013-12-121-1/+1
| | | | llvm-svn: 197185
* Unify type trait parsingAlp Toker2013-12-121-5/+1
| | | | | | | | | | | | | | | | | Type trait parsing is all over the place at the moment with unary, binary and n-ary C++11 type traits that were developed independently at different points in clang's history. There's no good reason to handle them separately -- there are three parsers, three AST nodes and lots of duplicated handling code with slightly different implementations and diags for each kind. This commit unifies parsing of type traits and sets the stage for further consolidation. No change in behaviour other than more consistent error recovery. llvm-svn: 197179
* Suppress -Wshadow / -Wold-style-cast expanded from system header macrosAlp Toker2013-12-122-3/+5
| | | | | | | | Thanks to Jonathan Sauer for providing initial test cases. Fixes PR16093 and PR18147. llvm-svn: 197150
* PR17602: check accessibility when performing an implicit derived-to-baseRichard Smith2013-12-121-9/+10
| | | | | | | conversion on the LHS of a .* or ->*. Slightly improve diagnostics in case of an ambiguous base class. llvm-svn: 197125
* Added a Subjects clause to the section attribute and made its diagnostics ↵Aaron Ballman2013-12-121-6/+0
| | | | | | more consistent with other attributes. llvm-svn: 197104
* PR18217: Rewrite JumpDiagnostics' handling of temporaries, to correctly handleRichard Smith2013-12-121-64/+54
| | | | | | | | | declarations that might lifetime-extend multiple temporaries. In passing, fix a crasher (PR18217) if an initializer was dependent and exactly the wrong shape, and remove a bogus function (Expr::findMaterializedTemporary) now its last use is gone. llvm-svn: 197103
* No longer accepting attribute spellings with prefix and suffix underscores ↵Aaron Ballman2013-12-111-9/+13
| | | | | | except for GNU attributes, or C++11-style attributes in the GNU namespace. This prevents attributes such as __declspec(__dllexport__) or [[__noreturn__]] from being treated as known attributes. llvm-svn: 197082
* Better diagnostic for static override when methods are thiscall by defaultHans Wennborg2013-12-111-0/+7
| | | | | | | | | | | | | | | | | | Methods are thiscall by default in the MS ABI, and also in MinGW targetting GCC 4.7 or later. This changes the diagnostic from the technically correct but hard to understand: virtual function 'foo' has different calling convention attributes ('void ()') than the function it overrides (which has calling convention 'void () __attribute__((thiscall))') to the more intuitive and also correct: 'static' member function 'foo' overrides a virtual function We already have a test for this. Let's just run it in both ABI modes. Differential Revision: http://llvm-reviews.chandlerc.com/D2375 llvm-svn: 197055
* Add front-end infrastructure now address space casts are in LLVM IR.David Tweed2013-12-111-3/+12
| | | | | | | | | | With the introduction of explicit address space casts into LLVM, there's a need to provide a new cast kind the front-end can create for C/OpenCL/CUDA and code to produce address space casts from those kinds when appropriate. Patch by Michele Scandale! llvm-svn: 197036
* When performing a delayed access check, use the surrounding lexical context forRichard Smith2013-12-111-5/+4
| | | | | | any local extern declaration, not just a local extern function. llvm-svn: 197000
* ObjectiveC. Fixes a bug where an 'unused property ivar'Fariborz Jahanian2013-12-111-1/+1
| | | | | | | warning is coming out incorrectly too early becuase of unrelated scope pop. // rdar://15630719 llvm-svn: 196989
* ObjectiveC. Provide a property-dot syntax for fixitFariborz Jahanian2013-12-101-8/+20
| | | | | | | when selector in objc_bridge_related attribute names a property. // rdar://15517899 llvm-svn: 196984
* Objective-C. Minor change to a diagnostic.Fariborz Jahanian2013-12-101-2/+2
| | | | | | // rdar://15499111 llvm-svn: 196977
* Tiny cleanup, as suggested by David Blaikie.Richard Smith2013-12-101-2/+2
| | | | llvm-svn: 196959
* Rename attribute 'objc_suppress_protocol_methods' to ↵Ted Kremenek2013-12-102-14/+7
| | | | | | | | | | | | | | | 'objc_protocol_requires_explicit_implementation'. That's a mouthful, and not necessarily the final name. This also reflects a semantic change where this attribute is now on the protocol itself instead of a class. This attribute will require that a protocol, when adopted by a class, is explicitly implemented by the class itself (instead of walking the super class chain). Note that this attribute is not "done". This should be considered a WIP. llvm-svn: 196955
* Improve on an objc_bridge_related diagnostic.Fariborz Jahanian2013-12-101-6/+6
| | | | | | // rdar://15499111 llvm-svn: 196950
* Objective-C. Provide fixit's for objc_bride_relatedFariborz Jahanian2013-12-103-8/+27
| | | | | | | attributed CF to ObjC type conversions. // rdar://15499111 llvm-svn: 196935
* Implement DR1460: fix handling of default initializers in unions; don't allowRichard Smith2013-12-103-50/+154
| | | | | | | | | more than one such initializer in a union, make mem-initializers override default initializers for other union members, handle anonymous unions with anonymous struct members better. Fix a couple of semi-related bugs exposed by the tests for same. llvm-svn: 196892
* [AArch64 NEON] Support poly128_t and implement relevant intrinsic.Kevin Qin2013-12-101-0/+4
| | | | llvm-svn: 196888
* Take into consideration calling convention when processing specializations.Rafael Espindola2013-12-102-10/+16
| | | | | | This fixes pr18141. llvm-svn: 196855
* Sema: Enforce C++11 pointer-to-member template arguments should rulesDavid Majnemer2013-12-101-3/+1
| | | | | | | | | | | | The standard is pretty clear on what it allows inside of template arguments for non-type template parameters of pointer-to-member. They must be of the form &qualified-id and cannot come from sources like constexpr VarDecls or things of that nature. This fixes PR18192. llvm-svn: 196852
* Objective-C: Improve on various diagnostics related toFariborz Jahanian2013-12-091-69/+83
| | | | | | use of objc_bridge_related attribute. // rdar://15499111 llvm-svn: 196828
* [CMake] clangSema doesn't depend on LLVM CodeGen any more.NAKAMURA Takumi2013-12-091-4/+1
| | | | llvm-svn: 196803
* Rename a variable that I missed in the previous refactoring.Faisal Vali2013-12-091-4/+4
| | | | llvm-svn: 196740
* Fix the message to go along with the assertion that was just fixed.Faisal Vali2013-12-081-1/+1
| | | | | | argh! llvm-svn: 196722
* Fix an assertion introduced by my previous refactoring.Faisal Vali2013-12-081-6/+4
| | | | | | Add back the test that was triggering the assertion (which I removed mistakenly thinking it was triggering just a warning and not an assertion). My error was brought to my attention by Rafael (Thanks!). llvm-svn: 196721
* [REFACTOR] Refactored some of the generic-lambda capturing code.Faisal Vali2013-12-073-135/+247
| | | | | | | | | | | | | | | Employed the following refactorings: - Renamed some functions - Introduced explaining variables - Cleaned up & added comments - Used Optional<unsigned> for return value instead of an out parameter - Added assertions - Constified a few member functions No functionality change. All regressions pass. llvm-svn: 196662
* Eliminate the last trivial NDEBUG uses in clang headersAlp Toker2013-12-071-1/+2
| | | | | | assert(sanity()) reads so much better than preprocessor conditional blocks. llvm-svn: 196657
OpenPOWER on IntegriCloud