summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* [OpenMP] Parsing and sema support for thread_limit clause.Kelvin Li2015-11-272-51/+80
| | | | | | http://reviews.llvm.org/D15029 llvm-svn: 254207
* [mips] Interrupt attribute support.Daniel Sanders2015-11-271-1/+73
| | | | | | | | | | | | | | Summary: This patch adds support for the interrupt attribute for mips32r2+. Patch by Simon Dardis. Reviewers: dsanders, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D10802 llvm-svn: 254205
* Revert r254203: [mips] Interrupt attribute support.Daniel Sanders2015-11-271-73/+1
| | | | | | I forgot to credit the author. llvm-svn: 254204
* [mips] Interrupt attribute support.Daniel Sanders2015-11-271-1/+73
| | | | | | | | | | | | Summary: This patch adds support for the interrupt attribute for mips32r2+. Reviewers: dsanders, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D10802 llvm-svn: 254203
* Fix for merging decls in pragma weakAlexander Musman2015-11-261-8/+13
| | | | | | | Calling CheckFunctionDeclaration so that 2 decls for the 'weak' are merged. Differential Revision: http://reviews.llvm.org/D13048 llvm-svn: 254143
* [OPENMP 4.5] Fixed rules for 'ordered' clause.Alexey Bataev2015-11-261-10/+16
| | | | | | According to OpenMP 4.5 the parameter of 'ordered' clause must be greater than or equal to the parameter of 'collapse' clause. Patch adds this rule. llvm-svn: 254141
* P0002R1: increment on expressions of type bool is no longer allowed in C++1z.Richard Smith2015-11-261-1/+3
| | | | llvm-svn: 254122
* P0001R1: 'register' storage class specifier is no longer permitted in C++1z.Richard Smith2015-11-251-1/+2
| | | | | | | We will still allow it in system headers, in macros from system headers, when combined with an 'asm' label, and under the flag -Wno-register. llvm-svn: 254097
* [MSVC] 'property' with an empty array in array subscript expression.Alexey Bataev2015-11-254-113/+182
| | | | | | | | | | | | MSVC supports 'property' attribute and allows to apply it to the declaration of an empty array in a class or structure definition. For example: ``` __declspec(property(get=GetX, put=PutX)) int x[]; ``` The above statement indicates that x[] can be used with one or more array indices. In this case, i=p->x[a][b] will be turned into i=p->GetX(a, b), and p->x[a][b] = i will be turned into p->PutX(a, b, i); Differential Revision: http://reviews.llvm.org/D13336 llvm-svn: 254067
* [OpenMP] Parsing and sema support for num_teams clauseKelvin Li2015-11-242-1/+55
| | | | | | http://reviews.llvm.org/D14802 llvm-svn: 254019
* Replace [=] lambda capture with [&] per David Blaikieþ suggestion.Yaron Keren2015-11-241-1/+1
| | | | llvm-svn: 254013
* Remove DataRecursiveASTVisitor; it no longer serves any purpose, since it's ↵Richard Smith2015-11-241-2/+2
| | | | | | just an alias for RecursiveASTVisitor. llvm-svn: 253949
* [coroutines] Build a CoroutineBodyStmt when finishing parsing a coroutine, ↵Richard Smith2015-11-241-4/+65
| | | | | | and form the initial_suspend, final_suspend, and get_return_object calls. llvm-svn: 253946
* Replace loop with std::any_of, NFC.Yaron Keren2015-11-231-6/+2
| | | | | | Inspired by similar commits from Craig Topper. llvm-svn: 253904
* [OpenCL 2.0] Apply default address space (AS).Anastasia Stulova2015-11-231-12/+44
| | | | | | | | | | | | If AS of a variable/parameter declaration is not set by the source, OpenCL v2.0 s6.5 defines explicit rules for default ASes: - The AS of global and local static variables defaults to global; - All pointers point to generic AS. http://reviews.llvm.org/D13168 llvm-svn: 253863
* [OpenMP] Parsing and sema support for map clauseKelvin Li2015-11-232-4/+252
| | | | | | http://reviews.llvm.org/D14134 llvm-svn: 253849
* [coroutines] Check for overload sets in co_yield / co_return operands being ↵Richard Smith2015-11-221-11/+8
| | | | | | resolved by a call to yield_value / return_value before rejecting them. llvm-svn: 253817
* [coroutines] Build implicit return_value / return_void calls for co_return.Richard Smith2015-11-221-6/+22
| | | | llvm-svn: 253816
* [coroutines] Materialize the awaitable before generating the await_* calls.Richard Smith2015-11-221-5/+9
| | | | llvm-svn: 253812
* [coroutines] Factor out co_await representation into common base class for ↵Richard Smith2015-11-222-13/+25
| | | | | | co_await and co_yield, and use it to hold await_* calls. llvm-svn: 253811
* [coroutines] Better handling of placeholder types.Richard Smith2015-11-201-6/+30
| | | | llvm-svn: 253731
* [coroutines] Synthesize yield_value call for co_yield.Richard Smith2015-11-201-16/+50
| | | | llvm-svn: 253725
* [coroutines] Per latest wording paper, co_* are no longer permitted in anyRichard Smith2015-11-201-11/+14
| | | | | | unevaluated operands. llvm-svn: 253641
* Change the expression evaluation context from Unevaluated to ↵Faisal Vali2015-11-191-1/+2
| | | | | | | | | | | | ConstantEvaluated while substituting into non-type template argument defaults. Also address a typo from a prior patch that performed a similar fix during Parsing of default non-type template arguments. I left the RAII ExpressionEvaluationContext variable Name as Unevaluated though we had switched the context to ConstantEvaluated. There should be no functionality change here - since when expression evaluation context is popped off, for the most part these two contexts currently behave similarly in regards to lambda diagnostics and odr-use tracking. Like its parsing counterpart, this patch presages the advent of constexpr lambda patches... llvm-svn: 253590
* PR10235: support for vector mode attributes + warning, by Dmitry Polukhin.Alexey Bataev2015-11-191-30/+72
| | | | | | | Add support for vector mode attributes like "attribute((mode(V4SF)))". Also add warning about deprecated vector modes like GCC does. Differential Revision: http://reviews.llvm.org/D14744 llvm-svn: 253551
* [coroutines] Tweak diagnostics to always use fully-qualified name for ↵Richard Smith2015-11-191-0/+6
| | | | | | std::coroutine_traits. llvm-svn: 253535
* Don't actually add the __unsafe_unretained qualifier in MRC;John McCall2015-11-191-0/+20
| | | | | | | | | | | driving a canonical difference between that and an unqualified type is a really bad idea when both are valid. Instead, remember that it was there in a non-canonical way, then look for that in the one place we really care about it: block captures. The net effect closely resembles the behavior of a decl attribute, except still closely following ARC's standard qualifier parsing rules. llvm-svn: 253534
* [Sema] Don't work around a malformed ASTDavid Majnemer2015-11-182-3/+11
| | | | | | | | | | | | We created a malformed TemplateSpecializationType: it was dependent but had a RecordType as it's canonical type. This would lead getAs to crash. r249090 worked around this but we should fix this for real by providing a more appropriate template specialization type as the canonical type. This fixes PR24246. llvm-svn: 253495
* Set flag for lldb when qualified name lookup is being doneEugene Leviant2015-11-181-1/+12
| | | | llvm-svn: 253456
* Don't expose iterators into the list of types on the ASTContext; these areRichard Smith2015-11-181-1/+6
| | | | | | | | unsafe, since many operations on the types can trigger lazy deserialization of more types and invalidate the iterators. This fixes a crasher, but I've not been able to reduce it to a reasonable testcase yet. llvm-svn: 253420
* Produce a better diagnostic for global register variables.Akira Hatanaka2015-11-181-3/+14
| | | | | | | | | | | | | | | | | | Currently, when there is a global register variable in a program that is bound to an invalid register, clang/llvm prints an error message that is not very user-friendly. This commit improves the diagnostic and moves the check that used to be in the backend to Sema. In addition, it makes changes to error out if the size of the register doesn't match the declared variable size. e.g., volatile register int B asm ("rbp"); rdar://problem/23084219 Differential Revision: http://reviews.llvm.org/D13834 llvm-svn: 253405
* [modules] When a #include is mapped to a module import and appears somewhereRichard Smith2015-11-171-4/+6
| | | | | | | | | | | | | | other than the top level, we issue an error. This breaks a fair amount of C++ code wrapping C libraries, where the C library is #included within a namespace / extern "C" combination, because the C library (probably) includes C++ standard library headers which may be within modules. Without modules, this setup is harmless if (and *only* if) the corresponding standard library module was already included outside the namespace, so downgrade the error to a default-error extension in that case, so that it can be selectively disabled for such misbehaving libraries. llvm-svn: 253398
* [Sema] Remove unnecessary typecast of bool to int when passing arguments to ↵Craig Topper2015-11-171-9/+8
| | | | | | diagnostics. NFC llvm-svn: 253316
* [Sema] Combine similar diagnostics using %select. NFCCraig Topper2015-11-173-15/+10
| | | | llvm-svn: 253315
* [Sema] Minor formatting fixes. NFCCraig Topper2015-11-174-6/+6
| | | | llvm-svn: 253314
* [modules] Fix some more cases where we used to reject a conflict between twoRichard Smith2015-11-173-8/+17
| | | | | | | declarations that are not simultaneously visible, and where at least one of them has internal/no linkage. llvm-svn: 253283
* [Sema] Implement several unary type traits more accuratelyDavid Majnemer2015-11-161-19/+32
| | | | | | | | | | | | | | is_empty, is_polymorphic, and is_abstract didn't handle incomplete types correctly. Only non-union class types must be complete for these traits. is_final and is_sealed don't care about the particular spelling of the FinalAttr. is_interface_class should always return false regardless of its input. The type trait can only be satisfied in a mode we do not support (/CLR). llvm-svn: 253184
* [Sema] Use getLangOpts in Sema instead of Preprocessor. Call getTargetInfo ↵Craig Topper2015-11-152-10/+9
| | | | | | on the AST context instead of Preprocessor. NFC llvm-svn: 253175
* [Sema] Fix filename in header. NFCCraig Topper2015-11-151-1/+1
| | | | llvm-svn: 253174
* [Sema] Remove unnecessary includes and forward declarations. NFCCraig Topper2015-11-151-2/+0
| | | | llvm-svn: 253173
* [libclang] Visit TypeAliasTemplateDeclSergey Kalinichev2015-11-151-0/+1
| | | | | | | | This makes TypeAliasTemplateDecl accessible via LibClang and python bindings Differential Revision: http://reviews.llvm.org/D13844 llvm-svn: 253166
* Fix a layering oddity by passing Sema to DeclSpec::Finish instead of ↵Craig Topper2015-11-151-47/+40
| | | | | | DiagnosticsEngine and Preprocessor. Everything the preprocessor was being used for can be acquired from Sema. llvm-svn: 253158
* [Sema] Don't crash trying to diagnose abs called on a pointer typeDavid Majnemer2015-11-151-0/+13
| | | | | | | | | | | | | | | | | Clang tries to figure out if a call to abs is suspicious by looking through implicit casts to look at the underlying, implicitly converted type. Interestingly, C has implicit conversions from pointer-ish types like function to less exciting types like int. This trips up our 'abs' checker because it doesn't know which variant of 'abs' is appropriate. Instead, diagnose 'abs' called on function types upfront. This sort of thing is highly suspicious and is likely indicative of a missing pointer dereference/function call/array index operation. This fixes PR25532. llvm-svn: 253156
* Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFCCraig Topper2015-11-159-42/+35
| | | | llvm-svn: 253155
* Move diagnostics from Parse to Sema to remove Sema's dependency on ↵Craig Topper2015-11-143-3/+0
| | | | | | ParserDiagnostic.h diagnostics. llvm-svn: 253143
* Fix indentation. NFCCraig Topper2015-11-141-6/+6
| | | | llvm-svn: 253142
* Merge some similar diagnostics using %select.Craig Topper2015-11-141-4/+2
| | | | llvm-svn: 253136
* [modules] Allow "redefinition" of typedef of anon tag from unimported submoduleBen Langmuir2015-11-141-1/+2
| | | | | | | | | r233345 started being stricter about typedef names for linkage purposes in non-visible modules, but broke languages without the ODR. rdar://23527954 llvm-svn: 253123
* [Sema] __is_constructible should return false for function typesDavid Majnemer2015-11-131-10/+11
| | | | | | | | While functions types are complete, they cannot be constructed. This fixes PR25513. llvm-svn: 253013
* [modules] Follow the C++ standard's rule for linkage of enumerators: they haveRichard Smith2015-11-132-32/+80
| | | | | | | | | the linkage of the enumeration. For enumerators of unnamed enumerations, extend the -Wmodules-ambiguous-internal-linkage extension to allow selecting an arbitrary enumerator (but only if they all have the same value, otherwise it's ambiguous). llvm-svn: 253010
OpenPOWER on IntegriCloud