summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP 4.5] Parsing/sema for 'num_tasks' clause.Alexey Bataev2015-12-082-0/+81
| | | | | | OpenMP 4.5 adds directives 'taskloop' and 'taskloop simd'. These directives support clause 'num_tasks'. Patch adds parsing/semantic analysis for this clause. llvm-svn: 255008
* [Sema] Remove tab characters. NFCCraig Topper2015-12-081-2/+2
| | | | llvm-svn: 255004
* Add parse and sema for OpenMP distribute directive and all its clauses ↵Carlo Bertolli2015-12-082-9/+175
| | | | | | excluding dist_schedule. llvm-svn: 255001
* [OPENMP 4.5] parsing/sema support for 'grainsize' clause.Alexey Bataev2015-12-072-0/+44
| | | | | | OpenMP 4.5 adds 'taksloop' and 'taskloop simd' directives, which have 'grainsize' clause. Patch adds parsing/sema analysis of this clause. llvm-svn: 254903
* [OPENMP 4.5] parsing/sema support for 'nogroup' clause.Alexey Bataev2015-12-072-0/+19
| | | | | | OpenMP 4.5 adds 'taskloop' and 'taskloop simd' directives. These directives have new 'nogroup' clause. Patch adds basic parsing/sema support for this clause. llvm-svn: 254899
* Fix PR20334: invalid assertion while diagnosing list initialization failureFaisal Vali2015-12-071-1/+3
| | | | | | | | | | | | | https://llvm.org/bugs/show_bug.cgi?id=20334 Unfortunately, clang currently checks for a certain brokenness of implementations of std::initializer_list in CodeGen (void AggExprEmitter::VisitCXXStdInitializerListExpr), not in SemaInit. Until that is fixed, make sure we don't let broken attempts that are aggregates leak through into sema, which allows maintenance of expected invariants, and avoids triggering an assertion. llvm-svn: 254889
* PR25731: namespace alias declarations can appear at block scope; ensure that weRichard Smith2015-12-031-10/+20
| | | | | | | | | do scope-based lookup when looking for redeclarations of them. Add some related missing checks for the scope-based redeclaration lookup: properly filter the list of found declarations to match the scope, and diagnose shadowing of a template parameter name. llvm-svn: 254663
* Add tests for `&enable_if_function` diagnostics.George Burgess IV2015-12-031-1/+0
| | | | | | | | The introduction of pass_object_size fixed a few bugs related to taking the address of a function with enable_if attributes. This patch adds tests for the cases that were fixed. llvm-svn: 254646
* Revert "Fix for merging decls in pragma weak Calling ↵Alexander Kornienko2015-12-031-13/+8
| | | | | | | | | | | | CheckFunctionDeclaration so that 2 decls for the 'weak' are merged. Differential Revision: http://reviews.llvm.org/D13048" This reverts commit r254143 which introduces a crash on the following input: f(char *); g(char *); #pragma weak f = g int g(char *p) {} llvm-svn: 254605
* [OPENMP 4.5] Parsing/sema support for 'omp taskloop simd' directive.Alexey Bataev2015-12-032-12/+108
| | | | | | OpenMP 4.5 adds directive 'taskloop simd'. Patch adds parsing/sema analysis for 'taskloop simd' directive and its clauses. llvm-svn: 254597
* PR25575: Make GCC 4.4+ comatible layout for packed bit-fileds of char type, ↵Alexey Bataev2015-12-031-9/+6
| | | | | | | | | patch by D. Polukhin This CL is for discussion how to better fix bit-filed layout compatibility issue with GCC (see PR25575 for test case and more details). Current clang behavior is compatible with GCC 4.1-4.3 series but it was fixed in 4.4+. Ignoring packed attribute looks very odd and because it was also fixed in GCC 4.4+, it makes sense also fix it in clang. Differential Revision: http://reviews.llvm.org/D14872 llvm-svn: 254596
* Fix a comment typo from r251874.Nico Weber2015-12-031-1/+1
| | | | llvm-svn: 254579
* PR17381: Treat undefined behavior during expression evaluation as an unmodeledRichard Smith2015-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | side-effect, so that we don't allow speculative evaluation of such expressions during code generation. This caused a diagnostic quality regression, so fix constant expression diagnostics to prefer either the first "can't be constant folded" diagnostic or the first "not a constant expression" diagnostic depending on the kind of evaluation we're doing. This was always the intent, but didn't quite work correctly before. This results in certain initializers that used to be constant initializers to no longer be; in particular, things like: float f = 1e100; are no longer accepted in C. This seems appropriate, as such constructs would lead to code being executed if sanitizers are enabled. llvm-svn: 254574
* Add the `pass_object_size` attribute to clang.George Burgess IV2015-12-029-59/+321
| | | | | | | | | | | | | `pass_object_size` is our way of enabling `__builtin_object_size` to produce high quality results without requiring inlining to happen everywhere. A link to the design doc for this attribute is available at the Differential review link below. Differential Revision: http://reviews.llvm.org/D13263 llvm-svn: 254554
* [OpenMP] Update target directive codegen to use 4.5 implicit data mappings.Samuel Antao2015-12-023-10/+125
| | | | | | | | | | | | | | | Summary: This patch implements the 4.5 specification for the implicit data maps. OpenMP 4.5 specification changes the default way data is captured into a target region. All the non-aggregate kinds are passed by value by default. This required activating the capturing by value during SEMA for the target region. All the non-aggregate values that can be encoded in the size of a pointer are properly casted and forwarded to the runtime library. On top of fixing the previous weird behavior for mapping pointers in nested data regions (an explicit map was always required), this also improves performance as the number of allocations/transactions to the device per non-aggregate map are reduced from two to only one - instead of passing a reference and the value, only the value passed. Explicit maps will be added later on once firstprivate, private, and map clauses' SEMA and parsing are available. Reviewers: hfinkel, rjmccall, ABataev Subscribers: cfe-commits, carlo.bertolli Differential Revision: http://reviews.llvm.org/D14940 llvm-svn: 254521
* [OPENMP 4.5] Parsing/sema analysis for 'priority' clause.Alexey Bataev2015-12-012-9/+60
| | | | | | OpenMP 4.5 defines new clause 'priority' for 'task', 'taskloop' and 'taskloop simd' directives. Added parsing and sema analysis for 'priority' clause in 'task' and 'taskloop' directives. llvm-svn: 254398
* [OPENMP 4.5] Parsing/sema analysis for 'taskloop' directive.Alexey Bataev2015-12-012-12/+113
| | | | | | Adds initial parsing and semantic analysis for 'taskloop' directive. llvm-svn: 254367
* [MS Compat] Adjust thiscall to cdecl when deducing template argumentsDavid Majnemer2015-11-301-2/+11
| | | | | | | | | | Function types can be extracted from member pointer types. However, the type is not appropriate without first adjusting the calling convention. This fixes PR25661. llvm-svn: 254323
* [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
OpenPOWER on IntegriCloud