summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [test][Driver] Fix Clang :: Driver/cl-response-file.cRainer Orth2019-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang :: Driver/cl-response-file.c currently FAILs on Solaris: Command Output (stderr): -- /vol/llvm/src/clang/dist/test/Driver/cl-response-file.c:10:11: error: CHECK: expected string not found in input // CHECK: "-I" "{{.*}}\\Inputs\\cl-response-file\\" "-D" "FOO=2" ^ Looking at the generated response file reveals that this is no surprise: /I/vol/llvm/src/clang/dist/test/Driver\Inputs with no newline at the end. The echo command used to create it boils down to echo 'a\cb' However, one cannot expect \c to be emitted literally: e.g. bash's builtin echo has \c suppress further output I've tried various combinations of builtin echo, /usr/bin/echo, GNU echo if different, the same for printf, and the backslash unescaped and quoted (a\cb and a\\cb). The only combination that worked reliably on Solaris, Linux, and macOS was printf 'a\\cb' so this is what this patch uses. Tested on amd64-pc-solaris2.11 and x86_64-pc-linux-gnu. Differential Revision: https://reviews.llvm.org/D63600 llvm-svn: 363985
* Rename CodeGenFunction::overlapFor* to getOverlapFor*.Richard Smith2019-06-206-15/+15
| | | | llvm-svn: 363980
* P0840R2: support for [[no_unique_address]] attributeRichard Smith2019-06-2021-98/+704
| | | | | | | | | | | | | | | | | Summary: Add support for the C++2a [[no_unique_address]] attribute for targets using the Itanium C++ ABI. This depends on D63371. Reviewers: rjmccall, aaron.ballman Subscribers: dschuff, aheejin, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63451 llvm-svn: 363976
* [clang-tidy] Fail gracefully upon empty database fieldsSerge Guelton2019-06-202-3/+5
| | | | | | | | Fix bz#42281 Differential Revision: https://reviews.llvm.org/D63613 llvm-svn: 363975
* Fix passing structs and AVX vectors through sysv_abiReid Kleckner2019-06-202-8/+67
| | | | | | | | Do this the same way we did it for ms_abi in r324594. Fixes PR36806. llvm-svn: 363973
* Fix crash and rejects-valid when a later template parameter or defaultRichard Smith2019-06-205-12/+70
| | | | | | | | | | | | | | | | | | | | template argument contains a backreference to a dependently-typed earlier parameter. In a case like: template<typename T, T A, decltype(A) = A> struct X {}; template<typename U> auto Y = X<U, 0>(); we previously treated both references to `A` in the third parameter as being of type `int` when checking the template-id in `Y`. That`s wrong; the type of `A` in these contexts is the dependent type `U`. When we encounter a non-type template argument that we can't convert to the parameter type because of type-dependence, we now insert a dependent conversion node so that the SubstNonTypeTemplateParmExpr for the template argument will have the parameter's type rather than whatever type the argument had. llvm-svn: 363972
* [clang][NewPM] Do not eliminate available_externally durng `-O2 -flto` runsLeonard Chan2019-06-201-3/+6
| | | | | | | | | | | | This fixes CodeGen/available-externally-suppress.c when the new pass manager is turned on by default. available_externally was not emitted during -O2 -flto runs when it should still be retained for link time inlining purposes. This can be fixed by checking that we aren't LTOPrelinking when adding the EliminateAvailableExternallyPass. Differential Revision: https://reviews.llvm.org/D63580 llvm-svn: 363971
* [clang][NewPM] Move EntryExitInstrumenterPass to the start of the pipelineLeonard Chan2019-06-202-2/+11
| | | | | | | | | | This fixes CodeGen/x86_64-instrument-functions.c when running under the new pass manager. The pass should go before any other pass to prevent `__cyg_profile_func_enter/exit()` from not being emitted by inlined functions. Differential Revision: https://reviews.llvm.org/D63577 llvm-svn: 363969
* Print additional information about @encode expressions when dumping the AST ↵Aaron Ballman2019-06-203-0/+148
| | | | | | to JSON. llvm-svn: 363966
* Print additional information on dependent scopes when dumping the AST to JSON.Aaron Ballman2019-06-203-366/+658
| | | | llvm-svn: 363965
* [NFC] Fix for InterfaceStubs tests (adding REQUIRES: x86-registered-target).Puyan Lotfi2019-06-2012-0/+12
| | | | | | | | | | clang-hexagon-elf bot was failing with: 'No available targets are compatible with triple "x86_64-unknown-linux-gnu"' Adding a "// REQUIRES: x86-registered-target" to these tests to quiet the bot. llvm-svn: 363963
* [X86] Make _mm_mask_cvtps_ph, _mm_maskz_cvtps_ph, _mm256_mask_cvtps_ph, and ↵Craig Topper2019-06-203-48/+12
| | | | | | | | | | | | | | _mm256_maskz_cvtps_ph aliases for their corresponding cvt_roundps_ph intrinsic. These intrinsics should always take an immediate for the rounding mode. The base instruction comes from before EVEX embdedded rounding. The user should always provide the immediate rather than us assuming CUR_DIRECTION. Make the 512-bit versions also explicit aliases instead of copy pasting the code. llvm-svn: 363961
* [OpenMP] Add support for handling declare target to clause when unified ↵Gheorghe-Teodor Bercea2019-06-208-76/+142
| | | | | | | | | | | | | | | | | | | | | memory is required Summary: This patch adds support for the handling of the variables under the declare target to clause. The variables in this case are handled like link variables are. A pointer is created on the host and then mapped to the device. The runtime will then copy the address of the host variable in the device pointer. Reviewers: ABataev, AlexEichenberger, caomhin Reviewed By: ABataev Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63108 llvm-svn: 363959
* Store a pointer to the return value in a static alloca and let the debugger ↵Amy Huang2019-06-2010-19/+78
| | | | | | | | | | | | | | use that as the variable address for NRVO variables. Subscribers: hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D63361 llvm-svn: 363952
* [clang-ifs] Clang Interface Stubs, first version (second landing attempt).Puyan Lotfi2019-06-2023-0/+956
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change reverts r363649; effectively re-landing r363626. At this point clang::Index::CodegenNameGeneratorImpl has been refactored into clang::AST::ASTNameGenerator. This makes it so that the previous circular link dependency no longer exists, fixing the previous share lib (-DBUILD_SHARED_LIBS=ON) build issue which was the reason for r363649. Clang interface stubs (previously referred to as clang-ifsos) is a new frontend action in clang that allows the generation of stub files that contain mangled name info that can be used to produce a stub library. These stub libraries can be useful for breaking up build dependencies and controlling access to a library's internal symbols. Generation of these stubs can be invoked by: clang -fvisibility=<visibility> -emit-interface-stubs \ -interface-stub-version=<interface format> Notice that -fvisibility (along with use of visibility attributes) can be used to control what symbols get generated. Currently the interface format is experimental but there are a wide range of possibilities here. Currently clang-ifs produces .ifs files that can be thought of as analogous to object (.o) files, but just for the mangled symbol info. In a subsequent patch I intend to add support for merging the .ifs files into one .ifs/.ifso file that can be the input to something like llvm-elfabi to produce something like a .so file or .dll (but without any of the code, just symbols). Differential Revision: https://reviews.llvm.org/D60974 llvm-svn: 363948
* [Sema] Diagnose addr space mismatch while constructing objectsAnastasia Stulova2019-06-208-4/+92
| | | | | | | | | | | | | | If we construct an object in some arbitrary non-default addr space it should fail unless either: - There is an implicit conversion from the address space to default /generic address space. - There is a matching ctor qualified with an address space that is either exactly matching or convertible to the address space of an object. Differential Revision: https://reviews.llvm.org/D62156 llvm-svn: 363944
* Dump more information about expressions involving temporaries when dumping ↵Aaron Ballman2019-06-205-2/+516
| | | | | | the AST to JSON. llvm-svn: 363943
* AIX system headers need stdint.h and inttypes.h to be re-enterableXing Xue2019-06-202-0/+10
| | | | | | | | | | | | | | | | | Summary: AIX system headers need stdint.h and inttypes.h to be re-enterable when macro _STD_TYPES_T is defined so that limit macro definitions such as UINT32_MAX can be found. This patch attempts to allow that on AIX. Reviewers: hubert.reinterpretcast, jasonliu, mclow.lists, EricWF Reviewed by: hubert.reinterpretcast, mclow.lists Subscribers: jfb, jsji, christof, cfe-commits, libcxx-commits, llvm-commits Tags: #LLVM, #clang, #libc++ Differential Revision: https://reviews.llvm.org/D59253 llvm-svn: 363939
* Removing a helper function that was trivial to inline into its only use; NFC.Aaron Ballman2019-06-202-11/+3
| | | | llvm-svn: 363935
* Add test cases for explicit casts when dumping the AST to JSON; NFC.Aaron Ballman2019-06-202-0/+2213
| | | | llvm-svn: 363932
* Dump more information about construct expressions (resolved and unresolved) ↵Aaron Ballman2019-06-204-384/+590
| | | | | | when dumping the AST to JSON. llvm-svn: 363926
* Revert "[clang] Fixing windows buildbot after D61552"Gauthier Harnisch2019-06-201-2/+0
| | | | | | | | This reverts commit 5d5d2ca69e2b29b36db1a7dd1993ead7b7d2680f. has already been fixed by c230eea2f349533468e14672eee94c2016476784 llvm-svn: 363920
* [clang] Fixing windows buildbot after D61552Gauthier Harnisch2019-06-201-0/+2
| | | | | | | | | | | | | | | | Summary: original review : https://reviews.llvm.org/D61552 build bot faillure : http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/110 this adds a missing definition of cxxDeductionGuideDecl. surprisingly it was still working on linux with out it. Reviewers: aaron.ballman Differential Revision: https://reviews.llvm.org/D63592 llvm-svn: 363919
* [clang][ASTMatchers] Add definition for cxxDeductionGuideDecl introduced in ↵Kadir Cetinkaya2019-06-201-0/+2
| | | | | | rL363855 llvm-svn: 363917
* [Testing] Dumping the graph requires assertions be enabledDavid Zarzycki2019-06-201-0/+1
| | | | llvm-svn: 363916
* [clang][AST] Refactoring ASTNameGenerator to use pimpl pattern (NFC).Puyan Lotfi2019-06-202-155/+171
| | | | | | | | | | | The original pimpl pattern used between CodegenNameGenerator and CodegenNameGeneratorImpl did a good job of hiding DataLayout making it so that users of CodegenNameGenerator did not need to link with llvm core. This is an NFC change to neatly wrap ASTNameGenerator in a pimpl. Differential Revision: https://reviews.llvm.org/D63584 llvm-svn: 363908
* [analyzer] exploded-graph-rewriter: Implement a --diff mode.Artem Dergachev2019-06-195-62/+411
| | | | | | | | | | | | | | | | | | | | | In this mode the tool would avoid duplicating the contents of the program state on every node, replacing them with a diff-like dump of changes that happened on that node. This is useful because most of the time we only interested in whether the effect of the statement was modeled correctly. A diffed graph would also be much faster to load and navigate, being much smaller than the original graph. The diffs are computed "semantically" as opposed to plain text diffs. I.e., the diff algorithm is hand-crafted separately for every state trait, taking the underlying data structures into account. This is especially nice for Environment because textual diffs would have been terrible. On the other hand, it requires some boilerplate to implement. Differential Revision: https://reviews.llvm.org/D62761 llvm-svn: 363898
* [analyzer] exploded-graph-rewriter: Fix escaping StringRegions.Artem Dergachev2019-06-194-3/+24
| | | | | | | | | | | Quotes around StringRegions are now escaped and unescaped correctly, producing valid JSON. Additionally, add a forgotten escape for Store values. Differential Revision: https://reviews.llvm.org/D63519 llvm-svn: 363897
* [analyzer] Fix JSON dumps for store clusters.Artem Dergachev2019-06-193-3/+4
| | | | | | | | | | Include a unique pointer so that it was possible to figure out if it's the same cluster in different program states. This allows comparing dumps of different states against each other. Differential Revision: https://reviews.llvm.org/D63362 llvm-svn: 363896
* [analyzer] Fix JSON dumps for location contexts.Artem Dergachev2019-06-195-11/+8
| | | | | | | | | | | Location context ID is a property of the location context, not of an item within it. It's useful to know the id even when there are no items in the context, eg. for the purposes of figuring out how did contents of the Environment for the same location context changed across states. Differential Revision: https://reviews.llvm.org/D62754 llvm-svn: 363895
* [analyzer] Fix JSON dumps for dynamic type information.Artem Dergachev2019-06-192-3/+6
| | | | | | | | They're now valid JSON. Differential Revision: https://reviews.llvm.org/D62716 llvm-svn: 363894
* [analyzer] NFC: Change evalCall() to provide a CallEvent.Artem Dergachev2019-06-1912-87/+96
| | | | | | | | | | | | This changes the checker callback signature to use the modern, easy to use interface. Additionally, this unblocks future work on allowing checkers to implement evalCall() for calls that don't correspond to any call-expression or require additional information that's only available as part of the CallEvent, such as C++ constructors and destructors. Differential Revision: https://reviews.llvm.org/D62440 llvm-svn: 363893
* [analyzer] DeadStores: Add a crude suppression files generated by DriverKit IIG.Artem Dergachev2019-06-193-0/+55
| | | | | | | | | | | | IIG is a replacement for MIG in DriverKit: IIG is autogenerating C++ code. Suppress dead store warnings on such code, as the tool seems to be producing them regularly, and the users of IIG are not in position to address these warnings, as they don't control the autogenerated code. IIG-generated code is identified by looking at the comments at the top of the file. Differential Revision: https://reviews.llvm.org/D63118 llvm-svn: 363892
* [analyzer] RetainCount: Add support for OSRequiredCast().Artem Dergachev2019-06-193-2/+32
| | | | | | | | | | | | | | It's a new API for custom RTTI in Apple IOKit/DriverKit framework that is similar to OSDynamicCast() that's already supported, but crashes instead of returning null (and therefore causing UB when the cast fails unexpectedly). Kind of like cast_or_null<> as opposed to dyn_cast_or_null<> in LLVM's RTTI. Historically, RetainCountChecker was responsible for modeling OSDynamicCast. This is simply an extension of the same functionality. Differential Revision: https://reviews.llvm.org/D63117 llvm-svn: 363891
* [X86] Correct the __min_vector_width__ attribute on a few intrinsics.Craig Topper2019-06-192-5/+5
| | | | llvm-svn: 363890
* [clang][AST] ASTNameGenerator: A refactoring of CodegenNameGeneratorImpl (NFC).Puyan Lotfi2019-06-195-193/+206
| | | | | | | | | | | | This is a NFC refactor move of CodegenNameGeneratorImpl from clang::Index to clang:AST (and rename to ASTNameGenerator). The purpose is to make the highlevel mangling code more reusable inside of clang (say in places like clang FrontendAction). This does not affect anything in CodegenNameGenerator, except that CodegenNameGenerator will now use ASTNameGenerator (in AST). Differential Revision: https://reviews.llvm.org/D63535 llvm-svn: 363878
* Print whether a generic selection expression is result dependent when ↵Aaron Ballman2019-06-193-0/+340
| | | | | | dumping the AST to JSON. llvm-svn: 363873
* Reapply "r363684: AMDGPU: Add GWS instruction builtins"Matt Arsenault2019-06-192-0/+14
| | | | llvm-svn: 363871
* Print out the union field being initialized by an InitListExpr when dumping ↵Aaron Ballman2019-06-193-2/+23
| | | | | | the AST to JSON. llvm-svn: 363869
* Dump the value calculated by a constant expression when dumping the AST to JSON.Aaron Ballman2019-06-194-0/+13
| | | | llvm-svn: 363866
* Switching this test to use output generated by script; NFC.Aaron Ballman2019-06-191-931/+937
| | | | llvm-svn: 363859
* [AST] Fixed extraneous warnings for binary conditional operatorNathan Huckleberry2019-06-192-6/+22
| | | | | | | | | | | | | | | | | | | | Summary: Binary conditional operator gave warnings where ternary operators did not. They have been fixed to warn similarly to ternary operators. Link: https://bugs.llvm.org/show_bug.cgi?id=42239 Reviewers: rsmith, aaron.ballman, nickdesaulniers Reviewed By: rsmith, nickdesaulniers Subscribers: srhines, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63369 llvm-svn: 363857
* [clang] Adapt ASTMatcher to explicit(bool) specifierGauthier Harnisch2019-06-196-15/+229
| | | | | | | | | | | | | | | | | | | | Summary: Changes: - add an ast matcher for deductiong guide. - allow isExplicit matcher for deductiong guide. - add hasExplicitSpecifier matcher which give access to the expression of the explicit specifier if present. Reviewers: klimek, rsmith, aaron.ballman Reviewed By: aaron.ballman Subscribers: aaron.ballman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61552 llvm-svn: 363855
* Add test cases for dumping record definition data to JSON; NFC.Aaron Ballman2019-06-191-0/+5196
| | | | llvm-svn: 363849
* [clang][test] Add missing LambdaTemplateParams test and migrate from getLocStartJordan Rupprecht2019-06-192-3/+4
| | | | | | These were removed a long time ago in r341573, but this test was missed because it was not in cmake llvm-svn: 363848
* [clang][NewPM] Fixing remaining -O0 tests that are broken under new PMLeonard Chan2019-06-1910-7/+148
| | | | | | | | | | | | | | - CodeGen/flatten.c will fail under new PM becausec the new PM AlwaysInliner seems to intentionally inline functions but not call sites marked with alwaysinline (D23299) - Tests that check remarks happen to check them for the inliner which is not turned on at O0. These tests just check that remarks work, but we can make separate tests for the new PM with -O1 so we can turn on the inliner and check the remarks with minimal changes. Differential Revision: https://reviews.llvm.org/D62225 llvm-svn: 363846
* Unify DependencyFileGenerator class and DependencyCollector interface (NFCI)Alex Lorenz2019-06-194-231/+104
| | | | | | | | | | | | | | Make DependencyFileGenerator a DependencyCollector as it was intended when DependencyCollector was introduced. The missing PPCallbacks overrides are added to the DependencyCollector as well. This change will allow clang-scan-deps to access the produced dependencies without writing them out to .d files to disk, so that it will be able collate them and report them to the user. Differential Revision: https://reviews.llvm.org/D63290 llvm-svn: 363840
* [NFC][codeview] Avoid undefined grep in debug-info-codeview-display-name.cppHubert Tong2019-06-191-1/+1
| | | | | | | | | vertical-line is not a BRE special character. POSIX.1-2017 XBD Section 9.3.2 indicates that the interpretation of `\|` is undefined. This patch uses an ERE instead. llvm-svn: 363826
* Revert rL363684 : AMDGPU: Add GWS instruction builtinsSimon Pilgrim2019-06-192-14/+0
| | | | | | | ........ Depends on rL363678 which was reverted at rL363797 llvm-svn: 363824
* [analyzer] SARIF: Add EOF newline; replace diff_sarifHubert Tong2019-06-196-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch applies a change similar to rC363069, but for SARIF files. The `%diff_sarif` lit substitution invokes `diff` with a non-portable `-I` option. The intended effect can be achieved by normalizing the inputs to `diff` beforehand. Such normalization can be done with `grep -Ev`, which is also used by other tests. Additionally, this patch updates the SARIF output to have a newline at the end of the file. This makes it so that the SARIF file qualifies as a POSIX text file, which increases the consumability of the generated file in relation to various tools. Reviewers: NoQ, sfertile, xingxue, jasonliu, daltenty, aaron.ballman Reviewed By: aaron.ballman Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62952 llvm-svn: 363822
OpenPOWER on IntegriCloud