summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of typeRichard Smith2019-06-146-9/+26
| | | | | | | | | | | nullptr_t does not access memory. We now reuse CK_NullToPointer to represent a conversion from a glvalue of type nullptr_t to a prvalue of nullptr_t where necessary. This reinstates r363337, reverted in r363352. llvm-svn: 363429
* C++ DR712 and others: handle non-odr-use resulting from an lvalue-to-rvalue ↵Richard Smith2019-06-144-78/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | conversion applied to a member access or similar not-quite-trivial lvalue expression. Summary: When a variable is named in a context where we can't directly emit a reference to it (because we don't know for sure that it's going to be defined, or it's from an enclosing function and not captured, or the reference might not "work" for some reason), we emit a copy of the variable as a global and use that for the known-to-be-read-only access. This reinstates r363295, reverted in r363352, with a fix for PR42276: we now produce a proper name for a non-odr-use reference to a static constexpr data member. The name <mangled-name>.const is used in that case; such names are reserved to the implementation for cases such as this and should demangle nicely. Reviewers: rjmccall Subscribers: jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63157 llvm-svn: 363428
* Reland: [Remarks] Refactor optimization remarks setupFrancis Visoiu Mistrih2019-06-141-27/+24
| | | | | | | | * Add a common function to setup opt-remarks * Rename common options to the same names * Add error types to distinguish between file errors and regex errors llvm-svn: 363415
* [AMDGPU] Enable the implicit arguments for HIP (CLANG)Yaxun Liu2019-06-141-1/+2
| | | | | | | | Enable 48-bytes of implicit arguments for HIP as well. Earlier it was enabled for OpenCL. This code is specific to AMDGPU target. Differential Revision: https://reviews.llvm.org/D62244 llvm-svn: 363414
* AMDGPU: Use AMDGPU toolchain for other OSesMatt Arsenault2019-06-141-0/+2
| | | | | | | This would need more work to actually support them, but this is less wrong than the default. llvm-svn: 363390
* Revert "[OpenCL] Move OpenCLBuiltins.td and remove unused include"Sven van Haastregt2019-06-143-304/+1
| | | | | | | | | This reverts commit r363242 as it broke some builds with make[2]: *** No rule to make target 'ClangOpenCLBuiltinsImpl', needed by 'tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaLookup.cpp.o'. llvm-svn: 363376
* [C++20] add Basic consteval specifierGauthier Harnisch2019-06-1423-161/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: this revision adds Lexing, Parsing and Basic Semantic for the consteval specifier as specified by http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r3.html with this patch, the consteval specifier is treated as constexpr but can only be applied to function declaration. Changes: - add the consteval keyword. - add parsing of consteval specifier for normal declarations and lambdas expressions. - add the whether a declaration is constexpr is now represented by and enum everywhere except for variable because they can't be consteval. - adapt diagnostic about constexpr to print constexpr or consteval depending on the case. - add tests for basic semantic. Reviewers: rsmith, martong, shafik Reviewed By: rsmith Subscribers: eraman, efriedma, rnkovacs, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61790 llvm-svn: 363362
* [clang] Fixing incorrect implicit deduction guides (PR41549)Gauthier Harnisch2019-06-141-0/+6
| | | | | | | | | | | | | | | | | | | | | Summary: [[ https://bugs.llvm.org/show_bug.cgi?id=41549 | bug report ]] Before this patch, implicit deduction guides were generated from the first declaration found by lookup. With this patch implicit deduction guides are generated from the definition of the class template. Also added test that was previously failing. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits, Quuxplusone Tags: #clang Differential Revision: https://reviews.llvm.org/D63072 llvm-svn: 363361
* [clang] Don't segfault on incorrect using directive (PR41400)Gauthier Harnisch2019-06-141-1/+1
| | | | | | | | | | | | | | | | | | | Summary: this is a bugfixe for [[ https://bugs.llvm.org/show_bug.cgi?id=41400 | PR41400 ]] added nullptr check at the relevent place and test Reviewers: rsmith, riccibruno Reviewed By: rsmith Subscribers: jkooker, jkorous, riccibruno, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60523 llvm-svn: 363360
* Revert 363295, it caused PR42276. Also revert follow-ups 363337, 363340.Nico Weber2019-06-149-285/+106
| | | | | | | | Revert 363340 "Remove unused SK_LValueToRValue initialization step." Revert 363337 "PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type" Revert 363295 "C++ DR712 and others: handle non-odr-use resulting from an lvalue-to-rvalue conversion applied to a member access or similar not-quite-trivial lvalue expression." llvm-svn: 363352
* [Targets] Move soft-float-abi filtering to `initFeatureMap`George Burgess IV2019-06-142-14/+25
| | | | | | | | | | | | | | | | | | ARM has a special target feature called soft-float-abi. This feature is special, since we get it passed to us explicitly in the frontend, but filter it out before it can land in any target feature strings in LLVM IR. __attribute__((target(""))) doesn't quite filter these features out properly, so today, we get warnings about soft-float-abi being an unknown feature from the backend. This CL has us filter soft-float-abi out at a slightly different point, so we don't end up passing these invalid features to the backend. Differential Revision: https://reviews.llvm.org/D61750 llvm-svn: 363346
* [AMDGPU] gfx1011/gfx1012 clang supportStanislav Mekhanoshin2019-06-141-0/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D63308 llvm-svn: 363345
* Revert "[Remarks] Refactor optimization remarks setup"Francis Visoiu Mistrih2019-06-141-24/+27
| | | | | | | | This reverts commit 6e6e3af55bb97e1a4c97375c15a2b0099120c5a7. This breaks greendragon. llvm-svn: 363343
* [AMDGPU] gfx1010 wave32 clang supportStanislav Mekhanoshin2019-06-133-6/+39
| | | | | | Differential Revision: https://reviews.llvm.org/D63209 llvm-svn: 363341
* Remove unused SK_LValueToRValue initialization step.Richard Smith2019-06-131-27/+0
| | | | | | | In addition to being unused and duplicating code, this was also wrong (it didn't properly mark the operand as being potentially not odr-used). llvm-svn: 363340
* PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of typeRichard Smith2019-06-136-9/+26
| | | | | | | | | | | | nullptr_t does not access memory. We now reuse CK_NullToPointer to represent a conversion from a glvalue of type nullptr_t to a prvalue of nullptr_t where necessary. This reinstates r345562, reverted in r346065, now that CodeGen's handling of non-odr-used variables has been fixed. llvm-svn: 363337
* Use fully qualified name when printing S_CONSTANT recordsAmy Huang2019-06-131-2/+7
| | | | | | | | | | | | | | | | Summary: Before it was using the fully qualified name only for static data members. Now it does for all variable names to match MSVC. Reviewers: rnk Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63012 llvm-svn: 363335
* [Remarks] Refactor optimization remarks setupFrancis Visoiu Mistrih2019-06-131-27/+24
| | | | | | | | * Add a common function to setup opt-remarks * Rename common options to the same names * Add error types to distinguish between file errors and regex errors llvm-svn: 363328
* C++ DR712 and others: handle non-odr-use resulting from an lvalue-to-rvalue ↵Richard Smith2019-06-134-77/+266
| | | | | | | | | | | | | | | | | | | | | conversion applied to a member access or similar not-quite-trivial lvalue expression. Summary: When a variable is named in a context where we can't directly emit a reference to it (because we don't know for sure that it's going to be defined, or it's from an enclosing function and not captured, or the reference might not "work" for some reason), we emit a copy of the variable as a global and use that for the known-to-be-read-only access. Reviewers: rjmccall Subscribers: jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63157 llvm-svn: 363295
* PR42182: Allow thread-local to use __cxa_thread_atexit whenErich Keane2019-06-131-5/+7
| | | | | | | | | | | -fno-use-cxx-atexit is used This matches the GCC behavior, __cxa_thread_atexit should be permissible even though cxa_atexit is disabled. Differential Revision: https://reviews.llvm.org/D63283/ llvm-svn: 363288
* [clang][NewPM] Fix split debug testLeonard Chan2019-06-131-1/+2
| | | | | | | | | This contains the part of D62225 which fixes CodeGen/split-debug-single-file.c by not placing .dwo sections when using -enable-split-dwarf=split. Differential Revision: https://reviews.llvm.org/D63168 llvm-svn: 363281
* [clang][NewPM] Fix broken profile testLeonard Chan2019-06-131-0/+6
| | | | | | | | | | This contains the part of D62225 which fixes Profile/gcc-flag-compatibility.c by adding the pass that allows default profile generation to work under the new PM. It seems that ./default.profraw was not being generated with new PM enabled. Differential Revision: https://reviews.llvm.org/D63155 llvm-svn: 363278
* [clang][NewPM] Fix broken -O0 test from the AlwaysInlinerLeonard Chan2019-06-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This contains the part of D62225 which prevents insertion of lifetime intrinsics when creating the AlwaysInliner. This fixes the following tests when the new PM is enabled by default: Clang :: CodeGen/aarch64-neon-across.c Clang :: CodeGen/aarch64-neon-fcvt-intrinsics.c Clang :: CodeGen/aarch64-neon-fma.c Clang :: CodeGen/aarch64-neon-perm.c Clang :: CodeGen/aarch64-neon-tbl.c Clang :: CodeGen/aarch64-poly128.c Clang :: CodeGen/aarch64-v8.2a-neon-intrinsics.c Clang :: CodeGen/arm-neon-fma.c Clang :: CodeGen/arm-neon-numeric-maxmin.c Clang :: CodeGen/arm-neon-vcvtX.c Clang :: CodeGen/avx-builtins.c Clang :: CodeGen/builtins-ppc-p9vector.c Clang :: CodeGen/builtins-ppc-vsx.c Clang :: CodeGen/lifetime.c Clang :: CodeGen/sse-builtins.c Clang :: CodeGen/sse2-builtins.c Differential Revision: https://reviews.llvm.org/D63153 llvm-svn: 363277
* Added AST matcher for ignoring elidable constructorsDmitri Gribenko2019-06-131-0/+1
| | | | | | | | | | | | | | | | | | Summary: Added AST matcher for ignoring elidable move constructors Reviewers: hokein, gribozavr Reviewed By: hokein, gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63149 Patch by Johan Vikström. llvm-svn: 363262
* [OpenCL] Move OpenCLBuiltins.td and remove unused includeSven van Haastregt2019-06-133-1/+304
| | | | | | | | Patch by Pierre Gondois. Differential revision: https://reviews.llvm.org/D62849 llvm-svn: 363242
* [WebAssembly] Modernize include path handlingSam Clegg2019-06-132-7/+42
| | | | | | | | | | Move include path construction from InitHeaderSearch::AddDefaultIncludePaths in the Driver which appears to be the more modern/correct way of doing things. Differential Revision: https://reviews.llvm.org/D63030 llvm-svn: 363241
* Add comment to r363191 code as requested in code reviewReid Kleckner2019-06-121-2/+5
| | | | llvm-svn: 363195
* [MS] Pretend constexpr variable template specializations are inlineReid Kleckner2019-06-121-4/+16
| | | | | | | | | | | | | | | | | | | Fixes link errors with clang and the latest Visual C++ 14.21.27702 headers, which was reported as PR42027. I chose to intentionally make these things linkonce_odr, i.e. discardable, so that we don't emit definitions of these things in every translation unit that includes STL headers. Note that this is *not* what MSVC does: MSVC has not yet implemented C++ DR2387, so they emit fully specialized constexpr variable templates with static / internal linkage. Reviewers: rsmith Differential Revision: https://reviews.llvm.org/D63175 llvm-svn: 363191
* PR42220: take into account the possibility of aggregates with baseRichard Smith2019-06-121-0/+3
| | | | | | classes when checking an InitListExpr for lifetime extension. llvm-svn: 363188
* [analyzer] ProgramPoint: more explicit printJson()Csaba Dabis2019-06-121-17/+26
| | | | | | | | | | | | | | | | | Summary: Now we print out every possible kinds of ProgramPoints. Reviewers: NoQ, xazax.hun, ravikandhadai, baloghadamsoftware, Szelethus Reviewed By: NoQ Subscribers: szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62946 llvm-svn: 363187
* [PowerPC] [Clang] Port SSE2 intrinsics to PowerPCZi Xuan Wu2019-06-122-0/+2319
| | | | | | | | | | | | | | | | Port emmintrin.h which include Intel SSE2 intrinsics implementation to PowerPC platform (using Altivec). The new headers containing those implemenations are located into a directory named ppc_wrappers which has higher priority when the platform is PowerPC on Linux. They are mainly developed by Steven Munroe, with contributions from Paul Clarke, Bill Schmidt, Jinsong Ji and Zixuan Wu. It's a follow-up patch of D62121. Patched by: Qiu Chaofan <qiucf@cn.ibm.com> Differential Revision: https://reviews.llvm.org/D62569 llvm-svn: 363122
* [X86] [ABI] Fix i386 ABI "__m64" type bugPengfei Wang2019-06-121-20/+36
| | | | | | | | | | | | | | | | According to System V i386 ABI: the __m64 type paramater and return value are passed by MMX registers. But current implementation treats __m64 as i64 which results in parameter passing by stack and returning by EDX and EAX. This patch fixes the bug (https://bugs.llvm.org/show_bug.cgi?id=41029) for Linux and NetBSD. Patch by Wei Xiao (wxiao3) Differential Revision: https://reviews.llvm.org/D59744 llvm-svn: 363116
* Mark declarations as referenced by a default argument in aRichard Smith2019-06-111-0/+2
| | | | | | | | | potentially-evaluated context. This applies even if the use of the default argument is within an unevaluated context. llvm-svn: 363113
* Remove redundant check for whether a DeclRefExpr that names a captureRichard Smith2019-06-111-10/+1
| | | | | | | | constitutes an odr-use. We now track this accurately on the DeclRefExpr. llvm-svn: 363088
* For DR712: store on a MemberExpr whether it constitutes an odr-use.Richard Smith2019-06-1110-45/+78
| | | | llvm-svn: 363087
* For DR712: store on a DeclRefExpr whether it constitutes an odr-use.Richard Smith2019-06-1116-116/+378
| | | | | | | Begin restructuring to support the forms of non-odr-use reference permitted by DR712. llvm-svn: 363086
* Revert r344630 Disable code object version 3 for HIP toolchain.Yaxun Liu2019-06-111-1/+1
| | | | | | Remove the workaround so that by default code object v3 is enabled. llvm-svn: 363076
* [libclang] Allow skipping warnings from all included filesNikolai Kosjar2019-06-111-22/+46
| | | | | | | | | | | | Depending on the included files and the used warning flags, e.g. - Weverything, a huge number of warnings can be reported for included files. As processing that many diagnostics comes with a performance impact and not all clients are interested in those diagnostics, add a flag to skip them. Differential Revision: https://reviews.llvm.org/D48116 llvm-svn: 363067
* [ASTImporter] Fix unhandled cases in ASTImporterLookupTableGabor Marton2019-06-112-7/+21
| | | | | | | | | | | | | | | | | | | | | Summary: In most cases the FriendDecl contains the declaration of the befriended class as a child node, so it is discovered during the recursive visitation. However, there are cases when the befriended class is not a child, thus it must be fetched explicitly from the FriendDecl, and only then can we add it to the lookup table. (Note, this does affect only CTU and does not affect LLDB, because we cannot and do not use the ASTImporterLookupTable in LLDB.) Reviewers: a_sidorin, a.sidorin, shafik Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62064 llvm-svn: 363062
* [RISCV] Add inline asm constraints I, J & K for RISC-VLewis Revill2019-06-112-3/+21
| | | | | | | | | | | | | | | | This allows the constraints I, J & K to be used in inline asm for RISC-V, with the following semantics (equivalent to GCC): I: Any 12-bit signed immediate. J: Integer zero only. K: Any 5-bit unsigned immediate. See the GCC definitions here: https://gcc.gnu.org/onlinedocs/gccint/Machine-Constraints.html Differential Revision: https://reviews.llvm.org/D54091 llvm-svn: 363055
* [X86] Enable intrinsics that convert float and bf16 data to each otherPengfei Wang2019-06-113-0/+144
| | | | | | | | | | | | | | | | Scalar version : _mm_cvtsbh_ss , _mm_cvtness_sbh Vector version: _mm512_cvtpbh_ps , _mm256_cvtpbh_ps _mm512_maskz_cvtpbh_ps , _mm256_maskz_cvtpbh_ps _mm512_mask_cvtpbh_ps , _mm256_mask_cvtpbh_ps Patch by Shengchen Kan (skan) Differential Revision: https://reviews.llvm.org/D62363 llvm-svn: 363018
* [Frontend] SetUpDiagnosticLog should handle unowned diagnostic consumerAlex Lorenz2019-06-101-3/+7
| | | | | | | | | | | | | in the compiler The function SetUpDiagnosticLog that was called from createDiagnostics didn't handle the case where the diagnostics engine didn't own the diagnostics consumer. This is a potential problem for a clang tool, in particular some of the follow-up patches for clang-scan-deps will need this fix. Differential Revision: https://reviews.llvm.org/D63101 llvm-svn: 363009
* Require stdcall etc parameters to be complete on ODR useReid Kleckner2019-06-101-0/+81
| | | | | | | | | | | | | | | | | | | Functions using stdcall, fastcall, or vectorcall with C linkage mangle in the size of the parameter pack. Calculating the size of the pack requires the parameter types to complete, which may require template instantiation. Previously, we would crash during IRgen when requesting the size of incomplete or uninstantiated types, as in this reduced example: struct Foo; void __fastcall bar(struct Foo o); void (__fastcall *fp)(struct Foo) = &bar; Reported in Chromium here: https://crbug.com/971245 Differential Revision: https://reviews.llvm.org/D62975 llvm-svn: 363000
* [PlistSupport] Produce a newline to end plist output filesHubert Tong2019-06-102-2/+2
| | | | | | | | | | | | | | | | | | | | | Summary: As suggested in the review of D62949, this patch updates the plist output to have a newline at the end of the file. This makes it so that the plist output file qualifies as a POSIX text file, which increases the consumability of the generated plist file in relation to various tools. Reviewers: NoQ, sfertile, xingxue, jasonliu, daltenty Reviewed By: NoQ, xingxue Subscribers: jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63041 llvm-svn: 362992
* [X86] Attempt to make the Intel core CPU inheritance a little more readable ↵Craig Topper2019-06-101-24/+27
| | | | | | | | | | | | and maintainable The recently added cooperlake CPU has made our already ugly switch statement even worse. There's a CPU exclusion list around the bf16 feature in the cooper lake block. I worry that we'll have to keep adding new CPUs to that until bf16 intercepts a client space CPU. We have several other exclusion lists in other parts of the switch due to skylakeserver, cascadelake, and cooperlake not having sgx. Another for cannonlake not having clwb but having all other features from skx. This removes all these special ifs at the cost of some duplication of features and a goto. I've copied all of the skx features into either cannonlake or icelakeclient(for clwb). And pulled sklyakeserver, cascadelake, and cooperlake out of the main inheritance chain into their own chain. At the end of skylakeserver we merge back into the main chain at skylakeclient but below sgx. I think this is at least easier to follow. Differential Revision: https://reviews.llvm.org/D63018 llvm-svn: 362965
* Re-land "[CodeComplete] Improve overload handling for C++ qualified and ↵Sam McCall2019-06-101-20/+121
| | | | | | | | ref-qualified methods." ShadowMapEntry is now really, truly a normal class. llvm-svn: 362950
* Revert "[CodeComplete] Improve overload handling for C++ qualified and ↵Sam McCall2019-06-101-112/+20
| | | | | | | | ref-qualified methods." This reverts commit r362924, which causes a double-free of ShadowMapEntry. llvm-svn: 362944
* Revert "Revert "[CodeComplete] Improve overload handling for C++ qualified ↵Sam McCall2019-06-101-20/+112
| | | | | | | | and ref-qualified methods."" This reverts commit r362830, and relands r362785 with the leak fixed. llvm-svn: 362924
* [analyzer][NFC] Add dividers to BugReporterVisitors.cppKristof Umann2019-06-081-8/+56
| | | | | | | | | Some minor formatting to make the file more readable. Added //===----------===// around the implementation of class methods and divided anonymous namespaces as per https://llvm.org/docs/CodingStandards.html#anonymous-namespaces llvm-svn: 362887
* DebugInfo: Add support for 'nodebug' attribute on typedefs and alias templatesDavid Blaikie2019-06-081-8/+16
| | | | | | | | | Seems like a logical extension to me - and of interest because it might help reduce the debug info size of libc++ by applying this attribute to type traits that have a disproportionate debug info cost compared to the benefit (& possibly harm/confusion) they cause users. llvm-svn: 362856
OpenPOWER on IntegriCloud