summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* [NFC] Minor coding style (indent) fix.Michael Liao2019-02-241-1/+1
| | | | llvm-svn: 354741
* Enable coroutines under -std=c++2a.Richard Smith2019-02-236-6/+6
| | | | llvm-svn: 354736
* 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-227-103/+202
| | | | | | | | | | | | | | | | | | | 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-221-2/+2
| | | | | | | | | | | | | | 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-222-9/+17
| | | | | | Generalized processing of the deferred diagnostics for OpenMP/CUDA code. llvm-svn: 354690
* Revert "[OPENMP] Delayed diagnostics for VLA support."Alexey Bataev2019-02-221-7/+9
| | | | | | | This reverts commit r354679 to fix the problem with the Windows buildbots llvm-svn: 354680
* [OPENMP] Delayed diagnostics for VLA support.Alexey Bataev2019-02-221-9/+7
| | | | | | Generalized processing of the deferred diagnostics for OpenMP/CUDA code. llvm-svn: 354679
* CodeGen: use COMDAT for block copy/destroy helpersSaleem Abdulrasool2019-02-221-0/+4
| | | | | | | | | | | 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-224-17/+12
| | | | | | | | | 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-221-6/+0
| | | | | | | | It caused regressions. Differential Revision: https://reviews.llvm.org/D58518 llvm-svn: 354651
* [analyzer] MIGChecker: Add support for more APIs.Artem Dergachev2019-02-221-18/+82
| | | | | | | | | | | | | | | 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-221-3/+18
| | | | | | | | | | | | | | | | | 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-221-7/+50
| | | | | | | | | | | | | | | | | | 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-221-14/+21
| | | | | | | | | | | | | | | | 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-212-0/+145
| | | | | | | | | | | | | | | | | 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-211-2/+5
| | | | | | Thanks to Yuriy Solodkyy for letting us know the mangling here. llvm-svn: 354633
* AMDGPU: Don't emit debugger subtarget featuresMatt Arsenault2019-02-211-9/+2
| | | | | | Keep the flag around for compatability. llvm-svn: 354624
* [Driver] Fix float ABI default for Android ARMv8.Dan Albert2019-02-211-1/+1
| | | | | | | | | | | | | | | | 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-212-12/+50
| | | | | | | | | 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-211-0/+6
| | | | | | | | | | 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
* [CodeGen] Fix string literal address space casting.Michael Liao2019-02-211-2/+4
| | | | | | | | | | | | | | | | Summary: - If a string literal is reused directly, need to add necessary address space casting if the target requires that. Reviewers: yaxunl Subscribers: jvesely, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58509 llvm-svn: 354610
* Revert "[CUDA]Delayed diagnostics for the asm instructions."Alexey Bataev2019-02-214-6/+13
| | | | | | | This reverts commit r354593 to fix the problem with the crash on windows. llvm-svn: 354596
* [CUDA]Delayed diagnostics for the asm instructions.Alexey Bataev2019-02-214-13/+6
| | | | | | | | | | | | | | | | Summary: Adapted targetDiag for the CUDA and used for the delayed diagnostics in asm constructs. Works for both host and device compilation sides. Reviewers: tra, jlebar Subscribers: jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58463 llvm-svn: 354593
* [CodeComplete] Collect visited contexts when scope specifier is invalid.Eric Liu2019-02-211-1/+14
| | | | | | | | | | | | | | | | | Summary: This will allow completion consumers to guess the specified scope by putting together scopes in the context with the specified scope (e.g. when the specified namespace is not imported yet). Reviewers: ilya-biryukov Subscribers: jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58446 llvm-svn: 354570
* [OpenCL] Simplify LLVM IR generated for OpenCL blocksAndrew Savonichev2019-02-213-48/+63
| | | | | | | | | | | | | | | | | | | Summary: Emit direct call of block invoke functions when possible, i.e. in case the block is not passed as a function argument. Also doing some refactoring of `CodeGenFunction::EmitBlockCallExpr()` Reviewers: Anastasia, yaxunl, svenvh Reviewed By: Anastasia Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58388 llvm-svn: 354568
* [clang][Index] Enable indexing of Template Type Parameters behind a flagKadir Cetinkaya2019-02-215-4/+19
| | | | | | | | | | | | | | | | | Summary: clangd uses indexing api to provide references and it was not possible to perform symbol information for template parameters. This patch enables visiting of TemplateTypeParmTypeLocs. Reviewers: ilya-biryukov, akyrtzi Subscribers: javed.absar, kristof.beyls, ioeric, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58293 llvm-svn: 354560
* [attributes] Add an attribute for server routines in Mach kernel and extensions.Artem Dergachev2019-02-211-0/+26
| | | | | | | | | | | | The new __attribute__ ((mig_server_routine)) is going to be used for annotating Mach Interface Generator (MIG) callback functions as such, so that additional static analysis could be applied to their implementations. It can also be applied to regular functions behavior of which is supposed to be identical to that of a MIG server routine. Differential Revision: https://reviews.llvm.org/D58365 llvm-svn: 354530
* [clang] Switch to LLVM_ENABLE_IDEShoaib Meenai2019-02-201-1/+1
| | | | | | | | | | | | r344555 switched LLVM to guarding install targets with LLVM_ENABLE_IDE instead of CMAKE_CONFIGURATION_TYPES, which expresses the intent more directly and can be overridden by a user. Make the corresponding change in clang. LLVM_ENABLE_IDE is computed by HandleLLVMOptions, so it should be available for both standalone and integrated builds. Differential Revision: https://reviews.llvm.org/D58284 llvm-svn: 354525
* Make predefined FLT16 macros conditional on support for the typeNemanja Ivanovic2019-02-201-1/+2
| | | | | | | | | | | | We unconditionally predefine these macros. However, they may be used to determine if the type is supported. In that case, there are unnecessary failures to compile the code. This is the proposed fix for https://bugs.llvm.org/show_bug.cgi?id=40559 Differential revision: https://reviews.llvm.org/D57577 llvm-svn: 354512
* [OPENMP] Use targetDiag for diagnostics of unsupported exceptions, NFC.Alexey Bataev2019-02-202-8/+2
| | | | llvm-svn: 354509
* [Clang Driver] Add support for "-static-pie" argument to the Clang driver.Siva Chandra2019-02-202-13/+25
| | | | | | | | | | | | Summary: This change mimics GCC's support for the "-static-pie" argument. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58307 llvm-svn: 354502
* [OPENMP] Delay emission of the asm target-specific error messages.Alexey Bataev2019-02-202-44/+53
| | | | | | | | | | | | | | | | | Summary: Added the ability to emit target-specific builtin assembler error messages only in case if the function is really is going to be emitted for the device. Reviewers: rjmccall Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58243 llvm-svn: 354486
* [OPENMP][NVPTX]Use faster teams reduction algorithm.Alexey Bataev2019-02-204-114/+618
| | | | | | | A faster way to reduce the values in teams reductions was found, the codegen is updated to use this faster algorithm and new runtime functions. llvm-svn: 354479
* [clang-format] Do not emit replacements if Java imports are OKKrasimir Georgiev2019-02-201-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently clang-format would always emit a replacement for a block of Java imports even if it is correctly formatted: ``` % cat /tmp/Aggregator.java import X; % clang-format /tmp/Aggregator.java import X; % clang-format -output-replacements-xml /tmp/Aggregator.java <?xml version='1.0'?> <replacements xml:space='preserve' incomplete_format='false'> <replacement offset='0' length='9'>import X;</replacement> </replacements> % ``` This change makes clang-format not emit replacements in this case. Note that there is logic to not emit replacements in this case for C++. Reviewers: ioeric Reviewed By: ioeric Subscribers: jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58436 llvm-svn: 354452
* [NewPM] Add other sanitizers at O0Leonard Chan2019-02-201-0/+8
| | | | | | | | This allows for MSan and TSan to be used without optimizations required. Differential Revision: https://reviews.llvm.org/D58424 llvm-svn: 354431
* Remove extraneous space in MSVC-style diagnostic outputHans Wennborg2019-02-191-1/+1
| | | | | | | | | | | | | | | There was an extra space between the file location and the diagnostic message: /tmp/a.c(1,12): warning: unused parameter 'unused' the tests didn't catch this due to FileCheck not running in --strict-whitespace mode. Reported by Marco: http://lists.llvm.org/pipermail/cfe-dev/2019-February/061326.html Differential revision: https://reviews.llvm.org/D58377 llvm-svn: 354351
* [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier.Michael Kruse2019-02-197-293/+535
| | | | | | | | | | | | | | | | | | | This patch implements the parsing and sema support for OpenMP map clauses with potential user-defined mapper attached. User defined mapper is a new feature in OpenMP 5.0. A map clause can have an explicit or implicit associated mapper, which instructs the compiler to generate extra data mapping. 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 map(mapper(id) tofrom: ss) // use the mapper with name 'id' to map ss Contributed-by: Lingda Li <lildmh@gmail.com> Differential Revision: https://reviews.llvm.org/D58074 llvm-svn: 354347
* [OpenCL] Change type of block pointer for OpenCLAlexey Bader2019-02-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For some reason OpenCL blocks in LLVM IR are represented as function pointers. These pointers do not point to any real function and never get called. Actually they point to some structure, which in turn contains pointer to the real block invoke function. This patch changes represntation of OpenCL blocks in LLVM IR from function pointers to pointers to `%struct.__block_literal_generic`. Such representation allows to avoid unnecessary bitcasts and simplifies further processing (e.g. translation to SPIR-V ) of the module for targets which do not support function pointers. Patch by: Alexey Sotkin. Reviewers: Anastasia, yaxunl, svenvh Reviewed By: Anastasia Subscribers: alexbatashev, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58277 llvm-svn: 354337
* Reland "[clang][FileManager] fillRealPathName even if we aren't opening the ↵Jan Korous2019-02-181-0/+3
| | | | | | | | | file" This reverts commit e2bb3121fd4ab5b01f9ec1d2e3e9877db9c6a54c. + fixed test for Windows llvm-svn: 354291
* [ASTImporter] Find previous friend function templateGabor Marton2019-02-181-1/+1
| | | | | | | | | | | | Reviewers: a_sidorin, shafik, a.sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57910 llvm-svn: 354267
* [ARM] Add pre-defined macros for ROPI and RWPIOliver Stannard2019-02-183-0/+15
| | | | | | | | | This adds ACLE-defined macros to test for code being compiled in the ROPI and RWPI position-independence modes. Differential revision: https://reviews.llvm.org/D23610 llvm-svn: 354265
* [clang][Index] Fix usage of IndexImplicitInstantiationKadir Cetinkaya2019-02-181-4/+4
| | | | | | | | | | | | | | Summary: Indexing context was skipping explicit template instantiations as well. This patch makes sure it only skips implicit ones. Subscribers: arphaman, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58189 llvm-svn: 354262
* [NFC] Add a llvm_unreachable to silence a warning in SubstObjCTypeArgsVisitorBruno Ricci2019-02-171-0/+1
| | | | | | All cases in the switch are covered. NFC. llvm-svn: 354233
* Recommit "[AST] Factor out the logic of the various Expr::Ignore*"Bruno Ricci2019-02-171-186/+153
| | | | | | | | | | | | | | | | | | | | (Originally commited in r354215 and reverted in r354216 because of a missed failing clang-tidy test (fix in r354228)) Now that the implementation of all of the Expr::Ignore* is in Expr.cpp we can try to remove some duplication. Do this by separating the logic of the Expr::Ignore* from the iterative loop. This is NFC, except for one change: IgnoreParenImpCasts now skips, among other things, everything that IgnoreImpCasts skips. This means FullExpr are now skipped by IgnoreParenImpCasts. This was likely an oversight when FullExpr was added to the nodes skipped by IgnoreImpCasts. Differential Revision: https://reviews.llvm.org/D57267 Reviewed By: aaron.ballman (with comments from void and rnk) llvm-svn: 354232
* [RISCV] Default enable RISCV linker relaxationShiva Chen2019-02-171-0/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D47127 llvm-svn: 354222
* Revert "[AST] Factor out the logic of the various Expr::Ignore*"Bruno Ricci2019-02-171-153/+186
| | | | | | | This breaks some clang-tidy checks. For some reason they were not included in check-clang ? llvm-svn: 354216
OpenPOWER on IntegriCloud