summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Add null check to diagnostic path for lambda captures.Richard Trieu2016-03-051-2/+3
| | | | | | | | Previously, the failed capture of a variable in nested lambdas may crash when the lambda pointer is null. Only give the note if a location can be retreived from the lambda pointer. llvm-svn: 262765
* Test commit: Fix run-on sentence in commentMike Spertus2016-03-051-2/+2
| | | | llvm-svn: 262764
* [analyzer] Nullability: add option to not report on calls to system headers.Devin Coughlin2016-03-051-2/+25
| | | | | | | | | | | | | | Add an -analyzer-config 'nullability:NoDiagnoseCallsToSystemHeaders' option to the nullability checker. When enabled, this option causes the analyzer to not report about passing null/nullable values to functions and methods declared in system headers. This option is motivated by the observation that large projects may have many nullability warnings. These projects may find warnings about nullability annotations that they have explicitly added themselves higher priority to fix than warnings on calls to system libraries. llvm-svn: 262763
* Update diagnostics now that hexadecimal literals look likely to be part of ↵Richard Smith2016-03-042-6/+13
| | | | | | C++17. llvm-svn: 262753
* PR5941 - improve diagnostic for * vs & confusion when choosing overload ↵David Blaikie2016-03-041-1/+4
| | | | | | | | | | candidate with a parameter of incomplete (ref or pointer) type Reviewers: dblaikie Differential Revision: http://reviews.llvm.org/D16949 llvm-svn: 262752
* clang-cl: Enable PCH flags by default.Nico Weber2016-03-041-8/+0
| | | | | | | | | | | | | Now that pragma comment and pragma detect_mismatch are implemented, this might just work. Some pragmas aren't serialized yet (from the top of my head: code_seg, bss_seg, data_seg, const_seg, init_seg, section, vtordisp), but these are as far as I know usually pushed and popped within the header and usually don't leak out. If it turns out the current PCH support isn't good enough yet, we can turn it off again. llvm-svn: 262749
* Implement P0036R0: remove support for empty unary folds of +, *, |, &.Richard Smith2016-03-041-15/+0
| | | | llvm-svn: 262747
* Revert r262741 - [OPENMP] Codegen for distribute directiveSamuel Antao2016-03-046-360/+106
| | | | | | Was causing a failure in one of the buildbot slaves. llvm-svn: 262744
* Switch krait to use -mcpu=cortex-a15 for assembler tool invocations.Stephen Hines2016-03-041-2/+2
| | | | | | | | | | | | | | | | | Summary: Using -no-integrated-as causes -mcpu=krait to be transformed into -march=armv7-a today. This precludes the assembler from using instructions like sdiv, which are present for krait. Cortex-a15 is the closest subset of functionality for krait, so we should switch the assembler to use that instead. Reviewers: cfe-commits, apazos, weimingz Subscribers: aemerson Differential Revision: http://reviews.llvm.org/D17874 llvm-svn: 262742
* [OPENMP] Codegen for distribute directiveCarlo Bertolli2016-03-046-106/+360
| | | | | | | | This patch provide basic implementation of codegen for teams directive, excluding all clauses except dist_schedule. It also fixes parts of AST reader/writer to enable correct pre-compiled header handling. http://reviews.llvm.org/D17170 llvm-svn: 262741
* Make TargetInfo store an actual DataLayout instead of a string.James Y Knight2016-03-049-152/+116
| | | | | | | | | | | | | | Use it to calculate UserLabelPrefix, instead of specifying it (often incorrectly). Note that the *actual* user label prefix has always come from the DataLayout, and is handled within LLVM. The main thing clang's TargetInfo::UserLabelPrefix did was to set the #define value. Having these be different from each-other is just silly. Differential Revision: http://reviews.llvm.org/D17183 llvm-svn: 262737
* [analyzer] Add diagnostic in ObjCDeallocChecker for use of -dealloc instead ↵Devin Coughlin2016-03-041-32/+92
| | | | | | | | | | | | | | | | | | of -release. In dealloc methods, the analyzer now warns when -dealloc is called directly on a synthesized retain/copy ivar instead of -release. This is intended to find mistakes of the form: - (void)dealloc { [_ivar dealloc]; // Mistaken call to -dealloc instead of -release [super dealloc]; } rdar://problem/16227989 llvm-svn: 262729
* Move class into anonymous namespace. NFC.Benjamin Kramer2016-03-041-0/+2
| | | | llvm-svn: 262716
* [SemaExprCXX] Avoid calling isInSystemHeader for invalid source locationsPavel Labath2016-03-041-1/+2
| | | | | | | | | | | | | | | | | | | Summary: While diagnosing a CXXNewExpr warning, we were calling isInSystemHeader(), which expect to be called with a valid source location. This causes an assertion failure if the location is unknown. A quick grep shows it's not without precedent to guard calls to the function with a "Loc.isValid()". This fixes a test failure in LLDB, which always creates object with invalid source locations as it does not (always) have access to the source. Reviewers: nlewycky Subscribers: lldb-commits, cfe-commits Differential Revision: http://reviews.llvm.org/D17847 llvm-svn: 262700
* [OPENMP 4.0] Codegen for 'declare reduction' construct.Alexey Bataev2016-03-0411-20/+144
| | | | | | | Emit function for 'combiner' part of 'declare reduction' construct and 'initialilzer' part, if any. llvm-svn: 262699
* [Coverage] Fix the start/end locations of switch statementsVedant Kumar2016-03-041-1/+1
| | | | | | | | | | | | While pushing switch statements onto the region stack we neglected to specify their start/end locations. This results in a crash (PR26825) if we end up in nested macro expansions without enough information to handle the relevant file exits. I added a test in switchmacro.c and fixed up a bunch of incorrect CHECK lines that specify strange end locations for switches. llvm-svn: 262697
* [OPENMP] Simplify handling of clauses with postupdates, NFC.Alexey Bataev2016-03-043-6/+3
| | | | | | | Clauses with post-update expressions always have pre-init statement. So OMPClauseWithPreInit now is the base for OMPClauseWithPostUpdate. llvm-svn: 262696
* [index] Distinguish USRs of anonymous enums by using their first enumerator.Argyrios Kyrtzidis2016-03-042-6/+11
| | | | | | rdar://24609949. llvm-svn: 262695
* [index] Include parameter types in the USRs for C functions marked with ↵Argyrios Kyrtzidis2016-03-041-1/+2
| | | | | | 'overloadable' attribute. llvm-svn: 262694
* [index] In ObjC++ handle objc type parameters for function USRs.Argyrios Kyrtzidis2016-03-041-0/+17
| | | | llvm-svn: 262693
* [OpenCL] Refine pipe builtin supportXiuli Pan2016-03-041-44/+52
| | | | | | | | | | | | | | Summary: Refine the type builtin support as the request with http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160201/148637.html Reviewers: pekka.jaaskelainen, Anastasia, yaxunl Subscribers: rsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D16876 llvm-svn: 262692
* [MIPS] initFeatureMap() to handle empty string argumentBhushan D. Attarde2016-03-041-0/+2
| | | | | | | | | | | SUMMARY: This patch sets CPU string to its default value when it is not supplied by caller. Reviewers: vkalintiris, dsanders Subscribers: mohit.bhakkad, sagar, jaydeep, cfe-commits Differential Revision: http://reviews.llvm.org/D16139 llvm-svn: 262691
* [X86] Pass __m64 types via SSE registers for GCC compatibilityDavid Majnemer2016-03-041-6/+22
| | | | | | | | | | For compatibility with GCC, classify __m64 as SSE. However, clang is a platform compiler for certain targets; retain our old behavior on those targets: classify __m64 as integer. This fixes PR26832. llvm-svn: 262688
* [VFS] Switch from close to SafelyCloseFileDescriptorDavid Majnemer2016-03-041-13/+3
| | | | | | | | The SafelyCloseFileDescriptor machinery does the right thing in the face of signals while close will do something platform specific which results in the FD potentially getting leaked. llvm-svn: 262687
* [index] Ignore ObjCTypeParamDecls during indexing.Argyrios Kyrtzidis2016-03-041-0/+3
| | | | llvm-svn: 262686
* [OPENMP] firstprivate and private clauses of teams, host codegenerationCarlo Bertolli2016-03-031-0/+17
| | | | | | | | Add code generation support for firstprivate and private clauses of teams on the host. Add extensive regression tests including lambda functions and vla testing. http://reviews.llvm.org/D17582 llvm-svn: 262663
* [analyzer] ObjCDeallocChecker: Only check for nil-out when type is retainable.Devin Coughlin2016-03-031-1/+5
| | | | | | This fixes a crash when setting a property of struct type in -dealloc. llvm-svn: 262659
* Add code generation for teams directive inside target regionCarlo Bertolli2016-03-034-9/+136
| | | | llvm-svn: 262652
* [OpenCL] Improve diagnostics of address spaces for variables in functionAnastasia Stulova2016-03-031-20/+12
| | | | | | | | | - Prevent local variables to be declared in global AS - Diagnose AS of local variables with an extern storage class as if they would be in a program scope Review: http://reviews.llvm.org/D17345 llvm-svn: 262641
* clang-format: Use stable_sort when sorting #includes.Daniel Jasper2016-03-031-4/+5
| | | | | | | Otherwise, clang-format can output useless replacements in the presence of identical #includes llvm-svn: 262630
* [OpenMP] Code generation for teams - kernel launchingSamuel Antao2016-03-032-8/+217
| | | | | | | | | | | | | | | Summary: This patch implements the launching of a target region in the presence of a nested teams region, i.e calls tgt_target_teams with the required arguments gathered from the enclosed teams directive. The actual codegen of the region enclosed by the teams construct will be contributed in a separate patch. Reviewers: hfinkel, arpith-jacob, kkwli0, carlo.bertolli, ABataev Subscribers: cfe-commits, caomhin, fraggamuffin Differential Revision: http://reviews.llvm.org/D17019 llvm-svn: 262625
* [ARM] Add Clang targeting for ARMv8-M Baseline/MainlineBradley Smith2016-03-032-7/+17
| | | | llvm-svn: 262619
* [CLANG][AVX512][BUILTIN] movddup{128|256|512}Michael Zuckerman2016-03-032-0/+61
| | | | | | Differential Revision: http://reviews.llvm.org/D17826 llvm-svn: 262617
* [OpenCL] Apply missing restrictions for Blocks in OpenCL v2.0Anastasia Stulova2016-03-032-24/+65
| | | | | | | | | | | | | | Applying the following restrictions for block types in OpenCL (v2.0 s6.12.5): - __block storage class is disallowed - every block declaration must be const qualified and initialized - a block can't be used as a return type of a function - a blocks can't be used to declare a structure or union field - extern speficier is disallowed Corrected image and sampler types diagnostics with struct and unions. Review: http://reviews.llvm.org/D16928 llvm-svn: 262616
* [CLANG][AVX512][BUILTIN] movdqu{qi|hi} {128|256|512}Michael Zuckerman2016-03-032-0/+108
| | | | | | Differential Revision: http://reviews.llvm.org/D17814 llvm-svn: 262609
* [CLANG][AVX512][BUILTIN] movdqa{32|64}{load|store|}{128|256|512}Michael Zuckerman2016-03-032-0/+174
| | | | | | Differential Revision: http://reviews.llvm.org/D17812 llvm-svn: 262598
* [Clang][AVX512][BUILTIN] Adding PSRL{W|WI}{128|256|512}Michael Zuckerman2016-03-032-0/+118
| | | | | | Differential Revision: http://reviews.llvm.org/D17754 llvm-svn: 262593
* Semantic analysis for the swiftcall calling convention.John McCall2016-03-037-15/+281
| | | | | | | I've tried to keep the infrastructure behind parameter ABI treatments fairly general. llvm-svn: 262587
* [index] Report references of ObjC super class/protocols in interfaces and ↵Argyrios Kyrtzidis2016-03-031-6/+31
| | | | | | protocols. llvm-svn: 262584
* [OPENMP 4.0] Initial support for 'omp declare reduction' construct.Alexey Bataev2016-03-0324-19/+732
| | | | | | | | | | | | | | | | | Add parsing, sema analysis and serialization/deserialization for 'declare reduction' construct. User-defined reductions are defined as #pragma omp declare reduction( reduction-identifier : typename-list : combiner ) [initializer ( initializer-expr )] These custom reductions may be used in 'reduction' clauses of OpenMP constructs. The combiner specifies how partial results can be combined into a single value. The combiner can use the special variable identifiers omp_in and omp_out that are of the type of the variables being reduced with this reduction-identifier. Each of them will denote one of the values to be combined before executing the combiner. It is assumed that the special omp_out identifier will refer to the storage that holds the resulting combined value after executing the combiner. As the initializer-expr value of a user-defined reduction is not known a priori the initializer-clause can be used to specify one. Then the contents of the initializer-clause will be used as the initializer for private copies of reduction list items where the omp_priv identifier will refer to the storage to be initialized. The special identifier omp_orig can also appear in the initializer-clause and it will refer to the storage of the original variable to be reduced. Differential Revision: http://reviews.llvm.org/D11182 llvm-svn: 262582
* [OPENMP 4.5] Initial support for data members in 'linear' clause.Alexey Bataev2016-03-032-69/+58
| | | | | | | | OpenMP 4.5 allows to privatize data members of current class in member functions. Patch adds initial support for privatization of data members in 'linear' clause, no codegen support. llvm-svn: 262578
* Caught and fixed a typo in r262572.Sean Callanan2016-03-031-1/+1
| | | | | | | | | | I should have checked and imported D's in-class initializer. Instead I accidentally used ToField's in-class initializer, which is always NULL so ToField will never get one. <rdar://problem/24943405> llvm-svn: 262576
* Fixed a problem where the ASTImporter mishandled in-class initializers.Sean Callanan2016-03-031-2/+7
| | | | | | | | | | | | | | Previously, the ASTImporter, when copying a FieldDecl, would make the new FieldDecl use the exact same in-class initializer as the original FieldDecl, which is a problem since the initializer is in the wrong AST. The initializer must be imported, just like all the other parts of the field. Doug Gregor reviewed this fix. <rdar://problem/24943405> llvm-svn: 262572
* This patch adds doxygen comments for all the intrinsincs in the header file ↵Ekaterina Romanova2016-03-031-0/+552
| | | | | | | | | | tmmintrin.h. The doxygen comments are automatically generated based on Sony's intrinsics document. I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. llvm-svn: 262565
* Serialize `pragma pointers_to_members` state.Nico Weber2016-03-032-0/+27
| | | | | | Like r262539, but for pointers_to_members. llvm-svn: 262552
* Improve some infrastructure for extended parameter infos andJohn McCall2016-03-034-24/+85
| | | | | | | fix a bug with the instantiation of ns_consumed parameter attributes in ARC. llvm-svn: 262551
* clang-cl pch test: Instead of copying the input, use /Fp to not write into ↵Nico Weber2016-03-021-1/+1
| | | | | | | | | the test directory. Also fix a bug with /Fp and absolute paths uncovered by this. Follow-up to r262487. llvm-svn: 262541
* Serialize `pragma ms_struct` state.Nico Weber2016-03-023-9/+29
| | | | | | | | | | | pragma ms_struct has an effect on struct decls, and the effect is serialized correctly already. But the "is ms_struct currently on" state wasn't before this change. This uses the same approach as `pragma clang optimize`: When writing a module, the state isn't serialized, only when writing a pch file. llvm-svn: 262539
* clang-format: [JS] Optionally re-quote string literals.Daniel Jasper2016-03-022-8/+96
| | | | | | | | | | | | | | | | | | | | | Turns "foo" into 'foo' (or vice versa, depending on configuration). This makes it more convenient to follow the Google JavaScript style guide: https://google.github.io/styleguide/javascriptguide.xml?showone=Strings#Strings This functionality is behind the option "JavaScriptQuotes", which can be: * "leave" (no re-quoting) * "single" (change to single quotes) * "double" (change to double quotes) This also changes single quoted JavaScript string literals to be treated as tok::string_literal, not tok::char_literal, which fixes two unrelated tests. Patch by Martin Probst. Thank you. llvm-svn: 262534
* [analyzer] Move ObjCSuperDeallocChecker out of the alpha package.Devin Coughlin2016-03-021-4/+4
| | | | | | | | It will now be on by default on Darwin. rdar://problem/6953275 llvm-svn: 262526
OpenPOWER on IntegriCloud