Re: [Lldb-commits] [PATCH] D92759: [lldb] Introduce separate scratch ASTs for debug info types and types imported from C++ modules.

2021-01-25 Thread Raphael “Teemperor” Isemann via lldb-commits
Yeah, that's an unfortunate bug in GCC 5.x. I actually just fixed that before 
the weekend in 
https://reviews.llvm.org/rG37510f69b4cb8d76064f108d57bebe95984a23ae 
 

+CC Tom (who is the release manager AFAIK), as that commit probably deserves to 
be cherry-picked to the 11 release branch (which contains D92759 so it won't 
build with GCC 5.x )

Thanks!
- Raphael

> On 25 Jan 2021, at 10:04, Sylvestre Ledru via Phabricator 
>  wrote:
> 
> sylvestre.ledru added a comment.
> 
> This change doesn't build with gcc 5.3.1.
> More details: https://bugs.llvm.org/show_bug.cgi?id=48869
> 
> It would be great if you have could have a look! thanks
> 
> 
> Repository:
>  rG LLVM Github Monorepo
> 
> CHANGES SINCE LAST ACTION
>  https://reviews.llvm.org/D92759/new/
> 
> https://reviews.llvm.org/D92759
> 

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


[Lldb-commits] [PATCH] D92759: [lldb] Introduce separate scratch ASTs for debug info types and types imported from C++ modules.

2021-01-25 Thread Sylvestre Ledru via Phabricator via lldb-commits
sylvestre.ledru added a comment.

This change doesn't build with gcc 5.3.1.
More details: https://bugs.llvm.org/show_bug.cgi?id=48869

It would be great if you have could have a look! thanks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92759

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


[Lldb-commits] [PATCH] D92759: [lldb] Introduce separate scratch ASTs for debug info types and types imported from C++ modules.

2020-12-10 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG47e7ecdd7d36: [lldb] Introduce separate scratch ASTs for 
debug info types and types imported… (authored by teemperor).
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Changed prior to commit:
  https://reviews.llvm.org/D92759?vs=310535=310958#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92759

Files:
  lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
  
lldb/test/API/commands/expression/import-std-module/non-module-type-separation/Makefile
  
lldb/test/API/commands/expression/import-std-module/non-module-type-separation/TestNonModuleTypeSeparation.py
  
lldb/test/API/commands/expression/import-std-module/non-module-type-separation/main.cpp
  lldb/unittests/Symbol/TestTypeSystemClang.cpp

Index: lldb/unittests/Symbol/TestTypeSystemClang.cpp
===
--- lldb/unittests/Symbol/TestTypeSystemClang.cpp
+++ lldb/unittests/Symbol/TestTypeSystemClang.cpp
@@ -730,3 +730,15 @@
   EXPECT_FALSE(method->isDirectMethod());
   EXPECT_EQ(method->getDeclName().getObjCSelector().getAsString(), "foo");
 }
+
+TEST(TestScratchTypeSystemClang, InferSubASTFromLangOpts) {
+  LangOptions lang_opts;
+  EXPECT_EQ(
+  ScratchTypeSystemClang::DefaultAST,
+  ScratchTypeSystemClang::InferIsolatedASTKindFromLangOpts(lang_opts));
+
+  lang_opts.Modules = true;
+  EXPECT_EQ(
+  ScratchTypeSystemClang::IsolatedASTKind::CppModules,
+  ScratchTypeSystemClang::InferIsolatedASTKindFromLangOpts(lang_opts));
+}
Index: lldb/test/API/commands/expression/import-std-module/non-module-type-separation/main.cpp
===
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/non-module-type-separation/main.cpp
@@ -0,0 +1,17 @@
+#include 
+
+struct DbgInfoClass {
+  std::vector ints;
+};
+
+int main(int argc, char **argv) {
+  std::vector a = {3, 1, 2};
+
+  // Create a std::vector of a class from debug info with one element.
+  std::vector dbg_info_vec;
+  dbg_info_vec.resize(1);
+  // And that class has a std::vector of integers that comes from the C++
+  // module.
+  dbg_info_vec.back().ints.push_back(1);
+  return 0; // Set break point at this line.
+}
Index: lldb/test/API/commands/expression/import-std-module/non-module-type-separation/TestNonModuleTypeSeparation.py
===
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/non-module-type-separation/TestNonModuleTypeSeparation.py
@@ -0,0 +1,88 @@
+"""
+Test that LLDB is separating C++ module types and debug information types
+in the scratch AST.
+"""
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@add_test_categories(["libc++"])
+@skipIf(compiler=no_match("clang"))
+def test(self):
+"""
+This test is creating ValueObjects with both C++ module and debug
+info types for std::vector. We can't merge these types into
+the same AST, so for this test to pass LLDB should split the types
+up depending on whether they come from a module or not.
+"""
+self.build()
+
+lldbutil.run_to_source_breakpoint(self,
+  "// Set break point at this line.",
+  lldb.SBFileSpec("main.cpp"))
+
+children = [
+ValueCheck(value="3"),
+ValueCheck(value="1"),
+ValueCheck(value="2"),
+]
+
+# The debug info vector type doesn't know about the default template
+# arguments, so they will be printed.
+debug_info_vector_type = "std::vector >"
+
+# The C++ module vector knows its default template arguments and will
+# suppress them.
+module_vector_type = "std::vector"
+
+# First muddy the scratch AST with non-C++ module types.
+self.expect_expr("a", result_type=debug_info_vector_type,
+ result_children=children)
+self.expect_expr("dbg_info_vec",
+ result_type="std::vector >",
+ result_children=[
+ValueCheck(type="DbgInfoClass", children=[
+ValueCheck(name="ints", type=debug_info_vector_type, children=[
+ValueCheck(value="1")
+