summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Clarify the error message when the reason the conversion is not viable is ↵Nick Lewycky2015-08-252-1/+2
| | | | | | because the returned value does not match the function return type. llvm-svn: 245979
* [Sema] Handle leading and trailing __ for GNU attributesDavid Majnemer2015-08-251-8/+16
| | | | | | | | | | GNU attributes can have a leading and trailing __ appended/prepended to the attribute name. While the parser and AttributeList::getKind did the right thing, AttributeList::getAttributeSpellingListIndex did not. This fixes PR24565. llvm-svn: 245953
* Fix possible crash on null base or type for array elements.Alexey Bataev2015-08-251-1/+2
| | | | llvm-svn: 245939
* [OPENMP 4.0] Initial support for array sections.Alexey Bataev2015-08-255-4/+229
| | | | | | | | Adds parsing/sema analysis/serialization/deserialization for array sections in OpenMP constructs (introduced in OpenMP 4.0). Currently it is allowed to use array sections only in OpenMP clauses that accepts list of expressions. Differential Revision: http://reviews.llvm.org/D10732 llvm-svn: 245937
* [modules] If local submodule visibility is disabled, don't bother checkingRichard Smith2015-08-241-15/+20
| | | | | | whether the owning module of a hidden declaration is visible -- it can't be. llvm-svn: 245822
* Instantiate function declarations in instantiated functions.Serge Pavlov2015-08-232-11/+5
| | | | | | | | | | | | | | | | | If a function declaration is found inside a template function as in: template<class T> void f() { void g(int x = T::v) except(T::w); } it must be instantiated along with the enclosing template function, including default arguments and exception specification. Together with the patch committed in r240974 this implements DR1484. Differential Revision: http://reviews.llvm.org/D11194 llvm-svn: 245810
* Improve the performance of resolving a lookup result. We usually don't need toRichard Smith2015-08-221-4/+37
| | | | | | | pick the most recent declaration, and we can often tell which declaration is more recent without walking the redeclaration chain. Do so when possible. llvm-svn: 245794
* When building a pseudo-object assignment, and the RHS isJohn McCall2015-08-221-17/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | a contextually-typed expression that semantic analysis will probably need to invasively rewrite, don't include the RHS OVE as a separate semantic expression, and check the operation with the original RHS expression. There are two contextually-typed expressions that can survive to here: overloaded function references, which are at least safe to double-emit, and C++11 initializer list expressions, which are not at all safe to double-emit and which often don't update the original syntactic InitListExpr with implicit conversions to member types, etc. This means that the original RHS may appear, undecorated by an OVE, in the semantic expressions. Fortunately, it will only ever be used in a single place there, and I don't believe there are clients that rely on being able to pick out the original RHS from the semantic expressions. But this could be problematic if there are clients that do visit the entire tree and rely on not seeing the same expression multiple times, once in the syntactic and once in the semantic expressions. This is a very fiddly part of the compiler. rdar://21801088 llvm-svn: 245771
* Fix typo - symetric -> symmetric.Eric Christopher2015-08-211-3/+3
| | | | llvm-svn: 245706
* [OPENMP 4.1] Initial support for 'simdlen' clause.Alexey Bataev2015-08-212-0/+118
| | | | | | Add parsing/sema analysis for 'simdlen' clause in simd directives. Also add check that if both 'safelen' and 'simdlen' clauses are specified, the value of 'simdlen' parameter is less than the value of 'safelen' parameter. llvm-svn: 245692
* [Sema] Don't crash when diagnosing hack in libstdc++David Majnemer2015-08-211-2/+5
| | | | | | | | | | | | While working around a bug in certain standard library implementations, we would try to diagnose the issue so that library implementors would fix their code. However, we assumed an entity being initialized was a non-static data member subobject when other circumstances are possible. This fixes PR24526. llvm-svn: 245675
* [OPENMP 4.1] Improved codegen for 'uval' qualifier of 'linear' clause.Alexey Bataev2015-08-211-5/+15
| | | | | | According to standard the 'uval' modifier declares the address of the original list item to have an invariant value for all iterations of the associated loop(s). Patch improves codegen for this qualifier by removing usage of the original reference variable and replacing by referenced l-value. llvm-svn: 245674
* Fix a few things with -Winfinite-recursion. NFCRichard Trieu2015-08-211-42/+48
| | | | | | | | | | | | | | Now that -Winfinite-recursion no longer uses recursive calls to before path analysis, several bits of the code can be improved. The main changes: 1) Early return when finding a path to the exit block without a recursive call 2) Moving the states vector into checkForRecursiveFunctionCall instead of passing it in by reference 3) Change checkForRecursiveFunctionCall to return a bool when the warning should be emitted. 4) Use the State vector instead of storing it in the Stack vector. llvm-svn: 245666
* [modules] When we see a definition of a function for which we already have aRichard Smith2015-08-212-37/+41
| | | | | | | non-visible definition, skip the new definition to avoid ending up with a function with multiple definitions. llvm-svn: 245664
* PR24483: Delete some dead/incorrect code that triggered assertions.Richard Smith2015-08-201-19/+0
| | | | llvm-svn: 245609
OpenPOWER on IntegriCloud