summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* clang-cl: Handle dll attributes in explicit class template specialization ↵Hans Wennborg2015-05-272-19/+28
| | | | | | | | | | definitions (PR23667) Previously, we wouldn't call checkDLLAttribute() after the class template specialization definition if the class template was already instantiated by an explicit class template specialization declaration. llvm-svn: 238266
* [Sema] Don't use dyn_cast to detect an AtomicTypeDavid Majnemer2015-05-231-1/+1
| | | | | | | | | | An AtomicType might be hidden behind arbitrary levels of typedefs. getAs<> will reliably walk through the sugar to get the underlying AtomicType. This fixes PR23638. llvm-svn: 238083
* [OPENMP] Prepare codegen for privates in tasks for non-capturing of privates ↵Alexey Bataev2015-05-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in CapturedStmt. Reworked codegen for privates in tasks: call @kmpc_omp_task_alloc(); ... call @kmpc_omp_task(task_proxy); void map_privates(.privates_rec. *privs, type1 ** priv1_ref, ..., typen **privn_ref) { *priv1_ref = &privs->private1; ... *privn_ref = &privs->privaten; ret void } i32 task_entry(i32 ThreadId, i32 PartId, void* privs, void (void*, ...) map_privates, shareds* captures) { type1 **priv1; ... typen **privn; call map_privates(privs, priv1, ..., privn); <Task body with priv1, .., privn instead of the captured variables>. ret i32 } i32 task_proxy(i32 ThreadId, kmp_task_t_with_privates *tt) { call task_entry(ThreadId, tt->task_data.PartId, &tt->privates, map_privates, tt->task_data.shareds); } llvm-svn: 238010
* [Sema] Don't crash on out-of-line virtual constexpr functionsDavid Majnemer2015-05-221-1/+2
| | | | | | | | | | The method wasn't an overrider but didn't have 'virtual' textually written because our CXXMethodDecl was an out-of-line definition. Make sure we use the canonical decl instead. This fixes PR23629. llvm-svn: 237999
* Fix assertion when assigning to object in OpenCL constant address space.Richard Smith2015-05-221-0/+3
| | | | | | Patch by John Garvin! llvm-svn: 237983
* [OPENMP] Fixed codegen for parameters privatization.Alexey Bataev2015-05-211-36/+3
| | | | | | For parameters we shall take a derived type of parameters, not the original one. llvm-svn: 237882
* Check for bool-like conversion in conditional expressions.Richard Trieu2015-05-201-0/+2
| | | | | | | | | | Add a check for bool-like conversions for the condition expression of conditional operators. This is similiar to the checking of condition expressions of if statements, for-loops, while-loops, and do-while loops. Specificially, this is to fix the problem of assert("message") not triggering -Wstring-conversion when the assert macro uses a conditional operator. llvm-svn: 237856
* [modules] Support merging a parsed default argument with an imported hidden ↵Richard Smith2015-05-201-0/+4
| | | | | | one for non-type and template template parameters too. llvm-svn: 237815
* [modules] Support merging a parsed default function/template argument with ↵Richard Smith2015-05-203-28/+60
| | | | | | an imported but hidden one. llvm-svn: 237814
* Fix for aggregate copying of variable length arrays.Alexey Bataev2015-05-201-1/+2
| | | | | | | | | | | | | Patch fixes codegen for aggregate copying of VLAs. Currently method CodeGenFunction::EmitAggregateCopy() does not support copying of VLAs. Patch checks if the size of the type is 0, then checks if the type is actually a variable-length array. Then it calculates total length for this array and calculates total size of the array in bytes: <total number of elements in array> * aligned_sizeof(ElementType) (if copy assignment is requested). If simple copying is requested, size is calculated like: <total number of elements in array> * aligned_sizeof(ElementType) - aligned_sizeof(ElementType) + sizeof(ElementType). memcpy() is used with this calculated size of the VLA. Differential Revision: http://reviews.llvm.org/D9851 llvm-svn: 237768
* [OPENMP] Prohibit VLAs in 'private/firstprivate' clauses of 'task' directive.Alexey Bataev2015-05-191-1/+31
| | | | | | Currently runtime does not allow to support variably modified types for 'private' and 'firstprivate' clauses in 'task' directives. llvm-svn: 237674
* [OPENMP] Prohibit variably modified types in 'copyprivate' clause.Alexey Bataev2015-05-191-0/+11
| | | | | | Runtime does not allow to work with VLAs in copyprivate clause. llvm-svn: 237672
* [OPENMP] Fixed analysis of function arguments and their data sharing attributes.Alexey Bataev2015-05-191-46/+72
| | | | | | Added proper analysis for types of function arguments. llvm-svn: 237670
* SemaExprCXX.cpp: Try to fix \param in r237608. [-Wdocumentation]NAKAMURA Takumi2015-05-191-2/+1
| | | | llvm-svn: 237668
* [modules] Support for merging a parsed definition of a static data member of ↵Richard Smith2015-05-191-14/+33
| | | | | | a class template into an imported but hidden definition. llvm-svn: 237647
* [modules] Support for merging a parsed class template specialization ↵Richard Smith2015-05-181-2/+11
| | | | | | definition into an imported but hidden definition. llvm-svn: 237612
* Detect uses of mismatching forms of 'new' and 'delete'Ismail Pazarbasi2015-05-183-9/+287
| | | | | | | | | | | | | | | | | Emit warning when operand to `delete` is allocated with `new[]` or operand to `delete[]` is allocated with `new`. rev 2 update: `getNewExprFromInitListOrExpr` should return `dyn_cast_or_null` instead of `dyn_cast`, since `E` might be null. Reviewers: rtrieu, jordan_rose, rsmith Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D4661 llvm-svn: 237608
* Have -Wredundant-move ignore reference types.Richard Trieu2015-05-181-0/+3
| | | | | | | Don't give a warning when the type being moved is a reference type. Also uncomment two lines in the test case. llvm-svn: 237607
* [modules] Move implicit creation of ImportDecls for #includes transformed ↵Richard Smith2015-05-181-1/+20
| | | | | | into module imports from the frontend into Sema where it belongs. llvm-svn: 237555
* [Sema] Improve llvm_unreachable() message.Davide Italiano2015-05-171-1/+1
| | | | llvm-svn: 237532
* [Sema] Fold array into for-range loop. No functional change intended.Benjamin Kramer2015-05-161-16/+14
| | | | llvm-svn: 237525
* When emitting a dropped qualifier error, show which qualifiers are dropped.Richard Trieu2015-05-161-3/+10
| | | | llvm-svn: 237505
* Reverse the order of types in the reference dropping qualifiers error.Richard Trieu2015-05-151-1/+1
| | | | | | | | The error has the form ... 'int' ... 'const int' ... dropped qualifiers. At first glance, it appears that the const qualifier is added. Reverse the types so that the second type is less qualified than the first. llvm-svn: 237482
* Use llvm::StringSwitch<std::string> to take advantage of implicit asserting ↵Peter Collingbourne2015-05-151-4/+2
| | | | | | conversion to std::string. llvm-svn: 237475
* [modules] Add local submodule visibility support for declarations.Richard Smith2015-05-154-36/+138
| | | | | | | | | | | | With this change, enabling -fmodules-local-submodule-visibility results in name visibility rules being applied to submodules of the current module in addition to imported modules (that is, names no longer "leak" between submodules of the same top-level module). This also makes it much safer to textually include a non-modular library into a module: each submodule that textually includes that library will get its own "copy" of that library, and so the library becomes visible no matter which including submodule you import. llvm-svn: 237473
* Implement no_sanitize attribute.Peter Collingbourne2015-05-151-8/+44
| | | | | | Differential Revision: http://reviews.llvm.org/D9631 llvm-svn: 237463
* Limit set of types instantiated in FindInstantiatedDecl.Serge Pavlov2015-05-152-6/+27
| | | | | | | | Starting from r236426 FindInstantiatedDecl may instantiate types that are referenced before definition. This change limit the set of types that can be instantiated by this function. llvm-svn: 237434
* Refactor: when exposing a definition in some module, provide listeners with theRichard Smith2015-05-151-1/+3
| | | | | | module rather than requiring them to work it out themselves. llvm-svn: 237416
* Fix Clang -Wsequence-pointDavid Blaikie2015-05-141-1/+1
| | | | llvm-svn: 237401
* Tweak availability checking to look through typedef declarations.Ted Kremenek2015-05-141-2/+18
| | | | llvm-svn: 237396
* Revert "Detect uses of mismatching forms of 'new' and 'delete'"Diego Novillo2015-05-143-287/+9
| | | | | | | | | This reverts commit 742dc9b6c9686ab52860b7da39c3a126d8a97fbc. This is generating multiple segfaults in our internal builds. Test case coming up shortly. llvm-svn: 237391
* DR295: cv-qualifiers on function types are ignored in C++.Richard Smith2015-05-141-37/+48
| | | | llvm-svn: 237383
* Detect uses of mismatching forms of 'new' and 'delete'Ismail Pazarbasi2015-05-143-9/+287
| | | | | | | | | | | | | Emit warning when operand to `delete` is allocated with `new[]` or operand to `delete[]` is allocated with `new`. Reviewers: rtrieu, jordan_rose, rsmith Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D4661 llvm-svn: 237368
* [AArch64 ACLE] Allow to define poly64_t as 'unsigned long long' on LLP64 system.Kevin Qin2015-05-141-1/+4
| | | | | | This fixes PR23414 as well. llvm-svn: 237348
* Make GNUInline consistent with whether we use traditional GNU inline semantics.Peter Collingbourne2015-05-132-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we were setting LangOptions::GNUInline (which controls whether we use traditional GNU inline semantics) if the language did not have the C99 feature flag set. The trouble with this is that C++ family languages also do not have that flag set, so we ended up setting this flag in C++ modes (and working around it in a few places downstream by also checking CPlusPlus). The fix is to check whether the C89 flag is set for the target language, rather than whether the C99 flag is cleared. This also lets us remove most CPlusPlus checks. We continue to test CPlusPlus when deciding whether to pre-define the __GNUC_GNU_INLINE__ macro for consistency with GCC. There is a change in semantics in two other places where we weren't checking both CPlusPlus and GNUInline (FunctionDecl::doesDeclarationForceExternallyVisibleDefinition and FunctionDecl::isInlineDefinitionExternallyVisible), but this change seems to put us back into line with GCC's semantics (test case: test/CodeGen/inline.c). While at it, forbid -fgnu89-inline in C++ modes, as GCC doesn't support it, it didn't have any effect before, and supporting it just makes things more complicated. Differential Revision: http://reviews.llvm.org/D9333 llvm-svn: 237299
* Silence Visual C++ warning C4189: 'Result' : local variable is initialized ↵Yaron Keren2015-05-131-2/+4
| | | | | | | | | but not referenced. Sadly, LLVM_ATTRIBUTE_UNUSED does nothing with Visual C++ which means we'll have to workaround such cases again and again. llvm-svn: 237267
* [OPENMP] Allow using of threadprivate variables as loop-control variables in ↵Alexey Bataev2015-05-121-3/+4
| | | | | | lop based directives. llvm-svn: 237102
* [OPENMP] Fixed support for 'schedule' clause with non-constant chunk size.Alexey Bataev2015-05-121-8/+26
| | | | | | 'schedule' clause for combined directives requires additional processing. Special helper variable is generated, that is captured in the outlined parallel region for 'parallel for' region. This captured variable is used to store chunk expression from the 'schedule' clause in this 'parallel for' region. llvm-svn: 237100
* PR20625: Instantiate static constexpr member function of a local struct in a ↵Richard Smith2015-05-111-0/+8
| | | | | | | | | | | | | | | function template earlier. This is necessary in order to allow the use of a constexpr member function, or a member function with deduced return type, of a local class within a surrounding instantiated function template specialization. Patch by Michael Park! This re-commits r236063, which was reverted in r236134, along with a fix for a delayed template parsing bug that was exposed by this change. llvm-svn: 237064
* Give isCompatibleWithMSVC a better interfaceDavid Majnemer2015-05-112-3/+4
| | | | | | | We now use an enum which maps the marketing name (almost always a year) to the major version number. llvm-svn: 236967
* [MS ABI] Import move assignment operatorsDavid Majnemer2015-05-111-9/+9
| | | | | | | MSVC 2015 changed behavior from 2013; it imports move assignment operators. llvm-svn: 236966
* [OPENMP] Code cleanup for capturing of variables in OpenMP regions.Alexey Bataev2015-05-081-124/+115
| | | | llvm-svn: 236821
* Replace the broken LambdaCapture::isInitCapture API.James Dennett2015-05-071-2/+2
| | | | | | | | | | | | | | | A LambdaCapture does not have sufficient information to correctly determine whether it is an init-capture or not. Doing so requires knowledge held in the LambdaExpr itself. It the case of a nested capture of an init-capture it is not sufficient to check (as LambdaCapture::isInitCapture did) whether the associated VarDecl was from an init-capture. This patch moves isInitCapture to LambdaExpr and updates Capture->isInitCapture() to Lambda->isInitCapture(Capture). llvm-svn: 236760
* [modules] Suport for merging a parsed enum definition into an existing ↵Richard Smith2015-05-073-20/+44
| | | | | | imported but not visible definition. llvm-svn: 236690
* [OPENMP] Fixed codegen for 'reduction' clause.Alexey Bataev2015-05-071-1/+1
| | | | | | | | Fixed codegen for reduction operations min, max, && and ||. Codegen for them is quite similar and I was confused by this similarity. Also added a call to kmpc_end_reduce() in atomic part of reduction codegen (call to kmpc_end_reduce_nowait() is not required). Differential Revision: http://reviews.llvm.org/D9513 llvm-svn: 236689
* When performing delayed typo correction in a for-range loop's variableKaelyn Takata2015-05-071-0/+9
| | | | | | | declaration, ensure the loop variable is properly marked as invalid when it is an "auto" variable. llvm-svn: 236682
* [OPENMP] Fixed messages about predetermined DSA for loop control variables.Alexey Bataev2015-05-061-3/+10
| | | | llvm-svn: 236574
* [OPENMP] Fix for http://llvm.org/PR23387: clang fails to compile ↵Alexey Bataev2015-05-061-2/+4
| | | | | | | | magick/attribute.c Allow to use variables with 'register' storage class as loop control variables in OpenMP loop based constructs. llvm-svn: 236571
* [SystemZ] Add support for z13 low-level vector builtinsUlrich Weigand2015-05-051-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | This adds low-level builtins to allow access to all of the z13 vector instructions. Note that instructions whose semantics can be described by standard C (including clang extensions) do not get any builtins. For each instructions whose semantics *cannot* (fully) be described, we define a builtin named __builtin_s390_<insn> that directly maps to this instruction. These are intended to be compatible with GCC. For instructions that also set the condition code, the builtin will take an extra argument of type "int *" at the end. The integer pointed to by this argument will be set to the post-instruction CC value. For many instructions, the low-level builtin is mapped to the corresponding LLVM IR intrinsic. However, a number of instructions can be represented in standard LLVM IR without requiring use of a target intrinsic. Some instructions require immediate integer operands within a certain range. Those are verified at the Sema level. Based on a patch by Richard Sandiford. llvm-svn: 236532
* Allow TransformTypos to ignore corrections to a specified VarDecl.Kaelyn Takata2015-05-052-9/+15
| | | | | | | | | | | | | This is needed to prevent a TypoExpr from being corrected to a variable when the TypoExpr is a subexpression of that variable's initializer. Also exclude more keywords from the correction candidate pool when the subsequent token is .* or ->* since keywords like "new" or "return" aren't valid on the left side of those operators. Fixes PR23140. llvm-svn: 236519
OpenPOWER on IntegriCloud