summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r245496 "[CUDA] Add appropriate host/device attribute to builtins."Artem Belevich2015-08-202-12/+1
| | | | | | It's breaking internal test. llvm-svn: 245592
* Fix crash with two typos in the arguments of a functionOlivier Goffart2015-08-201-0/+1
| | | | | | | | The problem is that the arguments are of TheCall are reset later to the ones in Args, making TypoExpr put back. Some TypoExpr that have already been diagnosed and will assert later in Sema::getTypoExprState llvm-svn: 245560
* [OPENMP 4.1] Allow to use 'uval' and 'ref' modifiers for reference types only.Alexey Bataev2015-08-201-0/+6
| | | | | | Standard allows to use 'uval' and 'ref' modifiers in 'linear' clause for variables with reference types only. Added check for it and modified test. llvm-svn: 245556
* [OPENMP 4.1] Initial support for modifiers in 'linear' clause.Alexey Bataev2015-08-202-14/+22
| | | | | | | | | | | | | | | | | | | | | | OpenMP 4.1 adds 3 optional modifiers to 'linear' clause. Format of 'linear' clause has changed to: ``` linear(linear-list[ : linear-step]) ``` where linear-list is one of the following ``` list modifier(list) ``` where modifier is one of the following: ``` ref (C++) val (C/C++) uval (C++) ``` Patch adds parsing and sema analysis for these modifiers. llvm-svn: 245550
* Fix -Wlogical-not-parentheses to work better with C code.Richard Trieu2015-08-191-5/+2
| | | | | | | Remove the assumption of a Boolean type by checking if an expression is known to have a boolean value. Disable warning in two other tests. llvm-svn: 245507
* [CUDA] Add appropriate host/device attribute to builtins.Artem Belevich2015-08-192-1/+12
| | | | | | Differential Revision: http://reviews.llvm.org/D12122 llvm-svn: 245496
* [SemaExpr] Re-enable missing assertion.Davide Italiano2015-08-191-2/+1
| | | | | | | | | | | | This has been disabled for a long time, but: 1) Initializers work (and apparently they're re reason why this was disabled). 2) various tests happen to hit this code path and the invariant seems to be always verified. Differential Revision: http://reviews.llvm.org/D12110 Reviewed by: rsmith llvm-svn: 245404
* Initialize the AST consumer as soon as we have both an ASTConsumer and anRichard Smith2015-08-181-4/+0
| | | | | | | ASTContext. Fixes some cases where we could previously initialize the AST consumer more than once. llvm-svn: 245346
* [TreeTransform] Simplify code. No functionality change.Benjamin Kramer2015-08-181-3/+1
| | | | llvm-svn: 245271
* [OPENMP 4.1] Allow variables with reference types in private clauses.Alexey Bataev2015-08-181-54/+21
| | | | | | OpenMP 4.1 allows to use variables with reference types in all private clauses (private, firstprivate, lastprivate, linear etc.). Patch allows to use such variables and fixes codegen for linear variables with reference types. llvm-svn: 245268
* [modules] When parsing the base specifiers of a parse-merged class, the currentRichard Smith2015-08-171-1/+3
| | | | | | | | context is the class itself but lookups should be performed starting with the lookup parent of the class (class and base members don't shadow types from the surrounding context because they have not been declared yet). llvm-svn: 245236
* Delay emitting members of dllexport classes until the class is fully parsed ↵Hans Wennborg2015-08-153-40/+71
| | | | | | | | | | | | | | | | | (PR23542) This enables Clang to correctly handle code such as: struct __declspec(dllexport) S { int x = 42; }; where it would otherwise error due to trying to generate the default constructor before the in-class initializer for x has been parsed. Differential Revision: http://reviews.llvm.org/D11850 llvm-svn: 245139
* [CONCEPTS] Add diagnostic; invalid tag when concept specifiedNathan Wilson2015-08-141-1/+9
| | | | | | | | | | | | Summary: Adding check to emit diagnostic for invalid tag when concept is specified and associated tests. Reviewers: rsmith, hubert.reinterpretcast, fraggamuffin, faisalv, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D11916 llvm-svn: 245123
* [Sema] main can't be declared as global variable, in C++.Davide Italiano2015-08-141-0/+16
| | | | | | | | | | | So, we now reject that. We also warn for any external-linkage global variable named main in C, because it results in undefined behavior. PR: 24309 Differential Revision: http://reviews.llvm.org/D11658 Reviewed by: rsmith llvm-svn: 245051
* [OPENMP] Fix for http://llvm.org/PR24371: Assert failure compiling blender 2.75.Alexey Bataev2015-08-141-21/+199
| | | | | | | blender uses statements expression in condition of the loop under control of the '#pragma omp parallel for'. This condition is used several times in different expressions required for codegen of the loop directive. If there are some variables defined in statement expression, it fires an assert during codegen because of redefinition of the same variables. We have to rebuild several expression to be sure that all variables are unique. llvm-svn: 245041
* Fix some coding standard issues and delete a dead conditional.Eric Christopher2015-08-131-6/+6
| | | | llvm-svn: 244959
* Wdeprecated: LambdaScopeInfos are copied in TreeTransform, so make sure ↵David Blaikie2015-08-131-1/+0
| | | | | | | | | | | they're copyable. Partly addressed by r244843, but the explicit dtor in LambdaScopeInfo was still thwarting the implicit copy ctor. This does remove the key function from LambdaScopeInfo unfortunately, but it seems neater than having to explicitly default any special members LambdaScopeInfo needs. llvm-svn: 244957
* Remove and forbid raw_svector_ostream::flush() calls.Yaron Keren2015-08-132-2/+0
| | | | | | | | | | After r244870 flush() will only compare two null pointers and return, doing nothing but wasting run time. The call is not required any more as the stream and its SmallString are always in sync. Thanks to David Blaikie for reviewing. llvm-svn: 244928
* -Wdeprecated: SavedInstanceContext is returned by value but isn't really ↵David Blaikie2015-08-121-3/+8
| | | | | | copyable, but it can be made movable llvm-svn: 244826
* Revert "[CUDA] Add implicit __attribute__((used)) to all __global__ functions."Daniel Jasper2015-08-111-4/+0
| | | | | | This is breaking internal test. I'll provide a reproduction. llvm-svn: 244583
* [MSVC Compat] Implement __is_destructible, __is_nothrow_destructibleDavid Majnemer2015-08-111-2/+41
| | | | | | | | Our implementations of these type trait intrinsics simply mapped them to __has_trivial_destructor. Instead, flesh these intrinsics out with a full implementation which matches the standard's description. llvm-svn: 244564
* If a variable template is inside a context with template arguments that is ↵Nick Lewycky2015-08-101-0/+1
| | | | | | being instantiated, and that instantiation fails, fail our instantiation instead of crashing. Errors have already been emitted. llvm-svn: 244515
* [CUDA] Add implicit __attribute__((used)) to all __global__ functions.Artem Belevich2015-08-101-0/+4
| | | | | | | | | This allows emitting kernels that were instantiated from the host code and which would never be explicitly referenced otherwise. Differential Revision: http://reviews.llvm.org/D11666 llvm-svn: 244501
* Add new llvm.loop.unroll.enable metadata for use with "#pragma unroll".Mark Heffernan2015-08-101-29/+41
| | | | | | | | | | | | | | | | | | | | | | This change adds the new unroll metadata "llvm.loop.unroll.enable" which directs the optimizer to unroll a loop fully if the trip count is known at compile time, and unroll partially if the trip count is not known at compile time. This differs from "llvm.loop.unroll.full" which explicitly does not unroll a loop if the trip count is not known at compile time With this change "#pragma unroll" generates "llvm.loop.unroll.enable" rather than "llvm.loop.unroll.full" metadata. This changes the semantics of "#pragma unroll" slightly to mean "unroll aggressively (fully or partially)" rather than "unroll fully or not at all". The motivating example for this change was some internal code with a loop marked with "#pragma unroll" which only sometimes had a compile-time trip count depending on template magic. When the trip count was a compile-time constant, everything works as expected and the loop is fully unrolled. However, when the trip count was not a compile-time constant the "#pragma unroll" explicitly disabled unrolling of the loop(!). Removing "#pragma unroll" caused the loop to be unrolled partially which was desirable from a performance perspective. llvm-svn: 244467
* [MSVC] Crash fix: assigning of overloaded member function pointer caused ↵Alexey Bataev2015-08-101-0/+2
| | | | | | | | | assertion Original class was not marked with inheritance attribute and it causes a crash on codegen. Differential Revision: http://reviews.llvm.org/D11828 llvm-svn: 244428
* This patch commits OpenMP 4 target device clausesMichael Wong2015-08-072-0/+53
| | | | | | | This is committed on behalf of Kelvin Li http://reviews.llvm.org/D11469?id=31227 llvm-svn: 244325
* Convert a few classes over to use the new TrailingObjects helper.James Y Knight2015-08-061-10/+9
| | | | | | | | | | This initial commit serves as an example -- the remainder of the classes using pointer arithmetic for trailing objects will be converted in subsequent changes. Differential Revision: http://reviews.llvm.org/D11298 llvm-svn: 244262
* [OPENMP 4.1] Allow references in init expression for loop-based constructs.Alexey Bataev2015-08-061-3/+23
| | | | | | OpenMP 4.1 allows to use variables with reference types in private clauses and, therefore, in init expressions of the cannonical loop forms. llvm-svn: 244209
* [ObjC] Circular containers: add support of subclassesAlex Denisov2015-08-061-114/+51
| | | | llvm-svn: 244193
* Rename the non-coding style conformant functions in namespace BuiltinsEric Christopher2015-08-062-9/+7
| | | | | | to match the rest of their brethren and reformat the bits that need it. llvm-svn: 244186
* function_ref-ize ExternalASTSource::FindExternalLexicalDecl and remove itsRichard Smith2015-08-051-8/+4
| | | | | | | | useless return value. Switch to using it directly when completing the redeclaration chain for an anonymous declaration, and reduce the set of declarations that we load in the process to just those of the right kind. llvm-svn: 244161
* [AST] ArrayRefize template param list info setters. No functionality change ↵Benjamin Kramer2015-08-053-24/+14
| | | | | | intended. llvm-svn: 244028
* [AST] ArrayRefize BlockDecl::setCaptures. No functionality change intended.Benjamin Kramer2015-08-052-4/+2
| | | | llvm-svn: 244027
* [AST] ArrayRefize template argument packs. No functionality change intended.Benjamin Kramer2015-08-052-15/+11
| | | | llvm-svn: 244026
* [Sema] Allocate SmallVector to the right size.Benjamin Kramer2015-08-041-1/+1
| | | | | | | | | | SmallVector::set_size does not reallocate the vector. Sadly I have no idea how to test this. The vector never has more than one member in all of the regression tests. Found by inspection. llvm-svn: 243987
* [OPENMP 4.1] Support for 'linear' clause in loop directives.Alexey Bataev2015-08-041-0/+20
| | | | | | OpenMP 4.1 allows 'linear' clause in loop directives. Patch adds support for it. llvm-svn: 243969
* [OPENMP] Fix compiler crash during data-sharing attributes analysis.Alexey Bataev2015-08-041-1/+3
| | | | | | If a global variable is marked as private in OpenMP construct and then is used in of the private clauses of the same construct, it might cause compiler crash because of incorrect capturing. llvm-svn: 243964
* [CONCEPTS] Add concept to VarDecl and diagnostic for uninitialized variable ↵Nathan Wilson2015-08-031-0/+12
| | | | | | | | | | | | | | concept Summary: Add IsConcept bit to VarDecl::NonParmVarDeclBitfields and associated isConcept/setConcept member functions. Set IsConcept to true when 'concept' specifier is in variable declaration. Create diagnostic when variable concept is not initialized. Reviewers: fraggamuffin, hubert.reinterpretcast, faisalv, aaron.ballman, rsmith Subscribers: aemerson, cfe-commits Differential Revision: http://reviews.llvm.org/D11600 llvm-svn: 243876
* Additional fix for PR14269: Crash on vector elements / global register vars ↵Andrey Bokhanko2015-08-031-14/+39
| | | | | | | | | | in inline assembler. Compiler crashed when vector elements / global register vars were used in inline assembler with "m" restriction. This patch fixes this. Differential Revision: http://reviews.llvm.org/D10476 llvm-svn: 243870
* [SemaExpr] Factor out common diagnostic code for remainder/division.Davide Italiano2015-08-011-18/+16
| | | | llvm-svn: 243832
* test commit; wrap ellipses in comment with bracketsNathan Wilson2015-07-311-1/+1
| | | | llvm-svn: 243776
* [Concepts] Add diagnostic: non template declarationHubert Tong2015-07-301-0/+6
| | | | | | | | | | | | | | | | Summary: Adding diagnostic for concepts declared as non template (function or variable) Reviewers: faisalv, fraggamuffin, rsmith, hubert.reinterpretcast Subscribers: nwilson, cfe-commits Differential Revision: http://reviews.llvm.org/D11490 Patch by Nathan Wilson! llvm-svn: 243690
* [sema] Allow to opt-out of overriding the super class's designated ↵Argyrios Kyrtzidis2015-07-301-4/+10
| | | | | | | | initializers by marking the initializer as unavailable in the subclass. rdar://20281322 llvm-svn: 243676
* Use llvm::reverse to make a bunch of loops use foreach. NFC.Pete Cooper2015-07-302-5/+3
| | | | | | | | | | | | | | | | In llvm commit r243581, a reverse range adapter was added which allows us to change code such as for (auto I = Fields.rbegin(), E = Fields.rend(); I != E; ++I) { in to for (const FieldDecl *I : llvm::reverse(Fields)) This commit changes a few of the places in clang which are eligible to use this new adapter. llvm-svn: 243663
* 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
OpenPOWER on IntegriCloud