[Lldb-commits] [PATCH] D138612: [lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE

2022-11-28 Thread Arthur Eubanks via Phabricator via lldb-commits
aeubanks updated this revision to Diff 478272.
aeubanks added a comment.

potential test fix


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138612/new/

https://reviews.llvm.org/D138612

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
  lldb/test/API/lang/cpp/accelerator-table/TestCPPAccelerator.py
  lldb/test/API/lang/cpp/accelerator-table/a.cpp
  lldb/test/API/lang/cpp/accelerator-table/b.cpp
  lldb/test/API/lang/cpp/accelerator-table/c.cpp
  lldb/test/API/lang/cpp/accelerator-table/d.cpp
  lldb/test/API/lang/cpp/accelerator-table/e.cpp
  lldb/test/API/lang/cpp/accelerator-table/f.cpp
  lldb/test/API/lang/cpp/accelerator-table/g.cpp
  lldb/test/API/lang/cpp/accelerator-table/main.cpp

Index: lldb/test/API/lang/cpp/accelerator-table/main.cpp
===
--- lldb/test/API/lang/cpp/accelerator-table/main.cpp
+++ lldb/test/API/lang/cpp/accelerator-table/main.cpp
@@ -6,23 +6,23 @@
   };\
 NAME::Inner ##NAME();
 
-CLASS(A)
-CLASS(B)
-CLASS(C)
-CLASS(D)
-CLASS(E)
-CLASS(F)
-CLASS(G)
+CLASS(AFoo)
+CLASS(BFoo)
+CLASS(CFoo)
+CLASS(DFoo)
+CLASS(EFoo)
+CLASS(FFoo)
+CLASS(GFoo)
 
 int main()
 {
-  A::Inner _a = getInnerA();
-  B::Inner _b = getInnerB();
-  C::Inner _c = getInnerC();
-  D::Inner _d = getInnerD();
-  E::Inner _e = getInnerE();
-  F::Inner _f = getInnerF();
-  G::Inner _g = getInnerG();
+  AFoo::Inner _a = getInnerAFoo();
+  BFoo::Inner _b = getInnerBFoo();
+  CFoo::Inner _c = getInnerCFoo();
+  DFoo::Inner _d = getInnerDFoo();
+  EFoo::Inner _e = getInnerEFoo();
+  FFoo::Inner _f = getInnerFFoo();
+  GFoo::Inner _g = getInnerGFoo();
 
   return 0; // break here
 }
Index: lldb/test/API/lang/cpp/accelerator-table/g.cpp
===
--- lldb/test/API/lang/cpp/accelerator-table/g.cpp
+++ lldb/test/API/lang/cpp/accelerator-table/g.cpp
@@ -1,2 +1,2 @@
 #include "source.h"
-CLASS(G)
+CLASS(GFoo)
Index: lldb/test/API/lang/cpp/accelerator-table/f.cpp
===
--- lldb/test/API/lang/cpp/accelerator-table/f.cpp
+++ lldb/test/API/lang/cpp/accelerator-table/f.cpp
@@ -1,2 +1,2 @@
 #include "source.h"
-CLASS(F)
+CLASS(FFoo)
Index: lldb/test/API/lang/cpp/accelerator-table/e.cpp
===
--- lldb/test/API/lang/cpp/accelerator-table/e.cpp
+++ lldb/test/API/lang/cpp/accelerator-table/e.cpp
@@ -1,2 +1,2 @@
 #include "source.h"
-CLASS(E)
+CLASS(EFoo)
Index: lldb/test/API/lang/cpp/accelerator-table/d.cpp
===
--- lldb/test/API/lang/cpp/accelerator-table/d.cpp
+++ lldb/test/API/lang/cpp/accelerator-table/d.cpp
@@ -1,2 +1,2 @@
 #include "source.h"
-CLASS(D)
+CLASS(DFoo)
Index: lldb/test/API/lang/cpp/accelerator-table/c.cpp
===
--- lldb/test/API/lang/cpp/accelerator-table/c.cpp
+++ lldb/test/API/lang/cpp/accelerator-table/c.cpp
@@ -1,2 +1,2 @@
 #include "source.h"
-CLASS(C)
+CLASS(CFoo)
Index: lldb/test/API/lang/cpp/accelerator-table/b.cpp
===
--- lldb/test/API/lang/cpp/accelerator-table/b.cpp
+++ lldb/test/API/lang/cpp/accelerator-table/b.cpp
@@ -1,2 +1,2 @@
 #include "source.h"
-CLASS(B)
+CLASS(BFoo)
Index: lldb/test/API/lang/cpp/accelerator-table/a.cpp
===
--- lldb/test/API/lang/cpp/accelerator-table/a.cpp
+++ lldb/test/API/lang/cpp/accelerator-table/a.cpp
@@ -1,2 +1,2 @@
 #include "source.h"
-CLASS(A)
+CLASS(AFoo)
Index: lldb/test/API/lang/cpp/accelerator-table/TestCPPAccelerator.py
===
--- lldb/test/API/lang/cpp/accelerator-table/TestCPPAccelerator.py
+++ lldb/test/API/lang/cpp/accelerator-table/TestCPPAccelerator.py
@@ -25,8 +25,8 @@
 log = f.readlines()
 n = 0
 for line in log:
-if re.findall(r'[abcdefg]\.o: FindByNameAndTag\(\)', line):
-self.assertIn("d.o", line)
+if re.findall(r'[ABCDEFG]Foo: FindByNameAndTag\(\)', line):
+self.assertIn("DFoo", line)
 n += 1
 
 self.assertEqual(n, 1, "".join(log))
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
===
--- 

[Lldb-commits] [PATCH] D138612: [lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE

2022-11-26 Thread Arthur Eubanks via Phabricator via lldb-commits
aeubanks added a comment.

> The bot has pretty good logs fwiw,

I don't have easy access to a mac, knowing what the logs are when the test is 
passing would be helpful with figuring out what's going wrong and relanding.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138612/new/

https://reviews.llvm.org/D138612

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D138612: [lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE

2022-11-25 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

FWIW when I was commenting on this last night, I hadn't realized that the test 
case was unmodified by the patch.   Reverting the patch until we can figure out 
the cause of the behavior change made the most sense.  The macOS incremental 
bot is green now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138612/new/

https://reviews.llvm.org/D138612

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D138612: [lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE

2022-11-25 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

Reverted for now.

  commit 1df47dbe131d2aed676d9d5e0441ff4b61fec018
  Author: Jason Molenda 
  Date:   Fri Nov 25 12:11:37 2022 -0800
  
  Revert "[lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to 
take DWARFDIE"
  
  The changes in https://reviews.llvm.org/D138612 cause a testsuite
  failure on Darwin systems in TestCPPAccelerator.py, first flagged
  by the "LLDB Incremental" CI bot.
  https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/
  with the specific failure text appended to the phabracator.
  
  This reverts commit c3c423b6cb2e1c00483e951ce8cc4d935e31cd14.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138612/new/

https://reviews.llvm.org/D138612

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D138612: [lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE

2022-11-24 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

In D138612#3950102 , @jasonmolenda 
wrote:

> 



> I didn't look into this patch enough to say whether this is a real failure, 
> or if the test assumes behavior that is only true with the accelerator tables 
> used in DWARF on linux, the apple ones used on macOS.  In which case this may 
> simply be a skipIfDarwin test, I don't know.

If this is a difference in behavior between the DWARF accelerator tables used 
on linux versus the apple accelerator tables used on macOS, it's an interesting 
question of whether this is pointing out a bug in the apple accelerator table 
support in lldb or something to do with how the tables are set up.  If you 
don't have access to a macOS system to investigate more closely, and you don't 
think this is indicating a bug or regression in behavior, then I think skipping 
the test for now on darwin is not unreasonable.  My two cents having not looked 
into any of these changes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138612/new/

https://reviews.llvm.org/D138612

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D138612: [lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE

2022-11-24 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

In D138612#3950098 , @aeubanks wrote:

> In D138612#3949869 , @jasonmolenda 
> wrote:
>
>> Hi Arthur, this change is causing a testsuite failure on Darwin systems - 
>> see https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/48671/ on the 
>> "LLDB Incremental" bot - and I can reproduce this failure on my local mac.  
>> Would you like to revert this until you've had a chance to find the issue, 
>> or should I?  It's a holiday weekend in the US & I would understand if you 
>> don't see this message for a while, I'll revert later today unless you 
>> suggest an alternative.  Thanks.
>
> Feel free to revert, but could you post the log file that the test looks at 
> with and without the change?

The bot is also broken with Adrian Vogelsgesang's coroutines formatter right 
now and I was going to wait until tomorrow morning US time before I revert his 
patchsets, not sure which time zone he's in, so I won't do anything until then 
at least.

The bot has pretty good logs fwiw,

  FAIL: test_dwarf (TestCPPAccelerator.CPPAcceleratorTableTestCase)
 Test that type lookups fail early (performance)
  --
  Traceback (most recent call last):
File 
"/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py",
 line 1691, in test_method
  return attrvalue(self)
File 
"/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py",
 line 159, in wrapper
  return func(*args, **kwargs)
File 
"/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/test/API/lang/cpp/accelerator-table/TestCPPAccelerator.py",
 line 32, in test
  self.assertEqual(n, 1, "".join(log))
  AssertionError: 0 != 1 :  (x86_64) 
/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/lang/cpp/accelerator-table/TestCPPAccelerator.test_dwarf/main.o:
 DWARFASTParserClang::ParseTypeFromDWARF (die = 0x0127, decl_ctx = 
0x7fc72ebdb430 (die 0x000b)) DW_TAG_reference_type name = '(null)')
   (x86_64) 
/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/lang/cpp/accelerator-table/TestCPPAccelerator.test_dwarf/main.o:
 DWARFASTParserClang::ParseTypeFromDWARF (die = 0x012c, decl_ctx = 
0x7fc72ebdb430 (die 0x000b)) DW_TAG_class_type name = 'D')
   (x86_64) 
/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/lang/cpp/accelerator-table/TestCPPAccelerator.test_dwarf/main.o:
 DWARFASTParserClang::ParseTypeFromDWARF (die = 0x0142, decl_ctx = 
0x7fc72ebdbca0 (die 0x012c)) DW_TAG_structure_type name = 'Inner')
   (x86_64) 
/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/lang/cpp/accelerator-table/TestCPPAccelerator.test_dwarf/main.o:
 SymbolFileDWARF(0x7fc72c4a7a50) - 0x0142: DW_TAG_structure_type type 
"Inner" is a forward declaration, trying to find complete type
   (x86_64) 
/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/lang/cpp/accelerator-table/TestCPPAccelerator.test_dwarf/main.o:
 
SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(tag=DW_TAG_structure_type,
 name='Inner')
   (x86_64) 
/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/lang/cpp/accelerator-table/TestCPPAccelerator.test_dwarf/main.o:
 
SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(tag=DW_TAG_structure_type,
 name='Inner')
   (x86_64) 
/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/lang/cpp/accelerator-table/TestCPPAccelerator.test_dwarf/a.o:
 
SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(tag=DW_TAG_structure_type,
 name='Inner')
   (x86_64) 
/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/lang/cpp/accelerator-table/TestCPPAccelerator.test_dwarf/a.o:
 
SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(tag=DW_TAG_structure_type,
 name='Inner') trying die=0x0061 (A::Inner)
   (x86_64) 
/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/lang/cpp/accelerator-table/TestCPPAccelerator.test_dwarf/b.o:
 
SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(tag=DW_TAG_structure_type,
 name='Inner')
   (x86_64) 
/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/lang/cpp/accelerator-table/TestCPPAccelerator.test_dwarf/b.o:
 
SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(tag=DW_TAG_structure_type,
 name='Inner') trying die=0x0061 (B::Inner)
   (x86_64) 
/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/lang/cpp/accelerator-table/TestCPPAccelerator.test_dwarf/c.o:
 
SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(tag=DW_TAG_structure_type,
 name='Inner')
   (x86_64) 

[Lldb-commits] [PATCH] D138612: [lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE

2022-11-24 Thread Arthur Eubanks via Phabricator via lldb-commits
aeubanks added a comment.

In D138612#3949869 , @jasonmolenda 
wrote:

> Hi Arthur, this change is causing a testsuite failure on Darwin systems - see 
> https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/48671/ on the "LLDB 
> Incremental" bot - and I can reproduce this failure on my local mac.  Would 
> you like to revert this until you've had a chance to find the issue, or 
> should I?  It's a holiday weekend in the US & I would understand if you don't 
> see this message for a while, I'll revert later today unless you suggest an 
> alternative.  Thanks.

Feel free to revert, but could you post the log file that the test looks at 
with and without the change?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138612/new/

https://reviews.llvm.org/D138612

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D138612: [lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE

2022-11-24 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

Hi Arthur, this change is causing a testsuite failure on Darwin systems - see 
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/48671/ on the "LLDB 
Incremental" bot - and I can reproduce this failure on my local mac.  Would you 
like to revert this until you've had a chance to find the issue, or should I?  
It's a holiday weekend in the US & I would understand if you don't see this 
message for a while, I'll revert later today unless you suggest an alternative. 
 Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138612/new/

https://reviews.llvm.org/D138612

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D138612: [lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE

2022-11-24 Thread Arthur Eubanks via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc3c423b6cb2e: [lldb][NFC] Change 
FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE (authored by aeubanks).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138612/new/

https://reviews.llvm.org/D138612

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h

Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
@@ -63,8 +63,8 @@
 
   UniqueDWARFASTTypeMap () override;
 
-  lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(
-  const DWARFDeclContext _decl_ctx) override;
+  lldb::TypeSP
+  FindDefinitionTypeForDWARFDeclContext(const DWARFDIE ) override;
 
   lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
   const DWARFDIE , lldb_private::ConstString type_name,
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -117,10 +117,9 @@
   return GetBaseSymbolFile().GetUniqueDWARFASTTypeMap();
 }
 
-lldb::TypeSP SymbolFileDWARFDwo::FindDefinitionTypeForDWARFDeclContext(
-const DWARFDeclContext _decl_ctx) {
-  return GetBaseSymbolFile().FindDefinitionTypeForDWARFDeclContext(
-  die_decl_ctx);
+lldb::TypeSP
+SymbolFileDWARFDwo::FindDefinitionTypeForDWARFDeclContext(const DWARFDIE ) {
+  return GetBaseSymbolFile().FindDefinitionTypeForDWARFDeclContext(die);
 }
 
 lldb::TypeSP SymbolFileDWARFDwo::FindCompleteObjCDefinitionTypeForDIE(
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
@@ -282,8 +282,7 @@
 
   CompileUnitInfo *GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf);
 
-  lldb::TypeSP
-  FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext _decl_ctx);
+  lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDIE );
 
   bool Supports_DW_AT_APPLE_objc_complete_type(SymbolFileDWARF *skip_dwarf_oso);
 
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -1125,10 +1125,10 @@
 }
 
 TypeSP SymbolFileDWARFDebugMap::FindDefinitionTypeForDWARFDeclContext(
-const DWARFDeclContext _decl_ctx) {
+const DWARFDIE ) {
   TypeSP type_sp;
   ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
-type_sp = oso_dwarf->FindDefinitionTypeForDWARFDeclContext(die_decl_ctx);
+type_sp = oso_dwarf->FindDefinitionTypeForDWARFDeclContext(die);
 return ((bool)type_sp);
   });
   return type_sp;
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -443,7 +443,7 @@
lldb_private::SymbolContext );
 
   virtual lldb::TypeSP
-  FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext _decl_ctx);
+  FindDefinitionTypeForDWARFDeclContext(const DWARFDIE );
 
   virtual lldb::TypeSP
   FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE ,
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2946,119 +2946,113 @@
   return true;
 }
 
-TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(
-const DWARFDeclContext _decl_ctx) {
+TypeSP
+SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(const DWARFDIE ) {
   TypeSP type_sp;
 
-  const uint32_t dwarf_decl_ctx_count = dwarf_decl_ctx.GetSize();
-  if (dwarf_decl_ctx_count > 0) {
-const ConstString type_name(dwarf_decl_ctx[0].name);
-const dw_tag_t tag = dwarf_decl_ctx[0].tag;
+  const ConstString 

[Lldb-commits] [PATCH] D138612: [lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE

2022-11-23 Thread Arthur Eubanks via Phabricator via lldb-commits
aeubanks updated this revision to Diff 477611.
aeubanks added a comment.

update


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138612/new/

https://reviews.llvm.org/D138612

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h

Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
@@ -63,8 +63,8 @@
 
   UniqueDWARFASTTypeMap () override;
 
-  lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(
-  const DWARFDeclContext _decl_ctx) override;
+  lldb::TypeSP
+  FindDefinitionTypeForDWARFDeclContext(const DWARFDIE ) override;
 
   lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
   const DWARFDIE , lldb_private::ConstString type_name,
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -117,10 +117,9 @@
   return GetBaseSymbolFile().GetUniqueDWARFASTTypeMap();
 }
 
-lldb::TypeSP SymbolFileDWARFDwo::FindDefinitionTypeForDWARFDeclContext(
-const DWARFDeclContext _decl_ctx) {
-  return GetBaseSymbolFile().FindDefinitionTypeForDWARFDeclContext(
-  die_decl_ctx);
+lldb::TypeSP
+SymbolFileDWARFDwo::FindDefinitionTypeForDWARFDeclContext(const DWARFDIE ) {
+  return GetBaseSymbolFile().FindDefinitionTypeForDWARFDeclContext(die);
 }
 
 lldb::TypeSP SymbolFileDWARFDwo::FindCompleteObjCDefinitionTypeForDIE(
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
@@ -282,8 +282,7 @@
 
   CompileUnitInfo *GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf);
 
-  lldb::TypeSP
-  FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext _decl_ctx);
+  lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDIE );
 
   bool Supports_DW_AT_APPLE_objc_complete_type(SymbolFileDWARF *skip_dwarf_oso);
 
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -1125,10 +1125,10 @@
 }
 
 TypeSP SymbolFileDWARFDebugMap::FindDefinitionTypeForDWARFDeclContext(
-const DWARFDeclContext _decl_ctx) {
+const DWARFDIE ) {
   TypeSP type_sp;
   ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
-type_sp = oso_dwarf->FindDefinitionTypeForDWARFDeclContext(die_decl_ctx);
+type_sp = oso_dwarf->FindDefinitionTypeForDWARFDeclContext(die);
 return ((bool)type_sp);
   });
   return type_sp;
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -443,7 +443,7 @@
lldb_private::SymbolContext );
 
   virtual lldb::TypeSP
-  FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext _decl_ctx);
+  FindDefinitionTypeForDWARFDeclContext(const DWARFDIE );
 
   virtual lldb::TypeSP
   FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE ,
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2946,119 +2946,113 @@
   return true;
 }
 
-TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(
-const DWARFDeclContext _decl_ctx) {
+TypeSP
+SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(const DWARFDIE ) {
   TypeSP type_sp;
 
-  const uint32_t dwarf_decl_ctx_count = dwarf_decl_ctx.GetSize();
-  if (dwarf_decl_ctx_count > 0) {
-const ConstString type_name(dwarf_decl_ctx[0].name);
-const dw_tag_t tag = dwarf_decl_ctx[0].tag;
+  const ConstString type_name(die.GetName());
+  if (type_name) {
+const dw_tag_t tag = die.Tag();
 
-if (type_name) {
-  Log *log = GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
-  if (log) {
- 

[Lldb-commits] [PATCH] D138612: [lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE

2022-11-23 Thread Arthur Eubanks via Phabricator via lldb-commits
aeubanks updated this revision to Diff 477608.
aeubanks added a comment.
Herald added a subscriber: JDevlieghere.

update


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138612/new/

https://reviews.llvm.org/D138612

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h

Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
@@ -63,8 +63,8 @@
 
   UniqueDWARFASTTypeMap () override;
 
-  lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(
-  const DWARFDeclContext _decl_ctx) override;
+  lldb::TypeSP
+  FindDefinitionTypeForDWARFDeclContext(const DWARFDIE ) override;
 
   lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
   const DWARFDIE , lldb_private::ConstString type_name,
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -117,10 +117,9 @@
   return GetBaseSymbolFile().GetUniqueDWARFASTTypeMap();
 }
 
-lldb::TypeSP SymbolFileDWARFDwo::FindDefinitionTypeForDWARFDeclContext(
-const DWARFDeclContext _decl_ctx) {
-  return GetBaseSymbolFile().FindDefinitionTypeForDWARFDeclContext(
-  die_decl_ctx);
+lldb::TypeSP
+SymbolFileDWARFDwo::FindDefinitionTypeForDWARFDeclContext(const DWARFDIE ) {
+  return GetBaseSymbolFile().FindDefinitionTypeForDWARFDeclContext(die);
 }
 
 lldb::TypeSP SymbolFileDWARFDwo::FindCompleteObjCDefinitionTypeForDIE(
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
@@ -282,8 +282,7 @@
 
   CompileUnitInfo *GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf);
 
-  lldb::TypeSP
-  FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext _decl_ctx);
+  lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDIE );
 
   bool Supports_DW_AT_APPLE_objc_complete_type(SymbolFileDWARF *skip_dwarf_oso);
 
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -1125,10 +1125,10 @@
 }
 
 TypeSP SymbolFileDWARFDebugMap::FindDefinitionTypeForDWARFDeclContext(
-const DWARFDeclContext _decl_ctx) {
+const DWARFDIE ) {
   TypeSP type_sp;
   ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
-type_sp = oso_dwarf->FindDefinitionTypeForDWARFDeclContext(die_decl_ctx);
+type_sp = oso_dwarf->FindDefinitionTypeForDWARFDeclContext(die);
 return ((bool)type_sp);
   });
   return type_sp;
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -443,7 +443,7 @@
lldb_private::SymbolContext );
 
   virtual lldb::TypeSP
-  FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext _decl_ctx);
+  FindDefinitionTypeForDWARFDeclContext(const DWARFDIE );
 
   virtual lldb::TypeSP
   FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE ,
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2946,119 +2946,113 @@
   return true;
 }
 
-TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(
-const DWARFDeclContext _decl_ctx) {
+TypeSP
+SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(const DWARFDIE ) {
   TypeSP type_sp;
 
-  const uint32_t dwarf_decl_ctx_count = dwarf_decl_ctx.GetSize();
-  if (dwarf_decl_ctx_count > 0) {
-const ConstString type_name(dwarf_decl_ctx[0].name);
-const dw_tag_t tag = dwarf_decl_ctx[0].tag;
+  const ConstString type_name(die.GetName());
+  if (type_name) {
+const dw_tag_t tag = die.Tag();
 
-if (type_name) {
-  Log *log = GetLog(DWARFLog::TypeCompletion 

[Lldb-commits] [PATCH] D138612: [lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE

2022-11-23 Thread Arthur Eubanks via Phabricator via lldb-commits
aeubanks created this revision.
Herald added a reviewer: shafik.
Herald added a project: All.
aeubanks requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This simplifies an upcoming patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138612

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h

Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
@@ -63,8 +63,8 @@
 
   UniqueDWARFASTTypeMap () override;
 
-  lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(
-  const DWARFDeclContext _decl_ctx) override;
+  lldb::TypeSP
+  FindDefinitionTypeForDWARFDeclContext(const DWARFDIE ) override;
 
   lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
   const DWARFDIE , lldb_private::ConstString type_name,
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -117,10 +117,9 @@
   return GetBaseSymbolFile().GetUniqueDWARFASTTypeMap();
 }
 
-lldb::TypeSP SymbolFileDWARFDwo::FindDefinitionTypeForDWARFDeclContext(
-const DWARFDeclContext _decl_ctx) {
-  return GetBaseSymbolFile().FindDefinitionTypeForDWARFDeclContext(
-  die_decl_ctx);
+lldb::TypeSP
+SymbolFileDWARFDwo::FindDefinitionTypeForDWARFDeclContext(const DWARFDIE ) {
+  return GetBaseSymbolFile().FindDefinitionTypeForDWARFDeclContext(die);
 }
 
 lldb::TypeSP SymbolFileDWARFDwo::FindCompleteObjCDefinitionTypeForDIE(
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
@@ -282,8 +282,7 @@
 
   CompileUnitInfo *GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf);
 
-  lldb::TypeSP
-  FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext _decl_ctx);
+  lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDIE );
 
   bool Supports_DW_AT_APPLE_objc_complete_type(SymbolFileDWARF *skip_dwarf_oso);
 
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -1125,10 +1125,10 @@
 }
 
 TypeSP SymbolFileDWARFDebugMap::FindDefinitionTypeForDWARFDeclContext(
-const DWARFDeclContext _decl_ctx) {
+const DWARFDIE ) {
   TypeSP type_sp;
   ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
-type_sp = oso_dwarf->FindDefinitionTypeForDWARFDeclContext(die_decl_ctx);
+type_sp = oso_dwarf->FindDefinitionTypeForDWARFDeclContext(die);
 return ((bool)type_sp);
   });
   return type_sp;
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -443,7 +443,7 @@
lldb_private::SymbolContext );
 
   virtual lldb::TypeSP
-  FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext _decl_ctx);
+  FindDefinitionTypeForDWARFDeclContext(const DWARFDIE );
 
   virtual lldb::TypeSP
   FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE ,
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2946,119 +2946,113 @@
   return true;
 }
 
-TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(
-const DWARFDeclContext _decl_ctx) {
+TypeSP
+SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(const DWARFDIE ) {
   TypeSP type_sp;
 
-  const uint32_t dwarf_decl_ctx_count = dwarf_decl_ctx.GetSize();
-  if (dwarf_decl_ctx_count > 0) {
-const ConstString type_name(dwarf_decl_ctx[0].name);
-const dw_tag_t tag = dwarf_decl_ctx[0].tag;
+  const ConstString type_name(die.GetName());
+  if (type_name) {
+const dw_tag_t tag = die.Tag();
 
-if (type_name) {
-  Log *log = GetLog(DWARFLog::TypeCompletion |