summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang][ScanDeps] Fix issue with multiple commands with the same input.Michael Spencer2019-10-311-6/+14
| | | | | | | | | | | | | | | | | | | Previously, given a CompilationDatabase with two commands for the same source file we would report that file twice with the union of the dependencies for each command both times. This was due to the way `ClangTool` runs actions given an input source file (see the comment in `DependencyScanningTool.cpp`). This commit adds a `SingleCommandCompilationDatabase` that is created with each `CompileCommand` in the original CDB, which is then used for each `ClangTool` invocation. This gives us a single run of `DependencyScanningAction` per `CompileCommand`. I looked at using `AllTUsToolExecutor` which is a parallel tool executor, but I'm not sure it's suitable for `clang-scan-deps` as it does a lot more sharing of state than `AllTUsToolExecutor` expects. Differential Revision: https://reviews.llvm.org/D69643
* Remove unneeded template alias, causes issues with some MSVC versionReid Kleckner2019-10-311-3/+1
| | | | | | | | | I built locally with the latest MSVC in c++14 and c++17, but it does not complain for me. Osman Zakir on llvm-dev reports that they run into compile errors here. In any case, it seems prefereable to reuse clang's LLVM.h header to bring in llvm::Optional and Expected.
* [clang-format] Fix SpacesInSquareBrackets for Lambdas with Initial "&ref" ↵Mitchell Balan2019-10-311-1/+1
| | | | | | | | | | | | | | | | | | | Parameter Summary: This fixes an edge case in the `SpacesInSquareBrackets` option where an initial `&ref` lambda parameter is not padded with an initial space. `int foo = [&bar ]() {}` is fixed to give `int foo = [ &bar ]() {}` Reviewers: MyDeveloperDay, klimek, sammccall Reviewed by: MyDeveloperDay Subscribers: cfe-commits Tags: #clang, #clang-format Differential Revision: https://reviews.llvm.org/D69649
* Build fix after 4b6597fNico Weber2019-10-311-1/+1
|
* [clang][analyzer] Using CallDescription in StreamChecker.Balázs Kéri2019-10-311-254/+146
| | | | | | | | | | | | | | | | | | | Summary: Recognization of function names is done now with the CallDescription class instead of using IdentifierInfo. This means function name and argument count is compared too. A new check for filtering not global-C-functions was added. Test was updated. Reviewers: Szelethus, NoQ, baloghadamsoftware, Charusso Reviewed By: Szelethus, NoQ, Charusso Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, donat.nagy, Charusso, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67706
* Make flang driver stuff work on macOSNico Weber2019-10-311-1/+1
| | | | | | | | | | | 6bf55804 added special-case code for TY_PP_Fortran to ToolChain::LookupTypeForExtension(), but Darwin::LookupTypeForExtension() overrode that method without calling the superclass implementation. Make it call the superclass implementation to fix things. Differential Revision: https://reviews.llvm.org/D69636
* [cfi] Add flag to always generate .debug_frameDavid Candler2019-10-313-0/+8
| | | | | | | | | This adds a flag to LLVM and clang to always generate a .debug_frame section, even if other debug information is not being generated. In situations where .eh_frame would normally be emitted, both .debug_frame and .eh_frame will be used. Differential Revision: https://reviews.llvm.org/D67216
* [Diagnostics] Warn for std::is_constant_evaluated in constexpr modeDávid Bolvanský2019-10-311-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: constexpr int fn1() { if constexpr (std::is_constant_evaluated()) // condition is always true! return 0; else return 1; } constexpr int fn2() { if (std::is_constant_evaluated()) return 0; else return 1; } Solves PR42977 Reviewers: rsmith, aaron.ballman Reviewed By: rsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69518
* Run clang-format on lib/CodeGen/CGCall.h and fix indentationAkira Hatanaka2019-10-301-308/+304
|
* Revert "[CodeView] Add option to disable inline line tables."Amy Huang2019-10-303-11/+0
| | | | | | because it breaks compiler-rt tests. This reverts commit 6d03890384517919a3ba7fe4c35535425f278f89.
* [CodeView] Add option to disable inline line tables.Amy Huang2019-10-303-0/+11
| | | | | | | | | | | | | | | | | Summary: This adds a clang option to disable inline line tables. When it is used, the inliner uses the call site as the location of the inlined function instead of marking it as an inline location with the function location. See https://bugs.llvm.org/show_bug.cgi?id=42344 Reviewers: rnk Subscribers: hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D67723
* [clang][ScanDeps] Fix shadowing warning.Michael Spencer2019-10-301-5/+5
|
* [clang][clang-scan-deps] Add support for extracting full module dependencies.Michael Spencer2019-10-305-21/+266
| | | | | | | | | | | This is a recommit of d8a4ef0e685c with the nondeterminism fixed. This adds experimental support for extracting a Clang module dependency graph from a compilation database. The output format is experimental and will change. It is currently a concatenation of JSON outputs for each compilation. Future patches will change this to deduplicate modules between compilations. Differential Revision: https://reviews.llvm.org/D69420
* Revert "[clang][clang-scan-deps] Add support for extracting full module ↵Michael Spencer2019-10-305-266/+21
| | | | | | | | dependencies." This reverts commit d8a4ef0e685cec1fc73d4953b48220b649d05b40. This commit broke some of the bots. I believe it's due to nondeterminism. Will fix and recommit.
* [MS] Don't reference deleted copy ctors from catchable typesReid Kleckner2019-10-301-1/+1
| | | | | | | | | | | When throwing objects with deleted copy constructors, the copy ctor field of the catchable type should remain null and the mangle name changes. This already worked in simple cases, but in cases involving non-trivial subobjects, sometimes LookupCopyingConstructor could return a non-null but deleted constructor decl. Skip those and don't reference them. Fixes PR43680
* [clang][clang-scan-deps] Add support for extracting full module dependencies.Michael Spencer2019-10-305-21/+266
| | | | | | | | | This adds experimental support for extracting a Clang module dependency graph from a compilation database. The output format is experimental and will change. It is currently a concatenation of JSON outputs for each compilation. Future patches will change this to deduplicate modules between compilations. Differential Revision: https://reviews.llvm.org/D69420
* Fix __attribute__((enable_if)) to treat arguments with side-effects asRichard Smith2019-10-301-11/+28
| | | | | | | | non-constant. We previously failed the entire condition evaluation if an unmodeled side-effect was encountered in an argument, even if that argument was unused in the attribute's condition.
* [OPENMP50]Add support for parallel master taskloop simd directive.Alexey Bataev2019-10-3015-16/+258
| | | | Added full support for parallel master taskloop simd directive.
* [ASTImporter] Add support for BuiltinTemplateDeclRaphael Isemann2019-10-301-0/+16
| | | | | | | | | | | | | | | | | Summary: That decl kind is currently not implemented. BuiltinTemplateDecl is for decls that are hardcoded in the ASTContext, so we can import them like we do other builtin decls by just taking the equivalent decl from the target ASTContext. Reviewers: martong, a.sidorin, shafik Reviewed By: martong, shafik Subscribers: rnkovacs, kristina, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69566
* [clang][driver] Add basic --driver-mode=flang support for fortranPeter Waller2019-10-306-1/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new Flang mode. When in Flang mode, the driver will invoke flang for fortran inputs instead of falling back to the GCC toolchain as it would otherwise do. The behaviour of other driver modes are left unmodified to preserve backwards compatibility. It is intended that a soon to be implemented binary in the flang project will import libclangDriver and run the clang driver in the new flang mode. Please note that since the binary invoked by the driver is under development, there will no doubt be further tweaks necessary in future commits. * Initial support is added for basic driver phases * -E, -fsyntax-only, -emit-llvm -S, -emit-llvm, -S, (none specified) * -### tests are added for all of the above * This is more than is supported by f18 so far, which will emit errors for those options which are unimplemented. * A test is added that ensures that clang gives a reasonable error message if flang is not available in the path (without -###). * Test that the driver accepts multiple inputs in --driver-mode=flang. * Test that a combination of C and Fortran inputs run both clang and flang in --driver-mode=flang. * clang/test/Driver/fortran.f95 is fixed to use the correct fortran comment character. Differential revision: https://reviews.llvm.org/D63607
* [MS] Fix constexpr data member pointer conversionsReid Kleckner2019-10-291-2/+18
| | | | | | | | | | | | | | | Constexpr data member conversions work by starting with the class that originally introduced the field, and converting from there to the type that the user desires. Before this change, Clang was using the inheritance model from the final destination class type instead of the model from the class that originally introduced the field. To fix this, find the relevant FieldDecl and take its parent class instead of using the member pointer type the user provided. Indirect field decls require some special handling to find the parent class. Fixes PR43803
* Thread safety analysis: Peel away NoOp implicit casts in initializersAaron Puchert2019-10-301-0/+3
| | | | | | | | | | | | Summary: This happens when someone initializes a variable with guaranteed copy elision and an added const qualifier. Fixes PR43826. Reviewers: aaron.ballman, rsmith Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D69533
* Replace std::function in PrintingPolicy with a callbacks object.Richard Smith2019-10-293-4/+15
| | | | | This makes PrintingPolicy significantly more lightweight and provides groundwork for more printing customization hooks.
* [Headers] Fix compatibility between arm_acle.h and intrin.hEli Friedman2019-10-291-0/+2
| | | | | | Make sure they don't both define __nop. Differential Revision: https://reviews.llvm.org/D69012
* [DWARF5] Added support for deleted C++ special member functions.Adrian Prantl2019-10-291-0/+23
| | | | | | | | | | This patch adds support for deleted C++ special member functions in clang and llvm. Also added Defaulted member encodings for future support for defaulted member functions. Patch by Sourabh Singh Tomar! Differential Revision: https://reviews.llvm.org/D69215
* Fix argument numbering confusion when diagnosing a non-viable operator().Richard Smith2019-10-291-2/+4
| | | | | This could lead to crashes if operator() is a variadic template, as we could end up asking for an out-of-bounds argument.
* isBuiltinFunc() uses StringRef instead of const char*Guillaume Chatelet2019-10-292-3/+2
| | | | | | | | | | | | Summary: This prevents a bug when passing nullptr, StringRef ctor would call strlen(nullptr). Reviewers: vlad.tsyrklevich Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69569
* [clang] Add no_builtin attributeGuillaume Chatelet2019-10-293-4/+96
| | | | | | | | | | | | | | | | Summary: This is a follow up on https://reviews.llvm.org/D61634 This patch is simpler and only adds the no_builtin attribute. Reviewers: tejohnson, courbet, theraven, t.p.northover, jdoerfert Subscribers: mgrang, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68028 This is a re-submit after it got reverted in https://reviews.llvm.org/rGbd8791610948 since the breakage doesn't seem to come from this patch.
* [OPENMP]Fix PR43772: No warning in non-combined target regions.Alexey Bataev2019-10-291-3/+18
| | | | | | Need to analyze inner target regions in case of implicit mapping of the data members when target region is created in one of the class member functions.
* [Hexagon] Handle remaining registers in getRegisterByName()Krzysztof Parzyszek2019-10-291-1/+4
| | | | This fixes https://llvm.org/PR43829.
* [NFC] Fix some indentation disturbed in D67368Reid Kleckner2019-10-281-10/+9
|
* Revert "[clang] Add no_builtin attribute"Vlad Tsyrklevich2019-10-283-96/+4
| | | | | This reverts commit bd87916109483d33455cbf20da2309197b983cdd. It was causing ASan/MSan failures on the sanitizer buildbots.
* Revert "[Concepts] Constraint Enforcement & Diagnostics"Vlad Tsyrklevich2019-10-2814-599/+115
| | | | | This reverts commit ffa214ef22892d75340dc6720271863901dc2c90, it was causing ASAN test failures on sanitizer-x86_64-linux-bootstrap.
* Revert "Use -fdebug-compilation-dir to form absolute paths in coverage mappings"Reid Kleckner2019-10-282-24/+9
| | | | | | | This reverts commit 9d4806a387892972fd544c0dcaefb0926126220c. There seem to be bugs in llvm-cov --path-equivalence that are causing Chromium problems. Revert this until they are understood or fixed.
* [Driver] Enable ShadowCallStack, not SafeStack, by default on AArch64 FuchsiaLeonard Chan2019-10-281-1/+6
| | | | | | | | | | | Submitted for mcgrathr. On AArch64, Fuchsia fully supports both SafeStack and ShadowCallStack ABIs. The latter is now preferred and will be the default. It's possible to enable both simultaneously, but ShadowCallStack is believed to have most of the practical benefit of SafeStack with less cost. Differential Revision: https://reviews.llvm.org/D66712
* Lexer::ReadToEndOfLine - fix Token uninitialised value warnings. NFCI.Simon Pilgrim2019-10-281-0/+1
| | | | Use Token::startToken to initialize Token.
* [OPENMP]Fix PR43771: Do not capture contexprs variables.Alexey Bataev2019-10-281-1/+5
| | | | If the variable is a constexpr variable, it should not be captured in the OpenMP region.
* [clang] Add no_builtin attributeGuillaume Chatelet2019-10-283-4/+96
| | | | | | | | | | | | | | Summary: This is a follow up on https://reviews.llvm.org/D61634 This patch is simpler and only adds the no_builtin attribute. Reviewers: tejohnson, courbet, theraven, t.p.northover, jdoerfert Subscribers: mgrang, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68028
* Add Windows Control Flow Guard checks (/guard:cf).Andrew Paverd2019-10-284-21/+40
| | | | | | | | | | | | | | | | | | | Summary: A new function pass (Transforms/CFGuard/CFGuard.cpp) inserts CFGuard checks on indirect function calls, using either the check mechanism (X86, ARM, AArch64) or or the dispatch mechanism (X86-64). The check mechanism requires a new calling convention for the supported targets. The dispatch mechanism adds the target as an operand bundle, which is processed by SelectionDAG. Another pass (CodeGen/CFGuardLongjmp.cpp) identifies and emits valid longjmp targets, as required by /guard:cf. This feature is enabled using the `cfguard` CC1 option. Reviewers: thakis, rnk, theraven, pcc Subscribers: ychen, hans, metalcanine, dmajor, tomrittervg, alex, mehdi_amini, mgorny, javed.absar, kristof.beyls, hiraditya, steven_wu, dexonsmith, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D65761
* [ARM][AArch64] Implement __cls, __clsl and __clsll intrinsics from ACLEvhscampos2019-10-282-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Writing support for three ACLE functions: unsigned int __cls(uint32_t x) unsigned int __clsl(unsigned long x) unsigned int __clsll(uint64_t x) CLS stands for "Count number of leading sign bits". In AArch64, these two intrinsics can be translated into the 'cls' instruction directly. In AArch32, on the other hand, this functionality is achieved by implementing it in terms of clz (count number of leading zeros). Reviewers: compnerd Reviewed By: compnerd Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69250
* [ARM][AArch64] Implement __arm_rsrf, __arm_rsrf64, __arm_wsrf & __arm_wsrf64vhscampos2019-10-281-0/+4
| | | | | | | | | | | | | | | | | Summary: Adding support for ACLE intrinsics. Patch by Michael Platings. Reviewers: chill, t.p.northover, efriedma Reviewed By: chill Subscribers: kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69297
* [clangd] Do not insert parentheses when completing a using declarationIlya Biryukov2019-10-283-26/+25
| | | | | | | | | | | | | | | | | | Summary: Would be nice to also fix this in clang, but that looks like more work if we want to preserve signatures in informative chunks. Fixes https://github.com/clangd/clangd/issues/118 Reviewers: kadircet Reviewed By: kadircet Subscribers: merge_guards_bot, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69382
* [c++20] Enforce rule that a union-like class or class with referenceRichard Smith2019-10-271-3/+36
| | | | members cannot have defaulted comparisons.
* PR43775: don't produce a bogus 'auto' -Wc++98-compat warning for CTADRichard Smith2019-10-271-1/+1
|
* OpenMP: Add convergent to more runtime functionsMatt Arsenault2019-10-271-2/+2
| | | | | Several of these other functions are probably also convergent, but these two seem obviously convergent.
* OpenMP: Add helper function for convergent runtime callsMatt Arsenault2019-10-273-11/+25
| | | | | | Most of the functions emitted here should probably be convergent, but only barriers are currently marked. Introduce this helper before adding convergent to more functions.
* PR43762: when implicitly changing the active union member for anRichard Smith2019-10-271-3/+10
| | | | | assignment during constant evaluation, only start the lifetime of trivially-default-constructible union members.
* Fix a spelling mistake in a couple of intrinsic description comments. NFCGreg Bedwell2019-10-271-2/+2
|
* [clang][DependencyScanning] 80-col.Michael Spencer2019-10-251-3/+5
|
* [Sema][Typo Correction] Fix another infinite loop on ambiguityDavid Goldman2019-10-251-2/+3
| | | | | | | | | | | See also: D67515 - For the given call expression we would end up repeatedly trying to transform the same expression over and over again - Fix is to keep the old TransformCache when checking for ambiguity Differential Revision: https://reviews.llvm.org/D69060
OpenPOWER on IntegriCloud