[clang] [lldb] [llvm] [WIP][lldb][Expression] More reliable function call resolution (PR #114529)

2024-11-01 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/114529 Naive implementation of all the parts of following RFC: https://discourse.llvm.org/t/rfc-lldb-handling-abi-tagged-constructors-destructors-in-expression-evaluator/82816 Main changes: 1. Instead of relying on

[clang] [lldb] [llvm] [WIP][lldb][Expression] More reliable function call resolution (PR #114529)

2024-11-01 Thread Michael Buch via cfe-commits
@@ -140,6 +141,64 @@ void MangleContext::mangleName(GlobalDecl GD, raw_ostream &Out) { const ASTContext &ASTContext = getASTContext(); const NamedDecl *D = cast(GD.getDecl()); + if (const StructorMangledNamesAttr *SMA = + D->getAttr()) { +CXXConstructorDecl

[clang] [lldb] [llvm] [WIP][lldb][Expression] More reliable function call resolution (PR #114529)

2024-11-01 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/114529 >From 9337e170d920eaabe2b59a25622f0c554ca5afcf Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Sun, 20 Oct 2024 11:35:15 +0100 Subject: [PATCH] [WIP][lldb][Expression] More reliable function call resolutio

[clang] [lldb] [llvm] [WIP][lldb][Expression] More reliable function call resolution (PR #114529)

2024-11-01 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/114529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [llvm] [WIP][lldb][Expression] More reliable function call resolution (PR #114529)

2024-11-01 Thread Michael Buch via cfe-commits
Michael137 wrote: Example constructor decl would look like the following: ``` | `-CXXConstructorDecl 0x246e6f8 <> Bar 'void ()' | `-StructorMangledNamesAttr 0x246e7c0 <> Implicit 2:$__lldb_func_0x014B6560:257 1:$__lldb_func_0x014B6560:294 ``` https://github.com/llvm/llvm-proj

[clang] [lldb] [llvm] [WIP][lldb][Expression] More reliable function call resolution (PR #114529)

2024-11-01 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/114529 >From 7f18d96b7117e83c4ed246ac498ee4c9a72064ff Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Sun, 20 Oct 2024 11:35:15 +0100 Subject: [PATCH] [WIP][lldb][Expression] More reliable function call resolutio

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-12 Thread Michael Buch via cfe-commits
Michael137 wrote: Hmm this one's a bit strange. Looks like the issue is in: ``` // Clang-diagnostics pragmas always take precedence over suppression mapping. if (!Mapping.isPragma()) { // We also use presumed locations here to improve reproduci

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-12 Thread Michael Buch via cfe-commits
Michael137 wrote: > > FYI, looks like this is causing following LLDB tests to fail: > > https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/15106/execution/node/97/log/ > > ``` > > Unresolved Tests (17): > > lldb-api :: > > commands/expression/import-std-module/array/TestArray

[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

2024-11-12 Thread Michael Buch via cfe-commits
Michael137 wrote: FYI, looks like this is causing following LLDB builds to fail: https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/15106/execution/node/97/log/ ``` Unresolved Tests (17): lldb-api :: commands/expression/import-std-module/array/TestArrayFromStdModule.py lldb

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-09-18 Thread Michael Buch via cfe-commits
Michael137 wrote: > This change leads to a crash in `ConstStructBuilder::Build()` for the > following program: > > ``` > struct S { > }; > > union U { > struct S s; > int x; > }; > > void foo() { > union U bar = {}; > } > ``` > > `isEmptyRecordForLayout` returns false for `union

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #109490)

2024-09-23 Thread Michael Buch via cfe-commits
@@ -109,6 +110,21 @@ static bool IsArtificial(VarDecl const *VD) { cast(VD->getDeclContext())->isImplicit()); } +static bool usesDebugTransparent(const Decl *D, const CodeGenModule &CGM) { + if (!D) +return false; + + if (auto *attr = D->get

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #109490)

2024-09-23 Thread Michael Buch via cfe-commits
@@ -109,6 +110,21 @@ static bool IsArtificial(VarDecl const *VD) { cast(VD->getDeclContext())->isImplicit()); } +static bool usesDebugTransparent(const Decl *D, const CodeGenModule &CGM) { + if (!D) +return false; + + if (auto *attr = D->get

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #109490)

2024-09-23 Thread Michael Buch via cfe-commits
@@ -109,6 +110,21 @@ static bool IsArtificial(VarDecl const *VD) { cast(VD->getDeclContext())->isImplicit()); } +static bool usesDebugTransparent(const Decl *D, const CodeGenModule &CGM) { + if (!D) +return false; + + if (auto *attr = D->get

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #109490)

2024-09-23 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/109490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #109490)

2024-09-23 Thread Michael Buch via cfe-commits
@@ -4160,6 +4178,8 @@ llvm::DISubprogram *CGDebugInfo::getFunctionFwdDeclOrStub(GlobalDecl GD, if (Stub) { Flags |= getCallSiteRelatedAttrs(); SPFlags |= llvm::DISubprogram::SPFlagDefinition; +if (usesDebugTransparent(FD, CGM)) Michael137 wrote:

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #109490)

2024-09-23 Thread Michael Buch via cfe-commits
@@ -109,6 +110,21 @@ static bool IsArtificial(VarDecl const *VD) { cast(VD->getDeclContext())->isImplicit()); } +static bool usesDebugTransparent(const Decl *D, const CodeGenModule &CGM) { + if (!D) +return false; + + if (auto *attr = D->get

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #109490)

2024-09-23 Thread Michael Buch via cfe-commits
https://github.com/Michael137 commented: Seems reasonable to me modulo nits. We'll also need a test for the "attribute ignored because not DWARF" diagnostic https://github.com/llvm/llvm-project/pull/109490 ___ cfe-commits mailing list cfe-commits@list

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #109490)

2024-09-26 Thread Michael Buch via cfe-commits
@@ -109,6 +110,21 @@ static bool IsArtificial(VarDecl const *VD) { cast(VD->getDeclContext())->isImplicit()); } +static bool usesDebugTransparent(const Decl *D, const CodeGenModule &CGM) { + if (!D) +return false; + + if (auto *attr = D->get

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #110188)

2024-09-27 Thread Michael Buch via cfe-commits
@@ -109,6 +110,20 @@ static bool IsArtificial(VarDecl const *VD) { cast(VD->getDeclContext())->isImplicit()); } +static bool usesDebugTransparent(const Decl *D, const CodeGenModule &CGM) { + if (!D) +return false; + + if (auto *attr = D->get

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #110188)

2024-09-27 Thread Michael Buch via cfe-commits
https://github.com/Michael137 commented: Can we add tests that we do the right thing for constructors/destructors/inlined functions? https://github.com/llvm/llvm-project/pull/110188 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #110188)

2024-09-27 Thread Michael Buch via cfe-commits
@@ -4566,6 +4583,7 @@ void CGDebugInfo::EmitFunctionDecl(GlobalDecl GD, SourceLocation Loc, llvm::DINodeArray Annotations = CollectBTFDeclTagAnnotations(D); llvm::DISubroutineType *STy = getOrCreateFunctionType(D, FnType, Unit); + Michael137 wrote: stray

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #110188)

2024-09-27 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/110188 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Check initializer of zero-size fields for nullptr (PR #109271)

2024-09-20 Thread Michael Buch via cfe-commits
@@ -738,7 +738,7 @@ bool ConstStructBuilder::Build(const InitListExpr *ILE, bool AllowOverwrite) { // Zero-sized fields are not emitted, but their initializers may still // prevent emission of this struct as a constant. if (isEmptyFieldForLayout(CGM.getContext(), F

[clang] [clang][CodeGen] Check initializer of zero-size fields for nullptr (PR #109271)

2024-09-20 Thread Michael Buch via cfe-commits
@@ -0,0 +1,11 @@ +// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefixes=CHECK +// RUN: %clang_cc1 -x c++ %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefixes=CHECK-CXX + +union Foo { + struct Empty {} val; +}; + +u

[clang] [clang][CodeGen] Check initializer of zero-size fields for nullptr (PR #109271)

2024-09-20 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/109271 >From 6d541092e00f0c59861ad17c8bf6988d849c42f0 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Thu, 19 Sep 2024 11:41:51 +0100 Subject: [PATCH 1/2] [clang][CodeGen] Check initializer of zero-size fields fo

[clang] [clang][CodeGen] Check initializer of zero-size fields for nullptr (PR #109271)

2024-09-20 Thread Michael Buch via cfe-commits
@@ -738,7 +738,7 @@ bool ConstStructBuilder::Build(const InitListExpr *ILE, bool AllowOverwrite) { // Zero-sized fields are not emitted, but their initializers may still // prevent emission of this struct as a constant. if (isEmptyFieldForLayout(CGM.getContext(), F

[clang] [clang][CodeGen] Check initializer of zero-size fields for nullptr (PR #109271)

2024-09-20 Thread Michael Buch via cfe-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/109271 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Check initializer of zero-size fields for nullptr (PR #109271)

2024-09-20 Thread Michael Buch via cfe-commits
@@ -738,7 +738,7 @@ bool ConstStructBuilder::Build(const InitListExpr *ILE, bool AllowOverwrite) { // Zero-sized fields are not emitted, but their initializers may still // prevent emission of this struct as a constant. if (isEmptyFieldForLayout(CGM.getContext(), F

[clang] [lldb] [clang][RecordLayoutBuilder] Be stricter about inferring packed-ness in ExternalLayouts (PR #97443)

2024-10-01 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/97443 >From 3a718c75d0458b7aece72f2ba8e5aa5a68815237 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Tue, 2 Jul 2024 18:43:34 +0200 Subject: [PATCH] [clang][RecordLayoutBuilder] Be stricter about inferring packed

[clang] [llvm] [clang] Add "debug_transparent" attribute (PR #110188)

2024-10-01 Thread Michael Buch via cfe-commits
https://github.com/Michael137 commented: CGDebugInfo related changes LGTM, I'll let the others comment on the rest https://github.com/llvm/llvm-project/pull/110188 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [clang][CodeGen] Check initializer of zero-size fields for nullptr (PR #109271)

2024-09-19 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/109271 In https://github.com/llvm/llvm-project/pull/96422 we started treating empty records as zero-sized for the purpose of layout. In `C`, empty fields were never considered `isZeroSize`, so we would never have t

[clang] [clang][CodeGen] Check initializer of zero-size fields for nullptr (PR #109271)

2024-09-19 Thread Michael Buch via cfe-commits
@@ -0,0 +1,11 @@ +// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefixes=CHECK +// RUN: %clang_cc1 -x c++ %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefixes=CHECK-CXX + +union Foo { + struct Empty {} val; +}; + +u

[clang] [lldb] [ASTImporter][lldb] Avoid implicit imports in VisitFieldDecl (PR #107828)

2024-09-19 Thread Michael Buch via cfe-commits
Michael137 wrote: > > Our idea is summarized in > > https://discourse.llvm.org/t/rfc-lldb-more-reliable-completion-of-record-types/77442. > > Basically the goal is to guarantee that a call to `getDefinition`, _will_ > > fetch the definition. This is something that Clang already does, but we >

[clang] [clang][DebugInfo] Revert to printing canonical typenames for template aliases (PR #110767)

2024-10-01 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/110767 This was originally added in https://reviews.llvm.org/D142268 have LLDB display variable typenames that benefit from suppressing defaulted template arguments. We currently represent template aliases as `DW_A

[clang] [clang][DebugInfo] Revert to printing canonical typenames for template aliases (PR #110767)

2024-10-02 Thread Michael Buch via cfe-commits
Michael137 wrote: Test failures in `Sema/aarch64-sve-vector-trig-ops.c` unrelated https://github.com/llvm/llvm-project/pull/110767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][DebugInfo] Revert to printing canonical typenames for template aliases (PR #110767)

2024-10-02 Thread Michael Buch via cfe-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/110767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][DebugInfo] Revert to printing canonical typenames for template aliases (PR #110767)

2024-10-02 Thread Michael Buch via cfe-commits
Michael137 wrote: Test failure unrelated. Will merge to unblock libc++ and investigate a path forward as a follow-up https://github.com/llvm/llvm-project/pull/110767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [lldb] [clang][RecordLayoutBuilder] Be stricter about inferring packed-ness in ExternalLayouts (PR #97443)

2024-10-02 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/97443 >From 3a718c75d0458b7aece72f2ba8e5aa5a68815237 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Tue, 2 Jul 2024 18:43:34 +0200 Subject: [PATCH 1/6] [clang][RecordLayoutBuilder] Be stricter about inferring pa

[clang] [lldb] [clang][RecordLayoutBuilder] Be stricter about inferring packed-ness in ExternalLayouts (PR #97443)

2024-10-02 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/97443 >From 3a718c75d0458b7aece72f2ba8e5aa5a68815237 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Tue, 2 Jul 2024 18:43:34 +0200 Subject: [PATCH 1/2] [clang][RecordLayoutBuilder] Be stricter about inferring pa

[clang] [lldb] [clang][RecordLayoutBuilder] Be stricter about inferring packed-ness in ExternalLayouts (PR #97443)

2024-10-02 Thread Michael Buch via cfe-commits
Michael137 wrote: > If I'm understanding correctly, the way this currently works is that you do > normal field layout, then if you discover that the actual offset of a field > is less than the offset normal field layout would produce, you assume the > struct is packed. This misses cases where

[clang] [clang][DebugInfo] Revert to printing canonical typenames for template aliases (PR #110767)

2024-10-02 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/110767 >From 53bfa785514f9811952aa5122f60d16129136285 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Wed, 2 Oct 2024 00:42:35 +0100 Subject: [PATCH 1/2] [clang][DebugInfo] Revert to printing canonical typenames

[clang] [clang][DebugInfo] Revert to printing canonical typenames for template aliases (PR #110767)

2024-10-02 Thread Michael Buch via cfe-commits
Michael137 wrote: > If we're still producing the typedef-style DWARF for these alias template > specializations - perhaps lldb could not cache pretty printers for typedefs? > (I guess the pretty printers shouldn't be typedef-specific, right, since > typedefs are transparent anyway - but I gues

[clang] [clang][DebugInfo] Revert to printing canonical typenames for template aliases (PR #110767)

2024-10-02 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/110767 >From 53bfa785514f9811952aa5122f60d16129136285 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Wed, 2 Oct 2024 00:42:35 +0100 Subject: [PATCH 1/3] [clang][DebugInfo] Revert to printing canonical typenames

[clang] [lldb] [clang][RecordLayoutBuilder] Be stricter about inferring packed-ness in ExternalLayouts (PR #97443)

2024-10-02 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/97443 >From 3a718c75d0458b7aece72f2ba8e5aa5a68815237 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Tue, 2 Jul 2024 18:43:34 +0200 Subject: [PATCH 1/3] [clang][RecordLayoutBuilder] Be stricter about inferring pa

[clang] [libcxxabi] [lldb] [llvm] [WIP (PR #115245)

2024-11-06 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/115245 None >From f8087e96f8d8d242a4da2e74a3259161a3bfc179 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Tue, 5 Nov 2024 00:22:07 + Subject: [PATCH] Init --- clang/include/clang/Basic/Attr.td

[clang] [libcxxabi] [lldb] [llvm] [WIP][lldb] Alternative implementation of more reliable function call infrastructure (PR #115245)

2024-11-06 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/115245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxxabi] [lldb] [llvm] [WIP][lldb] Alternative implementation of more reliable function call infrastructure (PR #115245)

2024-11-06 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/115245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Introduce symbol versioning for clang-cpp (PR #116556)

2024-11-19 Thread Michael Buch via cfe-commits
Michael137 wrote: Looks like this broke macOS CI: https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake/7705/execution/node/45/log/ ``` ld: unknown options: --version-script clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` Could you take a look/rev

[clang] [clang][www] Remove ClangDataFormat.py from docs (PR #117943)

2024-12-04 Thread Michael Buch via cfe-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/117943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][www] Remove ClangDataFormat.py from docs (PR #117943)

2024-12-04 Thread Michael Buch via cfe-commits
https://github.com/Michael137 approved this pull request. Not sure how well maintained these are either, but since they still exist, LGTM https://github.com/llvm/llvm-project/pull/117943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2024-12-06 Thread Michael Buch via cfe-commits
Michael137 wrote: > So, is this patch worth pursuing or is it too much code for a too specific > use case? Sorry I was out for a few weeks when you pinged. I'll have another pass/think about it early next week (if nobody else gets to it before me). https://github.com/llvm/llvm-project/pull/11

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-01-31 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/115005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WIP][clang][DebugInfo] Add new DW_AT_APPLE_enum_kind to encode enum_extensibility (PR #124752)

2025-02-05 Thread Michael Buch via cfe-commits
Michael137 wrote: > Is my thing about the ctor understanding correct, and it's that the ctor > exists theoretically/abstractly, but not in the AST or in the generated > IR/DWARF? Could it be added/would that be sufficient? > > But, yeah, probably fine to just add the attribute, since that's th

[clang] [llvm] [llvm][DebugInfo] Add new DW_AT_APPLE_enum_kind to encode enum_extensibility (PR #124752)

2025-02-05 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/124752 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][DebugInfo] Add new DW_AT_APPLE_enum_kind to encode enum_extensibility (PR #124752)

2025-02-05 Thread Michael Buch via cfe-commits
Michael137 wrote: I've only included the LLVM changes here now (anything metadata and DWARF attribute related). Will do the plumbing from the frontend in a separate patch https://github.com/llvm/llvm-project/pull/124752 ___ cfe-commits mailing list cf

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-05 Thread Michael Buch via cfe-commits
Michael137 wrote: > Might be as simple as a constant true or false, but I'm nearing the end of my > work day so I've reverted it for now. > > In the meantime, @Michael137 might know if this is something LLDB should > actually be tracking. Or in other words, is #125290 something that can happen

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-02-10 Thread Michael Buch via cfe-commits
@@ -2367,11 +2370,27 @@ size_t DWARFASTParserClang::ParseChildEnumerators( } if (name && name[0] && got_value) { - m_ast.AddEnumerationValueToEnumerationType( + auto ECD = m_ast.AddEnumerationValueToEnumerationType( clang_type, decl, name, enum_val

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-02-10 Thread Michael Buch via cfe-commits
Michael137 wrote: > @Michael137 Changed the first argument of `computeEnumBits` to an `ArrayRef` > to avoid the template and so it can be still seamlessly used from Sema. On > LLDB side, I had to create a `SmallVector` and put enum constants there at > the point of their creation (`AddEnumerat

[clang] [clang][Sema] Move computing enum bits into a separate function (PR #126096)

2025-02-10 Thread Michael Buch via cfe-commits
Michael137 wrote: > > > > This is just moving stuff around so that seems fine. Though, I wonder, > > > > could we just pass e.g. an `ArrayRef` to `computeEnumBits()`? > > > > The LLDB pr you linked seems to have an > > > > `SmallVector`, so that should be possible (I think > > > > it does req

[clang] [clang][DebugInfo] Set EnumKind based on enum_extensibility attribute (PR #126045)

2025-02-06 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/126045 >From 10d37ec7e406d3b6ff5034003087a4b6cbb76fe0 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Wed, 5 Feb 2025 12:02:50 + Subject: [PATCH] [clang][DebugInfo] Set EnumKind based on enum_extensibility at

[clang] [lldb] Reland: [clang] fix P3310 overload resolution flag propagation (PR #125791)

2025-02-06 Thread Michael Buch via cfe-commits
Michael137 wrote: Actually, @mizvekov, can we make `ClassTemplatePartialSpecializationDecl(ASTContext&)` default initialize the `StrictPackMatch` member to false? In that case users of `CreateDeserialized` wouldn't need to worry about it being potentially uninitialized? Otherwise we'll have t

[clang] [lldb] Reland: [clang] fix P3310 overload resolution flag propagation (PR #125791)

2025-02-06 Thread Michael Buch via cfe-commits
Michael137 wrote: > > Actually, @mizvekov, can we make the > > `ClassTemplateSpecializationDecl::ClassTemplateSpecializationDecl(ASTContext > > &C, Kind DK)` constructor default initialize the `StrictPackMatch` member > > to false? In that case users of `CreateDeserialized` wouldn't need to wo

[clang] [clang][Sema] Move computing enum bits into a separate function (PR #126096)

2025-02-06 Thread Michael Buch via cfe-commits
Michael137 wrote: > This is just moving stuff around so that seems fine. Though, I wonder, could > we just pass e.g. an `ArrayRef` to `computeEnumBits()`? The LLDB pr > you linked seems to have an `SmallVector`, so that should > be possible (I think it does require a `reinterpret_cast` from a

[clang] [lldb] Reland: [clang] fix P3310 overload resolution flag propagation (PR #125791)

2025-02-06 Thread Michael Buch via cfe-commits
Michael137 wrote: > > > > Actually, @mizvekov, can we make the > > > > `ClassTemplateSpecializationDecl::ClassTemplateSpecializationDecl(ASTContext > > > > &C, Kind DK)` constructor default initialize the `StrictPackMatch` > > > > member to false? In that case users of `CreateDeserialized` wou

[clang] [lldb] Reland: [clang] fix P3310 overload resolution flag propagation (PR #125791)

2025-02-05 Thread Michael Buch via cfe-commits
@@ -280,7 +280,8 @@ std::optional CxxModuleHandler::tryInstantiateStdTemplate(Decl *d) { new_class_template->getDeclContext(), new_class_template->getTemplatedDecl()->getLocation(), new_class_template->getLocation(), new_class_template, imported_args, -

[clang] [clang][DebugInfo] Set EnumKind based on enum_extensibility attribute (PR #126045)

2025-02-07 Thread Michael Buch via cfe-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/126045 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][DebugInfo] Set EnumKind based on enum_extensibility attribute (PR #126045)

2025-02-07 Thread Michael Buch via cfe-commits
Michael137 wrote: The one test failure unrelated: ``` FAIL: Clang :: Tooling/clang-linker-wrapper-spirv-elf.cpp (20542 of 21851) TEST 'Clang :: Tooling/clang-linker-wrapper-spirv-elf.cpp' FAILED Exit Code: 1 Command Output (stderr): -- RUN: at line 4: mk

[clang] [lldb] [lldb][TypeSystemClang] Initialize ClassTemplateSpecializationDecl's StrictPackMatch field (PR #126215)

2025-02-07 Thread Michael Buch via cfe-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/126215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [lldb][TypeSystemClang] Initialize ClassTemplateSpecializationDecl's StrictPackMatch field (PR #126215)

2025-02-07 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/126215 This addresses the MSAN failure reported in https://github.com/llvm/llvm-project/pull/125791#issuecomment-2639183154: ``` ==5633==WARNING: MemorySanitizer: use-of-uninitialized-value #0 in clang::ASTNodeI

[clang] [lldb] Reland: [clang] fix P3310 overload resolution flag propagation (PR #125791)

2025-02-07 Thread Michael Buch via cfe-commits
Michael137 wrote: Put up https://github.com/llvm/llvm-project/pull/126215 Should address the failure @hokein observed https://github.com/llvm/llvm-project/pull/125791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [llvm] [WIP][clang][DebugInfo] Add new DW_AT_APPLE_enum_kind to encode enum_extensibility (PR #124752)

2025-01-29 Thread Michael Buch via cfe-commits
Michael137 wrote: > (hmm, can't use the foundation library on godbolt/compiler explorer) Can you > show a small example of the code you're interested in and the DWARF it > produces? The documentation I can find seems to suggest that the extensible > enums have ctors that take the underlying in

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-01-31 Thread Michael Buch via cfe-commits
@@ -2367,11 +2369,36 @@ size_t DWARFASTParserClang::ParseChildEnumerators( } if (name && name[0] && got_value) { - m_ast.AddEnumerationValueToEnumerationType( + auto ECD = m_ast.AddEnumerationValueToEnumerationType( Michael137 wrote: Unless

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-01-30 Thread Michael Buch via cfe-commits
@@ -2367,11 +2369,36 @@ size_t DWARFASTParserClang::ParseChildEnumerators( } if (name && name[0] && got_value) { - m_ast.AddEnumerationValueToEnumerationType( + auto ECD = m_ast.AddEnumerationValueToEnumerationType( Michael137 wrote: I do th

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-01-30 Thread Michael Buch via cfe-commits
@@ -0,0 +1,37 @@ +""" +Test LLDB type promotion of unscoped enums. +""" + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestCPPEnumPromotion(TestBase): +@skipIf(debug_info=no_match([

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-01-30 Thread Michael Buch via cfe-commits
@@ -0,0 +1,37 @@ +""" +Test LLDB type promotion of unscoped enums. +""" + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestCPPEnumPromotion(TestBase): +@skipIf(debug_info=no_match([

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-01-30 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/115005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-01-30 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/115005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-01-30 Thread Michael Buch via cfe-commits
@@ -2367,11 +2369,38 @@ size_t DWARFASTParserClang::ParseChildEnumerators( } if (name && name[0] && got_value) { - m_ast.AddEnumerationValueToEnumerationType( + auto ECD = m_ast.AddEnumerationValueToEnumerationType( clang_type, decl, name, enum_val

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-01-31 Thread Michael Buch via cfe-commits
@@ -2367,11 +2369,36 @@ size_t DWARFASTParserClang::ParseChildEnumerators( } if (name && name[0] && got_value) { - m_ast.AddEnumerationValueToEnumerationType( + auto ECD = m_ast.AddEnumerationValueToEnumerationType( Michael137 wrote: Ah true

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-01-31 Thread Michael Buch via cfe-commits
@@ -2367,11 +2369,36 @@ size_t DWARFASTParserClang::ParseChildEnumerators( } if (name && name[0] && got_value) { - m_ast.AddEnumerationValueToEnumerationType( + auto ECD = m_ast.AddEnumerationValueToEnumerationType( Michael137 wrote: Feel fr

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-01-31 Thread Michael Buch via cfe-commits
@@ -2367,11 +2369,36 @@ size_t DWARFASTParserClang::ParseChildEnumerators( } if (name && name[0] && got_value) { - m_ast.AddEnumerationValueToEnumerationType( + auto ECD = m_ast.AddEnumerationValueToEnumerationType( Michael137 wrote: > Mostl

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-01-31 Thread Michael Buch via cfe-commits
@@ -2367,11 +2369,36 @@ size_t DWARFASTParserClang::ParseChildEnumerators( } if (name && name[0] && got_value) { - m_ast.AddEnumerationValueToEnumerationType( + auto ECD = m_ast.AddEnumerationValueToEnumerationType( Michael137 wrote: Apologi

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2025-01-31 Thread Michael Buch via cfe-commits
@@ -2367,11 +2369,36 @@ size_t DWARFASTParserClang::ParseChildEnumerators( } if (name && name[0] && got_value) { - m_ast.AddEnumerationValueToEnumerationType( + auto ECD = m_ast.AddEnumerationValueToEnumerationType( Michael137 wrote: That's

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2024-12-12 Thread Michael Buch via cfe-commits
@@ -8544,7 +8524,8 @@ clang::EnumConstantDecl *TypeSystemClang::AddEnumerationValueToEnumerationType( bool is_signed = false; underlying_type.IsIntegerType(is_signed); - llvm::APSInt value(enum_value_bit_size, is_signed); + // APSInt constructor's sign argument is isUns

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2024-12-12 Thread Michael Buch via cfe-commits
@@ -2299,11 +2301,103 @@ size_t DWARFASTParserClang::ParseChildEnumerators( } if (name && name[0] && got_value) { - m_ast.AddEnumerationValueToEnumerationType( + auto ECD = m_ast.AddEnumerationValueToEnumerationType( clang_type, decl, name, enum_va

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2024-12-12 Thread Michael Buch via cfe-commits
@@ -8544,7 +8524,8 @@ clang::EnumConstantDecl *TypeSystemClang::AddEnumerationValueToEnumerationType( bool is_signed = false; underlying_type.IsIntegerType(is_signed); - llvm::APSInt value(enum_value_bit_size, is_signed); + // APSInt constructor's sign argument is isUns

[clang] [lldb] [clang][DebugInfo][gmodules] Set runtimeLang on ObjC forward declarations (PR #120154)

2024-12-16 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/120154 In Objective-C, forward declarations are currently represented as: ``` DW_TAG_structure_type DW_AT_name("Foo") DW_AT_declaration (true) DW_AT_APPLE_runtime_class (DW_LANG_ObjC) ``

[clang] [lldb] [clang][DebugInfo][gmodules] Set runtimeLang on ObjC forward declarations (PR #120154)

2024-12-16 Thread Michael Buch via cfe-commits
@@ -2995,20 +2995,21 @@ llvm::DIType *CGDebugInfo::CreateType(const ObjCInterfaceType *Ty, if (!ID) return nullptr; + auto RuntimeLang = + static_cast(TheCU->getSourceLanguage()); + // Return a forward declaration if this type was imported from a clang module,

[clang] [lldb] [clang][DebugInfo][gmodules] Set runtimeLang on ObjC forward declarations (PR #120154)

2024-12-17 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/120154 >From b4c56cb11feb10a153edfd1aff8d53e43f7bb7db Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Mon, 16 Dec 2024 22:27:08 + Subject: [PATCH 1/2] [clang][DebugInfo][gmodules] Set runtimeLang on ObjC forw

[clang] [lldb] [clang][DebugInfo][gmodules] Set runtimeLang on ObjC forward declarations (PR #120154)

2024-12-17 Thread Michael Buch via cfe-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/120154 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Not using primary context in lookup table (PR #118466)

2024-12-18 Thread Michael Buch via cfe-commits
@@ -3165,6 +3165,7 @@ ExpectedDecl ASTNodeImporter::VisitRecordDecl(RecordDecl *D) { if (Error Err = ImportImplicitMethods(DCXX, FoundCXX)) return std::move(Err); } +return FoundDef; Michael137 wrote:

[clang] [clang][ASTImporter] Not using primary context in lookup table (PR #118466)

2024-12-18 Thread Michael Buch via cfe-commits
@@ -10181,6 +10184,151 @@ TEST_P(ImportTemplateParmDeclDefaultValue, FromD, FromDInherited); } +TEST_P(ASTImporterOptionSpecificTestBase, ImportIntoReopenedNamespaceNoMatch1) { + const char *ToCode = + R"( + namespace a { + } + namespace a { +

[clang] [clang][ASTImporter] Not using primary context in lookup table (PR #118466)

2024-12-18 Thread Michael Buch via cfe-commits
@@ -6082,6 +6084,7 @@ TEST_P(ASTImporterLookupTableTest, LookupSearchesInTheWholeRedeclChain) { auto Res = LT.lookup(N1, Name); ASSERT_EQ(Res.size(), 1u); EXPECT_EQ(*Res.begin(), A); + EXPECT_TRUE(LT.lookup(N2, Name).empty()); Michael137 wrote: So prio

[clang] [clang][ASTImporter] Not using primary context in lookup table (PR #118466)

2024-12-18 Thread Michael Buch via cfe-commits
@@ -10181,6 +10184,151 @@ TEST_P(ImportTemplateParmDeclDefaultValue, FromD, FromDInherited); } +TEST_P(ASTImporterOptionSpecificTestBase, ImportIntoReopenedNamespaceNoMatch1) { + const char *ToCode = + R"( + namespace a { + } + namespace a { +

[clang] [clang][ASTImporter] Not using primary context in lookup table (PR #118466)

2024-12-18 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/118466 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Not using primary context in lookup table (PR #118466)

2024-12-18 Thread Michael Buch via cfe-commits
https://github.com/Michael137 commented: LLDB doesn't use the `LookupTable` infrastructure here so my understanding of this is limited. Generally the idea makes sense to me. Just left some clarification questions for my own understanding. Does this have any affect on other redeclarable `DeclCo

[clang] [NFC] Updating Debug Info generation for 'this' (PR #119445)

2024-12-12 Thread Michael Buch via cfe-commits
Michael137 wrote: Don't see a problem with this but could we elaborate on the motivation for this? Looks like this is required for https://github.com/llvm/llvm-project/pull/119041? Why is that? The original change this is based on is: https://github.com/microsoft/DirectXShaderCompiler/pull/62

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2024-12-23 Thread Michael Buch via cfe-commits
@@ -2299,11 +2301,103 @@ size_t DWARFASTParserClang::ParseChildEnumerators( } if (name && name[0] && got_value) { - m_ast.AddEnumerationValueToEnumerationType( + auto ECD = m_ast.AddEnumerationValueToEnumerationType( clang_type, decl, name, enum_va

[clang] [lldb] [lldb] Analyze enum promotion type during parsing (PR #115005)

2024-12-23 Thread Michael Buch via cfe-commits
https://github.com/Michael137 edited https://github.com/llvm/llvm-project/pull/115005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [lldb] Reapply "[clang] Avoid re-evaluating field bitwidth" (PR #122289)

2025-01-10 Thread Michael Buch via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: https://github.com/Michael137 commented: LLDB changes LGTM https://github.com/llvm/llvm-project/pull/122289 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

<    1   2   3   4   5   6   >