[llvm] [lldb] Add SBType::FindNestedType() function (PR #68705)

Michael Buch via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 13 02:58:57 PDT 2023


================
@@ -119,6 +119,38 @@ def test(self):
 
         self.assertEqual(task_type, task_head_pointee_type)
 
+        # Check whether we can find a directly nested type by name
+        name_type = task_type.FindDirectNestedType("name")
+        self.assertTrue(name_type)
+        self.DebugSBType(name_type)
+
+        enum_type = task_type.FindDirectNestedType("E")
+        self.assertTrue(enum_type)
+        self.DebugSBType(enum_type)
+
+        union_type = task_type.FindDirectNestedType("U")
+        self.assertTrue(union_type)
+        self.DebugSBType(union_type)
+
+        # Check that we don't find indirectly nested types
+
+        self.assertTrue(enum_type.size == 1)
----------------
Michael137 wrote:

ah makes sense

https://github.com/llvm/llvm-project/pull/68705


More information about the llvm-commits mailing list