summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [AMDGPU][HIP] Improve opt-level handlingScott Linder2019-12-055-32/+156
| | | | | | | | | | | | | | | | | Summary: The HIP toolchain invokes `llc` without an explicit opt-level, meaning it always uses the default (-O2). This makes it impossible to use -O1, for example. The HIP toolchain also coerces -Os/-Oz to -O2 even when invoking opt, and it coerces -Og to -O2 rather than -O1. Forward the opt-level to `llc` as well as `opt`, and only coerce levels where it is required. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70987
* [OPENMP][DOCS]Update list of the supported features, NFC.Alexey Bataev2019-12-051-3/+3
|
* [Syntax] Show input code on tests failures. NFCIlya Biryukov2019-12-051-0/+2
|
* [OPENMP50]Add support for if clause for simd part in master taskloop simd ↵Alexey Bataev2019-12-053-18/+45
| | | | | | | directive. According to OpenMP 5.0, the if clause can be applied to simd subdirective in the combined directives.
* [AST] Traverse the class type loc inside the member type loc.Haojian Wu2019-12-053-2/+51
| | | | | | | | | | | | | | | Summary: We are missing this currently. This would fix https://github.com/clangd/clangd/issues/216. Reviewers: ilya-biryukov Subscribers: mgorny, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70849
* Also check /Fo when deciding on the .gcna / .gcda filename (PR44208)Hans Wennborg2019-12-052-1/+6
| | | | Differential revision: https://reviews.llvm.org/D71012
* [AST] Enable expression of OpenCL language address spaces an attributeVictor Lomuller2019-12-054-8/+70
| | | | | | | | | | | | | | | | | | Summary: Enable a way to set OpenCL language address space using attributes in addition to existing keywords. Signed-off-by: Victor Lomuller victor@codeplay.com Reviewers: aaron.ballman, Anastasia Subscribers: yaxunl, ebevhan, cfe-commits, Naghasan Tags: #clang Differential Revision: https://reviews.llvm.org/D71005 Signed-off-by: Alexey Bader <alexey.bader@intel.com>
* Reapply af57dbf12e54 "Add support for options -frounding-math, ↵Melanie Blower2019-12-0522-20/+633
| | | | | | | | | | | | ftrapping-math, -ffp-model=, and -ffp-exception-behavior=" Patch was reverted because https://bugs.llvm.org/show_bug.cgi?id=44048 The original patch is modified to set the strictfp IR attribute explicitly in CodeGen instead of as a side effect of IRBuilder. In the 2nd attempt to reapply there was a windows lit test fail, the tests were fixed to use wildcard matching. Differential Revision: https://reviews.llvm.org/D62731
* Fix the clang interpreter example which was broken by 4fc68b9b7f3e0.Lang Hames2019-12-051-3/+4
|
* [Checkers] Added support for freopen to StreamChecker.Balázs Kéri2019-12-052-0/+87
| | | | | | | | | | | | | | Summary: Extend StreamChecker with a new evaluation function for API call 'freopen'. Reviewers: NoQ, baloghadamsoftware, Szelethus, martong Reviewed By: baloghadamsoftware, martong Subscribers: martong, rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69948
* Revert "Properly convert all declaration non-type template arguments when"David L. Jones2019-12-043-100/+92
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 11d10527852b4d3ed738aa90d8bec0f398160593. This change is problematic with function pointer template parameters. For example, building libcxxabi with futexes (-D_LIBCXXABI_USE_FUTEX) produces this diagnostic: In file included from .../llvm-project/libcxxabi/src/cxa_guard.cpp:15: .../llvm-project/libcxxabi/src/cxa_guard_impl.h:416:54: error: address of function 'PlatformThreadID' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] has_thread_id_support(this->thread_id_address && GetThreadIDArg), ~~ ^~~~~~~~~~~~~~ .../llvm-project/libcxxabi/src/cxa_guard.cpp:38:26: note: in instantiation of member function '__cxxabiv1::(anonymous namespace)::InitByteFutex<&__cxxabiv1::(anonymous namespace)::PlatformFutexWait, &__cxxabiv1::(anonymous namespace)::PlatformFutexWake, &__cxxabiv1::(anonymous namespace)::PlatformThreadID>::InitByteFutex' requested here SelectedImplementation imp(raw_guard_object); ^ .../llvm-project/libcxxabi/src/cxa_guard_impl.h:416:54: note: prefix with the address-of operator to silence this warning has_thread_id_support(this->thread_id_address && GetThreadIDArg), ^ & 1 error generated. The diagnostic is incorrect: adding the address-of operator also fails ("cannot take the address of an rvalue of type 'uint32_t (*)()' (aka 'unsigned int (*)()')").
* Properly convert all declaration non-type template arguments whenRichard Smith2019-12-043-92/+100
| | | | forming non-type template parameter values.
* [c++17] Fix assert / wrong code when passing a noexcept pointer toRichard Smith2019-12-042-4/+19
| | | | | member function to a non-noexcept pointer to member non-type template parameter.
* [clang][IFS] Ignoring -Xlinker/-Xclang arguments in InterfaceStubs pass for now.Puyan Lotfi2019-12-042-0/+5
| | | | | | | | | | | Many of the inputs to clang driver toolchain tools can be things other than files such as -Xclang and -Xlinker arguments. For now we don't take such tool pass-through type arguments (although having an -Xifs would be nice to have to replace things like -emit-merged-ifs). So because for the moment we are not doing any sort of argument pass-through, I am going to have InterfaceStubs Merger ignore any non-file type input arguments. Differential Revision: https://reviews.llvm.org/D70838
* [analyzer] Fix more ObjC accessor body farms after 2073dd2d.Artem Dergachev2019-12-042-5/+17
| | | | | | | | Fix a crash when constructing a body farm for accessors of a property that is declared and @synthesize'd in different (but related) interfaces with the explicit ivar syntax. This is a follow-up for 0b58b80e.
* [clang][IFS] Adding support for new clang interface stubs decl types.Puyan Lotfi2019-12-045-0/+52
| | | | | | | NamespaceAliasDecl UnresolvedUsingTypenameDecl CXXDeductionGuideDecl ConstructorUsingShadowDecl Differential Revision: https://reviews.llvm.org/D70728
* Revert "[OpenMP50] Add parallel master construct, by Chi Chun Chen."Reid Kleckner2019-12-0437-2984/+18
| | | | | | This reverts commit 713dab21e27c987b9114547ce7136bac2e775de9. Tests do not pass on Windows.
* Bug 43965 - Value of _MSVC_LANG doesn't match MSVC++ VS2019 /std:c++latest modeSoumi Manna2019-12-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The patch adds correct value of _MSVC_LANG to match with MSVC++ VS2019 /std:c++latest mode. Bugzilla - Bug 43965 https://bugs.llvm.org/show_bug.cgi?id=43965 The value for a MS specific macro differs from Microsoft starting with VS2019 in /std:c++latest mode. -bash-4.2$ cat msvclang.cpp _MSVC_LANG -bash-4.2$ cl /std:c++latest -E msvclang.cpp Microsoft (R) C/C++ Optimizing Compiler Version 19.20.27508.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved. /std:c++latest is provided as a preview of language features from the latest C++ working draft, and we're eager to hear about bugs and suggestions for improvements. However, note that these features are provided as-is without support, and subject to changes or removal as the working draft evolves. See https://go.microsoft.com/fwlink/?linkid=2045807 for details. msvclang.cpp 201705L -bash-4.2$ clang-cl /std:c++latest -E msvclang.cpp 201704L Reviewers: rnk Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D70996
* [OPENMP50]Add support for if clause for simd part in taskloop simdAlexey Bataev2019-12-044-41/+83
| | | | | | | directive. According to OpenMP 5.0, the `if` clause can be applied to simd subdirective in the combined directive.
* Revert " Reapply af57dbf12e54 "Add support for options ↵Melanie Blower2019-12-0422-633/+20
| | | | | | | -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior="" This reverts commit cdbed2dd856c14687efd741c2d8321686102acb8. Build break on Windows (lit fail)
* Fix crash-on-invalid-code in lambda constant evaluation.James Y Knight2019-12-042-5/+17
| | | | | | | | | | If the lambda used 'this' without without capturing it, an error was emitted, but the constant evaluator would still attempt to lookup the capture, and failing to find it, dereference a null pointer. This only happens in C++17 (as that's when lambdas were made potentially-constexpr). Therefore, I also updated the lambda-expressions.cpp test to run in both C++14 and C++17 modes.
* [OPENMP]Update list of implemented features, NFC.Alexey Bataev2019-12-041-5/+5
|
* [OpenMP50] Add parallel master construct, by Chi Chun Chen.cchen2019-12-0437-18/+2984
| | | | | | | | | | | | Reviewers: ABataev, jdoerfert Reviewed By: ABataev Subscribers: jholewinski, guansong, arphaman, jfb, cfe-commits, sandoval, dreachem Tags: #clang Differential Revision: https://reviews.llvm.org/D70726
* Reapply af57dbf12e54 "Add support for options -frounding-math, ↵Melanie Blower2019-12-0422-20/+633
| | | | | | | | | | ftrapping-math, -ffp-model=, and -ffp-exception-behavior=" Patch was reverted because https://bugs.llvm.org/show_bug.cgi?id=44048 The original patch is modified to set the strictfp IR attribute explicitly in CodeGen instead of as a side effect of IRBuilder Differential Revision: https://reviews.llvm.org/D62731
* Revert "[Coverage] Revise format to reduce binary size"Vedant Kumar2019-12-047-136/+72
| | | | | | | | | | This reverts commit e18531595bba495946aa52c0a16b9f9238cff8bc. On Windows, there is an error: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/54963/steps/stage%201%20check/logs/stdio error: C:\b\slave\sanitizer-windows\build\stage1\projects\compiler-rt\test\profile\Profile-x86_64\Output\instrprof-merging.cpp.tmp.v1.o: Failed to load coverage: Malformed coverage data
* [Coverage] Revise format to reduce binary sizeVedant Kumar2019-12-047-72/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revise the coverage mapping format to reduce binary size by: 1. Naming function records and marking them `linkonce_odr`, and 2. Compressing filenames. This shrinks the size of llc's coverage segment by 82% (334MB -> 62MB) and speeds up end-to-end single-threaded report generation by 10%. For reference the compressed name data in llc is 81MB (__llvm_prf_names). Rationale for changes to the format: - With the current format, most coverage function records are discarded. E.g., more than 97% of the records in llc are *duplicate* placeholders for functions visible-but-not-used in TUs. Placeholders *are* used to show under-covered functions, but duplicate placeholders waste space. - We reached general consensus about giving (1) a try at the 2017 code coverage BoF [1]. The thinking was that using `linkonce_odr` to merge duplicates is simpler than alternatives like teaching build systems about a coverage-aware database/module/etc on the side. - Revising the format is expensive due to the backwards compatibility requirement, so we might as well compress filenames while we're at it. This shrinks the encoded filenames in llc by 86% (12MB -> 1.6MB). See CoverageMappingFormat.rst for the details on what exactly has changed. Fixes PR34533 [2], hopefully. [1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118428.html [2] https://bugs.llvm.org/show_bug.cgi?id=34533 Differential Revision: https://reviews.llvm.org/D69471
* [HIP] Remove opencl.amdgcn.libYaxun (Sam) Liu2019-12-042-4/+2
| | | | Differential Revision: https://reviews.llvm.org/D70980
* Reapply "[llvm][Support] Take in CurrentDirectory as a parameter in ↵Kadir Cetinkaya2019-12-043-10/+5
| | | | | | ExpandResponseFiles" Attemps to fix windows buildbots.
* Revert "[llvm][Support] Take in CurrentDirectory as a parameter in ↵Kadir Cetinkaya2019-12-043-5/+10
| | | | | | ExpandResponseFiles" This reverts commit 75656005dbc8866e1888932a68a830b0df403560.
* [opencl] Fix address space deduction on array variables.Michael Liao2019-12-042-0/+26
| | | | | | | | | | | | | | Summary: - The deduced address space needs applying to its element type as well. Reviewers: Anastasia Subscribers: yaxunl, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70981
* [ARM][MVE][Intrinsics] Add VMULH/VRMULH intrinsics.Mark Murray2019-12-043-0/+200
| | | | | | | | | | | | Summary: Add MVE VMULH/VRMULH intrinsics and unit tests. Reviewers: simon_tatham, ostannard, dmgreen Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D70948
* [llvm][Support] Take in CurrentDirectory as a parameter in ExpandResponseFilesKadir Cetinkaya2019-12-043-10/+5
| | | | | | | | | | | | | | | | | Summary: This is a follow-up to D70769 and D70222, which allows propagation of current directory down to ExpandResponseFiles for handling of relative paths. Previously clients had to mutate FS to achieve that, which is not thread-safe and can even be thread-hostile in the case of real file system. Reviewers: sammccall Subscribers: hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D70857
* [clang][Tooling] Add support for .rsp files in compile_commands.jsonKadir Cetinkaya2019-12-045-1/+134
| | | | | | | | | | | | | | | | | | | Summary: Add support for .rsp files. Fixes https://github.com/clangd/clangd/issues/81 Patch By: liu hui(@lh123) Reviewers: sammccall, ilya-biryukov, hokein, kadircet Reviewed By: kadircet Subscribers: merge_guards_bot, mgorny, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D70222
* [OpenCL] Allow addr space qualifiers on lambda call expressionsAnastasia Stulova2019-12-042-3/+45
| | | | | | | | | | | | | | | | | | | | | | | | | The addr space qualifier can be added optionally for lambdas after the attributes. They will alter the default addr space of lambda call operator that is in generic address space by default for OpenCL. Syntax: [ captures ] ( params ) specifiers exception attr opencl_addrspace -> ret { body } Example: [&] (int i) mutable __global { ... }; On the call into lambda a compatibility check will be performed to determine whether address space of lambda object and its call operator are compatible. This will follow regular addr space conversion rules and there will be no difference to how addr spaces work in method qualifiers. Tags: #clang Differential Revision: https://reviews.llvm.org/D70242
* Actually delay processing DelayedDllExportClasses until the outermost class ↵Hans Wennborg2019-12-045-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | is finished (PR40006) This was already the intention of DelayedDllExportClasses, but code such as this would break it: template<typename> struct Tmpl {}; struct Outer { struct Inner { __declspec(dllexport) Inner() = default; unsigned int x = 0; }; Tmpl<Inner> y; }; ActOnFinishCXXNonNestedClass() would get called when the instantiation of Templ<Inner> is finished, even though the compiler is still not finished with Outer, causing the compile fail. This hooks into Sema::{Push,Pop}ParsingClass() to avoid calling ActOnFinishCXXNonNestedClass() for template instantiations while a class is being parsed. Differential revision: https://reviews.llvm.org/D70905
* [CodeGen][ObjC] Emit a primitive store to store a __strong field inAkira Hatanaka2019-12-033-2/+28
| | | | | | | | | | ExpandTypeFromArgs This fixes a bug in IRGen where a call to `llvm.objc.storeStrong` was being emitted to initialize a __strong field of an uninitialized temporary struct, which caused crashes at runtime. rdar://problem/51807365
* [Clang] Define Fuchsia C++ABIPetr Hosek2019-12-036-6/+57
| | | | | | | Currently, it is a modified version of the Itanium ABI, with the only change being that constructors and destructors return 'this'. Differential Revision: https://reviews.llvm.org/D70575
* Fix warning on unused variable. NFC.Michael Liao2019-12-031-1/+1
|
* [Diagnostic][test] Remove an unneeded change to ↵Fangrui Song2019-12-031-1/+1
| | | | pragma_diagnostic_sections.cpp after D70638
* Fix `sed -e s@FOO@%/S@` and similar when there's @'s in the working directoryDaniel Sanders2019-12-0321-23/+23
| | | | | | | | | | | | | | | | | | | | | | Jenkins sometimes starts a new working directory by appending @2 (or incrementing the number if the @n suffix is already there). This causes several clang tests to fail as: s@INPUT_DIR@%/S/Inputs@g gets expanded to the invalid: s@INPUT_DIR@/path/to/workdir@2/Inputs@g ~~~~~~~~~~ where the part marked with ~'s is interpreted as the flags. These are invalid and the test fails. Previous fixes simply exchanged the @ character for another like | but that's just moving the problem. Address it by adding an expansion that escapes the @ character we're using as a delimiter as well as other magic characters in the replacement of sed's s@@@. There's still room for expansions to cause trouble though. One I ran into while testing this was that having a directory called foo@bar causes lots of `CHECK-NOT: foo` directives to match. There's also things like directories containing `\1`
* Reapply "Fix crash on switch conditions of non-integer types in templates"Elizabeth Andrews2019-12-037-7/+29
| | | | | | | | | | | | | | | | | | | | This patch reapplies commit 759948467ea. Patch was reverted due to a clang-tidy test fail on Windows. The test has been modified. There are no additional code changes. Patch was tested with ninja check-all on Windows and Linux. Summary of code changes: Clang currently crashes for switch statements inside a template when the condition is a non-integer field member because contextual implicit conversion is skipped when parsing the condition. This conversion is however later checked in an assert when the case statement is handled. The conversion is skipped when parsing the condition because the field member is set as type-dependent based on its containing class. This patch sets the type dependency based on the field's type instead. This patch fixes Bug 40982.
* [NFC] Pass a reference to CodeGenFunction to methods of LValue andAkira Hatanaka2019-12-0321-382/+397
| | | | | | | | | | | | | | AggValueSlot This reapplies 8a5b7c35709d9ce1f44a99f0c5b084bf2696ea17 after a null dereference bug in CGOpenMPRuntime::emitUserDefinedMapper. Original commit message: This is needed for the pointer authentication work we plan to do in the near future. https://github.com/apple/llvm-project/blob/a63a81bd9911f87a0b5dcd5bdd7ccdda7124af87/clang/docs/PointerAuthentication.rst
* [MS] Emit exported complete/vbase destructorsReid Kleckner2019-12-033-3/+17
| | | | | | | | | | | | | | | Summary: Fixes PR44205 I checked, and deleting destructors are not affected. Reviewers: hans Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70931
* Revert "[NFC] Pass a reference to CodeGenFunction to methods of LValue and"Akira Hatanaka2019-12-0321-399/+384
| | | | | This reverts commit 8a5b7c35709d9ce1f44a99f0c5b084bf2696ea17. This seems to have broken UBSan because of a null dereference.
* Fix warning on extra ';'. NFC.Michael Liao2019-12-031-1/+1
|
* [Coverage] Emit a gap region to cover switch bodiesVedant Kumar2019-12-034-13/+60
| | | | | | | | | | | | | | Emit a gap region beginning where the switch body begins. This sets line execution counts in the areas between non-overlapping cases to 0. This also removes some special handling of the first case in a switch: these are now treated like any other case. This does not resolve an outstanding issue with case statement regions that do not end when a region is terminated. But it should address llvm.org/PR44011. Differential Revision: https://reviews.llvm.org/D70571
* Switch to opening the temp file in binary modeAaron Ballman2019-12-031-1/+1
| | | | | This corrects an issue where the script would write the file with the incorrect line endings on Windows.
* [Diagnostic] add a warning which warns about misleading indentationTyker2019-12-039-2/+303
| | | | | | | | | | | | | | Summary: Add a warning for misleading indentation similar to GCC's -Wmisleading-indentation Reviewers: aaron.ballman, xbolva00 Reviewed By: aaron.ballman, xbolva00 Subscribers: tstellar, cfe-commits, arphaman, Ka-Ka, thakis Tags: #clang Differential Revision: https://reviews.llvm.org/D70638
* [NFCI] update formating for misleading indentation warningTyker2019-12-031-11/+10
| | | | | | | | Reviewers: xbolva00 Reviewed By: xbolva00 Differential Revision: https://reviews.llvm.org/D70861
* [NFC] Pass a reference to CodeGenFunction to methods of LValue andAkira Hatanaka2019-12-0321-384/+399
| | | | | | | | | AggValueSlot This is needed for the pointer authentication work we plan to do in the near future. https://github.com/apple/llvm-project/blob/a63a81bd9911f87a0b5dcd5bdd7ccdda7124af87/clang/docs/PointerAuthentication.rst
OpenPOWER on IntegriCloud