aboutsummaryrefslogtreecommitdiff
path: root/clang
AgeCommit message (Collapse)AuthorFilesLines
2024-01-06[đ˜€đ—œđ—ż] changes to main this commit is based onKoakuma1-1/+1
Created using spr 1.3.4 [skip ci]
2023-11-19[NFC] Fix typos in commentsPhoebe Wang1-2/+2
2023-11-19[clang] Remove unused selStructPtrTy in CGObjCGNU.cpp (NFC)Jie Fu1-2/+0
/llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp:3674:15: error: variable 'selStructPtrTy' set but not used [-Werror,-Wunused-but-set-variable] llvm::Type *selStructPtrTy = SelectorTy; ^ 1 error generated.
2023-11-18[clang] Remove ConstantAggregateBuilderBase::addBitCast (NFC)Youngsuk Kim2-35/+24
* Replace all existing uses of ConstantAggregateBuilderBase::addBitCast, as they involve a no-op ptr-to-ptr bitcast * Remove method ConstantAggregateBuilderBase::addBitCast Opaque ptr cleanup effort (NFC)
2023-11-18[CGObjCMac] Replace calls to ConstantAggregateBuilderBase::addBitCast (NFC)Youngsuk Kim1-17/+11
Replace calls to `ConstantAggregateBuilderBase::addBitCast` that involve a no-op ptr-to-ptr bitcast. Opaque ptr cleanup effort (NFC)
2023-11-18[CGObjCGNU] Remove unneeded method 'CGObjCGNUstep2::EnforceType' (NFC)Youngsuk Kim1-8/+2
Method CGObjCGNUstep2::EnforceType is called from 2 call-sites to perform bitcasts which are no-ops given that opaque pointers are enabled in LLVM. Remove the method. Opaque ptr cleanup effort (NFC).
2023-11-18[CGOpenMPRuntimeGPU] Replace unneeded use of ↔Youngsuk Kim1-3/+1
CreatePointerBitCastOrAddrSpaceCast (NFC) Opaque ptr cleanup effort (NFC)
2023-11-17[clang-format][NFC] Remove a redundant isLiteral() callOwen Pan1-3/+1
2023-11-17[NFC] Fix CSPGO clang pass manager test (#72681)Ellis Hoag1-2/+2
Fix a `CHECK-NOT` line in a cspgo clang test
2023-11-17[clang-format] Fix crashes in AlignArrayOfStructures (#72520)Owen Pan3-2/+36
Fixed #54815. Fixed #55269. Fixed #55493. Fixed #68431.
2023-11-17[OpenACC] Handle lack of construct/directiveerichkeane3-0/+15
Discovered while working on another patch, this patch fixes the case where are construct/directive name isn't provided.
2023-11-17Fix python SyntaxWarnings in check-all output (#72538)Georgios Eleftheriou1-1/+1
By converting the offending strings to raw string literals.
2023-11-17[OpenACC] Implement 'trivial' construct/directive parsing.erichkeane3-0/+96
Now that the `parallel` support has landed, add the other 'trivial' to implement ones that don't require any additional work other than adding them to the StringSwitch.
2023-11-17[OpenACC] Implement initial parsing for `parallel` construct (#72661)Erich Keane9-10/+160
As the first real parsing effort for the OpenACC implementation effort, this implements the parsing for first construct/directive name. This does not do any semantic analysis, nor any of the clauses. Those will come in a future patch. For the time being, we warn when we hit a point that we don't implement the parsing for either of these situations.
2023-11-17Replace getAs with castAs, dyn_cast with cast (NFC) (#72600)Mike Rice1-2/+2
Make the code clear that nullptrs are not expected.
2023-11-17[ClangModule] Fix decl-params-determinisim test after serialization change ↔Steven Wu1-10/+11
(#72572) Fix decl-params-determinisim test after 48be81e1 packed some information in the clang module. The test is to make sure the decls are appearing in a strict ordering and it relies on check the correct field in the bitcode format. Add more explanation in the comments to help future updates when serialization format affects this test.
2023-11-17[Clang] Warn on deprecated specializations used in system headers. (#70353)cor3ntin5-0/+77
When the top of the instantiation stack is in user code. The goal of this PR is to allow deprecation of some char_traits specializations in libc++ as done in https://reviews.llvm.org/D157058 which was later reverted by https://github.com/llvm/llvm-project/pull/66153#issuecomment-1719578384 as Clang never emitted the libc++ warnings. Because Clang likes to eagerly instantiate, we can look for the location of the top of the instantiation stack, and emit a warning if that location is in user code. The warning emission is forced by temporarily instructing the diag engine not to silence warning in system headers.
2023-11-17[Tooling/Inclusion] Avoid narrowing conversions in macro expansion (#72664)Krzysztof Parzyszek1-1/+3
``` clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp:144:65: warning: narrowing conversion of ‘llvm::StringRef(((const char*)"std::experiment al::filesystem::")).llvm::StringRef::size()’ from ‘size_t’ {aka ‘long un signed int’} to ‘unsigned int’ [-Wnarrowing] 144 | #define SYMBOL(Name, NS, Header) {#NS #Name, StringRef(#NS).size (), #Header}, | ~~~~~~~~~~~~~~~~~~~ ^~ clang/lib/Tooling/Inclusions/Stdlib/StdTsSymbolMap.inc:51:1: note: in ex pansion of macro ‘SYMBOL’ 51 | SYMBOL(temp_directory_path, std::experimental::filesystem::, <ex perimental/filesystem>) | ^~~~~~ ```
2023-11-17[coroutines] Introduce [[clang::coro_return_type]] and ↔Utkarsh Saxena8-2/+247
[[clang::coro_wrapper]] (#71945) First step in the implementation of [RFC](https://discourse.llvm.org/t/rfc-lifetime-bound-check-for-parameters-of-coroutines/74253) ([final approved doc](https://docs.google.com/document/d/1hkfXHuvIW1Yv5LI-EIkpWzdWgIoUlzO6Zv_KJpknQzM/edit)). This introduces the concepts of a **coroutine return type** and explicit **coroutine wrapper** functions. --------- Co-authored-by: Chuanqi Xu <yedeng.yd@linux.alibaba.com>
2023-11-17[OpenACC] Rename ParseOpenACCDirective to ParseOpenACCDirectiveDeclerichkeane5-5/+5
The former name is more useful as a callee of the function in a future patch, so as suggested in that review, move the rename here.
2023-11-17[clang][Interp] Implement __builtin_classify_type (#71972)Timm Baeder10-46/+111
This adds some infrastructure for unevaluated builtin calls, and uses the implementation from ExprConstant.cpp
2023-11-17[OpenACC] Initial commits to support OpenACC (#70234)Erich Keane25-27/+304
Initial commits to support OpenACC. This patchset: adds a clang-command line argument '-fopenacc', and starts to define _OPENACC, albeit to '1' instead of the standardized value (since we don't properly implement OpenACC yet). The OpenACC spec defines `_OPENACC` to be equal to the latest standard implemented. However, since we're not done implementing any standard, we've defined this by default to be `1`. As it is useful to run our compiler against existing OpenACC workloads, we're providing a temporary override flag to change the `_OPENACC` value to be any entirely digit value, permitting testing against any existing OpenACC project. Exactly like the OpenMP parser, the OpenACC pragma parser needs to consume and reprocess the tokens. This patch sets up the infrastructure to do so by refactoring the OpenMP version of this into a more general version that works for OpenACC as well. Additionally, this adds a few diagnostics and token kinds to get us started.
2023-11-17[Offloading][NFC] Refactor handling of offloading entries (#72544)Joseph Huber3-113/+42
Summary: This patch is a simple refactoring of code out of the linker wrapper into a common location. The main motivation behind this change is to make it easier to change the handling in the future to accept a triple to be used to emit entries that function on that target.
2023-11-17[APINotes] Upstream APINotesManagerEgor Zhdan10-0/+877
This upstreams more of the Clang API Notes functionality that is currently implemented in the Apple fork: https://github.com/apple/llvm-project/tree/next/clang/lib/APINotes
2023-11-17[MC] Fix compression header size check in ELF writerFangrui Song1-1/+1
This is #66888 with a test. For MC we only use a zstd test, as zlib has a lot of versions/forks with different speed/size tradeoff, which would make the test more brittle. If clang/test/Misc/cc1as-compress.s turns out to be brittle, we could make the string longer.
2023-11-17[clang] Add bitint classification for __builtin_classify_type (#72036)Timm Baeder4-3/+16
See #71911
2023-11-17[clang][Interp] Implement __builtin_bitreverse (#71687)Timm Baeder2-67/+147
Since the return value of this function is slightly more involved than the void/bool/int/size_t return values we've seen so far, also refactor this.
2023-11-17[clang][Interp][NFC] Properly implement IntegralAP::from(IntegralAP)Timm BĂ€der1-1/+6
This used to just pass on the given parameter, but we need to respect the given bit width.
2023-11-15[Driver][NFC] A bit more const for OpenBSD and DragonFlyBrad Smith2-11/+11
2023-11-16[clang-format] Handle lambdas in QualifierAlignment (#72456)Owen Pan3-3/+19
Fixed #62780.
2023-11-16[AArch64] Add support for Cortex-A520, Cortex-A720 and Cortex-X4 CPUs (#72395)Jonathan Thackray3-2/+14
Cortex-A520, Cortex-A720 and Cortex-X4 are Armv9.2 AArch64 CPUs. Technical Reference Manual for Cortex-A520: https://developer.arm.com/documentation/102517/latest/ Technical Reference Manual for Cortex-A720: https://developer.arm.com/documentation/102530/latest/ Technical Reference Manual for Cortex-X4: https://developer.arm.com/documentation/102484/latest/ Patch co-authored by: Sivan Shani <sivan.shani@arm.com>
2023-11-16[Driver,Gnu] Simplify -static -static-pie -shared -pie handling and suppress ↔Fangrui Song4-50/+27
-shared -rdynamic warning These options select different link modes (note: -shared -static can be used together for musl and mingw). It makes sense to place them together, which enables some simplification. The relevant ld options are now consistently placed after -m, similar to GCC. While here, suppress -Wunused-command-line-argument warning when -shared -rdynamic are used together (introduced by commit 291f4a00232b5742940d67e2ecf9168631251317). It can be argued either way whether the warning is justified (in ELF linkers --export-dynamic functionality is subsumed by -shared), but it is not useful (users can do -Wl,--export-dynamic, bypassing the driver diagnostic).
2023-11-16[clang] Ensure fixed point conversions work in C++ (#68344)PiJoules5-4/+56
2023-11-16[StaticAnalyzer] Fix warnings about missing overrideKazu Hirata1-2/+2
This patch fixes: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:609:23: error: 'describe' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:627:23: error: 'describe' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2023-11-16[flang][Driver] Support -rpath, -shared, and -static in the frontend (#66702)Tarun Prabhu1-2/+5
Enable -rpath, -shared, and -static for the flang frontend. This brings it in line with clang. Fixes issue #65546.
2023-11-16[clang][analyzer] Improve 'errno' handling in StdLibraryFunctionsChecker. ↔BalĂĄzs KĂ©ri5-85/+96
(#71392) The checker now displays one combined note tag for errno-related and "case"-related notes. Previous functions in the errno-modeling part that were used for construction of note tags are removed. The note tag added by StdLibraryFunctionsChecker contains the code to display the note tag for 'errno' (this was done previously by these removed functions).
2023-11-16[clang] Make `-fvisibility={}` and `-ftype-visibility={}` benign options. ↔Juergen Ributzka4-2/+145
(#71985) Both options do not affect the AST content that is serialized into the PCM. This commit includes the following changes: 1.) Mark `-fvisibility={}` and `-ftype-visibility={}` as benign options.That means they are no longer considered part of the module hash, which can reduce the number of module variants. 2.) Add a test to verify the generated LLVM IR is not affected by the default visibiliy mode in the module. 3.) Add a test to clang-scan-deps to ensure only one module is build, even if the above mentioned options are used. This fixes rdar://118246054.
2023-11-16[AArch64] Introduce the Armv9.5-A architecture version (#72392)Lucas Duarte Prates5-0/+31
This introduces the Armv9.5-A architecture version, including the relevant command-line option for -march. Mode details about the Armv9.5-A architecture version can be found at: * https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-developments-2023 * https://developer.arm.com/documentation/ddi0602/2023-09/ Patch by Oliver Stannard.
2023-11-16[AIX] Disable flaky ClangScanDeps testJake Egan1-0/+2
I missed this test in PR https://github.com/llvm/llvm-project/pull/72304
2023-11-16[Clang][SME2] Add single and multi min/max by vector builtins (#71707)Sam Tebbs3-0/+902
Adds the following SME2 builtins: svminnm_single_f(16|32|64)_x(2|4) svminnm_f(16|32|64)_x(2|4) svmaxnm_single_f(16|32|64)_x(2|4) svmaxnm_f(16|32|64)_x(2|4) See [ARM-software/acle#217](https://github.com/ARM-software/acle/pull/217) Patch by: Kerry McLaughlin <kerry.mclaughlin@arm.com>
2023-11-16[clang][Interp] Implement IntegralAP::mul() (#72491)Timm Baeder2-7/+21
2023-11-16[CUDA][HIP] make trivial ctor/dtor host device (#72394)Yaxun (Sam) Liu10-8/+71
Make trivial ctor/dtor implicitly host device functions so that they can be used to initialize file-scope device variables to match nvcc behavior. Fixes: https://github.com/llvm/llvm-project/issues/72261 Fixes: SWDEV-432412
2023-11-16Revert "[AArch64][SME2] Add ldr_zt, str_zt builtins and intrinsics (#71795)"Matt Devereau2-59/+0
This reverts commit cc1244980b74f45a06e2002a33444ce757b577aa.
2023-11-16[Clang][Sema] Differentiate between partial/explicit specializations when ↔Krystian Stasiowski4-8/+45
diagnosing unexpanded packs (#72015) This adds `UnexpandedParameterPackContext::UPPC_ExplicitSpecialization` and passes it to `DiagnoseUnexpandedParameterPack` when checking class/variable template explicit specializations. Right now we don't check for unexpanded packs in function template explicit specializations at all, so I will be addressing that in a followup PR.
2023-11-16[clang][Interp] Implement bitwise operations for IntegralAP (#71807)Timm Baeder2-5/+15
2023-11-16[NFC] [C++20] [Modules] Add a test from issue 71484Chuanqi Xu1-0/+41
The example from issue report 71484 works fine on trunk. Add the example to the tests since testing is always good.
2023-11-16[clang][Interp] Implement __builtin_clrsb (#72243)Timm Baeder2-0/+30
2023-11-15[Driver] -rdynamic: remove duplicate -export-dynamicFangrui Song2-16/+11
-export-dynamic is specified twice when -static is not specified. Fix it. While here, make some simplification, which can match GCC behavior as a side benefit: suppress -export-dynamic for -static-pie/-shared. (GCC passes -export-dynamic when -r is specified. This is unimportant trivia). This change largely has no behavior difference, since GNU ld and gold ignore -export-dynamic when creating a statically linked executable or a shared object.
2023-11-16[clang][Interp] Implement __builtin_parity (#71662)Timm Baeder2-1/+32
2023-11-16[clang][Interp] Implement IntegralAP subtraction (#71648)Timm Baeder2-20/+27