summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* [OPENMP 4.0] Add 'if' clause for 'cancel' directive.Alexey Bataev2015-09-181-5/+7
| | | | | | Add parsing, sema analysis and codegen for 'if' clause in 'cancel' directive. llvm-svn: 247976
* Fix for assertion fail for pragma weak on typedef.Alexander Musman2015-09-182-3/+10
| | | | | | | | | | Example: typedef int __td3; #pragma weak td3 = __td3 Differential Revision: http://reviews.llvm.org/D12904 llvm-svn: 247975
* Support __builtin_ms_va_list.Charles Davis2015-09-173-33/+98
| | | | | | | | | | | | | | | | | | Summary: This change adds support for `__builtin_ms_va_list`, a GCC extension for variadic `ms_abi` functions. The existing `__builtin_va_list` support is inadequate for this because `va_list` is defined differently in the Win64 ABI vs. the System V/AMD64 ABI. Depends on D1622. Reviewers: rsmith, rnk, rjmccall CC: cfe-commits Differential Revision: http://reviews.llvm.org/D1623 llvm-svn: 247941
* MS ABI: Don't allow dllexport/import on lambdasHans Wennborg2015-09-151-0/+8
| | | | | | | This is to follow up on David's comment in http://reviews.llvm.org/D12422#235509 llvm-svn: 247718
* Allow static local variables specified on data-sharing attribute clauses.Kelvin Li2015-09-151-1/+1
| | | | | | http://reviews.llvm.org/D11619 llvm-svn: 247715
* [OPENMP] Emit an additional note during analysis of 'if' clause.Alexey Bataev2015-09-151-1/+7
| | | | | | Patch adds emission of additional note for 'if' clauses with name modifiers in case if 'if' clause without name modified was specified or 'if' clause with the same name modifier was specified. llvm-svn: 247706
* [OPENMP] Emit __kmpc_cancel_barrier() and code for 'cancellation point' only ↵Alexey Bataev2015-09-151-14/+36
| | | | | | | | | | | | | | if 'cancel' is found. Patch improves codegen for OpenMP constructs. If the OpenMP region does not have internal 'cancel' construct, a call to 'void __kmpc_barrier()' runtime function is generated for all implicit/explicit barriers. If the region has inner 'cancel' directive, then ``` if (__kmpc_cancel_barrier()) exit from outer construct; ``` code is generated. Also, the code for 'canellation point' directive is not generated if parent directive does not have 'cancel' directive. llvm-svn: 247681
* [OpenCL] Add new types for OpenCL 2.0.Alexey Bader2015-09-152-0/+19
| | | | | | | | Patch by Pedro Ferreira. Reviewers: pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D12855 llvm-svn: 247676
* [MS ABI] Restore our warning for overwide bitfields using the MS ABIDavid Majnemer2015-09-151-19/+26
| | | | | | This restores a diagnostic lost in r247651. llvm-svn: 247659
* [modules] A using-declaration doesn't introduce a new entity, just a new nameRichard Smith2015-09-152-1/+7
| | | | | | | for an existing entity, and as such a using-declaration doesn't need to conflict with a hidden entity (nor vice versa). llvm-svn: 247654
* [MS ABI] Overwide bool bitfields should be permittedDavid Majnemer2015-09-151-4/+7
| | | | | | | | Overwide bool bitfields have eight bits of storage size, make sure we take the padding into account when determining whether or not they are problematic. llvm-svn: 247651
* Prevent implicit re-interpret casts between ExtVector and Scalar types.Stephen Canon2015-09-151-0/+8
| | | | | | Previously, in certain cases lax vector conversions could occur between scalar floating-point values and ExtVector types; these conversions would be simple bitcasts. We need to allow them with other vector types to support some common headers, but we don't need them for ExtVector. Preventing them here makes them behave like other operations involving scalars and ExtVectors. llvm-svn: 247643
* PR24595: Ignore calling convention modifiers for structors in MS ABI.Andrey Bokhanko2015-09-143-12/+37
| | | | | | | | | | MS compiler ignores calling convention modifiers for structors. This patch makes clang do the same (for MS ABI). This fixes PR24595 and makes vswriter.h header (from Windows SDK 8.1) compilable. Differential Revision: http://reviews.llvm.org/D12402 llvm-svn: 247619
* C11 _Bool bitfield diagnosticRachel Craik2015-09-141-10/+10
| | | | | | | | | | | | Summary: Implement DR262 (for C). This patch will mainly affect bitfields of type _Bool Reviewers: fraggamuffin, rsmith Subscribers: hubert.reinterpretcast, cfe-commits Differential Revision: http://reviews.llvm.org/D10018 llvm-svn: 247618
* [Sema] Reject value-initialization of function typesDavid Majnemer2015-09-141-0/+9
| | | | | | | | | T in the expression T() must be a non-array complete object type or the void type. Function types are neither. This fixes PR24798. llvm-svn: 247535
* Test commit.Kelvin Li2015-09-121-1/+0
| | | | llvm-svn: 247503
* [modules] When picking one of two template declarations as a lookup result,Richard Smith2015-09-111-1/+16
| | | | | | | | it's not sufficient to prefer the declaration with more default arguments, or the one that's visible; they might both be visible, but one of them might have a visible default argument where the other has a hidden default argument. llvm-svn: 247486
* Simplify logic introduced in r247464.David Majnemer2015-09-111-3/+3
| | | | llvm-svn: 247472
* [MS ABI] Select an inheritance model in template argumentsDavid Majnemer2015-09-111-3/+5
| | | | | | | | | | | | We used to only select an inheritance model if the pointer to member was nullptr. Instead, select a model regardless of the member pointer's value. N.B. This bug was exposed by making member pointers report true for isIncompleteType but has been latent since the member pointer scheme's inception. llvm-svn: 247464
* [sema] Fix assertion hit when using libclang to index a particular C++ ↵Argyrios Kyrtzidis2015-09-111-2/+7
| | | | | | | | snippet involving templates. Assertion hit was in ClassTemplateSpecializationDecl::getSourceRange(). llvm-svn: 247373
* [MS ABI] Remove another call to RequireCompleteTypeDavid Majnemer2015-09-111-4/+0
| | | | | | | | I cannot come up with a testcase which would rely on this call to RequireCompleteType, I believe that it is superfluous given the current state of clang. llvm-svn: 247367
* [MS ABI] Make member pointers return true for isIncompleteTypeDavid Majnemer2015-09-103-22/+12
| | | | | | | The type of a member pointer is incomplete if it has no inheritance model. This lets us reuse more general logic already embedded in clang. llvm-svn: 247346
* [OPENMP] Propagate alignment from original variables to the private copies.Alexey Bataev2015-09-101-17/+37
| | | | | | Currently private copies of captured variables have default alignment. Patch makes private variables to have same alignment as original variables. llvm-svn: 247260
* [OPENMP] Outlined function for parallel and other regions with list of ↵Alexey Bataev2015-09-101-5/+10
| | | | | | | | | captured variables. Currently all variables used in OpenMP regions are captured into a record and passed to outlined functions in this record. It may result in some poor performance because of too complex analysis later in optimization passes. Patch makes to emit outlined functions for parallel-based regions with a list of captured variables. It reduces code for 2*n GEPs, stores and loads at least. Codegen for task-based regions remains unchanged because runtime requires that all captured variables are passed in captured record. llvm-svn: 247251
* [MS ABI] Select a pointer to member representation more oftenDavid Majnemer2015-09-103-1/+11
| | | | | | | | | Given a reference to a pointer to member whose class's inheritance model is unspecified, make sure we come up with an inheritance model in plausible places. One place we were missing involved LValue to RValue conversion, another involved unary type traits. llvm-svn: 247248
* Fix access control for lookups using the Microsoft __super extension.John McCall2015-09-091-2/+15
| | | | | | rdar://22464808 llvm-svn: 247207
* [Concepts] Add diagnostic; invalid specifier on function or variable concept ↵Nathan Wilson2015-09-091-1/+43
| | | | | | | | | | | | | | declaration Summary: Diagnose variable and function concept declarations when an invalid specifier appears Reviewers: rsmith, aaron.ballman, faisalv, fraggamuffin, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12435 llvm-svn: 247194
* Introduce __builtin_nontemporal_store and __builtin_nontemporal_load.Michael Zolotukhin2015-09-081-0/+75
| | | | | | | | | | | | | Summary: Currently clang provides no general way to generate nontemporal loads/stores. There are some architecture specific builtins for doing so (e.g. in x86), but there is no way to generate non-temporal store on, e.g. AArch64. This patch adds generic builtins which are expanded to a simple store with '!nontemporal' attribute in IR. Differential Revision: http://reviews.llvm.org/D12313 llvm-svn: 247104
* Don't allow dllexport/import on static local variablesHans Wennborg2015-09-041-2/+4
| | | | | | | | They might technically have external linkage, but it still doesn't make sense for the user to try and export such variables. This matches MSVC's and MinGW's behaviour. llvm-svn: 246864
* [OPENMP] Fix false diagnostic on instantiation-dependent exprs for atomic ↵Alexey Bataev2015-09-041-40/+48
| | | | | | | | constructs. Some of instantiation-dependent expressions could cause false diagnostic to be emitted about unsupported atomic constructs. Relaxed rules for detection of incorrect expressions. llvm-svn: 246853
* Fix the perentheses location when the constructor is called on a class that ↵Olivier Goffart2015-09-041-2/+5
| | | | | | has a destructor llvm-svn: 246844
* Cleanups, no functionality change.Richard Smith2015-09-041-18/+13
| | | | llvm-svn: 246837
* Fix a potential APInt memory leak when using __attribute__((flag_enum)), andRichard Smith2015-09-042-48/+21
| | | | | | simplify the implementation a bit. llvm-svn: 246830
* [OPENMP] Fix for http://llvm.org/PR24687: ICE on compilation of R package TPmsm.Alexey Bataev2015-09-031-15/+15
| | | | | | Fixed capturing of VLAs in 'private' clause of the OpenMP directives. llvm-svn: 246757
* [OPENMP 4.1] Parsing/sema analysis for extended format of 'if' clause.Alexey Bataev2015-09-032-35/+189
| | | | | | | | | | | | | | | | | OpenMP 4.1 added special 'directive-name-modifier' to the 'if' clause. Format of 'if' clause is as follows: ``` if([ directive-name-modifier :] scalar-logical-expression) ``` The restriction rules are also changed. 1. If any 'if' clause on the directive includes a 'directive-name-modifier' then all 'if' clauses on the directive must include a 'directive-name-modifier'. 2. At most one 'if' clause without a 'directive-name-modifier' can appear on the directive. 3. At most one 'if' clause with some particular 'directive-name-modifier' can appear on the directive. 'directive-name-modifier' is important for combined directives and allows to separate conditions in 'if' clause for simple sub-directives in combined directive. This 'directive-name-modifier' identifies the sub-directive to which this 'if' clause must be applied. llvm-svn: 246747
* [Sema] Avoid crash on tag-type mismatch (Fixes PR24610)Vedant Kumar2015-09-021-0/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D12444 llvm-svn: 246618
* Fix assertion failure in TransformOpaqueValueExprHubert Tong2015-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: `OpaqueValueExpr`s may not have a source expression (as in the case when they are created due to a default argument error). This can cause an assertion failure in `TransformOpaqueValueExpr` during template instantiation. This patch fixes the assertion failure. Reviewers: hfinkel, rsmith Subscribers: fraggamuffin, cfe-commits Differential Revision: http://reviews.llvm.org/D11582 Patch by Rachel Craik! llvm-svn: 246600
* Add a new frontend warning for referencing members from the handler of a ↵Aaron Ballman2015-09-018-33/+65
| | | | | | | | constructor or destructor function-try-block, which is UB in C++. This corresponds to the CERT secure coding rule ERR53-CPP. llvm-svn: 246548
* [MS ABI] Correctly mangle classes without names for linkage purposesDavid Majnemer2015-08-312-21/+27
| | | | | | | | | | | | | | | | A class without a name for linkage purposes gets a name along the lines of <unnamed-type-foo> where foo is either the name of a declarator which defined it (like a variable or field) or a typedef-name (like a typedef or alias-declaration). We handled the declarator case correctly but it would fall down during template instantiation if the declarator didn't share the tag's type. We failed to handle the typedef-name case at all. Instead, keep track of the association between the two and keep it up to date in the face of template instantiation. llvm-svn: 246469
* [OpenCL] Improve diagnostics detecting implicit vector conversion.Alexey Bader2015-08-301-0/+12
| | | | | | | | Reviewers: pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D12470 llvm-svn: 246393
* [OpenMP] Make the filetered clause iterator a real iterator and type safe.Benjamin Kramer2015-08-301-14/+8
| | | | | | | | | This replaces the filtered generic iterator with a type-specfic one based on dyn_cast instead of comparing the kind enum. This allows us to use range-based for loops and eliminates casts. No functionality change intended. llvm-svn: 246384
* Follow-up to r246338: use getParentFunctionOrMethodHans Wennborg2015-08-281-1/+1
| | | | llvm-svn: 246348
* PR24612: Don't bail out of checking a constexpr function before checkingRichard Smith2015-08-281-3/+3
| | | | | | | whether it can ever produce a constant expression in the case where it has a void return type and no return statements. llvm-svn: 246347
* Allow TLS vars in dllimport/export functions; only inline dllimport ↵Hans Wennborg2015-08-281-3/+11
| | | | | | | | | | | | | | | | | | | | | functions when safe (PR24593) This patch does two things: 1) Don't error about dllimport/export on thread-local static local variables. We put those attributes on static locals in dllimport/export functions implicitly in case the function gets inlined. Now, for TLS variables this is a problem because we can't import such variables, but it's a benign problem becase: 2) Make sure we never inline a dllimport function TLS static locals. In fact, never inline a dllimport function that references a non-imported function or variable (because these are not defined in the importing library). This seems to match MSVC's behaviour. Differential Revision: http://reviews.llvm.org/D12422 llvm-svn: 246338
* fix typo; NFCSanjay Patel2015-08-281-1/+1
| | | | llvm-svn: 246303
* [CUDA] Check register names on appropriate side of cuda compilation only.Artem Belevich2015-08-272-8/+14
| | | | | | Differential Revision: http://reviews.llvm.org/D11950 llvm-svn: 246193
* [ms-inline-asm] Add field access to MS inline asm identifier lookupReid Kleckner2015-08-261-7/+55
| | | | | | | | | | | | | | Now we can parse code like this: struct A { int field; }; int f(A o) { __asm mov eax, o.field } Fixes PR19117. llvm-svn: 246088
* [Sema] Don't assume CallExpr::getDirectCallee will succeedDavid Majnemer2015-08-261-1/+1
| | | | | | | | | | We tried to provide a very nice diagnostic when diagnosing an assignment to a const int & produced by a function call. However, we cannot always determine what function was called. This fixes PR24568. llvm-svn: 246014
* Modify DeclaratorChuck::getFunction to be passed an Exception Specification ↵Nathan Wilson2015-08-263-7/+25
| | | | | | | | | | | | | | | | | SourceRange Summary: - Store the exception specification range's begin and end SourceLocation in DeclaratorChuck::FunctionTypeInfo. These SourceLocations can be used in a FixItHint Range. - Add diagnostic; function concept having an exception specification. Reviewers: hubert.reinterpretcast, fraggamuffin, faisalv, aaron.ballman, rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11789 llvm-svn: 246005
* Make sure that we evaluate __attribute__((enable_if)) on a method with no ↵Nick Lewycky2015-08-251-1/+34
| | | | | | overloads. Patch by Ettore Speziale! llvm-svn: 245985
OpenPOWER on IntegriCloud