summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for System z vector language extensionsUlrich Weigand2015-07-304-28/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The z13 vector facility has an associated language extension, closely modeled on AltiVec/VSX. The main differences are: - vector long, vector float and vector pixel are not supported - vector long long and vector double are supported (like VSX) - comparison operators return a vector rather than a scalar integer - shift operators behave like the OpenCL shift operators - vector bool is only supported as argument to certain operators; some operators allow mixing a bool with a non-bool vector This patch adds clang support for the extension. It is closely modelled on the AltiVec support. Similarly to the -faltivec option, there's a new -fzvector option to enable the extensions (as well as an -mzvector alias for compatibility with GCC). There's also a separate LangOpt. The extension as implemented here is intended to be compatible with the -mzvector extension recently implemented by GCC. Based on a patch by Richard Sandiford. Differential Revision: http://reviews.llvm.org/D11001 llvm-svn: 243642
* [OPENMP 4.1] Initial support for extended 'ordered' clause.Alexey Bataev2015-07-302-48/+125
| | | | | | | | OpenMP 4.1 introduces optional argument '(n)' for 'ordered' clause, where 'n' is a number of loops that immediately follow the directive. 'n' must be constant positive integer expressions and it must be less or equal than the number of the loops in the resulting loop nest. Patch adds parsing and semantic analysis for this optional argument. llvm-svn: 243635
* Fix -Wredundant-move warning.Richard Trieu2015-07-291-30/+3
| | | | | | | | | Without DR1579 implemented, the only case for -Wredundant-move is for a parameter being returned with the same type as the function return type. Also include a check to verify that the move constructor will be used by matching nodes in the AST dump. llvm-svn: 243594
* [modules] When performing redeclaration lookup for a using declaration, preferRichard Smith2015-07-291-26/+58
| | | | | | | | | | UsingShadowDecls over other declarations of the same entity in the lookup results. This ensures that we build correct redeclaration chains for the UsingShadowDecls (otherwise we could see assertions and other misbehavior in modules builds, when merging combines multiple redeclaration chains for the same entity from the same module into one chain). llvm-svn: 243592
* [SemaAccess] Provide meaningful message when we hit llvm_unreachable().Davide Italiano2015-07-291-1/+1
| | | | llvm-svn: 243571
* Disable -Wpessimizing-move and -Wredundant-move in template instantiations.Richard Trieu2015-07-291-0/+3
| | | | | | | | | Dependent types can throw off the analysis for these warnings, possibly giving conflicting warnings and fix-its. Disabling the warning in template instantiations will prevent this problem, and will still catch the non-dependent cases in templates. llvm-svn: 243538
* Do not give a -Wredundant-move warning when removing the move will result in anRichard Trieu2015-07-281-1/+11
| | | | | | | | | error. If the object being moved has a move constructor and a deleted copy constructor, std::move is required, otherwise Clang will give a deleted constructor error. llvm-svn: 243463
* [sema] Fix crash when typo-transforming an expression containing an ObjC ↵Argyrios Kyrtzidis2015-07-281-5/+4
| | | | | | | | super message expression. rdar://21427916 llvm-svn: 243387
* [sema] Fix infinite loop when using a boolean value as designated initializer.Argyrios Kyrtzidis2015-07-271-8/+6
| | | | | | | For designated indices use the max array size type bitwidth, not the bitwidth of the index value itself. rdar://21942503 llvm-svn: 243343
* [OpenMP] Add capture for threadprivate variables used in copyin clauseSamuel Antao2015-07-271-3/+14
| | | | | | if TLS is enabled in OpenMP code generation. llvm-svn: 243277
* [MS Extensions] Remove support for the i128 integer literal suffixDavid Majnemer2015-07-261-13/+1
| | | | | | | | | | | | | There is currently no support in MSVC for using i128 as an integer literal suffix. In fact, there appears to be no evidence that they have ever supported this feature in any of their compilers. This was an over generalization of their actual feature and is a nasty source of bugs. Why is it a source of bugs? Because most code in clang expects that evaluation of an integer constant expression won't give them something that 'long long' can't represent. Instead of providing a meaningful feature, i128 gives us cute ways of exploding the compiler. llvm-svn: 243243
* [Sema] Refactor AddAlignedAttr to reduce indentationDavid Majnemer2015-07-261-19/+19
| | | | | | No functionality change intended, just a tidy-up. llvm-svn: 243242
* [Sema] The alignment of an object has an upper bound from the object file formatDavid Majnemer2015-07-261-2/+4
| | | | | | | Don't use the spelling of the alignment attribute to determine whether or not an alignment amount makes sense. llvm-svn: 243233
* [AST] Turn the callbacks of lookupInBases and forallBases into a function_refBenjamin Kramer2015-07-256-170/+145
| | | | | | | | | This lets us pass functors (and lambdas) without void * tricks. On the downside we can't pass CXXRecordDecl's Find* members (which are now type safe) to lookupInBases directly, but a lambda trampoline is a small price to pay. No functionality change intended. llvm-svn: 243217
* [SemaTemplate] Detect instantiation of unparsed exceptions.Davide Italiano2015-07-251-1/+7
| | | | | | | | This fixes the clang crash reported in PR24000. Differential Revision: http://reviews.llvm.org/D11341 llvm-svn: 243196
* [code-completion] Strip outer nullability annotations when completing method ↵Argyrios Kyrtzidis2015-07-241-3/+6
| | | | | | | | | | | | implementations. The outer nullability is transferred from the declaration to the implementation so including them is redundant. The inner ones are not transferred so they are kept to match the exact types. When we transfer the inner ones as well adding them in the implementation will become redundant and we should strip those as well. rdar://21737451 llvm-svn: 243119
* Silence a "not all control paths return a value" warning from MSVC. Should ↵Aaron Ballman2015-07-241-1/+2
| | | | | | also silence a -Wreturn-type warning. NFC intended. llvm-svn: 243109
* Cleanup ObjCInterfaceDecl lookup for ObjC literalsAlex Denisov2015-07-241-99/+98
| | | | llvm-svn: 243092
* Fix the equal-vector-size rule for reinterpret_casts in C++John McCall2015-07-232-21/+32
| | | | | | | | | | | | | to consider the storage size of the vector instead of its sizeof. In other words, ban <3 x int> to <4 x int> casts, which produced invalid IR anyway. Also, attempt to be a little more rigorous, or at least explicit, about when enums are allowed in these casts. rdar://21901132 llvm-svn: 243069
* Sema: Avoid a stack overflow on large CFGsDuncan P. N. Exon Smith2015-07-231-16/+24
| | | | | | | | | Large CFGs cause `checkForFunctionCall()` to overflow its stack. Break the recursion by manually managing the call stack instead. Patch by Vedant Kumar! llvm-svn: 243039
* Sema: Split out helper from checkForFunctionCall(), NFCDuncan P. N. Exon Smith2015-07-231-37/+37
| | | | | | | | | | Split out `hasRecursiveCallInPath()` from `checkForFunctionCall()` to flatten nesting and clarify the code. This also simplifies a follow-up patch that refactors the other logic in `checkForFunctionCall()`. Patch by Vedant Kumar! llvm-svn: 243038
* Downgrade error about adding 'dllimport' to used free function to warning ↵Hans Wennborg2015-07-221-3/+9
| | | | | | | | (PR24215) The code will still work as it can reference the function via its thunk. llvm-svn: 242973
* [CONCEPTS] Add diagnostics: non-defining function; non-namespace scopeHubert Tong2015-07-221-0/+26
| | | | | | | | | | | | | | | | | | | | | Summary: Create diagnostic for function concept declaration which is not a definition. Create diagnostic for concept declaration which isn't in namespace scope. Create associated tests. Reviewers: rsmith, faisalv, fraggamuffin, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11027 Patch by Nathan Wilson! llvm-svn: 242899
* [modules] Stop performing PCM lookups for all identifiers when building with ↵Richard Smith2015-07-221-0/+3
| | | | | | C++ modules. Instead, serialize a list of interesting identifiers and mark those ones out of date on module import. Avoiding the identifier lookups here gives a 20-30% speedup in builds with large numbers of modules. No functionality change intended. llvm-svn: 242868
* [Sema] Diagnose use of declaration correctly.Davide Italiano2015-07-221-9/+1
| | | | | | | | | | | | | Before we skipped that for virtual functions not fully qualified (r81507). This commit basically reverts this to the older behaviour, which seems more consistent. We now also correctly consider ill-formed calls to deleted member functions, which were silently passed before in some cases. The review contains the whole discussion. PR: 20268 Differential Revision: http://reviews.llvm.org/D11334 llvm-svn: 242857
* [modules] In C++, stop serializing and deserializing a list of declarations inRichard Smith2015-07-212-45/+26
| | | | | | | | | the identifier table. This is redundant, since the TU-scope lookups are also serialized as part of the TU DeclContext, and wasteful in a number of ways. We still emit the decls for PCH / preamble builds, since for those we want identical results, not merely semantically equivalent ones. llvm-svn: 242855
* Use range-based for loops; NFC.Aaron Ballman2015-07-211-10/+6
| | | | llvm-svn: 242846
* Use a range-based for loop; NFC.Aaron Ballman2015-07-211-2/+2
| | | | llvm-svn: 242836
* Replace some uses of Self.Context with the local variable C; NFC.Aaron Ballman2015-07-211-14/+14
| | | | llvm-svn: 242835
* Commit for http://reviews.llvm.org/D10765Michael Wong2015-07-212-1/+26
| | | | | | | for OpenMP 4 target data directive parsing and sema. This commit is on behalf of Kelvin Li. llvm-svn: 242785
* Ignore the "novtable" declspec when not using the Microsoft C++ ABI.Bob Wilson2015-07-202-4/+5
| | | | | | | | | | | | | | Clang used to silently ignore __declspec(novtable). It is implemented now, but leaving the vtable uninitialized does not work when using the Itanium ABI, where the class layout for complex class hierarchies is stored in the vtable. It might be possible to honor the novtable attribute in some simple cases and either report an error or ignore it in more complex situations, but it’s not clear if that would be worthwhile. There is also value in having a simple and predictable behavior, so this changes clang to simply ignore novtable when not using the Microsoft C++ ABI. llvm-svn: 242730
* [MS Compat] Add support for __declspec(noalias)David Majnemer2015-07-201-0/+3
| | | | | | | The attribute '__declspec(noalias)' communicates that the function only accesses memory pointed to by its pointer-typed arguments. llvm-svn: 242728
* Silence a -Wtype-limits warning; NFC.Aaron Ballman2015-07-201-1/+1
| | | | llvm-svn: 242670
* [X86, inlineasm] Improve analysis of x,Y0,Yi,Ym,Yt,L,e,Z,s asm constraints ↵Alexey Bataev2015-07-201-2/+1
| | | | | | | | | (patch by Alexey Frolov) Improve Sema checking of 9 existing inline asm constraints (‘x’, ‘Y*’, ‘L’, ‘e’, ‘Z’, ‘s’). Differential Revision: http://reviews.llvm.org/D10536 llvm-svn: 242665
* [Sema] Make an assertion stricter.Davide Italiano2015-07-191-1/+1
| | | | | | We now check for the exact range of IdealIndex. llvm-svn: 242652
* [modules] Don't save uninteresting identifiers, and don't consider identifiersRichard Smith2015-07-191-1/+1
| | | | | | | to be interesting just because they are the name of a builtin. Reduces the size of an empty module by over 80% (~100KB). llvm-svn: 242650
* Remove two unused includes.Nico Weber2015-07-191-1/+0
| | | | llvm-svn: 242648
* [AST] Remove StmtRange in favor of an iterator_range.Benjamin Kramer2015-07-181-4/+4
| | | | | | | | | StmtRange was just a convenient wrapper for two StmtIterators before we had real range support. This removes some of the implicit conversions StmtRange had leading to slightly more verbose code but also should make more obvious what's going on. No functional change intended. llvm-svn: 242615
* [Sema] Emit correct warning when copy-elision is not possible.Davide Italiano2015-07-181-0/+5
| | | | | | | | | | If we're returning a function parameter, copy elision isn't possible, so we now warn for redundant move. PR: 23819 Differential Revision: http://reviews.llvm.org/D11305 llvm-svn: 242600
* Fix alignment issues in Clang.James Y Knight2015-07-171-2/+3
| | | | | | | | | | | | | | | | | Some const-correctness changes snuck in here too, since they were in the area of code I was modifying. This seems to make Clang actually work without Bus Error on 32bit-sparc. Follow-up patches will factor out a trailing-object helper class, to make classes using the idiom of appending objects to other objects easier to understand, and to ensure (with static_assert) that required alignment guarantees continue to hold. Differential Revision: http://reviews.llvm.org/D10272 llvm-svn: 242554
* [Sema] Refactor Sema::ImplicitExceptionSpecification::CalledDeclDavide Italiano2015-07-161-16/+14
| | | | | | This (hopefully) brings more clarity. No functional changes (intended). llvm-svn: 242483
* [SemaType] Use a range loop.Davide Italiano2015-07-161-4/+2
| | | | llvm-svn: 242432
* Disable #pragma redefine_extname for C++ code as it does not make sense in ↵Aaron Ballman2015-07-161-22/+27
| | | | | | | | such a context. Patch by Andrey Bokhanko! llvm-svn: 242420
* [OPENMP] Fixed detection of canonical loops with random access iterators.Alexey Bataev2015-07-161-4/+6
| | | | | | Add handling of iterators with copy/move constructors with default arguments + converting template constructors. llvm-svn: 242382
* [OPENMP] http://llvm.org/PR24121: canonical loop rejected when comparison ↵Alexey Bataev2015-07-151-3/+30
| | | | | | | | has implicit conversions or destruction Allow to use complex iterators expressions in loops for C++. llvm-svn: 242285
* [Sema] Don't emit "pure virtual" warning for fully qualified calls.Davide Italiano2015-07-142-4/+11
| | | | | | | | | | -fapple-kext is an exception because calls will still go through the vtable in that mode. Add a note to make the user aware of that. PR: 23215 Differential Revision: http://reviews.llvm.org/D10935 llvm-svn: 242246
* Add a "maximum TLS alignment" characteristic to the target info, so itPaul Robinson2015-07-142-5/+47
| | | | | | | | | | can be different from the normal variable maximum. Add an error diagnostic for when TLS variables exceed maximum TLS alignment. Currenty only PS4 sets an explicit maximum TLS alignment. Patch by Charles Li! llvm-svn: 242198
* [Sema] Emit a better diagnostic when variable redeclarations disagreeDavid Majnemer2015-07-141-3/+10
| | | | | | | | | | | We referred to all declaration in definitions in our diagnostic messages which is can be inaccurate. Instead, classify the declaration and emit an appropriate diagnostic for the new declaration and an appropriate note pointing to the old one. This fixes PR24116. llvm-svn: 242190
* Fixed 22941: Integer template parameter as immediate 'I' expectes an integer ↵Sunil Srivastava2015-07-141-11/+13
| | | | | | | | | constant Basically fixed premature testing of integer constraints during template parsing Reviewed at http://reviews.llvm.org/D10452 llvm-svn: 242175
* [OPENMP] Drop type qualifiers from private variables.Alexey Bataev2015-07-141-0/+3
| | | | | | If the variable is marked as private in OpenMP construct, the reference to this variable should not keep type qualifiers for the original variable. Private copy is not volatile or constant, so we can use unqualified type for private copy. llvm-svn: 242133
OpenPOWER on IntegriCloud