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

2025-01-10 Thread Michael Buch via cfe-commits
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= Message-ID: In-Reply-To: https://github.com/Michael137 approved this pull request. https://github.com/llvm/llvm-project/pull/118466 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [clang][ASTImporter][test] Add test for importing explicit object parameter (PR #124305)

2025-01-24 Thread Michael Buch via cfe-commits
@@ -3441,13 +3441,33 @@ TEST_P(ASTImporterOptionSpecificTestBase, ImportParmVarDecl) { ASSERT_TRUE(FromVar); ASSERT_TRUE(FromVar->hasUninstantiatedDefaultArg()); ASSERT_TRUE(FromVar->getUninstantiatedDefaultArg()); + ASSERT_FALSE(FromVar->isExplicitObjectParameter());

[clang] [llvm] [clang][DebugInfo] Emit DW_AT_object_pointer on function declarations with explicit `this` (PR #122928)

2025-01-23 Thread Michael Buch via cfe-commits
Michael137 wrote: > The C API must remain stable and backward compatible. It's the C++ APIs that > we are willing to change without worrying. In that case should we adjust the documentation in the header? https://github.com/llvm/llvm-project/blob/1c28b9237382b093f477479c993c80181922ca6a/llvm/in

[clang] [llvm] [clang][DebugInfo] Emit DW_AT_object_pointer on function declarations with explicit `this` (PR #122928)

2025-01-23 Thread Michael Buch via cfe-commits
Michael137 wrote: > This causes a breaking change in the C-API which I believe can easily be > avoided. I've submitted https://github.com/llvm/llvm-project/pull/124144 as a > suggestion to keep compatability Yea that's not unexpected, since the APIs aren't stable not stable/experimental. I co

[clang] [clang][modules] Partially revert 48d0eb518 to fix -gmodules output (PR #124003)

2025-01-23 Thread Michael Buch via cfe-commits
Michael137 wrote: FYI, this also fixed the macOS public matrix bot. Some tests where we built with `-gmodules` were crashing. Though weirdly just the clang-17 tests (which build against clang-17 aligned libc++, so might have something to do with that). Just wanted to mentioned that here in cas

[clang] [clang][ASTImporter][test] Add test for importing explicit object parameter (PR #124305)

2025-01-24 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/124305 Adds test that confirms that we import the explicit object parameter location for `ParmVarDecl`s. This is how Clang determines whether a parameter `isExplicitObjectParamater`. The LLDB expression evaluator r

[clang] [clang][ASTImporter][test] Add test for importing explicit object parameter (PR #124305)

2025-01-24 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/124305 >From 2fbabc9802e09a175bd71624b2ff89a2d9b7f3a1 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 24 Jan 2025 11:59:42 + Subject: [PATCH] [clang][ASTImporter][test] Add test for importing explicit ob

[clang] [clang][ASTImporter] Fix possible crash at import of function template (PR #124273)

2025-01-24 Thread Michael Buch via cfe-commits
=?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: https://github.com/Michael137 commented: So in spirit this is kind of like an ODR violation right? Which the ASTImporter does try to handle, so this seems reasonable to me. For my own understanding, where did the crash end up happening? Also,

[clang] [clang][ASTImporter] Import explicit object parameter location (PR #124262)

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

[clang] [clang][ASTImporter] Import explicit object parameter location (PR #124262)

2025-01-24 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/124262 >From ff885745df0d4842dd4c541ec5e3c6cbb557f6a5 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 24 Jan 2025 11:59:42 + Subject: [PATCH 1/2] [clang][ASTImporter] Import explicit object parameter loc

[clang] [clang][ASTImporter] Import explicit object parameter location (PR #124262)

2025-01-24 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/124262 Make sure to import the explicit object parameter location for `ParmVarDecl`s. This is how Clang determines whether a parameter `isExplicitObjectParamater`. This will be needed to enable expression evaluatio

[clang] [llvm] [clang][DebugInfo] Emit DW_AT_object_pointer on function declarations with explicit `this` (PR #122928)

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

[clang] [clang][ASTImporter] Import source location of explicit object parameter instead of copying it (PR #124305)

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

[clang] [clang][ASTImporter][test] Add test for importing explicit object parameter (PR #124305)

2025-01-27 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/124305 >From 2fbabc9802e09a175bd71624b2ff89a2d9b7f3a1 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 24 Jan 2025 11:59:42 + Subject: [PATCH 1/2] [clang][ASTImporter][test] Add test for importing explici

[clang] [clang][ASTImporter][test] Add test for importing explicit object parameter (PR #124305)

2025-01-27 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/124305 >From 2fbabc9802e09a175bd71624b2ff89a2d9b7f3a1 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 24 Jan 2025 11:59:42 + Subject: [PATCH 1/3] [clang][ASTImporter][test] Add test for importing explici

[clang] [clang][ASTImporter] Import source location of explicit object parameter instead of copying it (PR #124305)

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

[clang] [clang][ASTImporter] Import source location of explicit object parameter instead of copying it (PR #124305)

2025-01-27 Thread Michael Buch via cfe-commits
@@ -3441,13 +3441,33 @@ TEST_P(ASTImporterOptionSpecificTestBase, ImportParmVarDecl) { ASSERT_TRUE(FromVar); ASSERT_TRUE(FromVar->hasUninstantiatedDefaultArg()); ASSERT_TRUE(FromVar->getUninstantiatedDefaultArg()); + ASSERT_FALSE(FromVar->isExplicitObjectParameter());

[clang] [clang][ASTImporter] Import source location of explicit object parameter instead of copying it (PR #124305)

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

[clang] [clang][ASTImporter] Fix possible crash at import of function template (PR #124273)

2025-01-27 Thread Michael Buch via cfe-commits
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= Message-ID: In-Reply-To: https://github.com/Michael137 approved this pull request. https://github.com/llvm/llvm-project/pull/124273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [clang][ASTImporter] Import source location of explicit object parameter instead of copying it (PR #124305)

2025-01-27 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/124305 >From 2fbabc9802e09a175bd71624b2ff89a2d9b7f3a1 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 24 Jan 2025 11:59:42 + Subject: [PATCH 1/4] [clang][ASTImporter][test] Add test for importing explici

[clang] [clang][ASTImporter] Fix possible crash at import of function template (PR #124273)

2025-01-27 Thread Michael Buch via cfe-commits
=?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: Michael137 wrote: > If this case is not handled, the following `setDescribedFunctionTemplate` > will run into an assertion. The case happens in the test code. What exactly > happens is that because of the `__get_first_arg` mismatch a field >

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

2025-01-27 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-27 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-27 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-27 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-27 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-27 Thread Michael Buch via cfe-commits
@@ -3903,6 +3903,7 @@ class EnumDecl : public TagDecl { void setInstantiationOfMemberEnum(ASTContext &C, EnumDecl *ED, TemplateSpecializationKind TSK); +public: Michael137 wrote: Don't need this change anymore https://gi

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

2025-01-27 Thread Michael Buch via cfe-commits
https://github.com/Michael137 commented: Looks much better Left some more clarification comments 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/c

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

2025-01-27 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-01-28 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/124752 When creating `EnumDecl`s from DWARF for Objective-C `NS_ENUM`s, the Swift compiler tries to figure out if it should perform "swiftification" of that enum (which involves renaming the enumerator cases, etc.)

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

2025-01-28 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-28 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-28 Thread Michael Buch via cfe-commits
@@ -3903,6 +3903,7 @@ class EnumDecl : public TagDecl { void setInstantiationOfMemberEnum(ASTContext &C, EnumDecl *ED, TemplateSpecializationKind TSK); +public: Michael137 wrote: I see why you moved it. It's because we're

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

2025-01-28 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-28 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-28 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-28 Thread Michael Buch via cfe-commits
https://github.com/Michael137 deleted 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-28 Thread Michael Buch via cfe-commits
@@ -3903,6 +3903,7 @@ class EnumDecl : public TagDecl { void setInstantiationOfMemberEnum(ASTContext &C, EnumDecl *ED, TemplateSpecializationKind TSK); +public: Michael137 wrote: Can we not just leave this whole block in

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

2025-01-28 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] [clang][DebugInfo] Emit DW_AT_object_pointer on function declarations with explicit `this` (PR #122928)

2025-01-18 Thread Michael Buch via cfe-commits
Michael137 wrote: @mgorny thanks for the ping. I relanded in https://github.com/llvm/llvm-project/commit/a5fb2bbb2ad8488482843e2298fbe6f6a1d45bbd. Confirmed that the OCaml bindings build and tests pass. https://github.com/llvm/llvm-project/pull/122928 __

[clang] a5fb2bb - Reapply "[clang][DebugInfo] Emit DW_AT_object_pointer on function declarations with explicit `this`" (#123455)

2025-01-18 Thread Michael Buch via cfe-commits
Author: Michael Buch Date: 2025-01-18T18:03:41Z New Revision: a5fb2bbb2ad8488482843e2298fbe6f6a1d45bbd URL: https://github.com/llvm/llvm-project/commit/a5fb2bbb2ad8488482843e2298fbe6f6a1d45bbd DIFF: https://github.com/llvm/llvm-project/commit/a5fb2bbb2ad8488482843e2298fbe6f6a1d45bbd.diff LOG:

[clang] [lldb] [clang][DebugInfo] Expand detection of structured bindings to account for std::get free function (PR #122265)

2025-01-13 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/122265 >From b43ffd0c1bb6e4f1ca5b8458848f574480021b08 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Thu, 9 Jan 2025 10:01:31 + Subject: [PATCH 1/5] [clang][DebugInfo] Expand detection of structured bindings

[clang] [lldb] [clang][DebugInfo] Expand detection of structured bindings to account for std::get free function (PR #122265)

2025-01-13 Thread Michael Buch via cfe-commits
Michael137 wrote: > > > Did you try to modify `IgnoreUnlessSpelledInSource` to support CallExpr? > > > > > > Yea I was thinking about it initially. But I wasn't sure what that would > > look like tbh. IIUC `IgnoreImplicitMemberCallSingleStep` will unwrap > > `CXXMemberCallExpr` into the under

[clang] [lldb] [clang][DebugInfo] Expand detection of structured bindings to account for std::get free function (PR #122265)

2025-01-13 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/122265 >From b43ffd0c1bb6e4f1ca5b8458848f574480021b08 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Thu, 9 Jan 2025 10:01:31 + Subject: [PATCH 1/4] [clang][DebugInfo] Expand detection of structured bindings

[clang] [lldb] [clang][DebugInfo] Expand detection of structured bindings to account for std::get free function (PR #122265)

2025-01-13 Thread Michael Buch via cfe-commits
Michael137 wrote: > Did you try to modify `IgnoreUnlessSpelledInSource` to support CallExpr? Updated to use this approach in latest commit. Seems to work well (including the explicit object parameter case). Didn't find a great way to test this in the clang AST unit-tests yet. Trying to underst

[clang] [lldb] [clang][Expr] Teach IgnoreUnlessSpelledInSource about implicit calls to std::get free function (PR #122265)

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

[clang] [lldb] [clang][DebugInfo] Expand detection of structured bindings to account for std::get free function (PR #122265)

2025-01-13 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/122265 >From b43ffd0c1bb6e4f1ca5b8458848f574480021b08 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Thu, 9 Jan 2025 10:01:31 + Subject: [PATCH 1/6] [clang][DebugInfo] Expand detection of structured bindings

[clang] [lldb] [clang][Expr] Teach IgnoreUnlessSpelledInSource about implicit calls to std::get free function (PR #122265)

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

[clang] [lldb] [clang][Expr] Teach IgnoreUnlessSpelledInSource about implicit calls to std::get free function (PR #122265)

2025-01-13 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/122265 >From b43ffd0c1bb6e4f1ca5b8458848f574480021b08 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Thu, 9 Jan 2025 10:01:31 + Subject: [PATCH 1/7] [clang][DebugInfo] Expand detection of structured bindings

[clang] [lldb] [clang][Expr] Teach IgnoreUnlessSpelledInSource about implicit calls to std::get free function (PR #122265)

2025-01-13 Thread Michael Buch via cfe-commits
Michael137 wrote: Added tests and updated PR description. https://github.com/llvm/llvm-project/pull/122265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][DebugInfo] Emit DW_AT_object_pointer on function definitions with explicit `this` (PR #122897)

2025-01-14 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/122897 We currently don't emit `DW_AT_object_pointer` on function declarations or definitions. GCC suffers from the same issue: https://godbolt.org/z/h4jeT54G5 If I interpreted the DWARFv5 spec correctly, it doesn'

[clang] [clang][DebugInfo] Emit DW_AT_object_pointer on function definitions with explicit `this` (PR #122897)

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

[clang] [clang][DebugInfo] Emit DW_AT_object_pointer on function definitions with explicit `this` (PR #122897)

2025-01-14 Thread Michael Buch via cfe-commits
Michael137 wrote: @dwblaikie @adrian-prantl any thoughts on adjusting the DWARF spec to allow explicit `this` parameters to be non-artificial but still be valid `DW_AT_object_pointer`s? https://github.com/llvm/llvm-project/pull/122897 ___ cfe-commits

[clang] [lldb] [C++20] [Modules] Support module level lookup (PR #122887)

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

[clang] [lldb] [C++20] [Modules] Support module level lookup (PR #122887)

2025-01-14 Thread Michael Buch via cfe-commits
@@ -2711,6 +2715,12 @@ class DeclContext { bool Deserialize = false) const; private: + /// Lookup all external visible declarations and the external declarations + /// within the same module specified by \param NamedModule. We can't Michae

[clang] [lldb] [C++20] [Modules] Support module level lookup (PR #122887)

2025-01-14 Thread Michael Buch via cfe-commits
https://github.com/Michael137 commented: LLDB API adjustments look fine. Just left some minor comments re. documentation https://github.com/llvm/llvm-project/pull/122887 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [lldb] [C++20] [Modules] Support module level lookup (PR #122887)

2025-01-14 Thread Michael Buch via cfe-commits
@@ -145,12 +146,17 @@ class ExternalASTSource : public RefCountedBase { /// Find all declarations with the given name in the given context, /// and add them to the context by calling SetExternalVisibleDeclsForName /// or SetNoExternalVisibleDeclsForName. + /// \param Na

[clang] [llvm] [clang][DebugInfo] Emit DW_AT_object_pointer on function declarations with explicit `this` (PR #122928)

2025-01-14 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/122928 In https://github.com/llvm/llvm-project/pull/122897 we started attaching `DW_AT_object_pointer` to function definitions. This patch does the same but for function declarations (which we do for implicit objec

[clang] [llvm] [clang][DebugInfo] Emit DW_AT_object_pointer on function declarations with explicit `this` (PR #122928)

2025-01-14 Thread Michael Buch via cfe-commits
Michael137 wrote: Will be rebased on top of https://github.com/llvm/llvm-project/pull/122897 https://github.com/llvm/llvm-project/pull/122928 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [lldb] [C++20] [Modules] Support module level lookup (PR #122887)

2025-01-14 Thread Michael Buch via cfe-commits
@@ -145,12 +146,18 @@ class ExternalASTSource : public RefCountedBase { /// Find all declarations with the given name in the given context, /// and add them to the context by calling SetExternalVisibleDeclsForName /// or SetNoExternalVisibleDeclsForName. - /// \return \

[clang] [lldb] [C++20] [Modules] Support module level lookup (PR #122887)

2025-01-14 Thread Michael Buch via cfe-commits
@@ -145,12 +146,18 @@ class ExternalASTSource : public RefCountedBase { /// Find all declarations with the given name in the given context, /// and add them to the context by calling SetExternalVisibleDeclsForName /// or SetNoExternalVisibleDeclsForName. - /// \return \

[clang] [lldb] [C++20] [Modules] Support module level lookup (PR #122887)

2025-01-14 Thread Michael Buch via cfe-commits
@@ -145,12 +146,17 @@ class ExternalASTSource : public RefCountedBase { /// Find all declarations with the given name in the given context, /// and add them to the context by calling SetExternalVisibleDeclsForName /// or SetNoExternalVisibleDeclsForName. + /// \param Na

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

2024-12-23 Thread Michael Buch via cfe-commits
Michael137 wrote: > > FWIW, I came across another no_unique_address-related crash today: > > ``` > > $ cat a.cc > > struct S { > > private: > > int i; > > short s; > > }; > > static_assert(sizeof(S) == 8); > > > > struct T { > > [[no_unique_address]] S s; > > char c; > > }; > > static_as

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

2024-12-23 Thread Michael Buch via cfe-commits
Michael137 wrote: > FWIW, I came across another no_unique_address-related crash today: > > ``` > $ cat a.cc > struct S { > private: > int i; > short s; > }; > static_assert(sizeof(S) == 8); > > struct T { > [[no_unique_address]] S s; > char c; > }; > static_assert(sizeof(T) == 8); > >

[clang] [clang][DebugInfo] Emit DW_AT_object_pointer on function definitions with explicit `this` (PR #122897)

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

[clang] [lldb] [clang][Expr] Teach IgnoreUnlessSpelledInSource about implicit calls to std::get free function (PR #122265)

2025-01-16 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/122265 >From b43ffd0c1bb6e4f1ca5b8458848f574480021b08 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Thu, 9 Jan 2025 10:01:31 + Subject: [PATCH 1/8] [clang][DebugInfo] Expand detection of structured bindings

[clang] [lldb] [clang][Expr] Teach IgnoreUnlessSpelledInSource about implicit calls to std::get free function (PR #122265)

2025-01-16 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/122265 >From b43ffd0c1bb6e4f1ca5b8458848f574480021b08 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Thu, 9 Jan 2025 10:01:31 + Subject: [PATCH 1/8] [clang][DebugInfo] Expand detection of structured bindings

[clang] [lldb] [clang][Expr] Teach IgnoreUnlessSpelledInSource about implicit calls to std::get free function (PR #122265)

2025-01-16 Thread Michael Buch via cfe-commits
@@ -3183,10 +3183,24 @@ Expr *Expr::IgnoreUnlessSpelledInSource() { } return E; }; + + auto IgnoreImplicitCallSingleStep = [](Expr *E) { +if (auto *C = dyn_cast(E)) { + auto NumArgs = C->getNumArgs(); + if (NumArgs == 1 || + (NumArgs > 1 && isa

[clang] [clang][PCH] Don't try to create standalone debug-info for types marked nodebug (PR #123253)

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

[clang] [llvm] [clang][DebugInfo] Emit DW_AT_object_pointer on function declarations with explicit `this` (PR #122928)

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

[clang] [llvm] [clang][DebugInfo] Emit DW_AT_object_pointer on function declarations with explicit `this` (PR #122928)

2025-01-17 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/122928 >From 88125a0f3a28d49877cedfd4350ab6e0f37185ed Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Tue, 14 Jan 2025 11:33:33 + Subject: [PATCH] [clang][DebugInfo] Emit DW_AT_object_pointer on function defi

[clang] [lldb] [clang][Expr] Teach IgnoreUnlessSpelledInSource about implicit calls to std::get free function (PR #122265)

2025-01-17 Thread Michael Buch via cfe-commits
Michael137 wrote: Hmm there's a clang-tidy test failing because this codepath gets hit for `UserDefinedLiteral`, which is a `CallExpr` with a single argument: ``` (lldb) p E->dump() UserDefinedLiteral 0x15402b738 'unsigned long long' |-ImplicitCastExpr 0x15402b720 'unsigned long long (*)(unsigne

[clang] [lldb] [clang][DebugInfo] Expand detection of structured bindings to account for std::get free function (PR #122265)

2025-01-09 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/122265 >From f56f9469e5465f38f6252b2c8c2136473187969b Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Thu, 9 Jan 2025 10:01:31 + Subject: [PATCH 1/3] [clang][DebugInfo] Expand detection of structured bindings

[clang] [lldb] [clang][DebugInfo] Expand detection of structured bindings to account for std::get free function (PR #122265)

2025-01-09 Thread Michael Buch via cfe-commits
Michael137 wrote: > Did you try to modify `IgnoreUnlessSpelledInSource` to support CallExpr? Yea I was thinking about it initially. But I wasn't sure what that would look like tbh. IIUC `IgnoreImplicitMemberCallSingleStep` will unwrap `CXXMemberCallExpr` into the underlying `MemberExpr`. And t

[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

2025-01-02 Thread Michael Buch via cfe-commits
@@ -20099,73 +20179,13 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceRange BraceRange, BestPromotionType = BestType; BestWidth = Context.getIntWidth(BestType); - } - else if (NumNegativeBits) { -// If there is a negative value, figure out the small

[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

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

[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

2025-01-02 Thread Michael Buch via cfe-commits
https://github.com/Michael137 commented: Looks fine to me, thanks! I'll defer approval to one of the maintainers (lets mark the commit as `[NFC]` so it's clear that this doesn't change behaviour) https://github.com/llvm/llvm-project/pull/120965 ___ c

[clang] [clang][PCH] Don't try to create standalone debug-info for types marked nodebug (PR #123253)

2025-01-16 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/123253 >From 33b128cc2fd83894506f27ad730c3ac145c49f6f Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Thu, 16 Jan 2025 23:02:10 + Subject: [PATCH 1/2] [clang][PCH] Don't try to create standalone debug-info fo

[clang] [clang][PCH] Don't try to create standalone debug-info for types marked nodebug (PR #123253)

2025-01-16 Thread Michael Buch via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -std=c++23 -x c++-header -emit-pch -fmodule-format=obj \ +// RUN: -o %t.pch %s \ +// RUN: -mllvm -debug-only=pchcontainer &>%t-pch.ll +// RUN: cat %t-pch.ll | FileCheck %s + +template Michael137 wrote:

[clang] [clang][PCH] Don't try to create standalone debug-info for types marked nodebug (PR #123253)

2025-01-16 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/123253 Fixes one of the crashes uncovered by https://github.com/llvm/llvm-project/pull/118710 `getOrCreateStandaloneType` asserts that a `DIType` was created for the requested type. If the `Decl` was marked `nodebu

[clang] [clang][DebugInfo][test] Add tests for C++20 non-type template parameters (PR #127056)

2025-02-13 Thread Michael Buch via cfe-commits
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/127056 This exercises the codepath where we create `DITemplateValueParameter`s whose `TemplateArgument::ArgKind` is `StructuralValue`, which was added in (https://github.com/llvm/llvm-project/pull/78041). Previousl

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

2025-02-13 Thread Michael Buch via cfe-commits
https://github.com/Michael137 approved this pull request. Looks great! Thank you for moving all this functionality into Clang LGTM (just one minor comment left) https://github.com/llvm/llvm-project/pull/115005 ___ cfe-commits mailing list cfe-commits@

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

2025-02-13 Thread Michael Buch via cfe-commits
@@ -8476,27 +8476,20 @@ bool TypeSystemClang::CompleteTagDeclarationDefinition( clang::ASTContext &ast = lldb_ast->getASTContext(); - /// TODO This really needs to be fixed. + unsigned NumNegativeBits = 0; Michael137 wrote: Can we move this block back in

[clang] [clang][DebugInfo][test] Add tests for C++20 non-type template parameters (PR #127056)

2025-02-13 Thread Michael Buch via cfe-commits
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/127056 >From b84ebf9c696ffc3867a52ed1540d59d18d2e5ece Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Thu, 13 Feb 2025 13:00:28 + Subject: [PATCH 1/2] [clang][DebugInfo][test] Add tests for C++20 non-type tem

[clang] [clang][ASTDump] Dump value of structural TemplateArguments (PR #126937)

2025-02-12 Thread Michael Buch via cfe-commits
Michael137 wrote: ah fair enough lets get that one merged then https://github.com/llvm/llvm-project/pull/126937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTDump] Dump value of structural TemplateArguments (PR #126937)

2025-02-12 Thread Michael Buch via cfe-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/126937 ___ 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-02-13 Thread Michael Buch via cfe-commits
Michael137 wrote: FYI on macOS CI this is failing with: ``` FAIL: test_dsym (TestCPPEnumPromotion.TestCPPEnumPromotion) -- Traceback (most recent call last): File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-

[clang] [clang][DebugInfo][test] Add tests for C++20 non-type template parameters (PR #127056)

2025-02-13 Thread Michael Buch via cfe-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/127056 ___ 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-02-13 Thread Michael Buch via cfe-commits
Michael137 wrote: let me know if you need me to merge this for you 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-02-13 Thread Michael Buch via cfe-commits
Michael137 wrote: Fixed in `0feb00f17cbaac7428dcb7aed13d903b65974978` 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] [clang][DebugInfo] Add symbol for debugger with VTable information. (PR #130255)

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

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

2025-03-07 Thread Michael Buch via cfe-commits
@@ -2518,6 +2518,59 @@ StringRef CGDebugInfo::getVTableName(const CXXRecordDecl *RD) { return internString("_vptr$", RD->getNameAsString()); } +// Emit symbol for the debugger that points to the vtable address for +// the given class. The symbol is named as '_vtable$'. +//

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

2025-03-07 Thread Michael Buch via cfe-commits
@@ -2518,6 +2518,59 @@ StringRef CGDebugInfo::getVTableName(const CXXRecordDecl *RD) { return internString("_vptr$", RD->getNameAsString()); } +// Emit symbol for the debugger that points to the vtable address for +// the given class. The symbol is named as '_vtable$'. +//

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

2025-03-07 Thread Michael Buch via cfe-commits
@@ -2518,6 +2518,59 @@ StringRef CGDebugInfo::getVTableName(const CXXRecordDecl *RD) { return internString("_vptr$", RD->getNameAsString()); } +// Emit symbol for the debugger that points to the vtable address for +// the given class. The symbol is named as '_vtable$'. +//

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

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

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

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

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

2025-03-07 Thread Michael Buch via cfe-commits
@@ -2518,6 +2518,59 @@ StringRef CGDebugInfo::getVTableName(const CXXRecordDecl *RD) { return internString("_vptr$", RD->getNameAsString()); } +// Emit symbol for the debugger that points to the vtable address for +// the given class. The symbol is named as '_vtable$'. +//

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

2025-03-07 Thread Michael Buch via cfe-commits
@@ -2518,6 +2518,59 @@ StringRef CGDebugInfo::getVTableName(const CXXRecordDecl *RD) { return internString("_vptr$", RD->getNameAsString()); } +// Emit symbol for the debugger that points to the vtable address for +// the given class. The symbol is named as '_vtable$'. +//

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

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

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

2025-03-07 Thread Michael Buch via cfe-commits
https://github.com/Michael137 commented: Would be great to have a simpler of getting to the vtable info! I left some nits Don't see an issue with the the general approach, but i'll let others chime in https://github.com/llvm/llvm-project/pull/130255 _

<    1   2   3   4   5   6   >