aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
AgeCommit message (Collapse)AuthorFilesLines
4 hours[AMDGPU] Support builtin/intrinsics for load monitors on gfx1250 (#150540)Changpeng Fang1-0/+35
5 hours[NFC][HLSL] Let `RootSignatureParser` own the references (#150310)Finn Plummer2-8/+6
- this is a clean up from a review comment that we should let the parser own the constructed `RootSignatureElement`s Original comment here: https://github.com/llvm/llvm-project/pull/147115#discussion_r2192999527.
7 hours[HLSL] Avoid putting the byval attribute on out and inout parameters (#150495)Deric C.1-14/+22
Fixes #148063 by preventing the ByVal attribute from being placed on out and inout function parameters which causes them to be eliminated by the Dead Store Elimination (DSE) pass.
7 hours[clang] Fix const eval of constexpr-unknown relational comparisons. (#150088)Eli Friedman1-2/+4
Like in other places, ignore the reference type of the base. (It might make sense to refactor this at some point.) Fixes #150015.
7 hours[CIR] Implement CK_LValueToRValueBitCast for ComplexType (#150296)Amr Hesham1-2/+6
This change adds support for CK_LValueToRValueBitCast for ComplexType https://github.com/llvm/llvm-project/issues/141365
8 hours[CIR] Unblock destructor alias handling (#150497)Andy Kaylor1-2/+0
This change removes a stale errorNYI message to allow destructor alias handling. The error message was an artifact of the order in which various parts of the implementation were upstreamed. Now that all the parts are in place, all this needed was to remove the diagnostic and add a test.
9 hours[CIR] Add support for normal cleanups (#149948)Andy Kaylor8-33/+469
This change adds basic handling for normal cleanups. This is a very minimal implemention. In particular, it uses a naive substitute for the rich cleanup and EH stack handling that is present in classic codegen and the CIR incubator. This is intended as a temporary implementation to allow incremental progress. It is not expected to scale well enough to be used in a production environment. It will be replaced with the full EHScopeStack handling when such an implementation is needed.
10 hoursclang: Handle deleting pointers to incomplete array types (#150359)Harald van Dijk1-24/+3
CodeGenFunction::EmitCXXDeleteExpr contains logic to go from a pointer to an array to a pointer to the first element of the array using a getelementptr LLVM IR instruction. This was done for pointers that were not variable length arrays, as pointers to variable length arrays never existed in LLVM IR, but rather than checking for arrays that were not variable length arrays, it checked for arrays that had a constant bound. This caused incomplete arrays to be inadvertently omitted. This getelementptr was necessary back when LLVM IR used typed pointers, but they have been gone for a while, a gep with a constant zero offset does nothing now, so we can simplify the code by removing that.
11 hours[clang-format] Fix a bug in `DerivePointerAlignment: true` (#150387)Owen Pan1-2/+3
Fixes #150327
11 hours[clang-format] Add AfterNot to SpaceBeforeParensOptions (#150367)Owen Pan2-1/+3
Closes #149971
12 hours[CIR] Add support for array constructors (#149142)Morris Hafner6-32/+293
This patch upstreams support for creating arrays of classes that require calling a constructor. * Adds the ArrayCtor operation * New lowering pass for lowering ArrayCtor to a loop --------- Co-authored-by: Andy Kaylor <akaylor@nvidia.com> Co-authored-by: Henrich Lauko <xlauko@mail.muni.cz>
12 hours[OpenACC] Fix checking of sub-expressions in cacheerichkeane1-4/+12
Running an external test suite (UDel) showed that our expression comparison for the 'cache' rule checking was overly strict in the presence of irrelevant parens/casts/etc. This patch ensures we skip them when checking. This also changes the diagnostic to say 'sub-expression' instead of variable, which is more correct.
13 hours[OpenMP] Fix initialization order for CopyOverlappedEntryGaps (#150431)Julian Brown1-2/+2
NFC.
13 hours[analyzer] Eliminate unique release point assertion (#150240)Donát Nagy1-6/+8
MallocChecker.cpp has a complex heuristic that supresses reports where the memory release happens during the release of a reference-counted object (to suppress a significant amount of false positives). Previously this logic asserted that there is at most one release point corresponding to a symbol, but it turns out that there is a rare corner case where the symbol can be released, forgotten and then released again. This commit removes that assertion to avoid the crash. (As this issue just affects a bug suppression heuristic, I didn't want to dig deeper and modify the way the state of the symbol is changed.) Fixes #149754
13 hours[clang][Driver] Add a new member for CLANG_DEFAULT_LINKER to ↵parabola946-11/+11
clang::driver::Driver (NFC) (#149784) The default linker can be changed by a CMake variable CLANG_DEFAULT_LINKER, but it is shared in all toolchains. This patch intends to resolve this.
14 hours[OpenMP] Don't emit redundant zero-sized mapping nodes for overlapped ↵Julian Brown1-47/+110
structs (#148947) The handling of overlapped structure mapping in CGOpenMPRuntime.cpp can lead to redundant zero-sized mapping nodes at runtime. This patch fixes it using a combination of approaches: trivially adjacent struct members won't have a mapping node created between them, and for more complicated cases (inheritance) the physical layout of the struct/class is used to make sure that elements aren't missed. I've introduced a new class to track the state whilst iterating over the struct. This reduces a bit of redundancy in the code (accumulating CombinedInfo both during and after the loop), which I think is a bit neater. Before: omptarget --> Entry 0: Base=0x00007fff8d483830, Begin=0x00007fff8d483830, Size=48, Type=0x20, Name=unknown omptarget --> Entry 1: Base=0x00007fff8d483830, Begin=0x00007fff8d483830, Size=0, Type=0x1000000000003, Name=unknown omptarget --> Entry 2: Base=0x00007fff8d483830, Begin=0x00007fff8d483834, Size=0, Type=0x1000000000003, Name=unknown omptarget --> Entry 3: Base=0x00007fff8d483830, Begin=0x00007fff8d483838, Size=0, Type=0x1000000000003, Name=unknown omptarget --> Entry 4: Base=0x00007fff8d483830, Begin=0x00007fff8d48383c, Size=20, Type=0x1000000000003, Name=unknown omptarget --> Entry 5: Base=0x00007fff8d483830, Begin=0x00007fff8d483854, Size=0, Type=0x1000000000003, Name=unknown omptarget --> Entry 6: Base=0x00007fff8d483830, Begin=0x00007fff8d483858, Size=0, Type=0x1000000000003, Name=unknown omptarget --> Entry 7: Base=0x00007fff8d483830, Begin=0x00007fff8d48385c, Size=4, Type=0x1000000000003, Name=unknown omptarget --> Entry 8: Base=0x00007fff8d483830, Begin=0x00007fff8d483830, Size=4, Type=0x1000000000003, Name=unknown omptarget --> Entry 9: Base=0x00007fff8d483830, Begin=0x00007fff8d483834, Size=4, Type=0x1000000000003, Name=unknown omptarget --> Entry 10: Base=0x00007fff8d483830, Begin=0x00007fff8d483838, Size=4, Type=0x1000000000003, Name=unknown omptarget --> Entry 11: Base=0x00007fff8d483840, Begin=0x00005e7665275130, Size=32, Type=0x1000000000013, Name=unknown omptarget --> Entry 12: Base=0x00007fff8d483830, Begin=0x00007fff8d483850, Size=4, Type=0x1000000000003, Name=unknown omptarget --> Entry 13: Base=0x00007fff8d483830, Begin=0x00007fff8d483854, Size=4, Type=0x1000000000003, Name=unknown omptarget --> Entry 14: Base=0x00007fff8d483830, Begin=0x00007fff8d483858, Size=4, Type=0x1000000000003, Name=unknown After: omptarget --> Entry 0: Base=0x00007fffd0f562e0, Begin=0x00007fffd0f562e0, Size=48, Type=0x20, Name=unknown omptarget --> Entry 1: Base=0x00007fffd0f562e0, Begin=0x00007fffd0f562ec, Size=20, Type=0x1000000000003, Name=unknown omptarget --> Entry 2: Base=0x00007fffd0f562e0, Begin=0x00007fffd0f5630c, Size=4, Type=0x1000000000003, Name=unknown omptarget --> Entry 3: Base=0x00007fffd0f562e0, Begin=0x00007fffd0f562e0, Size=4, Type=0x1000000000003, Name=unknown omptarget --> Entry 4: Base=0x00007fffd0f562e0, Begin=0x00007fffd0f562e4, Size=4, Type=0x1000000000003, Name=unknown omptarget --> Entry 5: Base=0x00007fffd0f562e0, Begin=0x00007fffd0f562e8, Size=4, Type=0x1000000000003, Name=unknown omptarget --> Entry 6: Base=0x00007fffd0f562f0, Begin=0x000058b6013fb130, Size=32, Type=0x1000000000013, Name=unknown omptarget --> Entry 7: Base=0x00007fffd0f562e0, Begin=0x00007fffd0f56300, Size=4, Type=0x1000000000003, Name=unknown omptarget --> Entry 8: Base=0x00007fffd0f562e0, Begin=0x00007fffd0f56304, Size=4, Type=0x1000000000003, Name=unknown omptarget --> Entry 9: Base=0x00007fffd0f562e0, Begin=0x00007fffd0f56308, Size=4, Type=0x1000000000003, Name=unknown For code: #include <cstdlib> #include <cstdio> struct S { int x; int y; int z; int *p1; int *p2; }; struct T : public S { int a; int b; int c; }; int main() { T v; v.p1 = (int*) calloc(8, sizeof(int)); v.p2 = (int*) calloc(8, sizeof(int)); #pragma omp target map(tofrom: v, v.x, v.y, v.z, v.p1[:8], v.a, v.b, v.c) { v.x++; v.y += 2; v.z += 3; v.p1[0] += 4; v.a += 7; v.b += 5; v.c += 6; } return 0; }
17 hours[NFC][AMDGPU] Rename "amdgpu-as" to "amdgpu-synchronize-as" (#148627)Pierre van Houtryve1-1/+1
"amdgpu-as" is way too vague and doesn't give enough context. We may want to support it on normal atomics too, to control the synchronized (ordered) AS. If we do that, the name has to be less vague.
19 hours[clang] Fix crash when diagnosing unsupported attributes (#150333)Benjamin Maxwell1-1/+2
In #141305, the attribute argument was (unintentionally) removed from the diagnostic emission. Fixes #150237
20 hours[clang-format] Stop ctor initializer from being inlined (#150361)Eric Li1-1/+2
The colon in a constructor's initializer list triggers the inlining of a nested block as if it was a conditional operator expression. This prevents line breaks under certain circumstances when the initializer list contains braced initializers, which in turn prevents the line formatter from finding a solution. In this commit we exclude colons that are a constructor initializer colon from consideration of nested block inlining. Fixes #97242. Fixes #81822.
20 hours[Clang] Fix a partial ordering bug involving CTAD injected template ↵Younan Zhang1-3/+18
arguments (#149782) The synthesized deduction guides use injected template arguments for distinguishment of explicit and implicit deduction guides. In partial ordering, we may substitute into these injected types when checking consistency. Properly substituting them needs the instantiated class template specializations which isn't the case at that point. So instead, we check their template specialization types. No release note because I think we want a backport, after baking it for a couple of days. Fixes https://github.com/llvm/llvm-project/issues/134613
21 hours[Clang] Suppress deprecated field warnings in implicit functions definitions ↵Shashi Shankar1-0/+6
(#147400) Do not warn on deprecated member used in an implicit definition (such as a defaulted special member function). Co-authored-by: Corentin Jabot <corentinjabot@gmail.com> Fixes #147293
27 hours[clang] Avoid inheriting [[noreturn]] in explicit function template ↵Samarth Narang2-0/+15
specializations (#150003) This patch fixes incorrect behavior in Clang where [[noreturn]] (either spelled or inferred) was being inherited by explicit specializations of function templates or member function templates, even when those specializations returned normally. Follow up on https://github.com/llvm/llvm-project/pull/145166
31 hours[clang][Sema][NFC] Fixed incorrect assert messages in SemaOpenMP (#150305)David Pagan1-9/+9
31 hours[Clang] Make SPIR-V handling only for HIPSPRVJoseph Huber1-2/+2
31 hours[Clang] Fix new driver HIP SPIR-V compilation in device only mode (#150309)Joseph Huber1-2/+5
Summary: This should emit LLVM-IR. Add to the extremely ugly if statement so that this happens correctly.
34 hours[clang][OpenMP] In 6.0, can omit length in array section (#148048)David Pagan1-1/+1
In OpenMP 6.0 specification, section 5.2.5 Array Sections, page 166, lines 28-28: When the length is absent and the size of the dimension is not known, the array section is an assumed-size array. Testing - Updated LIT test - check-all - OpenMP_VV (formerly sollve) test case tests/6.0/target/test_target_assumed_array_size.c
34 hours[CIR] Upstream Cast kinds for ComplexType (#149717)Amr Hesham4-6/+375
This change adds support for cast kinds for ComplexType https://github.com/llvm/llvm-project/issues/141365
35 hours[OpenMP 6.0] Allow only byref arguments with `need_device_addr` modifier on ↵Fazlay Rabbi1-0/+17
`adjust_args` clause (#149586) If the need_device_addr adjust-op modifier is present, each list item that appears in the clause must refer to an argument in the declaration of the function variant that has a reference type. Reference: OpenMP 6.0 [Sec 9.6.2, page 332, line 31-33, adjust_args clause, Restrictions]
37 hours[CIR] Add support for binary operations on bitfield members (#149676)Andres-Salamanca1-1/+1
This PR introduces support for binary operations on bitfield members.
37 hours[Driver] Default to -mv8plus on 32-bit Solaris/SPARC (#150176)Rainer Orth1-1/+12
While investigating PR #149990, I noticed that while both the Oracle Studio compilers and GCC default to `-mv8plus` on 32-bit Solaris/SPARC, Clang does not. This patch fixes this by enabling the `v8plus` feature. Tested on `sparcv9-sun-solaris2.11` and `sparc64-unknown-linux-gnu`.
37 hours[clang-repl] Always clean up scope and context for TopLevelStmtDecl (#150215)Devajith2-3/+3
This fixes an issue introduced by https://github.com/llvm/llvm-project/pull/84150, where failing to pop compound scope, function scope info, and decl context after a failed statement could lead to an inconsistent internal state.
39 hours[Clang] Fix new driver device only compilation for `amdgcnspirv` target ↵Joseph Huber1-3/+10
(#150110) Summary: This is broken with the current target because it was not bundling the output as HIP likes and this would fail if targeting both at the same time.
40 hours[Clang] Fix build on 32-bit platforms after #125556Harald van Dijk1-1/+1
40 hours[Clang] Fix a crash on invalid concept (#150186)Corentin Jabot1-0/+3
Fixes #149986
41 hours[LifetimeSafety] Add loan expiry analysis (#148712)Utkarsh Saxena1-6/+95
This PR adds the `ExpiredLoansAnalysis` class to track which loans have expired. The analysis uses a dataflow lattice (`ExpiredLattice`) to maintain the set of expired loans at each program point. This is a very light weight dataflow analysis and is expected to reach fixed point in ~2 iterations. In principle, this does not need a dataflow analysis but is used for convenience in favour of lean code.
42 hours[NFC][Clang][FMV] Make FMV priority data type future proof. (#150079)Alexandros Lamprineas9-19/+22
FMV priority is the returned value of a polymorphic function. On RISC-V and X86 targets a 32-bit value is enough. On AArch64 we currently need 64 bits and we will soon exceed that. APInt seems to be a suitable replacement for uint64_t, presumably with minimal compile time overhead. It allows bit manipulation, comparison and variable bit width.
42 hours[clang-repl] Improve error message on failed undos (#149396)Aaron Danen1-2/+10
Updated error message logic for undo function. Throws different errors for the case of there being nothing to undo, and for the case of requesting more undos than there are operations to undo. Fixes https://github.com/llvm/llvm-project/issues/143668
44 hours[HIP][Clang][Driver] Move BC preference logic into ROCm detection (#149294)Jakub Chlanda10-82/+134
This patch provides a single point for handling the logic behind choosing common bitcode libraries. The intention is that the users of ROCm installation detector will not have to rewrite options handling code each time the bitcode libraries are queried. This is not too distant from detectors for other architecture that encapsulate the similar decision making process, providing cleaner interface. The only flag left in `getCommonBitcodeLibs` (main point of entry) is `NeedsASanRT`, this is deliberate, as in order to calculate it we need to consult `ToolChain`.
45 hours[Driver] Default to -mcpu=ultrasparc3 on Solaris/SPARC (#149990)Rainer Orth1-1/+6
Prompted by PR #149652, this patch changes the Solaris/SPARC default to -mcpu, matching both the Oracle Studio 12.6 compilers and GCC 16: [[PATCH] Default to -mcpu=ultrasparc3 on Solaris/SPARC](https://gcc.gnu.org/pipermail/gcc-patches/2025-July/690191.html). This is equivalent to enabling the `vis2` feature. Tested on `sparcv9-sun-solaris2.11` and `sparc64-unknown-linux-gnu`.
48 hours[clang][bytecode] Activate primitive fields before initializing them (#149963)Timm Baeder4-39/+63
The initializer itself might need the field to be active.
2 days[clang][bytecode] Only implicitly start lifetime of ↵Timm Baeder1-1/+8
trivially-default-constructible union members (#149835) See https://github.com/llvm/llvm-project/commit/faee39baa87e43f4b746dd77e479268391163658
2 days[clang][timers][stats] Add a flag to enable timers in the stats file (#149946)Alan Zhao1-3/+3
As reported in #138173, enabling `-ftime-report` adds pass timing info to the stats file if `-stats-file` is specified. This was determined to be WAI. However, if one intentionally wants to put timer information in the stats file, using `-ftime-report` may lead to a lot of logspam (that can't be removed by directing stderr to `/dev/null` as that would also redirect compiler errors). To address this, this PR adds a flag `-stats-file-timers` that adds timer data to the stats file without outputting to stderr.
2 days[Clang] Add generated offloading Xarch args to synthesized args (#150142)Joseph Huber1-0/+1
Summary: The synthesized args contains a list of unique pointers, so this should clean this generated argument up once created.
2 days[clang] Set correct CXXABI for UEFI (#150115)Prabhu Rajasekaran1-1/+1
The target triple x86_64-uefi must be assumed to have Microsft ABI by default. Fixes: https://github.com/llvm/llvm-project/issues/150113
2 days[API Notes] Attach API notes to forward declarations of tags (#149951)Doug Gregor1-0/+4
Forward declarations can still have useful API notes applied to them. When the use of the tag is not a definition, apply the API notes immediately. Fixes rdar://156288588.
2 days[Clang] Add elementwise maximumnum/minimumnum builtin functions (#149775)Wenju He2-0/+18
Addresses https://github.com/llvm/llvm-project/issues/112164. minimumnum and maximumnum intrinsics were added in 5bf81e53dbea. The new built-ins can be used for implementing OpenCL math function fmax and fmin in #128506.
2 daysAdding Loongarch64 to OpenBSD parts (#149737)Slava "nerfur" Voronzoff3-1/+5
Adding Loongarch64 to OpenBSD parts
2 days[LifetimeSafety] Add language option for experimental lifetime safety (#149592)Utkarsh Saxena1-2/+1
Add a language option flag for experimental lifetime safety analysis in C++. This change provides a language option to control the experimental lifetime safety analysis feature, making it more explicit and easier to enable/disable. Previously, the feature was controlled indirectly through a diagnostic warning flag, which we do not want to accidentally enable with `-Weverything` (atm)! ### Changes: - Added a new language option `EnableLifetimeSafety` in `LangOptions.def` for experimental lifetime safety analysis in C++ - Added corresponding driver options `-fexperimental-lifetime-safety` and `-fno-experimental-lifetime-safety` in `Options.td` - Modified `AnalysisBasedWarnings.cpp` to use the new language option flag instead of checking if a specific diagnostic is ignored - Updated a test case to use the new flag instead of relying on the warning flag alone
2 days[clang][deps] Remove dependency on `tooling::ToolAction` (#149904)Jan Svoboda1-47/+36
The dependency scanner was initially using a fair amount of infrastructure provided by the `clangTooling` library. Over time, the needs for bespoke handling of command lines grew and the overlap with the tooling library kept shrinking. I don't think the library provides any value anymore. I decided to remove the dependency and only reimplement the small bits required by the scanner. This allowed for a nice simplification, where we no longer need to create temporary dummy `FileManager` instances (mis-named as `DriverFileMgr` in some parts) and `SourceManager` instances to attach to the `DiagnosticsEngine`. That code was copied from the tooling library to support `DiagnosticConsumers` that expect these to exist. The scanner uses a closed set of consumers and none need these objects to exist. The motivation for this (hopefully NFC) patch are some new restrictions to how VFS's can be propagated in Clang that I'm working on.
2 days[KeyInstr] Inline asm atoms (#149076)Orlando Cazalet-Hyams1-1/+6