[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-10 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: I was able to verify that this was indeed the issue by compiling a C++ program using `-gmlt`. Fix is in #148095 https://github.com/llvm/llvm-project/pull/141937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [clang] CTAD alias: Respect explicit deduction guides defined after the first use of the alias template. (PR #125478)

2025-07-08 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: @hokein is there still anything missing to set the feature test macro and mark P1814 as done on https://clang.llvm.org/cxx_status.html#cxx26? https://github.com/llvm/llvm-project/pull/125478 ___ cfe-commits mailing list cfe-commits

[clang] [clang] Fix a typo in documentation (PR #147128)

2025-07-05 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/147128 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-04 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: Thanks for pinpointing this - https://github.com/llvm/llvm-project/pull/147087 https://github.com/llvm/llvm-project/pull/141937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-03 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang updated https://github.com/llvm/llvm-project/pull/141937 >From 185be04e482344ce2f76eeb02859162e1838150e Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Tue, 27 May 2025 19:36:42 + Subject: [PATCH 1/9] [debuginfo][coro] Emit debug info labels for coro

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-01 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang updated https://github.com/llvm/llvm-project/pull/141937 >From 185be04e482344ce2f76eeb02859162e1838150e Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Tue, 27 May 2025 19:36:42 + Subject: [PATCH 1/6] [debuginfo][coro] Emit debug info labels for coro

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-01 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/141937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-01 Thread Adrian Vogelsgesang via cfe-commits
@@ -0,0 +1,148 @@ +; Tests that we add DILabels for the suspend points. +; +; We check both the generated LLVM: +; RUN: opt < %s -passes='cgscc(coro-split)' -S | FileCheck %s +; +; And the debug info: +; RUN: opt < %s -passes='cgscc(coro-split),coro-cleanup' \ +; RUN: | llc -O0

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-01 Thread Adrian Vogelsgesang via cfe-commits
@@ -0,0 +1,148 @@ +; Tests that we add DILabels for the suspend points. +; +; We check both the generated LLVM: +; RUN: opt < %s -passes='cgscc(coro-split)' -S | FileCheck %s +; +; And the debug info: +; RUN: opt < %s -passes='cgscc(coro-split),coro-cleanup' \ +; RUN: | llc -O0

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-01 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang updated https://github.com/llvm/llvm-project/pull/141937 >From 185be04e482344ce2f76eeb02859162e1838150e Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Tue, 27 May 2025 19:36:42 + Subject: [PATCH 1/6] [debuginfo][coro] Emit debug info labels for coro

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-01 Thread Adrian Vogelsgesang via cfe-commits
@@ -2344,11 +2344,15 @@ void ModuleBitcodeWriter::writeDILocalVariable( void ModuleBitcodeWriter::writeDILabel( const DILabel *N, SmallVectorImpl &Record, unsigned Abbrev) { - Record.push_back((uint64_t)N->isDistinct()); + uint64_t IsArtificialFlag = uint64_t(N->isArt

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-01 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/141937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-01 Thread Adrian Vogelsgesang via cfe-commits
@@ -2240,14 +2242,28 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( break; } case bitc::METADATA_LABEL: { -if (Record.size() != 5) +if (Record.size() < 5 || Record.size() > 7) return error("Invalid record"); IsDistinct = Record[0]

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-01 Thread Adrian Vogelsgesang via cfe-commits
@@ -715,6 +715,7 @@ static void printExtendedName(raw_ostream &OS, const DINode *Node, Res = V->getName(); Line = V->getLine(); } else if (const auto *L = dyn_cast(Node)) { +// XXX what are we doing here? Adjust it? vogelsgesang wrote: yes. I ca

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-01 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/141937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-07-01 Thread Adrian Vogelsgesang via cfe-commits
@@ -1133,6 +1133,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseMetadata(bool ModuleLevel) { ++NumMDRecordLoaded; if (Expected MaybeCode = Stream.readRecord(Entry.ID, Record, &Blob)) { + // Crashes called from here! vogelsgesang w

[clang] [NFC][docs][coro] Fix syntax & typos (PR #146282)

2025-06-29 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang closed https://github.com/llvm/llvm-project/pull/146282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-29 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: Thanks for reporting. I actually ended up feeding this document to AI and asked it to do a proof-read. It found a couple more smaller issues. Those are fixed in #146282 now https://github.com/llvm/llvm-project/pull/142651 ___ cfe-

[clang] [NFC][docs][coro] Fix syntax & typos (PR #146282)

2025-06-29 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang updated https://github.com/llvm/llvm-project/pull/146282 >From b547ef22612bdd66abc8076df40924074230c9e3 Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Sun, 29 Jun 2025 17:07:29 + Subject: [PATCH] [NFC][docs][coro] Fix syntax & typos Follow-up fixes

[clang] [NFC][docs][coro] Fix syntax & typos (PR #146282)

2025-06-29 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang created https://github.com/llvm/llvm-project/pull/146282 Follow-up fixes to #142651 >From 21f5dad37ecae2465e9c135e70bec6c040449823 Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Sun, 29 Jun 2025 17:07:29 + Subject: [PATCH] [NFC][docs][coro] Fix syn

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-29 Thread Adrian Vogelsgesang via cfe-commits
@@ -301,177 +735,284 @@ optimized to the equivalent of: std::cout << a+5 << "\n"; } -It should now be obvious why the value of `__int_32_0` remains unchanged -throughout the function. It is important to recognize that `__int_32_0` -does not directly correspond to `a`, bu

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-28 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang updated https://github.com/llvm/llvm-project/pull/141937 >From 185be04e482344ce2f76eeb02859162e1838150e Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Tue, 27 May 2025 19:36:42 + Subject: [PATCH 1/5] [debuginfo][coro] Emit debug info labels for coro

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-28 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: Note that this also influences Swift. The new labels will also be available in Swift. I hope this might also be useful for Swift to improve debugging experience, and hence is actually a good thing? Not sure, though. If you want, I could also skip emitting those labels for

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-28 Thread Adrian Vogelsgesang via cfe-commits
@@ -8,470 +8,966 @@ Debugging C++ Coroutines Introduction -For performance and other architectural reasons, the C++ Coroutines feature in -the Clang compiler is implemented in two parts of the compiler. Semantic -analysis is performed in Clang, and Coroutine cons

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-28 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang closed https://github.com/llvm/llvm-project/pull/142651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-27 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: > I don't feel there are coroutine specific things What I would have had in mind: The integration in the `CoroSplit` pass and the test case changes > I can accept this Thanks! I will still wait for a 2nd review from someone with debuginfo expertise. We still have 3 weeks

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-26 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang updated https://github.com/llvm/llvm-project/pull/141937 >From 8fe2bd74609cf0c14466ff82a9c966c07eecd6c8 Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Tue, 27 May 2025 19:36:42 + Subject: [PATCH 1/5] [debuginfo][coro] Emit debug info labels for coro

[clang] [llvm] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-26 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: Could you review clang and the coroutine-specific pieces? I think the DWARF and `DILabel` aspects @dwblaikie might be able to give feedback? https://github.com/llvm/llvm-project/pull/141937 ___ cfe-commits mailing list cfe-commits@

[clang] [llvm] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-26 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang updated https://github.com/llvm/llvm-project/pull/141937 >From 8fe2bd74609cf0c14466ff82a9c966c07eecd6c8 Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Tue, 27 May 2025 19:36:42 + Subject: [PATCH 1/4] [debuginfo][coro] Emit debug info labels for coro

[clang] [llvm] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-26 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/141937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-26 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang updated https://github.com/llvm/llvm-project/pull/141937 >From 8fe2bd74609cf0c14466ff82a9c966c07eecd6c8 Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Tue, 27 May 2025 19:36:42 + Subject: [PATCH 1/5] [debuginfo][coro] Emit debug info labels for coro

[clang] [llvm] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-26 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/141937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-26 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang updated https://github.com/llvm/llvm-project/pull/141937 >From 8fe2bd74609cf0c14466ff82a9c966c07eecd6c8 Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Tue, 27 May 2025 19:36:42 + Subject: [PATCH 1/4] [debuginfo][coro] Emit debug info labels for coro

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-23 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: @hokein @ChuanqiXu9 @yuxuanchen1997 friendly ping 🙂 https://github.com/llvm/llvm-project/pull/142651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++][Modules] A module directive may only appear as the first preprocessing tokens in a file (PR #144233)

2025-06-14 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: Should this commit also mark the papers as implemented on https://clang.llvm.org/cxx_status.html? https://github.com/llvm/llvm-project/pull/144233 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [llvm] [Transforms] Implement always_specialize attribute lowering (PR #143983)

2025-06-14 Thread Adrian Vogelsgesang via cfe-commits
@@ -0,0 +1,324 @@ +//===- AlwaysSpecializer.cpp - implementation of always_specialize ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [lldb] [llvm] [debuginfo][coro] Fix linkage name for clones of coro functions (PR #141889)

2025-06-11 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/141889 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [llvm] [debuginfo][coro] Fix linkage name for clones of coro functions (PR #141889)

2025-06-11 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang closed https://github.com/llvm/llvm-project/pull/141889 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [llvm] [debuginfo][coro] Fix linkage name for clones of coro functions (PR #141889)

2025-06-11 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/141889 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [llvm] [debuginfo][coro] Fix linkage name for clones of coro functions (PR #141889)

2025-06-11 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/141889 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [llvm] [debuginfo][coro] Fix linkage name for clones of coro functions (PR #141889)

2025-06-11 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/141889 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [llvm] [debuginfo][coro] Fix linkage name for clones of coro functions (PR #141889)

2025-06-10 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: @ChuanqiXu9 do you want to take another look? (given that this is a NFC for Swift, and primarily changes C++ behavior) Alternatively, is it fine by you if I ship this based on @Michael137's approval? https://github.com/llvm/llvm-project/pull/141889 __

[clang] [lldb] [llvm] [debuginfo][coro] Fix linkage name for clones of coro functions (PR #141889)

2025-06-10 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: > The LLDB test failure seems expected. The demangled frame name changed Good catch. I updated the LLDB test expectations just now https://github.com/llvm/llvm-project/pull/141889 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang] [lldb] [llvm] [debuginfo][coro] Fix linkage name for clones of coro functions (PR #141889)

2025-06-10 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang updated https://github.com/llvm/llvm-project/pull/141889 >From 700c1c465ff7f29dc980356f36844a12d580 Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Tue, 27 May 2025 23:50:18 + Subject: [PATCH 1/3] [debuginfo][coro] Fix linkage name for clones of

[clang] [llvm] [clang][DebugInfo] Add symbol for debugger with VTable information. (PR #130255)

2025-06-06 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: Afaict, the issue is not that the address gets optimized out, but rather that we are setting `LineNo` to 0: ``` DBuilder.createGlobalVariableExpression( TheCU, SymbolName, VTable->getName(), Unit, /*LineNo=*/0, getOrCreateType(VoidPtr, Unit), VTable

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-03 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang ready_for_review https://github.com/llvm/llvm-project/pull/142651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-03 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang unassigned https://github.com/llvm/llvm-project/pull/142651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-03 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang unassigned https://github.com/llvm/llvm-project/pull/142651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [debuginfo][coro] Fix linkage name for clones of coro functions (PR #141889)

2025-06-03 Thread Adrian Vogelsgesang via cfe-commits
@@ -124,7 +124,7 @@ static void resolveTopLevelMetadata(llvm::Function *Fn, auto *DIS = Fn->getSubprogram(); if (!DIS) return; - auto *NewDIS = DIS->replaceWithDistinct(DIS->clone()); + auto *NewDIS = llvm::MDNode::replaceWithDistinct(DIS->clone()); v

[clang] [llvm] [debuginfo][coro] Fix linkage name for clones of coro functions (PR #141889)

2025-06-03 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: > Since the change is almost about swift, CC @adrian-prantl Note that this change should be a NFC for Swift. Changing the `DISubprogram::get` call to `Decl->clone() + replaceLinkageName` just simplifies the code, but does not change its semantics. This PR primarily enables

[clang] [llvm] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-03 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: CC @iains @ArsenArsen, since from the gcc commit look, it seems you are working on coroutine support in gcc. Would be great if clang/LLVM and gcc could agree on a common approach to emit debug info for coroutine suspension points 🙂 See https://discourse.llvm.org/t/rfc-deb

[clang] [llvm] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-05-29 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/141937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Propagate elide safe context through [[clang::coro_await_elidable_argument]] (PR #108474)

2024-09-17 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang commented: Looks good to me, but at the same time: I am not experienced in the clang-frontend, so please wait for an approval of a more experienced clang-frontend contributor https://github.com/llvm/llvm-project/pull/108474 __

[clang] [Clang] Propagate elide safe context through [[clang::coro_await_elidable_argument]] (PR #108474)

2024-09-16 Thread Adrian Vogelsgesang via cfe-commits
@@ -880,14 +898,12 @@ ExprResult Sema::BuildUnresolvedCoawaitExpr(SourceLocation Loc, Expr *Operand, } auto *RD = Promise->getType()->getAsCXXRecordDecl(); - bool AwaitElidable = - isCoroAwaitElidableCall(Operand) && - isAttributedCoroAwaitElidable( -

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-16 Thread Adrian Vogelsgesang via cfe-commits
@@ -8261,12 +8261,19 @@ def CoroAwaitElidableDoc : Documentation { The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applied to a coroutine return type. -When a coroutine function that returns such a type calls another coroutine function, -the compiler

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-16 Thread Adrian Vogelsgesang via cfe-commits
@@ -880,14 +898,12 @@ ExprResult Sema::BuildUnresolvedCoawaitExpr(SourceLocation Loc, Expr *Operand, } auto *RD = Promise->getType()->getAsCXXRecordDecl(); - bool AwaitElidable = - isCoroAwaitElidableCall(Operand) && - isAttributedCoroAwaitElidable( -

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-15 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/108474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-14 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/108474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-14 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang commented: Thanks for implementing this! Looking forward to using it 🙂 https://github.com/llvm/llvm-project/pull/108474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-14 Thread Adrian Vogelsgesang via cfe-commits
@@ -8261,12 +8261,19 @@ def CoroAwaitElidableDoc : Documentation { The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applied to a coroutine return type. -When a coroutine function that returns such a type calls another coroutine function, -the compiler

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-14 Thread Adrian Vogelsgesang via cfe-commits
@@ -880,14 +898,12 @@ ExprResult Sema::BuildUnresolvedCoawaitExpr(SourceLocation Loc, Expr *Operand, } auto *RD = Promise->getType()->getAsCXXRecordDecl(); - bool AwaitElidable = - isCoroAwaitElidableCall(Operand) && - isAttributedCoroAwaitElidable( -

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-14 Thread Adrian Vogelsgesang via cfe-commits
@@ -84,4 +84,35 @@ Task nonelidable() { co_return 1; } +// CHECK-LABEL: define{{.*}} @_Z8addTasksO4TaskIiES1_{{.*}} { +Task addTasks([[clang::coro_must_await]] Task &&t1, Task &&t2) { + int i1 = co_await t1; + int i2 = co_await t2; + co_return i1 + i2; +} + +// CHECK-LABE

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-14 Thread Adrian Vogelsgesang via cfe-commits
@@ -8261,12 +8261,19 @@ def CoroAwaitElidableDoc : Documentation { The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applied to a coroutine return type. vogelsgesang wrote: ```suggestion to a coroutine return type. It provides a hint to

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-14 Thread Adrian Vogelsgesang via cfe-commits
@@ -84,4 +84,35 @@ Task nonelidable() { co_return 1; } +// CHECK-LABEL: define{{.*}} @_Z8addTasksO4TaskIiES1_{{.*}} { +Task addTasks([[clang::coro_must_await]] Task &&t1, Task &&t2) { + int i1 = co_await t1; + int i2 = co_await t2; + co_return i1 + i2; +} + +// CHECK-LABE

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-14 Thread Adrian Vogelsgesang via cfe-commits
@@ -8281,8 +8288,62 @@ Example: co_await t; } -The behavior is undefined if the caller coroutine is destroyed earlier than the -callee coroutine. +Such elision replaces the heap allocated activation frame of the callee coroutine +with a local variable within the enclosi

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-14 Thread Adrian Vogelsgesang via cfe-commits
@@ -8281,8 +8288,62 @@ Example: co_await t; } -The behavior is undefined if the caller coroutine is destroyed earlier than the -callee coroutine. +Such elision replaces the heap allocated activation frame of the callee coroutine +with a local variable within the enclosi

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-14 Thread Adrian Vogelsgesang via cfe-commits
@@ -8261,12 +8261,19 @@ def CoroAwaitElidableDoc : Documentation { The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applied to a coroutine return type. -When a coroutine function that returns such a type calls another coroutine function, -the compiler

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-14 Thread Adrian Vogelsgesang via cfe-commits
@@ -8281,8 +8288,62 @@ Example: co_await t; } -The behavior is undefined if the caller coroutine is destroyed earlier than the -callee coroutine. +Such elision replaces the heap allocated activation frame of the callee coroutine +with a local variable within the enclosi

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-14 Thread Adrian Vogelsgesang via cfe-commits
@@ -249,7 +249,10 @@ Attribute Changes in Clang (#GH106864) - Introduced a new attribute ``[[clang::coro_await_elidable]]`` on coroutine return types - to express elideability at call sites where the coroutine is co_awaited as a prvalue. + to express elideability at call

[clang] [llvm] Introduce -defer-thinlto-prelink-coro-split that skips Coro passes in ThinLTO pre-link pipeline (PR #107153)

2024-09-13 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: > Unfortunately, it seems we have an "either-or" decision here Although... Is this even an either-or decision? Could we add coro-split to the llc unconditionally, also for non-thin-lto pipelines? Afaict, coro-split is a no-op pass if coroutines were already split previousl

[clang] [llvm] Introduce -defer-thinlto-prelink-coro-split that skips Coro passes in ThinLTO pre-link pipeline (PR #107153)

2024-09-13 Thread Adrian Vogelsgesang via cfe-commits
vogelsgesang wrote: My 2cts: I think it would be best for clang-users, if HALO / coroutine optimizations work out-of-the-box in as many cases as possible. Unfortunately, it seems we have an "either-or" decision here. Either, the "thin-lto + HALO" work out-of-the-box or the llc-code-generation

[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-07-22 Thread Adrian Vogelsgesang via cfe-commits
@@ -1217,6 +1217,14 @@ def CoroDisableLifetimeBound : InheritableAttr { let SimpleHandler = 1; } +def CoroAwaitElidable : InheritableAttr { vogelsgesang wrote: does this also warrant an entry in `clang/docs/ReleaseNotes.rst`? https://github.com/llvm/llvm-p

[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-07-19 Thread Adrian Vogelsgesang via cfe-commits
@@ -8108,6 +8108,24 @@ but do not pass them to the underlying coroutine or pass them by value. }]; } +def CoroAwaitElidableDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applie

[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-07-19 Thread Adrian Vogelsgesang via cfe-commits
@@ -8108,6 +8108,24 @@ but do not pass them to the underlying coroutine or pass them by value. }]; } +def CoroAwaitElidableDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applie

[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-07-19 Thread Adrian Vogelsgesang via cfe-commits
@@ -825,6 +826,32 @@ ExprResult Sema::BuildOperatorCoawaitLookupExpr(Scope *S, SourceLocation Loc) { return CoawaitOp; } +static bool isAttributedCoroInplaceTask(const QualType &QT) { + auto *Record = QT->getAsCXXRecordDecl(); + return Record && Record->hasAttr(); +} + +s

[clang] [llvm] [Clang][Coroutines] Introducing the `[[clang::coro_inplace_task]]` attribute (PR #94693)

2024-06-18 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/94693 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][Coroutines] Introducing the `[[clang::coro_inplace_task]]` attribute (PR #94693)

2024-06-18 Thread Adrian Vogelsgesang via cfe-commits
https://github.com/vogelsgesang edited https://github.com/llvm/llvm-project/pull/94693 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][Coroutines] Introducing the `[[clang::coro_inplace_task]]` attribute (PR #94693)

2024-06-18 Thread Adrian Vogelsgesang via cfe-commits
@@ -0,0 +1,84 @@ +// This file tests the coro_structured_concurrency attribute semantics. +// RUN: %clang_cc1 -std=c++20 -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s + +#include "Inputs/coroutine.h" +#include "Inputs/utility.h" + +template +struct [[clang::coro_struct

[clang] [llvm] [Clang][Coroutines] Introducing the `[[clang::coro_inplace_task]]` attribute (PR #94693)

2024-06-17 Thread Adrian Vogelsgesang via cfe-commits
@@ -0,0 +1,84 @@ +// This file tests the coro_structured_concurrency attribute semantics. +// RUN: %clang_cc1 -std=c++20 -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s + +#include "Inputs/coroutine.h" +#include "Inputs/utility.h" + +template +struct [[clang::coro_struct

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-30 Thread Adrian Vogelsgesang via cfe-commits
@@ -167,7 +167,7 @@ C++2c implementation status Disallow Binding a Returned Glvalue to a Temporary https://wg21.link/P2748R5";>P2748R5 - No + Clang 19 vogelsgesang wrote: Ah, I just saw this was already fixed in the meantime - nevermind 🙂 https://git

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-30 Thread Adrian Vogelsgesang via cfe-commits
@@ -167,7 +167,7 @@ C++2c implementation status Disallow Binding a Returned Glvalue to a Temporary https://wg21.link/P2748R5";>P2748R5 - No + Clang 19 vogelsgesang wrote: Should be `class="unreleased"` instead of `class="full"` https://github.com/llvm

[clang] [Clang] Address post commit feedbacks in #89906 (PR #90495)

2024-04-29 Thread Adrian Vogelsgesang via cfe-commits
@@ -187,7 +187,7 @@ C++2c implementation status Trivial infinite loops are not Undefined Behavior https://wg21.link/P2809R3";>P2809R3 (DR) - Clang 19 + No vogelsgesang wrote: unreleased -> none https://github.com/llvm/llvm-project/pull/90495 _

[clang] [Clang] Address post commit feedbacks in #89906 (PR #90495)

2024-04-29 Thread Adrian Vogelsgesang via cfe-commits
@@ -177,7 +177,7 @@ C++2c implementation status Attributes for Structured Bindings https://wg21.link/P0609R3";>P0609R3 - No + Clang 19 vogelsgesang wrote: none -> unreleased But maybe just fix this together when landing #90066... https://github.com/l

[clang] [Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (PR #89906)

2024-04-29 Thread Adrian Vogelsgesang via cfe-commits
@@ -187,7 +187,7 @@ C++2c implementation status Trivial infinite loops are not Undefined Behavior https://wg21.link/P2809R3";>P2809R3 (DR) - No + Clang 19 vogelsgesang wrote: the wrong paper was marked as implemented https://github.com/llvm/llvm-proje

[clang-tools-extra] fda7778 - [clang-tidy] Update tests to include C++23 and C++26

2023-08-07 Thread Adrian Vogelsgesang via cfe-commits
Author: Adrian Vogelsgesang Date: 2023-08-07T21:25:22Z New Revision: fda777849b0088ba83e28683c53c5c8321ef2558 URL: https://github.com/llvm/llvm-project/commit/fda777849b0088ba83e28683c53c5c8321ef2558 DIFF: https://github.com/llvm/llvm-project/commit/fda777849b0088ba83e28683c53c5c8321ef2558.diff

[libunwind] c9cffdd - [libunwind] Fix usage of `_dl_find_object` on 32-bit x86

2022-09-16 Thread Adrian Vogelsgesang via cfe-commits
Author: Adrian Vogelsgesang Date: 2022-09-16T06:29:49-07:00 New Revision: c9cffdde393f646acf62d6160e7fa6613e038508 URL: https://github.com/llvm/llvm-project/commit/c9cffdde393f646acf62d6160e7fa6613e038508 DIFF: https://github.com/llvm/llvm-project/commit/c9cffdde393f646acf62d6160e7fa6613e038508

[clang] 9138900 - [LLDB] Add data formatter for std::coroutine_handle

2022-08-24 Thread Adrian Vogelsgesang via cfe-commits
Author: Adrian Vogelsgesang Date: 2022-08-24T14:40:53-07:00 New Revision: 91389000abe8ef5d06d98cbbefd3fa03ac7e4480 URL: https://github.com/llvm/llvm-project/commit/91389000abe8ef5d06d98cbbefd3fa03ac7e4480 DIFF: https://github.com/llvm/llvm-project/commit/91389000abe8ef5d06d98cbbefd3fa03ac7e4480

[libunwind] df9a23e - [libunwind] Use `_dl_find_object` if available

2022-08-09 Thread Adrian Vogelsgesang via cfe-commits
Author: Adrian Vogelsgesang Date: 2022-08-09T16:19:13-07:00 New Revision: df9a23e2feda18f0308b6d4dbd591ebe6b605aa4 URL: https://github.com/llvm/llvm-project/commit/df9a23e2feda18f0308b6d4dbd591ebe6b605aa4 DIFF: https://github.com/llvm/llvm-project/commit/df9a23e2feda18f0308b6d4dbd591ebe6b605aa4