summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename DiagnosticClient to DiagnosticConsumer as per issue 5397.Fangrui Song2018-04-302-9/+9
| | | | llvm-svn: 331152
* Fix printing of reference-to-reference types.Richard Smith2018-04-292-8/+48
| | | | | | Previously we would sometimes print these as 'T &&&' or even 'T &&&&'. llvm-svn: 331137
* PR37275 packed attribute should not apply to base classesRichard Smith2018-04-294-14/+70
| | | | | | | | | | | | | Clang incorrectly applied the packed attribute to base classes. Per GCC's documentation and as can be observed from its behavior, packed only applies to members, not base classes. This change is conditioned behind -fclang-abi-compat so that an ABI break can be avoided by users if desired. Differential Revision: https://reviews.llvm.org/D46218 llvm-svn: 331136
* Remove unused includes of clang/Config/config.hNico Weber2018-04-285-5/+0
| | | | | | | | | | | | | | | | | | | | Found by opening config.h.cmake in vim, finding all defined macros with /define\(01\)\? \zs[A-Za-z0-9_]*<cr> :%s//\=setreg('A', submatch(0), 'V')/gn<cr> :put A<cr> and then joining them all with |, and passing that to git grep -E that_pattern 'clang/*.h' 'clang/*.cpp' 'clang/*.c' and diffing that output with the result of git grep Config/config.h 'clang/*.h' 'clang/*.cpp' 'clang/*.c' No intended behavior change. llvm-svn: 331124
* [ItaniumMangle] Undeduced auto type shouldn't be substitutable.Erik Pilkington2018-04-282-14/+22
| | | | | | | | | We still support the old mangling if we're trying to be ABI-compatible with Clang 6.0, though. Differential revision: https://reviews.llvm.org/D45451 llvm-svn: 331098
* [analyzer] CStringChecker: Add support for BSD strlcpy() and strlcat().Artem Dergachev2018-04-271-2/+39
| | | | | | | | Patch by David Carlier! Differential Revision: https://reviews.llvm.org/D45177 llvm-svn: 331096
* Fix diag-format test to not care about what cl.exe is on pathReid Kleckner2018-04-271-1/+1
| | | | llvm-svn: 331093
* [analyzer] ObjCAutoreleaseWrite: Support a few more APIs and fix warning text.Artem Dergachev2018-04-272-16/+75
| | | | | | API list and improved warning text composed by Devin Coughlin. llvm-svn: 331089
* Revert r329698 (and r329702).Nico Weber2018-04-272-5/+37
| | | | | | | | | Speculative. ClangMoveTests started failing on http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/9958 after this change. I can't reproduce on my machine, let's see if it was due to this change. llvm-svn: 331077
* s/LLVM_ON_WIN32/_WIN32/, clangNico Weber2018-04-2718-34/+34
| | | | | | | | | | | LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the default macro instead of a reinvented one. See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. No intended behavior change. llvm-svn: 331069
* [clang-format/ObjC] Use getIdentifierInfo() instead of tok::identifierBen Hamilton2018-04-272-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, we checked tokens for `tok::identifier` to see if they were identifiers inside an Objective-C selector. However, this missed C++ keywords like `new` and `delete`. To fix this, this diff uses `getIdentifierInfo()` to find identifiers or keywords inside Objective-C selectors. Test Plan: New tests added. Ran tests with: % make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: djasper, jolesiak Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D46143 llvm-svn: 331067
* [Modules][ObjC] ASTReader should add protocols for class extensionsBruno Cardoso Lopes2018-04-276-0/+43
| | | | | | | | | | | | During deserialization clang is currently missing the merging of protocols into the canonical interface for the class extension. This merging only currently happens during parsing and should also be considered during deserialization. rdar://problem/38724303 llvm-svn: 331063
* [docs] more dashesSanjay Patel2018-04-271-1/+1
| | | | llvm-svn: 331057
* [docs] add -ffp-cast-overflow-workaround to the release notesSanjay Patel2018-04-271-0/+9
| | | | | | | | | This option was added with: D46135 rL331041 ...copying the text from UsersManual.rst for more exposure. llvm-svn: 331056
* [MC] Undo spurious commit added into r331052.Nirav Dave2018-04-271-3/+0
| | | | llvm-svn: 331055
* Test commit removing trailing whitespaceStuart Brady2018-04-271-1/+1
| | | | llvm-svn: 331053
* [MC] Provide default value for IsResolved.Nirav Dave2018-04-271-0/+3
| | | | llvm-svn: 331052
* [MC] Modify MCAsmStreamer to always build MCAssembler. NFCI.Nirav Dave2018-04-271-13/+18
| | | | llvm-svn: 331048
* [Driver, CodeGen] add options to enable/disable an FP cast optimizationSanjay Patel2018-04-278-0/+69
| | | | | | | | | | | | | | | | | | | | | | As discussed in the post-commit thread for: rL330437 ( http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20180423/545906.html ) We need a way to opt-out of a float-to-int-to-float cast optimization because too much existing code relies on the platform-specific undefined result of those casts when the float-to-int overflows. The LLVM changes associated with adding this function attribute are here: rL330947 rL330950 rL330951 Also as suggested, I changed the LLVM doc to mention the specific sanitizer flag that catches this problem: rL330958 Differential Revision: https://reviews.llvm.org/D46135 llvm-svn: 331041
* [ARM,AArch64] Add intrinsics for dot product instructionsOliver Stannard2018-04-276-0/+238
| | | | | | | | | | The ACLE spec which describes these intrinsics hasn't been published yet, but this is based on the final draft which will be published soon, and these have already been implemented by GCC. Differential revision: https://reviews.llvm.org/D46109 llvm-svn: 331039
* [ARM] Add __ARM_FEATURE_DOTPROD pre-defined macroOliver Stannard2018-04-273-0/+12
| | | | | | | | | | | | | | This adds a pre-defined macro to test if the compiler has support for the v8.2-A dot rpoduct intrinsics in AArch32 mode. The AAcrh64 equivalent has already been added by rL330229. The ACLE spec which describes this macro hasn't been published yet, but this is based on the final internal draft, and GCC has already implemented this. Differential revision: https://reviews.llvm.org/D46108 llvm-svn: 331038
* [OpenCL] Add separate read_only and write_only pipe IR typesSven van Haastregt2018-04-277-54/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | SPIR-V encodes the read_only and write_only access qualifiers of pipes, so separate LLVM IR types are required to target SPIR-V. Other backends may also find this useful. These new types are `opencl.pipe_ro_t` and `opencl.pipe_wo_t`, which replace `opencl.pipe_t`. This replaces __get_pipe_num_packets(...) and __get_pipe_max_packets(...) which took a read_only pipe with separate versions for read_only and write_only pipes, namely: * __get_pipe_num_packets_ro(...) * __get_pipe_num_packets_wo(...) * __get_pipe_max_packets_ro(...) * __get_pipe_max_packets_wo(...) These separate versions exist to avoid needing a bitcast to one of the two qualified pipe types. Patch by Stuart Brady. Differential Revision: https://reviews.llvm.org/D46015 llvm-svn: 331026
* Make MultiplexASTDeserializationListener part of the API [NFC]Raphael Isemann2018-04-272-25/+22
| | | | | | | | | | | | | | | | | | | | | Summary: This patch moves the MultiplexASTDeserializationListener declaration into a public header. We're currently using this multiplexer in the cling interpreter to attach another ASTDeserializationListener during the execution (so, after the MultiplexConsumer is already attached which prevents us from attaching more). So far we're doing this by patching clang and making this class public, but it makes things easier if we make this instead just public in upstream. Reviewers: thakis, v.g.vassilev, rsmith, bruno Reviewed By: bruno Subscribers: llvm-commits, cfe-commits, v.g.vassilev Differential Revision: https://reviews.llvm.org/D37475 llvm-svn: 331021
* [CodeGen] Avoid destructing a callee-destructued struct type in aAkira Hatanaka2018-04-278-5/+157
| | | | | | | | | | | | | | | | | | | | | | | function if a function delegates to another function. Fix a bug introduced in r328731, which caused a struct with ObjC __weak fields that was passed to a function to be destructed twice, once in the callee function and once in another function the callee function delegates to. To prevent this, keep track of the callee-destructed structs passed to a function and disable their cleanups at the point of the call to the delegated function. This reapplies r331016, which was reverted in r331019 because it caused an assertion to fail in EmitDelegateCallArg on a windows bot. I made changes to EmitDelegateCallArg so that it doesn't try to deactivate cleanups for structs that have trivial destructors (cleanups for those structs are never pushed to the cleanup stack in EmitParmDecl). rdar://problem/39194693 Differential Revision: https://reviews.llvm.org/D45382 llvm-svn: 331020
* Revert "[CodeGen] Avoid destructing a callee-destructued struct type in a"Akira Hatanaka2018-04-277-143/+5
| | | | | | | | This reverts commit r331016, which broke a windows bot. http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/11727 llvm-svn: 331019
* Fix typo.Richard Smith2018-04-271-2/+2
| | | | llvm-svn: 331017
* [CodeGen] Avoid destructing a callee-destructued struct type in aAkira Hatanaka2018-04-277-5/+143
| | | | | | | | | | | | | | | | | function if a function delegates to another function. Fix a bug introduced in r328731, which caused a struct with ObjC __weak fields that was passed to a function to be destructed twice, once in the callee function and once in another function the callee function delegates to. To prevent this, keep track of the callee-destructed structs passed to a function and disable their cleanups at the point of the call to the delegated function. rdar://problem/39194693 Differential Revision: https://reviews.llvm.org/D45382 llvm-svn: 331016
* [analyzer] Fix operator delete[] array-type-sub-expression handling.Artem Dergachev2018-04-272-2/+22
| | | | | | | | | | | | Avoid crash when the sub-expression of operator delete[] is of array type. This is not the same as simply using a delete[] syntax. We're still not properly calling destructors in this case in the analyzer. Differential Revision: https://reviews.llvm.org/D46146 llvm-svn: 331014
* Parse A::template B as an identifier rather than as a template-id with noRichard Smith2018-04-2719-65/+143
| | | | | | | | | | template arguments. This fixes some cases where we'd incorrectly accept "A::template B" when B is a kind of template that requires template arguments (in particular, a variable template or a concept). llvm-svn: 331013
* [Driver] Don't enable "-fregister-global-dtors-with-atexit" by defaultAkira Hatanaka2018-04-272-1/+3
| | | | | | | | | when compiling the kernel or kexts. Destructors should be registered with atexit by default only when we are compiling userland code. llvm-svn: 331010
* [x86] Revert r330322 (& r330323): Lowering x86 adds/addus/subs/subus intrinsicsChandler Carruth2018-04-265-656/+90
| | | | | | | | The LLVM commit introduces a crash in LLVM's instruction selection. I filed http://llvm.org/PR37260 with the test case. llvm-svn: 330997
* [X86] Make __builtin_ia32_readeflags_u32 and __builtin_ia32_writeeflags_u32 ↵Craig Topper2018-04-263-0/+24
| | | | | | | | | | | | only available on 32-bit targets. These builtins can't be handled by the backend on 64-bit targets. So error up front instead of throwing an isel error. Fixes PR37225 Differential Revision: https://reviews.llvm.org/D46132 llvm-svn: 330987
* Add getDeserializationListener to ASTReaderYuka Takahashi2018-04-261-0/+5
| | | | | | | | | | | | | | | Summary: We need to know if ASTReader already has a DeserializationListner or not, and this also helps to create a multiplexing deserialization listener if there is one already attached. Reviewers: v.g.vassilev, rsmith, dblaikie, thakis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45921 llvm-svn: 330946
* Make test more platform neutralSerge Pavlov2018-04-261-1/+1
| | | | llvm-svn: 330927
* [ConfigFiles] Update argument strings when merging argrument listsSerge Pavlov2018-04-263-1/+6
| | | | | | | | | | | Implementation of `InputArgList` assumes its field `ArgStrings` contains strings for each argument exactly in the same order. This condition was broken when arguments from config file and from invocation were merged. This change fixes https://bugs.llvm.org/show_bug.cgi?id=37196 (Clang config files can crash argument handling). llvm-svn: 330926
* [X86] Add support for _mm512_mullox_epi64 and _mm512_mask_mullox_epi64 ↵Craig Topper2018-04-262-0/+25
| | | | | | | | | | intrinsics to match icc. On AVX512F targets we'll produce an emulated sequence using 3 pmuludqs with shifts and adds. On AVX512DQ we'll use vpmulld. Fixes PR37140. llvm-svn: 330923
* Diagnose missing template arguments for a variable template even when there isRichard Smith2018-04-262-0/+24
| | | | | | | | | a preceding 'template' keyword. We only diagnose in the dependent case (wherein we used to crash). Another bug prevents the diagnostic from appearing in the non-template case. llvm-svn: 330894
* Revert addition of 'concept' to diagnostics in r330890.Richard Smith2018-04-263-9/+6
| | | | | | Matches revert in r330888 of r330794. llvm-svn: 330891
* Factor out common code for diagnosing missing template arguments.Richard Smith2018-04-269-36/+34
| | | | | | In passing, add 'concept' to the list of template kinds in diagnostics. llvm-svn: 330890
* Fix a merge conflict that was inadvertently introduced in r330888 Faisal Vali2018-04-261-6/+0
| | | | | | - during the reversion of r330794 llvm-svn: 330889
* Revert rC330794 and some dependent tiny bug fixes Faisal Vali2018-04-2633-629/+69
| | | | | | | | | | | | | | See Richard's humbling feedback here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226482.html http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226486.html Wish I'd had the patience to solicit the feedback prior to committing :) Sorry for the noise guys. Thank you Richard for being the steward that clang deserves! llvm-svn: 330888
* Switch to Clang's isDigit function.Richard Trieu2018-04-251-4/+4
| | | | | | | | std::isdigit can be overloaded, causing the template deduction to fail. Use Clang's isDigit function which to avoid this. Switch the other calls for consistency. llvm-svn: 330887
* Include <cctype> to get std::isdigit, fixes MSVC STL buildReid Kleckner2018-04-251-0/+1
| | | | llvm-svn: 330886
* [analyzer] Fix a crash on lifetime extension through aggregate initialization.Artem Dergachev2018-04-254-6/+58
| | | | | | | | | | | | If 'A' is a C++ aggregate with a reference field of type 'C', in code like A a = { C() }; C() is lifetime-extended by 'a'. The analyzer wasn't expecting this pattern and crashing. Additionally, destructors aren't added in the CFG for this case, so for now we shouldn't be inlining the constructor for C(). Differential Revision: https://reviews.llvm.org/D46037 llvm-svn: 330882
* Fix crash on qualified template name instantiation if the template name has noRichard Smith2018-04-252-6/+17
| | | | | | template argument list. llvm-svn: 330881
* [RISCV] More validations on the input value of -march=Ana Pazos2018-04-253-79/+561
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Supporting additional rules for parsing ISA string. - RISC-V ISA strings must be lowercase. E.g.: rv32IMC is not supported, rv32imc is correct. - Multi-letter extensions are to be separated by a single underscore '_'. The extension prefix counts as a letter. This means extensions that start with 's', 'sx' and 'sx' are all multi-letter. E.g.: xasb is a single non-standard extension named 'xasb' xa_sb are two extensions, the non-standard user level extension 'xa', and the supervisor level extension 'sb'. - Standard user-level extensions are specified following a canonical order, according to Table 22.1 in RISC-V User-Level ISA V2.2. - Non-standard user-level 'x' extensions, standard supervisor-level 's' extensions and non-standard supervisor-level 'sx' extensions are also specified following a canonical order according to Table 22.1 in RISC-V User-Level ISA V2.2: 'x' extensions, follwed by 's' extensions and then 'sx' extensions. - Extensions might have a version number. Underscores may be used to separate ISA subset components to improve readability and to provide disambiguation. E.g.: rv32i2_m3_a1_f2_d2 - Version numbers are divided into major and minor numbers, separated by a 'p'. If the minor version is 0, then 'p0' can be omitted. - Additional checks for dependent extensions and invalid extensions combinations. E.g.: 'e' requires rv32 'e' can't be combined with 'f' nor 'd' 'q' requires rv64 - TODO items have also been marked with comments in the code. Reviewers: asb, kito-cheng Reviewed By: asb Subscribers: edward-jones, mgrang, zzheng, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, shiva0217, cfe-commits Differential Revision: https://reviews.llvm.org/D45284 llvm-svn: 330880
* [driver][darwin] Do not infer -simulator environment for OS version env varsAlex Lorenz2018-04-252-3/+20
| | | | | | | | with non-simulator SDKs rdar://37955008 llvm-svn: 330878
* [analyzer] Enable analysis of WebKit "unified sources".Artem Dergachev2018-04-259-13/+99
| | | | | | | | | | | | | | | | | | | Normally the analyzer begins path-sensitive analysis from functions within the main file, even though the path is allowed to go through any functions within the translation unit. When a recent version of WebKit is compiled, the "unified sources" technique is used, that assumes #including multiple code files into a single main file. Such file would have no functions defined in it, so the analyzer wouldn't be able to find any entry points for path-sensitive analysis. This patch pattern-matches unified file names that are similar to those used by WebKit and allows the analyzer to find entry points in the included code files. A more aggressive/generic approach is being planned as well. Differential Revision: https://reviews.llvm.org/D45839 llvm-svn: 330876
* [Driver] Reland "Android triples are not aliases for other triples."Dan Albert2018-04-252-50/+111
| | | | | | | | | Fixed directory separators in tests to be compatible with both Windows and !Windows. This reverts commit aa423850afa4c16a53c4c492fe254dcad3d5a53e. llvm-svn: 330873
* [test] Add a testcase for MinGW sysroot detections from SVN r330244. NFC.Martin Storsjo2018-04-251-0/+42
| | | | | | Differential Revision: https://reviews.llvm.org/D45985 llvm-svn: 330872
OpenPOWER on IntegriCloud