summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [CFG] Add branch to skip vbase inits when they're handled by superclass.Artem Dergachev2019-05-245-20/+80
| | | | | | | | | | | | | | | | | | | This patch adds the run-time CFG branch that would skip initialization of virtual base classes depending on whether the constructor is called from a superclass constructor or not. Previously the Static Analyzer was already skipping virtual base-class initializers in such constructors, but it wasn't skipping their arguments and their potential side effects, which was causing pr41300 (and was generally incorrect). The previous skipping behavior is now replaced with a hard assertion that we're not even getting there due to how our CFG works. The new CFG element is under a CFG build option so that not to break other consumers of the CFG by this change. Static Analyzer support for this change is implemented. Differential Revision: https://reviews.llvm.org/D61816 llvm-svn: 361681
* Fix crash deserializing a CUDAKernelCallExpr with a +Asserts binary.Richard Smith2019-05-241-1/+1
| | | | | | | The assertion in setConfig read from the (uninitialized) CONFIG expression. llvm-svn: 361680
* Default arguments are potentially constant evaluated.Richard Smith2019-05-241-5/+1
| | | | | | | | We need to eagerly instantiate constexpr functions used in them even if the default argument is never actually used, because we might evaluate portions of it when performing semantic checks. llvm-svn: 361670
* Refactor use-marking to better match standard terminology. NoRichard Smith2019-05-241-162/+244
| | | | | | functionality change intended. llvm-svn: 361668
* [Analyzer] Checker for non-determinism caused by iteration of unordered ↵Mandeep Singh Grang2019-05-242-0/+101
| | | | | | | | | | | | | | | | | | container of pointers Summary: Added a checker for non-determinism caused by iterating unordered containers like std::unordered_set containing pointer elements. Reviewers: NoQ, george.karpenkov, whisperity, Szelethus, baloghadamsoftware Reviewed By: Szelethus Subscribers: mgorny, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, jdoerfert, Charusso, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59279 llvm-svn: 361664
* Add JSON dumping tests for ObjC statements; add support for dumping @catch ↵Aaron Ballman2019-05-241-0/+7
| | | | | | catch-all statements. llvm-svn: 361660
* [NewPassManager] Add tuning option: LoopUnrolling [clang-change]Alina Sbirlea2019-05-241-0/+1
| | | | | | | | | | | | | | | | Summary: Use CodeGenOpts's setting for loop unrolling. [to be coupled with D61618] Reviewers: chandlerc Subscribers: jlebar, dmgreen, cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61620 llvm-svn: 361653
* Add support for dumping Objective C AST declaration nodes to JSON.Aaron Ballman2019-05-241-4/+155
| | | | llvm-svn: 361652
* [WebAssembly] Use "linker" as linker shortname.Sam Clegg2019-05-242-10/+4
| | | | | | | | | | | This is in line with other platforms. Also, move the single statement methods into the header (also in line with other platform). Differential Revision: https://reviews.llvm.org/D62406 llvm-svn: 361651
* [ASTImporter] Call to HandleNameConflict in VisitRecordDecl mistakeningly ↵Shafik Yaghmour2019-05-241-1/+1
| | | | | | | | | | | | | using Name instead of SearchName Summary: https://reviews.llvm.org/D51633 added error handling to the ASTNodeImporter::VisitRecordDecl for the conflicting names case. This could lead to erroneous return of an error in that case since we should have been using SearchName. Name may be empty in the case where we find the name via D->getTypedefNameForAnonDecl()->getDeclName(). This fix is very similar to https://reviews.llvm.org/D59665 Differential Revision: https://reviews.llvm.org/D62352 llvm-svn: 361650
* [CodeComplete] Add whitespace around braces in lambda completionsIlya Biryukov2019-05-241-0/+3
| | | | | | | This produces nicer output. Trivial follow-up to r361461, so sending without review. llvm-svn: 361645
* [LibTooling] Add Explanation parameter to `makeRule`.Yitzhak Mandelbaum2019-05-241-4/+4
| | | | | | | | | | | | | | | | | Summary: Conceptually, a single-case RewriteRule has a matcher, edit(s) and an (optional) explanation. `makeRule` previously only took the matcher and edit(s). This change adds (optional) support for the explanation. Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62390 llvm-svn: 361643
* [OpenCL] Add support for the cl_arm_integer_dot_product extensionsKevin Petit2019-05-241-0/+28
| | | | | | | | | The specification is available in the Khronos OpenCL registry: https://www.khronos.org/registry/OpenCL/extensions/arm/cl_arm_integer_dot_product.txt Signed-off-by: Kevin Petit <kevin.petit@arm.com> llvm-svn: 361641
* [CodeComplete] Filter override completions by function nameIlya Biryukov2019-05-241-18/+29
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We put only part of the signature starting with a function name into "typed text" chunks now, previously the whole signature was "typed text". This leads to meaningful fuzzy match scores, giving better signals to compare with other completion items. Ideally, we would not display the result type to the user, but that requires adding a new kind of completion chunk. Reviewers: kadircet Reviewed By: kadircet Subscribers: jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62298 llvm-svn: 361623
* Do not resolve directory junctions for `-fdiagnostics-absolute-paths` on ↵Igor Kudrin2019-05-241-0/+21
| | | | | | | | | | | | | | Windows. If the source file path contains directory junctions, and we resolve them when printing diagnostic messages, these paths look independent for an IDE. For example, both Visual Studio and Visual Studio Code open separate editors for such paths, which is not only inconvenient but might even result in losing changes made in one of them. Differential Revision: https://reviews.llvm.org/D59415 llvm-svn: 361598
* Factor out repeated code to build 'this' expressions and mark themRichard Smith2019-05-244-15/+21
| | | | | | referenced. llvm-svn: 361588
* [CFG] NFC: Remove implicit conversion from CFGTerminator to Stmt *.Artem Dergachev2019-05-2416-49/+59
| | | | | | | | | | | Turn it into a variant class instead. This conversion does indeed save some code but there's a plan to add support for more kinds of terminators that aren't necessarily based on statements, and with those in mind it becomes more and more confusing to have CFGTerminators implicitly convertible to a Stmt *. Differential Revision: https://reviews.llvm.org/D61814 llvm-svn: 361586
* Fix hang during constant evaluation of union assignment.Eric Fiselier2019-05-231-3/+2
| | | | | | | | | | HandleUnionActiveMemberChange forgot to walk over a nop implicit conversion node and got stuck in the process. As a cleanup I changed the declaration of `E` so it can't be accidentally accessed after the loop. llvm-svn: 361571
* [analyzer] List checker/plugin options in 3 categories: released, alpha, ↵Kristof Umann2019-05-233-17/+45
| | | | | | | | | | | | developer Same patch as D62093, but for checker/plugin options, the only difference being that options for alpha checkers are implicitly marked as alpha. Differential Revision: https://reviews.llvm.org/D62093 llvm-svn: 361566
* [OPENMP]Do not crash for const firstprivates.Alexey Bataev2019-05-231-1/+19
| | | | | | | | | If the variable is a firstprivate variable and it was not emitted beause this a constant variable with the constant initializer, we can use the initial value instead of the variable itself. It also fixes the problem with the compiler crash in this case. llvm-svn: 361564
* [analyzer] Hide developer-only checker/package options by defaultKristof Umann2019-05-233-11/+16
| | | | | | | | | These options are now only visible under -analyzer-checker-option-help-developer. Differential Revision: https://reviews.llvm.org/D61839 llvm-svn: 361561
* [analyzer] List checkers in 3 categories: released, alpha, developerKristof Umann2019-05-233-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the only way to display the list of available checkers was to invoke the analyzer with -analyzer-checker-help frontend flag. This however wasn't really great from a maintainer standpoint: users came across checkers meant strictly for development purposes that weren't to be tinkered with, or those that were still in development. This patch creates a clearer division in between these categories. From now on, we'll have 3 flags to display the list checkers. These lists are mutually exclusive and can be used in any combination (for example to display both stable and alpha checkers). -analyzer-checker-help: Displays the list for stable, production ready checkers. -analyzer-checker-help-alpha: Displays the list for in development checkers. Enabling is discouraged for non-development purposes. -analyzer-checker-help-developer: Modeling and debug checkers. Modeling checkers shouldn't be enabled/disabled by hand, and debug checkers shouldn't be touched by users. Differential Revision: https://reviews.llvm.org/D62093 llvm-svn: 361558
* [X86] Split multi-line chained assignments into single lines to avoid making ↵Craig Topper2019-05-231-26/+24
| | | | | | | | clang-format create triangle shaped indentation. Simplify one if statement to remove a bunch of string matches. NFCI We had an if statement that checked over every avx512* feature to see if it should enabled avx512f. Since they are all prefixed with avx512 just check for that instead. llvm-svn: 361557
* [analyzer] Add a new frontend flag to display all checker optionsKristof Umann2019-05-235-46/+99
| | | | | | | | | Add the new frontend flag -analyzer-checker-option-help to display all checker/package options. Differential Revision: https://reviews.llvm.org/D57858 llvm-svn: 361552
* [NewPassManager] Add tuning option: SLPVectorization [clang-change]Alina Sbirlea2019-05-231-1/+8
| | | | | | | | | | | | | | | | Summary: NewPassManager is not using CodeGenOpts values before this patch. [to be coupled with D61616] Reviewers: chandlerc Subscribers: jlebar, cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61617 llvm-svn: 361534
* [Driver] Move the "-o OUT -x TYPE SRC.c" flags to the end of -cc1Reid Kleckner2019-05-231-24/+26
| | | | | | | | | | | New -cc1 arguments, such as -faddrsig, have started appearing after the input name. I personally find it convenient for the input to be the last argument to the compile command line, since I often need to edit it when running crash reproduction scripts. Differential Revision: https://reviews.llvm.org/D62270 llvm-svn: 361530
* [OPENMP]Simplify codegen for the outlined regions.Alexey Bataev2019-05-231-40/+19
| | | | | | | Simplified codegen for the outlined regions, excluding duplication code for handling variables with the reference types. llvm-svn: 361529
* lld-link, clang: Treat non-existent input files as possible spellos for ↵Nico Weber2019-05-231-11/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | option flags OptTable treats arguments starting with / that aren't a known option as filenames. This means lld-link's and clang-cl's typo correction for unknown flags didn't do spell checking for misspelled options that start with /. I first tried changing OptTable, but that got pretty messy, see PR41787 comments 2 and 3. Instead, let lld-link's and clang's (including clang-cl's) "file not found" diagnostic check if a non-existent file looks like it could be a mis-spelled option, and if so add a "did you mean" suggestion to the "file not found" diagnostic. While here, make formatting of a few diagnostics a bit more self-consistent. Fixes PR41787. Differential Revision: https://reviews.llvm.org/D62276 llvm-svn: 361518
* [WebAssembly] Add multivalue and tail-call target featuresThomas Lively2019-05-232-0/+28
| | | | | | | | | | | | | | | | Summary: These features will both be implemented soon, so I thought I would save time by adding the boilerplate for both of them at the same time. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D62047 llvm-svn: 361516
* [LibTooling] Fix dangling references in RangeSelector.Yitzhak Mandelbaum2019-05-231-13/+13
| | | | | | | | | | | | | | | | | | | Summary: RangeSelector had a number of cases of capturing a StringRef in a lambda, which lead to dangling references. This change converts all uses in the API of `StringRef` to `std::string` to avoid this problem. `std::string` in the API is a reasonable choice, because the combinators are always storing the string beyond the life of the combinator construction. Reviewers: ilya-biryukov, gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62328 llvm-svn: 361514
* [Index] Fix reported references in presence of template type aliasesIlya Biryukov2019-05-231-16/+28
| | | | | | | | | | | | | | | | Summary: See the added test for an example. Reviewers: kadircet Reviewed By: kadircet Subscribers: jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62303 llvm-svn: 361511
* [CodeComplete] Only show lambda completions if patterns are requestedIlya Biryukov2019-05-231-0/+2
| | | | | | This is a trivial follow-up to r361461, so sending without review. llvm-svn: 361510
* Ensure builtins use the target default Calling ConventionErich Keane2019-05-232-27/+32
| | | | | | | | | | | | | | | | | r355317 changed builtins/allocation functions to use the default calling convention in order to support platforms that use non-cdecl calling conventions by default. However the default calling convention is overridable on Windows 32 bit implementations with some of the /G options. The intent is to permit the user to set the calling convention of normal functions, however it should NOT apply to builtins and C++ allocation functions. This patch ensures that the builtin/allocation functions always use the Target specific Calling Convention, ignoring the user overridden version of said default. llvm-svn: 361507
* [Driver] Try normalized triple when looking for C++ librariesPetr Hosek2019-05-231-0/+5
| | | | | | | | | | This addresses the issue introduced in r361432 where we would only try effective triple but not the normalized one as we do for other runtimes. Differential Revision: https://reviews.llvm.org/D62286 llvm-svn: 361504
* Work around a Visual C++ bug.Paul Robinson2019-05-231-6/+16
| | | | | | | | | | | | | | | | Using a static function as a template parameter gets a bogus compile-time error with Visual Studio 2017, prior to version 15.8. Our current minimum-version requirement is a particular update to VS2015, and we assume all Visual Studio 2017 versions are usable. This patch makes the code buildable with older versions of VS2017, and can be reverted after we upgrade the minimum version sometime in the future. Description of the Microsoft bug: https://developercommunity.visualstudio.com/content/problem/25334/error-code-c2971-when-specifying-a-function-as-the.html Differential Revision: https://reviews.llvm.org/D62202 llvm-svn: 361502
* Delete default constructors, copy constructors, move constructors, copy ↵Dmitri Gribenko2019-05-231-11/+8
| | | | | | | | | | | | | | assignment, move assignment operators on Expr, Stmt and Decl Reviewers: ilya-biryukov, rsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62187 llvm-svn: 361468
* Enable queue_t and clk_event_t comparisons in C++ modeSven van Haastregt2019-05-231-1/+1
| | | | | | | | | Support queue_t and clk_event_t comparisons in C++ for OpenCL mode, to preserve backwards compatibility with OpenCL C. Differential Revision: https://reviews.llvm.org/D62208 llvm-svn: 361467
* [CodeComplete] Complete a lambda when preferred type is a functionIlya Biryukov2019-05-231-0/+71
| | | | | | | | | | | | | | | | Summary: Uses a heuristic to detect std::function and friends. Reviewers: kadircet Reviewed By: kadircet Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62238 llvm-svn: 361461
* [runtimes] Move libunwind, libc++abi and libc++ to lib/$target/c++ and ↵Petr Hosek2019-05-223-3/+9
| | | | | | | | | | | | | | | | | include/c++ This change is a consequence of the discussion in "RFC: Place libs in Clang-dedicated directories", specifically the suggestion that libunwind, libc++abi and libc++ shouldn't be using Clang resource directory. Tools like clangd make this assumption, but this is currently not true for the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR build. This change addresses that by moving the output of these libraries to lib/$target/c++ and include/c++ directories, leaving resource directory only for compiler-rt runtimes and Clang builtin headers. Differential Revision: https://reviews.llvm.org/D59168 llvm-svn: 361432
* Add back --sysroot support for darwin header search.James Y Knight2019-05-222-9/+14
| | | | | | | | | | | | | | | | Before e97b5f5cf37e ([clang][Darwin] Refactor header search path logic into the driver), both --sysroot and -isysroot worked to specify where to look for system and C++ headers on Darwin. However, that change caused clang to start ignoring --sysroot. This fixes the regression, and adds tests. (I also note that on all other platforms, clang seems to almost completely ignore -isysroot, but that's another issue...) Differential Revision: https://reviews.llvm.org/D62268 llvm-svn: 361429
* Modules: Code generation of enum constants for merged enum definitionsDavid Blaikie2019-05-221-1/+1
| | | | | | | | | | | | | | | Found in a bootstrap of LLVM with implicit modules, resulting in a deadlock of some Orc unit tests with libstdc++ 8.1. An enum was used as part of the implementation of std::recursive_mutex and this bug resulted in the constant initialization of zero instead of the desired non-zero value. => Badness. Richard Smith tells me neither of these fields are necessarily canonical & so using declaresSamEntity is the right solution here (rather than changing both of these Fields to be canonical by construction/from their source) llvm-svn: 361428
* Part of P1091R3: permit structured bindings to be declared 'static' andRichard Smith2019-05-221-5/+25
| | | | | | 'thread_local' in C++20. llvm-svn: 361424
* [LibTooling] Update Stencil to use RangeSelectorYitzhak Mandelbaum2019-05-221-43/+18
| | | | | | | | | | | | | | | | | | | Add support for creating a `StencilPart` from any `RangeSelector`, which broadens the scope of `Stencil`. Correspondingly, deprecate Stencil's specialized combinators `node` and `sNode` in favor of using the new `selection` combinator directly (with the appropriate range selector). Reviewers: sbenza Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62160 llvm-svn: 361413
* Fixed a -Wunused-variable warning when assertions are disabledDmitri Gribenko2019-05-221-0/+1
| | | | llvm-svn: 361411
* Combine two if cases because the second one is never reached.Amy Huang2019-05-221-6/+4
| | | | | | | | | | Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62214 llvm-svn: 361400
* [LibTooling] Update Transformer to use RangeSelector instead of NodePart enum.Yitzhak Mandelbaum2019-05-221-89/+13
| | | | | | | | | | | | | | | | | Transformer provides an enum to indicate the range of source text to be edited. That support is now redundant with the new (and more general) RangeSelector library, so we remove the custom enum support in favor of supporting any RangeSelector. Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62149 llvm-svn: 361392
* Reland r361148 with a fix to the buildbot failure.Ilya Biryukov2019-05-223-0/+520
| | | | | | | Reverted in r361377. Also reland the '.gn' files (reverted in r361389). llvm-svn: 361391
* [OpenCL] Support pipe keyword in C++ modeSven van Haastregt2019-05-225-8/+21
| | | | | | | | | | | | Support the OpenCL C pipe feature in C++ for OpenCL mode, to preserve backwards compatibility with OpenCL C. Various changes had to be made in Parse and Sema to enable pipe-specific diagnostics, so enable a SemaOpenCL test for C++. Differential Revision: https://reviews.llvm.org/D62181 llvm-svn: 361382
* [CGOpenMPRuntime] emitX86DeclareSimdFunction - assert simdlen/cdtsize is not ↵Simon Pilgrim2019-05-221-2/+3
| | | | | | | | zero. NFCI. Fixes scan-build division by zero warning. llvm-svn: 361379
* Revert r361148 "[Syntax] Introduce TokenBuffer, start clangToolingSyntax ↵Russell Gallop2019-05-223-520/+0
| | | | | | | | | | | | library" Also reverted r361264 "[Syntax] Rename TokensTest to SyntaxTests. NFC" which built on it. This is because there were hitting an assert on bots http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast llvm-svn: 361377
OpenPOWER on IntegriCloud