summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Objective-C. More tests for both bridging attributes andFariborz Jahanian2014-06-111-1/+1
| | | | | | | a fix to make it work when CFStructs have no definition. // rdar://17238954. llvm-svn: 210690
* Add some comments to TypoCorrectionConsumer.Kaelyn Takata2014-06-111-26/+49
| | | | | | | | | | | Also move the constructor for NamespaceSpecifierSet out of line to improve the class' readability. I meant to do these two things while cleaning up the previous TypoCorrectionConsumer changes and have them folded into those changes. No functionality changed. llvm-svn: 210686
* Sink SpecifierInfo into the only class that uses it.Kaelyn Takata2014-06-111-18/+13
| | | | | | | | | | | | | SpecifierInfo is not used outside of NamespaceSpecifierSet except indirectly through NamespaceSpecifierSet's iterator, so clean up the code a bit by moving SpecifierInfo into NamespaceSpecifierSet. Also drop SpecifierInfo's trivial yet verbose constructor since brace initiialization is sufficient in the only two places the constructor was being explicitly called. No functionality changed. llvm-svn: 210672
* Make a couple of helper classes private to TypoCorrectionConsumer.Kaelyn Takata2014-06-111-81/+87
| | | | | | | | | | | The SpecifierInfo and NamespaceSpecifierSet are now only used by TypoCorrectionConsumer, so treat them as the implementation details of TypoCorrectionConsumer that they are. Also make NamespaceSpecifierSet's method names more style guide compliant. No functionality changed. llvm-svn: 210671
* Clean up the TypoCorrectionConsumer's interface a bit.Kaelyn Takata2014-06-111-37/+26
| | | | | | No functionality changed. llvm-svn: 210670
* Move TypoCorrection filtering into the TypoCorrectionConsumer and make it ↵Kaelyn Takata2014-06-111-257/+253
| | | | | | | | | | | | incremental. The only external/visible functional change that fell out of this refactoring is that there was one less case where the typo caching and/or counting didn't work properly. The result is that a test case had to be moved from typo-correction.cpp to typo-correction-pt2.cpp to avoid the hard-coded limit on per file/TU typo correction attempts. llvm-svn: 210669
* Move a few classes to be before TypoCorrectionConsumer.Kaelyn Takata2014-06-111-129/+134
| | | | | | | | | | | This is in preparation for moving TypoCorrection filtering into the TypoCorrectionConsumer, to separate out some of the purely mechanical churn. It also makes some of the method names in NamespaceSpecifierSet be more style guide compliant. No functionality changed. llvm-svn: 210668
* Add loop unroll pragma supportEli Bendersky2014-06-111-53/+60
| | | | | | | | http://reviews.llvm.org/D4089 Patch by Mark Heffernan. llvm-svn: 210667
* Objective-C. Patch to handle bridge attribute warningsFariborz Jahanian2014-06-111-29/+80
| | | | | | | | correctly when both NSAttributedString and NSMutableAttributedString are specified on the same CFStruct via different typedefs. // rdar://17238954 llvm-svn: 210660
* Allow lookup into dependent bases in more places under -fms-compatibilityReid Kleckner2014-06-111-22/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently allow unqualified lookup for instance methods but not static methods because we can't recover with a semantic 'this->' insertion. ATL headers have static methods that do unqualified lookup into dependent base classes. The pattern looks like: template <typename T> struct Foo : T { static int *getBarFromT() { return Bar; } }; Now we recover as if the user had written: template <typename T> struct Foo : T { static int *getBarFromT() { return Foo::Bar; } }; ... which will eventually look up Bar in T at instantiation time. Now we emit a diagnostic in both cases, and delay lookup in other contexts where 'this' is available and refers to a class with dependent bases. Reviewed by: rsmith Differential Revision: http://reviews.llvm.org/D4079 llvm-svn: 210611
* Related to PR19992: when the GNU alignof-expression extension is applied to anRichard Smith2014-06-101-4/+15
| | | | | | | expression of array-of-unknown-bound type, don't try to complete the array bound, and return the alignment of the element type rather than 1. llvm-svn: 210608
* Recover from missing typenames on template args for MSVC compatibilityReid Kleckner2014-06-102-10/+45
| | | | | | | | | | | | | While matching a non-type template argument against a known template type parameter we now modify the AST's TemplateArgumentLoc to assume the user wrote typename. Under -fms-compatibility, we downgrade our diagnostic from an error to an extwarn. Reviewed by: rsmith Differential Revision: http://reviews.llvm.org/D4049 llvm-svn: 210607
* PR19992: alignof is permitted on an array of unknown bound.Richard Smith2014-06-101-19/+16
| | | | llvm-svn: 210585
* Remove a redundant conditional when caching typo failures.Kaelyn Takata2014-06-101-6/+5
| | | | | | No functionality change. llvm-svn: 210583
* Objective-C. Don't ignore availability attribute whenFariborz Jahanian2014-06-101-1/+4
| | | | | | | doing Objective-C subscript access. // rdar://16842487 PR19682. llvm-svn: 210565
* Don't inherit dll attributes to deleted methods (PR19988)Hans Wennborg2014-06-101-3/+2
| | | | | | | | | | | | | We would previously end up with an error when instantiating the following template: template <typename> struct __declspec(dllimport) S { void foo() = delete; }; S<int> s; error: attribute 'dllimport' cannot be applied to a deleted function llvm-svn: 210550
* Improve checking for dynamic initializers of dllimport fields in template ↵Hans Wennborg2014-06-101-8/+8
| | | | | | | | | instantiation We would previously assert if the initializer was dependent. I also think that checking isConstantInitializer is more correct here than checkInitIsICE. llvm-svn: 210505
* Reduce indentation in ActOnIdExpression, NFCReid Kleckner2014-06-091-51/+48
| | | | llvm-svn: 210499
* Removing an "if (this == nullptr)" check from two print methods. The conditionRichard Trieu2014-06-093-0/+5
| | | | | | | will never be true in a well-defined context. The checking for null pointers has been moved into the caller logic so it does not rely on undefined behavior. llvm-svn: 210498
* Objective-C. Consider block pointer as NSObject as well as conforming toFariborz Jahanian2014-06-091-2/+33
| | | | | | | 'NSCopying' protocol when diagnosing block to ObjC pointer conversion. // rdar://16739120 llvm-svn: 210491
* Allow definition of dllimport static fields in partial specializations (PR19956)Hans Wennborg2014-06-091-2/+4
| | | | | | This expands the logic from r210141 to cover partial specializations too. llvm-svn: 210484
* [C++11] Use 'nullptr'.Craig Topper2014-06-093-9/+9
| | | | llvm-svn: 210448
* Don't include llvm/MC/MCParser throughout all of SemaAlp Toker2014-06-081-1/+2
| | | | | | Requires LLVM r210417. llvm-svn: 210418
* Avoid dubious IdentifierInfo::getNameStart() usesAlp Toker2014-06-072-5/+3
| | | | | | | | These cases in particular were incurring an extra strlen() when we already knew the length. They appear to be leftovers from when the interfaces worked with C strings that have continued to compile due to the implicit StringRef ctor. llvm-svn: 210403
* Delay lookup of simple default template arguments under -fms-compatibilityReid Kleckner2014-06-061-0/+44
| | | | | | | | | | | | | | | | | | MSVC delays parsing of default arguments until instantiation. If the default argument is never used, it is never parsed. We don't model this. Instead, if lookup of a type name fails in a template argument context, we form a DependentNameType, which will be looked up at instantiation time. This fixes errors about 'CControlWinTraits' in atlwin.h. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D3995 llvm-svn: 210382
* Add -Wtautological-undefined-compare and -Wundefined-bool-conversion warningsRichard Trieu2014-06-061-2/+14
| | | | | | to detect underfined behavior involving pointers. llvm-svn: 210372
* Fix DOS-style newlines.Eli Bendersky2014-06-061-181/+181
| | | | | | | | | A previous patch r210330 (and possibly another) introduced DOS-style newlines into a UNIX newline formatted file. Patch by Mark Heffernan (http://reviews.llvm.org/D4046) llvm-svn: 210369
* Retain an expression pack expansion when the parameter pack expansion code asksRichard Smith2014-06-061-2/+27
| | | | | | us to. llvm-svn: 210355
* PR14841: If partial substitution of explicitly-specified template argumentsRichard Smith2014-06-061-0/+11
| | | | | | | | results in a template having too many arguments, but all the trailing arguments are packs, that's OK if we have a partial pack substitution: the trailing pack expansions may end up empty. llvm-svn: 210350
* Replacing r210333 with an improved solution; we should never reach this code ↵Aaron Ballman2014-06-061-2/+3
| | | | | | with any other loop hint options. llvm-svn: 210338
* Quieting a false-positive which was causing the sanitizer bots to go red.Aaron Ballman2014-06-061-1/+1
| | | | llvm-svn: 210333
* Adding a new #pragma for the vectorize and interleave optimization hints.Aaron Ballman2014-06-061-25/+180
| | | | | | Patch thanks to Tyler Nowicki! llvm-svn: 210330
* Fix typosAlp Toker2014-06-062-2/+2
| | | | llvm-svn: 210328
* PR11306 - Variadic template fix-it suggestion. Recover from misplaced or ↵Nikola Smiljanic2014-06-061-3/+4
| | | | | | redundant ellipsis in parameter pack. llvm-svn: 210304
* Add pointer types to global named registerRenato Golin2014-06-051-0/+4
| | | | | | | | | | This patch adds support for pointer types in global named registers variables. It'll be lowered as a pair of read/write_register and inttoptr/ptrtoint calls. Also adds some early checks on types on SemaDecl to avoid the assert. Tests changed accordingly. (PR19837) llvm-svn: 210274
* Don't dynamically initialize dllimport vars (PR19933)Hans Wennborg2014-06-041-0/+6
| | | | | | | | They should be initialized when they're exported. Differential Revision: http://reviews.llvm.org/D4020 llvm-svn: 210217
* [OPENMP] Parsing/Sema for OMPLasprivateClause.Alexander Musman2014-06-042-4/+206
| | | | | | Parsing this clause, allowing it on directive ‘omp simd’ and semantic checks. llvm-svn: 210184
* [OPENMP] Small comment and reformatting fixes.Alexander Musman2014-06-042-79/+68
| | | | | | | | | Fix post-commit review comments by Carlo Bertolli for commit r209660 - OMP collapse clause. Re-formatted TransformOMP* functions in TreeTransform.h with clang-format. llvm-svn: 210169
* Downgrade "definition of dllimport static field" error to warning for class ↵Hans Wennborg2014-06-041-2/+11
| | | | | | | | | | | | | | | | | | | templates (PR19902) This allows us to compile the following kind of code, which occurs in MSVC headers: template <typename> struct S { __declspec(dllimport) static int x; }; template <typename T> int S<T>::x; The definition works similarly to a dllimport inline function definition and gets available_externally linkage. Differential Revision: http://reviews.llvm.org/D3998 llvm-svn: 210141
* Add __builtin_operator_new and __builtin_operator_delete, which act like callsRichard Smith2014-06-031-1/+15
| | | | | | | to the normal non-placement ::operator new and ::operator delete, but allow optimizations like new-expressions and delete-expressions do. llvm-svn: 210137
* [OPENMP] Loop canonical form analysis (Sema)Alexander Musman2014-06-034-17/+511
| | | | | | | | | This patch implements semantic analysis to make sure that the loop is in OpenMP canonical form. This is the form required for 'omp simd', 'omp for' and other loop pragmas. Differential revision: http://reviews.llvm.org/D3778 llvm-svn: 210095
* Implement DR990 and DR1070. Aggregate initialization initializes uninitializedRichard Smith2014-06-031-73/+103
| | | | | | | | | elements from {}, rather than value-initializing them. This permits calling an initializer-list constructor or constructing a std::initializer_list object. (It would also permit initializing a const reference or rvalue reference if that weren't explicitly prohibited by other rules.) llvm-svn: 210091
* PR11410: Extend diagnostic to cover all cases of aggregate initialization, notRichard Smith2014-06-031-5/+5
| | | | | | | | | | just the extremely specific case of a trailing array element that couldn't be initialized because the default constructor for the element type is deleted. Also reword the diagnostic to better match our other context diagnostics and to prepare for the implementation of core issue 1070. llvm-svn: 210083
* The exception-declaration for a function-try-block cannot redeclare aAaron Ballman2014-06-021-4/+8
| | | | | | | function parameter. One of our existing test cases was XFAILed because of this. This fixes the issue and un-XFAILs the test. llvm-svn: 210026
* Fix PR18498: Support explicit template arguments with variadic generic lambdasFaisal Vali2014-06-011-1/+11
| | | | | | | | | | | | | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=18498 This code was resulting in a crash: auto L = [](auto ... v) { }; L.operator()<int>(3); The reason is that the partially-substituted-pack is incorrectly retained within the current-instantiation-scope during template-argument-finalization, and because lambda's are local, there parent instantiation scopes are merged, which leads to the expansion-pattern being retained in the finalized specialization. This patch ensures that once we have finalized deduction of a parameter-pack, we remove the partially-substituted-pack so that it doesn't cause CheckParameterPacksForExpansion to incorrectly inform the caller that it needs to retain the expansion pattern. Thanks to Richard Smith for the review! http://reviews.llvm.org/D2135 llvm-svn: 209992
* Format strings: check against an enum's underlying type.Jordan Rose2014-05-311-11/+18
| | | | | | | | | | | | | This allows us to be more careful when dealing with enums whose fixed underlying type requires special handling in a format string, like NSInteger. A refinement of r163266 from a year and a half ago, which added the special handling for NSInteger and friends in the first place. <rdar://problem/16616623> llvm-svn: 209966
* PR12961 - Extend DR532 to cover C++98/03.Nikola Smiljanic2014-05-311-19/+9
| | | | llvm-svn: 209955
* Diagnose dll attribute on member of class that already has a dll attributeHans Wennborg2014-05-311-7/+16
| | | | | | Differential Revision: http://reviews.llvm.org/D3973 llvm-svn: 209954
* Refactor: use the DeclarationNameInfo form of BuildMemberReferenceExprRichard Smith2014-05-312-199/+155
| | | | | | | consistently, rather than sometimes performing lookup and calling the LookupResult form. No functionality change intended. llvm-svn: 209941
* Start adding support for dllimport/dllexport on classes (PR11170)Hans Wennborg2014-05-302-1/+58
| | | | | | | | | | | | | | | | This implements the central part of support for dllimport/dllexport on classes: allowing the attribute on class declarations, inheriting it to class members, and forcing emission of exported members. It's based on Nico Rieck's patch from http://reviews.llvm.org/D1099. This patch doesn't propagate dllexport to bases that are template specializations, which is an interesting problem. It also doesn't look at the rules when redeclaring classes with different attributes, I'd like to do that separately. Differential Revision: http://reviews.llvm.org/D3877 llvm-svn: 209908
OpenPOWER on IntegriCloud