summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [Driver] Allow enum SanitizerOrdinal to represent more than 64 different ↵Pierre Gousseau2019-02-2611-145/+325
| | | | | | | | | | | | | sanitizer checks, NFC. enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks. This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare". Fixes: https://llvm.org/PR39425 Differential Revision: https://reviews.llvm.org/D57914 llvm-svn: 354873
* [CodeComplete] Propagate preferred type for function arguments in more casesIlya Biryukov2019-02-269-98/+153
| | | | | | | | | | | | | | | | | | | | | Summary: See the added test for some new cases. This change also removes special code completion calls inside the ParseExpressionList function now that we properly propagate expected type to the function responsible for parsing elements of the expression list (ParseAssignmentExpression). Reviewers: kadircet Reviewed By: kadircet Subscribers: xbolva00, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58541 llvm-svn: 354864
* CodeGen: Explicitly initialize structure padding in the ↵Alexander Potapenko2019-02-262-25/+232
| | | | | | | | | | | | | | | -ftrivial-auto-var-init mode When generating initializers for local structures in the -ftrivial-auto-var-init mode, explicitly wipe the padding bytes with either 0x00 or 0xAA. This will allow us to automatically handle the padding when splitting the initialization stores (see https://reviews.llvm.org/D57898). Reviewed at https://reviews.llvm.org/D58188 llvm-svn: 354861
* [CGDebugInfo] Set NonTrivial DIFlag to a c++ record if it's not trivialAaron Smith2019-02-261-0/+2
| | | | | | This goes with https://reviews.llvm.org/D44406 llvm-svn: 354843
* Revert r354832 "[ASTImporter] Add support for importing ChooseExpr AST nodes."Reid Kleckner2019-02-2684-2040/+0
| | | | | | Test does not pass on Windows llvm-svn: 354839
* [MS] Fix for Bug 8446, template instantiation without a 'typename' keywordReid Kleckner2019-02-262-0/+113
| | | | | | | | Patch by Zahira Ammarguellat! Differential Revision: https://reviews.llvm.org/D41950 llvm-svn: 354838
* [ASTImporter] Add support for importing ChooseExpr AST nodes.Tom Roeder2019-02-259-0/+99
| | | | | | | | | | | | | | | | | | | | | Summary: This allows ASTs to be merged when they contain ChooseExpr (the GNU __builtin_choose_expr construction). This is needed, for example, for cross-CTU analysis of C code that makes use of __builtin_choose_expr. The node is already supported in the AST, but it didn't have a matcher in ASTMatchers. So, this change adds the matcher and adds support to ASTImporter. Reviewers: shafik, a_sidorin, martong, aaron.ballman Subscribers: aaron.ballman, rnkovacs, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58292 llvm-svn: 354832
* [NFC] Reorder some mis-ordered testsJF Bastien2019-02-251-4/+4
| | | | | | I somehow had misaligned some of the tests when I originally wrote this. Re-order them properly. llvm-svn: 354831
* Reapply "Make static counters in ASTContext non-static." with fixes.Alexander Kornienko2019-02-253-37/+24
| | | | | | This reverts commit e50038e4dc53caee1acc811362ac0b15e00ef5eb. llvm-svn: 354827
* [CodeGenObjC] Fix a nullptr dyn_castErik Pilkington2019-02-252-2/+16
| | | | | | | | | | ObjCMessageExpr::getInstanceReceiver returns nullptr if the receiver is 'super'. Make this check more strict, since we don't care about messages to super here. rdar://48247290 llvm-svn: 354826
* [libclang] Expose warn_unused and warn_unused_result attributes.Emilio Cobos Alvarez2019-02-255-2/+22
| | | | | | | | | This is helpful to properly detect them, and fixing issues like https://github.com/rust-lang/rust-bindgen/issues/1518. Differential Revision: https://reviews.llvm.org/D58570 llvm-svn: 354824
* [libclang] Fix a trivial error introduced in D57946.Emilio Cobos Alvarez2019-02-251-1/+1
| | | | | | | | | | The value for CXCursor_ConvergentAttr is not 420. I'm not really sure how easy it is to test this, and I'm not familiar with the python bindings, just noticed the error while looking at D57946 to write D58570. Differential Revision: https://reviews.llvm.org/D58571 llvm-svn: 354823
* [OpenMP 5.0] Parsing/sema support for from clause with mapper modifier.Michael Kruse2019-02-2516-71/+203
| | | | | | | | | | | | | | | | | | | | This patch implements the parsing and sema support for the OpenMP 'from'-clause with potential user-defined mappers attached. User-defined mappers are a new feature in OpenMP 5.0. A 'from'-clause can have an explicit or implicit associated mapper, which instructs the compiler to generate and use customized mapping functions. An example is shown below: struct S { int len; int *d; }; #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len]) struct S ss; #pragma omp target update from(mapper(id): ss) // use the mapper with name 'id' to map ss from device Contributed-by: Lingda Li <lildmh@gmail.com> Differential Revision: https://reviews.llvm.org/D58638 llvm-svn: 354817
* Revert "Make static counters in ASTContext non-static."Vlad Tsyrklevich2019-02-253-24/+37
| | | | | | | This reverts commit r354795, I suspect it is causing test failures on MSan sanitizer bots. llvm-svn: 354812
* [analyzer] Fix infinite recursion in printing macrosKristof Umann2019-02-251-1/+11
| | | | | | | | | | | | | | | | #define f(y) x #define x f(x) int main() { x; } This example results a compilation error since "x" in the first line was not defined earlier. However, the macro expression printer goes to an infinite recursion on this example. Patch by Tibor Brunner! Differential Revision: https://reviews.llvm.org/D57892 llvm-svn: 354806
* Make static counters in ASTContext non-static.Alexander Kornienko2019-02-253-37/+24
| | | | | | | | | | | | | | | | | | Summary: Fixes a data race and makes it possible to run clang-based tools in multithreaded environment with TSan. Reviewers: ilya-biryukov, riccibruno Reviewed By: riccibruno Subscribers: riccibruno, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58612 llvm-svn: 354795
* [AArch64] Add support for Cortex-A76 and Cortex-A76AELuke Cheeseman2019-02-254-0/+57
| | | | | | | | | | - Add LLVM backend support for Cortex-A76 and Cortex-A76AE - Documentation can be found at https://developer.arm.com/products/processors/cortex-a/cortex-a76 Differential Revision: https://reviews.llvm.org/D57764 llvm-svn: 354789
* Fixed typos in tests: s/CHEKC/CHECK/Dmitri Gribenko2019-02-252-2/+2
| | | | | | | | | | | | Reviewers: ilya-biryukov Subscribers: nemanjai, javed.absar, jsji, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D58611 llvm-svn: 354785
* [SYCL] Add clang front-end option to enable SYCL device compilation flow.Alexey Bader2019-02-255-1/+22
| | | | | | Patch by Mariya Podchishchaeva <mariya.podchishchaeva@intel.com> llvm-svn: 354773
* Fix accidentally used hard tabs. NFCKristina Brooks2019-02-241-1/+1
| | | | | | | Big sorry. This undoes the indentation mess I made in r354751. llvm-svn: 354752
* Wrap code for builtin_assume_aligned at 80 col.NFCKristina Brooks2019-02-241-1/+2
| | | | | | | Minor style fix to avoid going over 80 cols in handling of case for Builtin::BI__builtin_assume_aligned. NFC. llvm-svn: 354751
* Typo: s/CHCCK/CHECKMichael Liao2019-02-241-1/+1
| | | | llvm-svn: 354742
* [NFC] Minor coding style (indent) fix.Michael Liao2019-02-241-1/+1
| | | | llvm-svn: 354741
* Enable coroutines under -std=c++2a.Richard Smith2019-02-2311-16/+22
| | | | llvm-svn: 354736
* [cxx_status] Update to match Kona motions.Richard Smith2019-02-231-8/+59
| | | | llvm-svn: 354735
* [NFC] Fix Wdocumentation warning in OMPToClauseBruno Ricci2019-02-231-1/+0
| | | | llvm-svn: 354728
* [Sema][NFC] SequenceChecker: More tests in preparation for D57660Bruno Ricci2019-02-231-5/+148
| | | | llvm-svn: 354727
* Remove OpenBSD case for old system libstdc++ header path as OpenBSDBrad Smith2019-02-231-8/+0
| | | | | | has switched to libc++. llvm-svn: 354723
* Remove sanitizer context workaround no longer necessaryBrad Smith2019-02-231-3/+1
| | | | | | The base linker is now lld. llvm-svn: 354721
* [OpenMP 5.0] Parsing/sema support for to clause with mapper modifier.Michael Kruse2019-02-2218-118/+309
| | | | | | | | | | | | | | | | | | | This patch implements the parsing and sema support for OpenMP to clause with potential user-defined mappers attached. User defined mapper is a new feature in OpenMP 5.0. A to/from clause can have an explicit or implicit associated mapper, which instructs the compiler to generate and use customized mapping functions. An example is shown below: struct S { int len; int *d; }; #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len]) struct S ss; #pragma omp target update to(mapper(id): ss) // use the mapper with name 'id' to map ss to device Contributed-by: <lildmh@gmail.com> Differential Revision: https://reviews.llvm.org/D58523 llvm-svn: 354698
* [clang] Only provide C11 features in <float.h> starting with C++17Louis Dionne2019-02-222-4/+4
| | | | | | | | | | | | | | Summary: In r353970, I enabled those features in C++11 and above. To be strictly conforming, those features should only be enabled in C++17 and above. Reviewers: jfb, eli.friedman Subscribers: jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D58289 llvm-svn: 354691
* [OPENMP] Delayed diagnostics for VLA support.Alexey Bataev2019-02-225-12/+32
| | | | | | Generalized processing of the deferred diagnostics for OpenMP/CUDA code. llvm-svn: 354690
* Fix "not all control paths return" warning. NFCI.Simon Pilgrim2019-02-221-0/+1
| | | | llvm-svn: 354681
* Revert "[OPENMP] Delayed diagnostics for VLA support."Alexey Bataev2019-02-223-20/+12
| | | | | | | This reverts commit r354679 to fix the problem with the Windows buildbots llvm-svn: 354680
* [OPENMP] Delayed diagnostics for VLA support.Alexey Bataev2019-02-223-12/+20
| | | | | | Generalized processing of the deferred diagnostics for OpenMP/CUDA code. llvm-svn: 354679
* CodeGen: use COMDAT for block copy/destroy helpersSaleem Abdulrasool2019-02-222-1/+14
| | | | | | | | | | | SVN r339438 added support to deduplicate the helpers by using a consistent naming scheme and using LinkOnceODR semantics. This works on ELF by means of weak linking semantics, and entirely does not work on PE/COFF where you end up with multiply defined strong symbols, which is a strong error on PE/COFF. Assign the functions a COMDAT group so that they can be uniqued by the linker. This fixes the use of blocks in CoreFoundation on Windows. llvm-svn: 354678
* [CUDA]Delayed diagnostics for the asm instructions.Alexey Bataev2019-02-226-20/+134
| | | | | | | | | Adapted targetDiag for the CUDA and used for the delayed diagnostics in asm constructs. Works for both host and device compilation sides. Differential Revision: https://reviews.llvm.org/D58463 llvm-svn: 354671
* revert r354615: [HIP] change kernel stub nameYaxun Liu2019-02-222-8/+1
| | | | | | | | It caused regressions. Differential Revision: https://reviews.llvm.org/D58518 llvm-svn: 354651
* [analyzer] MIGChecker: Enable by default as `osx.MIG'.Artem Dergachev2019-02-222-10/+6
| | | | | | | | | | With r354643, the checker is feature-rich and polished enough. rdar://problem/35380337 Differential Revision: https://reviews.llvm.org/D58397 llvm-svn: 354644
* [analyzer] MIGChecker: Add support for more APIs.Artem Dergachev2019-02-222-18/+166
| | | | | | | | | | | | | | | Add more "consuming" functions. For now only vm_deallocate() was supported. Add a non-zero value that isn't an error; this value is -305 ("MIG_NO_REPLY") and it's fine to deallocate data when you are returning this error. Make sure that the mig_server_routine annotation is inherited. rdar://problem/35380337 Differential Revision: https://reviews.llvm.org/D58397 llvm-svn: 354643
* [analyzer] MIGChecker: Fix an FN when the object is released in a destructor.Artem Dergachev2019-02-222-3/+43
| | | | | | | | | | | | | | | | | When a MIG server routine argument is released in an automatic destructor, the Static Analyzer thinks that this happens after the return statement, and so the violation of the MIG convention doesn't happen. Of course, it doesn't quite work that way, so this is a false negative. Add a hack that makes the checker double-check at the end of function that no argument was released when the routine fails with an error. rdar://problem/35380337 Differential Revision: https://reviews.llvm.org/D58392 llvm-svn: 354642
* [analyzer] MIGChecker: Improve intermediate diagnostic notes.Artem Dergachev2019-02-222-12/+71
| | | | | | | | | | | | | | | | | | Add a BugReporterVisitor for highlighting the events of deallocating a parameter. All such events are relevant to the emitted report (as long as the report is indeed emitted), so all of them will get highlighted. Add a trackExpressionValue visitor for highlighting where does the error return code come from. Do not add a trackExpressionValue visitor for highlighting how the deallocated argument(s) was(were) copied around. This still remains to be implemented. rdar://problem/35380337 Differential Revision: https://reviews.llvm.org/D58368 llvm-svn: 354641
* [analyzer] MIGChecker: Take advantage of the mig_server_routine annotation.Artem Dergachev2019-02-222-15/+70
| | | | | | | | | | | | | | | | r354530 has added a new function/block/message attribute "mig_server_routine" that attracts compiler's attention to functions that need to follow the MIG server routine convention with respect to deallocating out-of-line data that was passed to them as an argument. Teach the checker to identify MIG routines by looking at this attribute, rather than by making heuristic-based guesses. rdar://problem/35380337 Differential Revision: https://reviews.llvm.org/58366 llvm-svn: 354638
* [analyzer] MIGChecker: A checker for Mach Interface Generator conventions.Artem Dergachev2019-02-214-0/+190
| | | | | | | | | | | | | | | | | This checker detects use-after-free bugs in (various forks of) the Mach kernel that are caused by errors in MIG server routines - functions called remotely by MIG clients. The MIG convention forces the server to only deallocate objects it receives from the client when the routine is executed successfully. Otherwise, if the server routine exits with an error, the client assumes that it needs to deallocate the out-of-line data it passed to the server manually. This means that deallocating such data within the MIG routine and then returning a non-zero error code is always a dangerous use-after-free bug. rdar://problem/35380337 Differential Revision: https://reviews.llvm.org/D57558 llvm-svn: 354635
* Use _Q as MS ABI mangling for char8_t.Richard Smith2019-02-212-7/+12
| | | | | | Thanks to Yuriy Solodkyy for letting us know the mangling here. llvm-svn: 354633
* [clang-cl] Whitelist -fbracket-depth=123 in clang-clReid Kleckner2019-02-212-1/+2
| | | | | | | | Users apparently need it when expanding large quantities of macros. Fixes PR38685 llvm-svn: 354626
* AMDGPU: Don't emit debugger subtarget featuresMatt Arsenault2019-02-212-10/+3
| | | | | | Keep the flag around for compatability. llvm-svn: 354624
* [Driver] Fix float ABI default for Android ARMv8.Dan Albert2019-02-212-1/+11
| | | | | | | | | | | | | | | | Summary: Android doesn't regress back to soft float after ARMv7 :) Reviewers: srhines, pirama Reviewed By: srhines, pirama Subscribers: javed.absar, kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58477 llvm-svn: 354622
* [Fixed Point Arithmetic] Fixed Point ComparisonsLeonard Chan2019-02-213-12/+428
| | | | | | | | | This patch implements fixed point comparisons with other fixed point types and integers. This also provides constant expression evaluation for them. Differential Revision: https://reviews.llvm.org/D57219 llvm-svn: 354621
* [HIP] change kernel stub nameYaxun Liu2019-02-212-1/+8
| | | | | | | | | | Add .stub to kernel stub function name so that it is different from kernel name in device code. This is necessary to let debugger find correct symbol for kernel Differential Revision: https://reviews.llvm.org/D58518 llvm-svn: 354615
OpenPOWER on IntegriCloud