[Lldb-commits] [clang] [compiler-rt] [lldb] [llvm] [Support] Remove terminfo dependency (PR #92865)

2024-05-26 Thread via lldb-commits

gulfemsavrun wrote:

We started seeing the following issue after this patch in our Clang toolchain 
builders: 
```
1448/1517](45) Linking CXX executable unittests/LineEditor/LineEditorTests
FAILED: unittests/LineEditor/LineEditorTests 
: && /b/s/w/ir/x/w/cipd/bin/clang++ --sysroot=/b/s/w/ir/x/w/cipd/linux 
-stdlib=libc++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden 
-Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra 
-Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers 
-pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough 
-Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor 
-Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion 
-Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color 
-ffunction-sections -fdata-sections -ffat-lto-objects 
-ffile-prefix-map=/b/s/w/ir/x/w/llvm_build=../llvm-llvm-project 
-ffile-prefix-map=/b/s/w/ir/x/w/llvm-llvm-project/= -no-canonical-prefixes -O3 
-DNDEBUG -static-libstdc++ -stdlib=libc++ -static-libstdc++ -fuse-ld=lld 
-Wl,--color-diagnostics -ffat-lto-objects-Wl,--gc-sections 
unittests/LineEditor/CMakeFiles/LineEditorTests.dir/LineEditor.cpp.o -o 
unittests/LineEditor/LineEditorTests  lib/libLLVMLineEditor.a  
lib/libLLVMSupport.a  lib/libLLVMSupport.a  -lpthread  lib/libllvm_gtest_main.a 
 lib/libllvm_gtest.a  -lpthread  /b/s/w/ir/x/w/libedit_install/lib/libedit.a  
lib/libLLVMSupport.a  -lrt  -ldl  -lpthread  -lm  
/b/s/w/ir/x/w/zlib_install_target/lib/libz.a  
/b/s/w/ir/x/w/zstd_install/lib/libzstd.a  -pthread  lib/libLLVMDemangle.a  
-lpthread && :
ld.lld: error: undefined symbol: tgetent
>>> referenced by terminal.c
>>>   terminal.o:(terminal_set) in archive 
>>> /b/s/w/ir/x/w/libedit_install/lib/libedit.a
```
https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8747030306803673361/+/u/clang/test/stdout

https://github.com/llvm/llvm-project/pull/92865
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [libcxx] [lldb] [llvm] Add clang basic module directory (PR #93388)

2024-05-26 Thread Chuanqi Xu via lldb-commits

ChuanqiXu9 wrote:

BTW, I tried to split `Module` class into `ModuleBase`, `ClangModule` and 
`Cpp20Modules` (and HeaderUnits) classes to improve the readability. But it 
showed too hard and too many things get changes then I stopped.

https://github.com/llvm/llvm-project/pull/93388
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [libcxx] [lldb] [llvm] Add clang basic module directory (PR #93388)

2024-05-26 Thread David Stone via lldb-commits

davidstone wrote:

To give a little more detail about my plans as of right now:

* Move `VisibleModuleSet` into its own file
* Move `ASTFileSignature` into its own file
* Take some of the related members of `Module`, group them together into their 
own class, and move the resulting classes into their own headers

That last one is the most vague, because until I actually do some of the work I 
won't really know what the proper divisions are. But even if that last bullet 
ends up being two things split out, the `Module` directory ends up with 6 files 
in it, which is a much more reasonable organizational structure than the 2 
files in this commit.

https://github.com/llvm/llvm-project/pull/93388
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [libcxx] [lldb] [llvm] Add clang basic module directory (PR #93388)

2024-05-26 Thread David Stone via lldb-commits

davidstone wrote:

> I don't like the PR since I don't feel it makes the code cleaner and it may 
> make the downstream suffering backporting.
> 
> If there are deeper reasons or following patches, we can discuss them 
> seperately.

On its own, I would agree. My goal is to split several more things out of 
`Module.h` but still keep all the module things together. I'm fine letting this 
sit until I get some of those other changes together and we can look over a 
broader set of changes and see if the direction is good.

https://github.com/llvm/llvm-project/pull/93388
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [libcxx] [lldb] [llvm] Add clang basic module directory (PR #93388)

2024-05-26 Thread David Stone via lldb-commits

https://github.com/davidstone edited 
https://github.com/llvm/llvm-project/pull/93388
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [libcxx] [lldb] [llvm] Add clang basic module directory (PR #93388)

2024-05-26 Thread David Stone via lldb-commits

https://github.com/davidstone updated 
https://github.com/llvm/llvm-project/pull/93388

>From f4b9852b0c11a9b5087c5fdb7794b5cab7f4d22c Mon Sep 17 00:00:00 2001
From: David Stone 
Date: Sun, 26 May 2024 10:34:09 -0600
Subject: [PATCH 1/3] [clang][Modules] Remove unnecessary includes of
 `Module.h`

---
 .../clangd/unittests/ReplayPeambleTests.cpp   |  10 +-
 .../include/clang/APINotes/APINotesManager.h  |   5 +-
 .../Serialization/SymbolGraphSerializer.h |   1 -
 clang/include/clang/Serialization/ASTWriter.h |  32 ++---
 .../clang/Serialization/ModuleManager.h   |  14 +-
 clang/lib/APINotes/APINotesManager.cpp|   1 +
 clang/lib/AST/ASTDumper.cpp   |  12 +-
 clang/lib/CodeGen/CodeGenModule.h | 126 --
 clang/lib/ExtractAPI/API.cpp  |   1 -
 .../header_exportable_declarations.cpp|   2 -
 10 files changed, 93 insertions(+), 111 deletions(-)

diff --git a/clang-tools-extra/clangd/unittests/ReplayPeambleTests.cpp 
b/clang-tools-extra/clangd/unittests/ReplayPeambleTests.cpp
index 147d9abe69137..32942e6bbfdc8 100644
--- a/clang-tools-extra/clangd/unittests/ReplayPeambleTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ReplayPeambleTests.cpp
@@ -25,7 +25,6 @@
 #include "clang/AST/DeclTemplate.h"
 #include "clang/Basic/FileEntry.h"
 #include "clang/Basic/LLVM.h"
-#include "clang/Basic/Module.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/TokenKinds.h"
@@ -42,7 +41,11 @@
 #include 
 #include 
 
-namespace clang::clangd {
+namespace clang {
+
+class Module;
+
+namespace clangd {
 namespace {
 struct Inclusion {
   Inclusion(const SourceManager , SourceLocation HashLoc,
@@ -170,4 +173,5 @@ TEST(ReplayPreambleTest, IncludesAndSkippedFiles) {
   }
 }
 } // namespace
-} // namespace clang::clangd
+} // namespace clangd
+} // namespace clang
diff --git a/clang/include/clang/APINotes/APINotesManager.h 
b/clang/include/clang/APINotes/APINotesManager.h
index 18375c9e51a17..40c6328319dbd 100644
--- a/clang/include/clang/APINotes/APINotesManager.h
+++ b/clang/include/clang/APINotes/APINotesManager.h
@@ -9,7 +9,6 @@
 #ifndef LLVM_CLANG_APINOTES_APINOTESMANAGER_H
 #define LLVM_CLANG_APINOTES_APINOTESMANAGER_H
 
-#include "clang/Basic/Module.h"
 #include "clang/Basic/SourceLocation.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
@@ -24,6 +23,7 @@ namespace clang {
 class DirectoryEntry;
 class FileEntry;
 class LangOptions;
+class Module;
 class SourceManager;
 
 namespace api_notes {
@@ -159,7 +159,8 @@ class APINotesManager {
   ArrayRef getCurrentModuleReaders() const {
 bool HasPublic = CurrentModuleReaders[ReaderKind::Public];
 bool HasPrivate = CurrentModuleReaders[ReaderKind::Private];
-assert((!HasPrivate || HasPublic) && "private module requires public 
module");
+assert((!HasPrivate || HasPublic) &&
+   "private module requires public module");
 if (!HasPrivate && !HasPublic)
   return {};
 return ArrayRef(CurrentModuleReaders).slice(0, HasPrivate ? 2 : 1);
diff --git 
a/clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h 
b/clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h
index 27e9167ca1ad0..f8759bf2d8f25 100644
--- a/clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h
+++ b/clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h
@@ -17,7 +17,6 @@
 #ifndef LLVM_CLANG_EXTRACTAPI_SERIALIZATION_SYMBOLGRAPHSERIALIZER_H
 #define LLVM_CLANG_EXTRACTAPI_SERIALIZATION_SYMBOLGRAPHSERIALIZER_H
 
-#include "clang/Basic/Module.h"
 #include "clang/ExtractAPI/API.h"
 #include "clang/ExtractAPI/APIIgnoresList.h"
 #include "clang/ExtractAPI/Serialization/APISetVisitor.h"
diff --git a/clang/include/clang/Serialization/ASTWriter.h 
b/clang/include/clang/Serialization/ASTWriter.h
index 88192e439a3f0..ddd3514b3c2db 100644
--- a/clang/include/clang/Serialization/ASTWriter.h
+++ b/clang/include/clang/Serialization/ASTWriter.h
@@ -18,7 +18,6 @@
 #include "clang/AST/Decl.h"
 #include "clang/AST/Type.h"
 #include "clang/Basic/LLVM.h"
-#include "clang/Basic/Module.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Sema/Sema.h"
 #include "clang/Sema/SemaConsumer.h"
@@ -277,7 +276,8 @@ class ASTWriter : public ASTDeserializationListener,
   std::vector TypeOffsets;
 
   /// The first ID number we can use for our own identifiers.
-  serialization::IdentifierID FirstIdentID = 
serialization::NUM_PREDEF_IDENT_IDS;
+  serialization::IdentifierID FirstIdentID =
+  serialization::NUM_PREDEF_IDENT_IDS;
 
   /// The identifier ID that will be assigned to the next new identifier.
   serialization::IdentifierID NextIdentID = FirstIdentID;
@@ -288,7 +288,8 @@ class ASTWriter : public ASTDeserializationListener,
   /// The ID numbers for identifiers are consecutive (in order of
   /// discovery), starting at 1. An ID of zero refers to a NULL
   /// IdentifierInfo.
-  llvm::MapVector 

[Lldb-commits] [clang] [clang-tools-extra] [libcxx] [lldb] [llvm] Add clang basic module directory (PR #93388)

2024-05-26 Thread Sergei Barannikov via lldb-commits


@@ -11,7 +11,7 @@
 //

s-barannikov wrote:

I guess this file should've been removed.


https://github.com/llvm/llvm-project/pull/93388
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [clang][Modules] Move `ASTSourceDescriptor` into its own file (PR #67930)

2024-05-26 Thread via lldb-commits

https://github.com/cor3ntin approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/67930
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits