Skip to content

Remove clang-pseudo #109154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 19, 2024
Merged

Conversation

AaronBallman
Copy link
Collaborator

The functionality is incomplete and the authors have since shifted gears to other work, so this is effectively unmaintained.

The original design document for clang-pseudo can be found at:
https://docs.google.com/document/d/1eGkTOsFja63wsv8v0vd5JdoTonj-NlN3ujGF0T7xDbM/edit
in case anyone wishes to pick this project back up again in the future.

Original RFC: https://discourse.llvm.org/t/removing-pseudo-parser/71131/

The functionality is incomplete and the authors have since shifted
gears to other work, so this is effectively unmaintained.

Original RFC: https://discourse.llvm.org/t/removing-pseudo-parser/71131/
@AaronBallman AaronBallman added clang Clang issues not falling into any other category clang-tools-extra labels Sep 18, 2024
@llvmbot llvmbot added the clangd label Sep 18, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 18, 2024

@llvm/pr-subscribers-clangd
@llvm/pr-subscribers-clang-tools-extra

@llvm/pr-subscribers-clang

Author: Aaron Ballman (AaronBallman)

Changes

The functionality is incomplete and the authors have since shifted gears to other work, so this is effectively unmaintained.

The original design document for clang-pseudo can be found at:
https://docs.google.com/document/d/1eGkTOsFja63wsv8v0vd5JdoTonj-NlN3ujGF0T7xDbM/edit
in case anyone wishes to pick this project back up again in the future.

Original RFC: https://discourse.llvm.org/t/removing-pseudo-parser/71131/


Patch is 392.50 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/109154.diff

102 Files Affected:

  • (modified) clang-tools-extra/CMakeLists.txt (-1)
  • (modified) clang-tools-extra/clangd/CMakeLists.txt (-1)
  • (modified) clang-tools-extra/clangd/SemanticSelection.cpp (+16-16)
  • (renamed) clang-tools-extra/clangd/support/Bracket.cpp (+4-4)
  • (renamed) clang-tools-extra/clangd/support/Bracket.h (+6-6)
  • (modified) clang-tools-extra/clangd/support/CMakeLists.txt (+4)
  • (renamed) clang-tools-extra/clangd/support/DirectiveTree.cpp (+3-3)
  • (renamed) clang-tools-extra/clangd/support/DirectiveTree.h (+6-6)
  • (renamed) clang-tools-extra/clangd/support/Lex.cpp (+3-3)
  • (renamed) clang-tools-extra/clangd/support/Token.cpp (+3-3)
  • (renamed) clang-tools-extra/clangd/support/Token.h (+5-5)
  • (removed) clang-tools-extra/pseudo/CMakeLists.txt (-12)
  • (removed) clang-tools-extra/pseudo/DesignNotes.md (-123)
  • (removed) clang-tools-extra/pseudo/Disambiguation.md (-367)
  • (removed) clang-tools-extra/pseudo/README.md (-37)
  • (removed) clang-tools-extra/pseudo/benchmarks/Benchmark.cpp (-156)
  • (removed) clang-tools-extra/pseudo/benchmarks/CMakeLists.txt (-9)
  • (removed) clang-tools-extra/pseudo/fuzzer/CMakeLists.txt (-16)
  • (removed) clang-tools-extra/pseudo/fuzzer/Fuzzer.cpp (-82)
  • (removed) clang-tools-extra/pseudo/fuzzer/Main.cpp (-16)
  • (removed) clang-tools-extra/pseudo/gen/CMakeLists.txt (-11)
  • (removed) clang-tools-extra/pseudo/gen/Main.cpp (-172)
  • (removed) clang-tools-extra/pseudo/include/CMakeLists.txt (-32)
  • (removed) clang-tools-extra/pseudo/include/clang-pseudo/Disambiguate.h (-64)
  • (removed) clang-tools-extra/pseudo/include/clang-pseudo/Forest.h (-236)
  • (removed) clang-tools-extra/pseudo/include/clang-pseudo/GLR.h (-170)
  • (removed) clang-tools-extra/pseudo/include/clang-pseudo/Language.h (-64)
  • (removed) clang-tools-extra/pseudo/include/clang-pseudo/cli/CLI.h (-35)
  • (removed) clang-tools-extra/pseudo/include/clang-pseudo/cxx/CXX.h (-91)
  • (removed) clang-tools-extra/pseudo/include/clang-pseudo/grammar/Grammar.h (-230)
  • (removed) clang-tools-extra/pseudo/include/clang-pseudo/grammar/LRGraph.h (-196)
  • (removed) clang-tools-extra/pseudo/include/clang-pseudo/grammar/LRTable.h (-278)
  • (removed) clang-tools-extra/pseudo/lib/CMakeLists.txt (-31)
  • (removed) clang-tools-extra/pseudo/lib/Disambiguate.cpp (-48)
  • (removed) clang-tools-extra/pseudo/lib/Forest.cpp (-199)
  • (removed) clang-tools-extra/pseudo/lib/GLR.cpp (-772)
  • (removed) clang-tools-extra/pseudo/lib/cli/CLI.cpp (-54)
  • (removed) clang-tools-extra/pseudo/lib/cli/CMakeLists.txt (-15)
  • (removed) clang-tools-extra/pseudo/lib/cxx/CMakeLists.txt (-19)
  • (removed) clang-tools-extra/pseudo/lib/cxx/CXX.cpp (-452)
  • (removed) clang-tools-extra/pseudo/lib/cxx/cxx.bnf (-775)
  • (removed) clang-tools-extra/pseudo/lib/grammar/CMakeLists.txt (-10)
  • (removed) clang-tools-extra/pseudo/lib/grammar/Grammar.cpp (-190)
  • (removed) clang-tools-extra/pseudo/lib/grammar/GrammarBNF.cpp (-362)
  • (removed) clang-tools-extra/pseudo/lib/grammar/LRGraph.cpp (-265)
  • (removed) clang-tools-extra/pseudo/lib/grammar/LRTable.cpp (-79)
  • (removed) clang-tools-extra/pseudo/lib/grammar/LRTableBuild.cpp (-121)
  • (removed) clang-tools-extra/pseudo/test/.clang-format (-1)
  • (removed) clang-tools-extra/pseudo/test/CMakeLists.txt (-29)
  • (removed) clang-tools-extra/pseudo/test/Unit/lit.cfg.py (-25)
  • (removed) clang-tools-extra/pseudo/test/Unit/lit.site.cfg.py.in (-11)
  • (removed) clang-tools-extra/pseudo/test/check-cxx-bnf.test (-2)
  • (removed) clang-tools-extra/pseudo/test/crash/backslashes.c (-4)
  • (removed) clang-tools-extra/pseudo/test/cxx/capture-list.cpp (-23)
  • (removed) clang-tools-extra/pseudo/test/cxx/contextual-keywords.cpp (-9)
  • (removed) clang-tools-extra/pseudo/test/cxx/dangling-else.cpp (-22)
  • (removed) clang-tools-extra/pseudo/test/cxx/decl-specfier-seq.cpp (-27)
  • (removed) clang-tools-extra/pseudo/test/cxx/declarator-function.cpp (-9)
  • (removed) clang-tools-extra/pseudo/test/cxx/declarator-var.cpp (-9)
  • (removed) clang-tools-extra/pseudo/test/cxx/declator-member-function.cpp (-9)
  • (removed) clang-tools-extra/pseudo/test/cxx/empty-member-declaration.cpp (-7)
  • (removed) clang-tools-extra/pseudo/test/cxx/empty-member-spec.cpp (-13)
  • (removed) clang-tools-extra/pseudo/test/cxx/keyword.cpp (-12)
  • (removed) clang-tools-extra/pseudo/test/cxx/literals.cpp (-43)
  • (removed) clang-tools-extra/pseudo/test/cxx/mixed-designator.cpp (-27)
  • (removed) clang-tools-extra/pseudo/test/cxx/nested-name-specifier.cpp (-28)
  • (removed) clang-tools-extra/pseudo/test/cxx/parameter-decl-clause.cpp (-14)
  • (removed) clang-tools-extra/pseudo/test/cxx/predefined-identifier.cpp (-5)
  • (removed) clang-tools-extra/pseudo/test/cxx/recovery-func-parameters.cpp (-13)
  • (removed) clang-tools-extra/pseudo/test/cxx/recovery-init-list.cpp (-13)
  • (removed) clang-tools-extra/pseudo/test/cxx/structured-binding.cpp (-6)
  • (removed) clang-tools-extra/pseudo/test/cxx/template-empty-type-parameter.cpp (-3)
  • (removed) clang-tools-extra/pseudo/test/cxx/unsized-array.cpp (-7)
  • (removed) clang-tools-extra/pseudo/test/fuzzer.cpp (-4)
  • (removed) clang-tools-extra/pseudo/test/glr-variant-start.cpp (-9)
  • (removed) clang-tools-extra/pseudo/test/glr.cpp (-30)
  • (removed) clang-tools-extra/pseudo/test/html-forest.c (-8)
  • (removed) clang-tools-extra/pseudo/test/lex.c (-42)
  • (removed) clang-tools-extra/pseudo/test/lit.cfg.py (-20)
  • (removed) clang-tools-extra/pseudo/test/lit.local.cfg (-2)
  • (removed) clang-tools-extra/pseudo/test/lit.site.cfg.py.in (-14)
  • (removed) clang-tools-extra/pseudo/test/lr-build-basic.test (-32)
  • (removed) clang-tools-extra/pseudo/test/lr-build-conflicts.test (-49)
  • (removed) clang-tools-extra/pseudo/test/strip-directives.c (-49)
  • (removed) clang-tools-extra/pseudo/tool/CMakeLists.txt (-30)
  • (removed) clang-tools-extra/pseudo/tool/ClangPseudo.cpp (-243)
  • (removed) clang-tools-extra/pseudo/tool/HTMLForest.cpp (-192)
  • (removed) clang-tools-extra/pseudo/tool/HTMLForest.css (-93)
  • (removed) clang-tools-extra/pseudo/tool/HTMLForest.html (-15)
  • (removed) clang-tools-extra/pseudo/tool/HTMLForest.js (-290)
  • (removed) clang-tools-extra/pseudo/unittests/BracketTest.cpp (-117)
  • (removed) clang-tools-extra/pseudo/unittests/CMakeLists.txt (-32)
  • (removed) clang-tools-extra/pseudo/unittests/CXXTest.cpp (-30)
  • (removed) clang-tools-extra/pseudo/unittests/DirectiveTreeTest.cpp (-357)
  • (removed) clang-tools-extra/pseudo/unittests/DisambiguateTest.cpp (-111)
  • (removed) clang-tools-extra/pseudo/unittests/ForestTest.cpp (-180)
  • (removed) clang-tools-extra/pseudo/unittests/GLRTest.cpp (-789)
  • (removed) clang-tools-extra/pseudo/unittests/GrammarTest.cpp (-213)
  • (removed) clang-tools-extra/pseudo/unittests/LRTableTest.cpp (-76)
  • (removed) clang-tools-extra/pseudo/unittests/TokenTest.cpp (-224)
  • (modified) clang/docs/ClangFormattedStatus.rst (-5)
  • (modified) clang/docs/tools/clang-formatted-files.txt (-1)
diff --git a/clang-tools-extra/CMakeLists.txt b/clang-tools-extra/CMakeLists.txt
index f6a6b57b5ef0bc..6b6f2b1ca22765 100644
--- a/clang-tools-extra/CMakeLists.txt
+++ b/clang-tools-extra/CMakeLists.txt
@@ -27,7 +27,6 @@ add_subdirectory(clang-move)
 add_subdirectory(clang-query)
 add_subdirectory(include-cleaner)
 add_subdirectory(pp-trace)
-add_subdirectory(pseudo)
 add_subdirectory(tool-template)
 
 option(CLANG_TOOLS_EXTRA_INCLUDE_DOCS "Generate build targets for the Clang Extra Tools docs."
diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt
index c21d277d2ffcbd..8dcbf5f47e056a 100644
--- a/clang-tools-extra/clangd/CMakeLists.txt
+++ b/clang-tools-extra/clangd/CMakeLists.txt
@@ -183,7 +183,6 @@ target_link_libraries(clangDaemon
   ${LLVM_PTHREAD_LIB}
 
   clangIncludeCleaner
-  clangPseudo
   clangTidy
   clangTidyUtils
 
diff --git a/clang-tools-extra/clangd/SemanticSelection.cpp b/clang-tools-extra/clangd/SemanticSelection.cpp
index 3d687173b2be99..dd7116e619e6d0 100644
--- a/clang-tools-extra/clangd/SemanticSelection.cpp
+++ b/clang-tools-extra/clangd/SemanticSelection.cpp
@@ -11,9 +11,6 @@
 #include "Protocol.h"
 #include "Selection.h"
 #include "SourceCode.h"
-#include "clang-pseudo/Bracket.h"
-#include "clang-pseudo/DirectiveTree.h"
-#include "clang-pseudo/Token.h"
 #include "clang/AST/DeclBase.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Basic/SourceManager.h"
@@ -25,6 +22,9 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/Error.h"
+#include "support/Bracket.h"
+#include "support/DirectiveTree.h"
+#include "support/Token.h"
 #include <optional>
 #include <queue>
 #include <vector>
@@ -181,16 +181,16 @@ llvm::Expected<std::vector<FoldingRange>> getFoldingRanges(ParsedAST &AST) {
 // Related issue: https://github.com/clangd/clangd/issues/310
 llvm::Expected<std::vector<FoldingRange>>
 getFoldingRanges(const std::string &Code, bool LineFoldingOnly) {
-  auto OrigStream = pseudo::lex(Code, clang::pseudo::genericLangOpts());
+  auto OrigStream = lex(Code, genericLangOpts());
 
-  auto DirectiveStructure = pseudo::DirectiveTree::parse(OrigStream);
-  pseudo::chooseConditionalBranches(DirectiveStructure, OrigStream);
+  auto DirectiveStructure = DirectiveTree::parse(OrigStream);
+  chooseConditionalBranches(DirectiveStructure, OrigStream);
 
   // FIXME: Provide ranges in the disabled-PP regions as well.
   auto Preprocessed = DirectiveStructure.stripDirectives(OrigStream);
 
-  auto ParseableStream = cook(Preprocessed, clang::pseudo::genericLangOpts());
-  pseudo::pairBrackets(ParseableStream);
+  auto ParseableStream = cook(Preprocessed, genericLangOpts());
+  pairBrackets(ParseableStream);
 
   std::vector<FoldingRange> Result;
   auto AddFoldingRange = [&](Position Start, Position End,
@@ -205,19 +205,19 @@ getFoldingRanges(const std::string &Code, bool LineFoldingOnly) {
     FR.kind = Kind.str();
     Result.push_back(FR);
   };
-  auto OriginalToken = [&](const pseudo::Token &T) {
+  auto OriginalToken = [&](const Token &T) {
     return OrigStream.tokens()[T.OriginalIndex];
   };
-  auto StartOffset = [&](const pseudo::Token &T) {
+  auto StartOffset = [&](const Token &T) {
     return OriginalToken(T).text().data() - Code.data();
   };
-  auto StartPosition = [&](const pseudo::Token &T) {
+  auto StartPosition = [&](const Token &T) {
     return offsetToPosition(Code, StartOffset(T));
   };
-  auto EndOffset = [&](const pseudo::Token &T) {
+  auto EndOffset = [&](const Token &T) {
     return StartOffset(T) + OriginalToken(T).Length;
   };
-  auto EndPosition = [&](const pseudo::Token &T) {
+  auto EndPosition = [&](const Token &T) {
     return offsetToPosition(Code, EndOffset(T));
   };
   auto Tokens = ParseableStream.tokens();
@@ -235,7 +235,7 @@ getFoldingRanges(const std::string &Code, bool LineFoldingOnly) {
       }
     }
   }
-  auto IsBlockComment = [&](const pseudo::Token &T) {
+  auto IsBlockComment = [&](const Token &T) {
     assert(T.Kind == tok::comment);
     return OriginalToken(T).Length >= 2 &&
            Code.substr(StartOffset(T), 2) == "/*";
@@ -246,10 +246,10 @@ getFoldingRanges(const std::string &Code, bool LineFoldingOnly) {
       T++;
       continue;
     }
-    pseudo::Token *FirstComment = T;
+    Token *FirstComment = T;
     // Show starting sentinals (// and /*) of the comment.
     Position Start = offsetToPosition(Code, 2 + StartOffset(*FirstComment));
-    pseudo::Token *LastComment = T;
+    Token *LastComment = T;
     Position End = EndPosition(*T);
     while (T != Tokens.end() && T->Kind == tok::comment &&
            StartPosition(*T).line <= End.line + 1) {
diff --git a/clang-tools-extra/pseudo/lib/Bracket.cpp b/clang-tools-extra/clangd/support/Bracket.cpp
similarity index 97%
rename from clang-tools-extra/pseudo/lib/Bracket.cpp
rename to clang-tools-extra/clangd/support/Bracket.cpp
index 07836146ad8a58..93d0f38015efbf 100644
--- a/clang-tools-extra/pseudo/lib/Bracket.cpp
+++ b/clang-tools-extra/clangd/support/Bracket.cpp
@@ -62,10 +62,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "clang-pseudo/Bracket.h"
+#include "Bracket.h"
 
 namespace clang {
-namespace pseudo {
+namespace clangd {
 namespace {
 
 struct Bracket {
@@ -83,7 +83,7 @@ struct Bracket {
 // Find brackets in the stream and convert to Bracket struct.
 std::vector<Bracket> findBrackets(const TokenStream &Stream) {
   std::vector<Bracket> Brackets;
-  auto Add = [&](const pseudo::Token &Tok, Bracket::BracketKind K,
+  auto Add = [&](const Token &Tok, Bracket::BracketKind K,
                  Bracket::Direction D) {
     Brackets.push_back(
         {K, D, Tok.Line, Tok.Indent, Stream.index(Tok), Bracket::None});
@@ -151,5 +151,5 @@ void pairBrackets(TokenStream &Stream) {
   applyPairings(Brackets, Stream);
 }
 
-} // namespace pseudo
+} // namespace clangd
 } // namespace clang
diff --git a/clang-tools-extra/pseudo/include/clang-pseudo/Bracket.h b/clang-tools-extra/clangd/support/Bracket.h
similarity index 87%
rename from clang-tools-extra/pseudo/include/clang-pseudo/Bracket.h
rename to clang-tools-extra/clangd/support/Bracket.h
index 268cfff1ab07ab..b43c22cea06d06 100644
--- a/clang-tools-extra/pseudo/include/clang-pseudo/Bracket.h
+++ b/clang-tools-extra/clangd/support/Bracket.h
@@ -23,19 +23,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef CLANG_PSEUDO_BRACKET_H
-#define CLANG_PSEUDO_BRACKET_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_BRACKET_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_BRACKET_H
 
-#include "clang-pseudo/Token.h"
+#include "Token.h"
 
 namespace clang {
-namespace pseudo {
+namespace clangd {
 
 /// Identifies bracket token in the stream which should be paired.
 /// Sets Token::Pair accordingly.
 void pairBrackets(TokenStream &);
 
-} // namespace pseudo
+} // namespace clangd
 } // namespace clang
 
-#endif
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_BRACKET_H
diff --git a/clang-tools-extra/clangd/support/CMakeLists.txt b/clang-tools-extra/clangd/support/CMakeLists.txt
index 0c8c199dd4a4c2..a1a2a7765fae95 100644
--- a/clang-tools-extra/clangd/support/CMakeLists.txt
+++ b/clang-tools-extra/clangd/support/CMakeLists.txt
@@ -16,9 +16,12 @@ if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB OR NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
 endif()
 
 add_clang_library(clangdSupport
+  Bracket.cpp
   Cancellation.cpp
   Context.cpp
+  DirectiveTree.cpp
   FileCache.cpp
+  Lex.cpp
   Logger.cpp
   Markup.cpp
   MemoryTree.cpp
@@ -27,6 +30,7 @@ add_clang_library(clangdSupport
   ThreadCrashReporter.cpp
   Threading.cpp
   ThreadsafeFS.cpp
+  Token.cpp
   Trace.cpp
 
   LINK_LIBS
diff --git a/clang-tools-extra/pseudo/lib/DirectiveTree.cpp b/clang-tools-extra/clangd/support/DirectiveTree.cpp
similarity index 99%
rename from clang-tools-extra/pseudo/lib/DirectiveTree.cpp
rename to clang-tools-extra/clangd/support/DirectiveTree.cpp
index 9e853e46edc232..d25da111681afc 100644
--- a/clang-tools-extra/pseudo/lib/DirectiveTree.cpp
+++ b/clang-tools-extra/clangd/support/DirectiveTree.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "clang-pseudo/DirectiveTree.h"
+#include "DirectiveTree.h"
 #include "clang/Basic/IdentifierTable.h"
 #include "clang/Basic/TokenKinds.h"
 #include "llvm/Support/FormatVariadic.h"
@@ -14,7 +14,7 @@
 #include <variant>
 
 namespace clang {
-namespace pseudo {
+namespace clangd {
 namespace {
 
 class DirectiveParser {
@@ -353,5 +353,5 @@ TokenStream DirectiveTree::stripDirectives(const TokenStream &In) const {
   return Out;
 }
 
-} // namespace pseudo
+} // namespace clangd
 } // namespace clang
diff --git a/clang-tools-extra/pseudo/include/clang-pseudo/DirectiveTree.h b/clang-tools-extra/clangd/support/DirectiveTree.h
similarity index 95%
rename from clang-tools-extra/pseudo/include/clang-pseudo/DirectiveTree.h
rename to clang-tools-extra/clangd/support/DirectiveTree.h
index 2b6cb63297915d..34f5a888863f26 100644
--- a/clang-tools-extra/pseudo/include/clang-pseudo/DirectiveTree.h
+++ b/clang-tools-extra/clangd/support/DirectiveTree.h
@@ -25,17 +25,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef CLANG_PSEUDO_DIRECTIVETREE_H
-#define CLANG_PSEUDO_DIRECTIVETREE_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_DIRECTIVETREE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_DIRECTIVETREE_H
 
-#include "clang-pseudo/Token.h"
+#include "Token.h"
 #include "clang/Basic/TokenKinds.h"
 #include <optional>
 #include <variant>
 #include <vector>
 
 namespace clang {
-namespace pseudo {
+namespace clangd {
 
 /// Describes the structure of a source file, as seen by the preprocessor.
 ///
@@ -124,7 +124,7 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &,
 /// The choices are stored in Conditional::Taken nodes.
 void chooseConditionalBranches(DirectiveTree &, const TokenStream &Code);
 
-} // namespace pseudo
+} // namespace clangd
 } // namespace clang
 
-#endif // CLANG_PSEUDO_DIRECTIVETREE_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_DIRECTIVETREE_H
diff --git a/clang-tools-extra/pseudo/lib/Lex.cpp b/clang-tools-extra/clangd/support/Lex.cpp
similarity index 98%
rename from clang-tools-extra/pseudo/lib/Lex.cpp
rename to clang-tools-extra/clangd/support/Lex.cpp
index 2111476f04dc5b..f043b551b6bc6c 100644
--- a/clang-tools-extra/pseudo/lib/Lex.cpp
+++ b/clang-tools-extra/clangd/support/Lex.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "clang-pseudo/Token.h"
+#include "Token.h"
 #include "clang/Basic/IdentifierTable.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Basic/TokenKinds.h"
@@ -14,7 +14,7 @@
 #include "clang/Lex/LiteralSupport.h"
 
 namespace clang {
-namespace pseudo {
+namespace clangd {
 
 TokenStream lex(const std::string &Code, const clang::LangOptions &LangOpts) {
   clang::SourceLocation Start;
@@ -135,5 +135,5 @@ TokenStream cook(const TokenStream &Code, const LangOptions &LangOpts) {
   return Result;
 }
 
-} // namespace pseudo
+} // namespace clangd
 } // namespace clang
diff --git a/clang-tools-extra/pseudo/lib/Token.cpp b/clang-tools-extra/clangd/support/Token.cpp
similarity index 98%
rename from clang-tools-extra/pseudo/lib/Token.cpp
rename to clang-tools-extra/clangd/support/Token.cpp
index 5b07a62f37fb2f..13eee66606061d 100644
--- a/clang-tools-extra/pseudo/lib/Token.cpp
+++ b/clang-tools-extra/clangd/support/Token.cpp
@@ -6,14 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "clang-pseudo/Token.h"
+#include "Token.h"
 #include "clang/Basic/LangOptions.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/FormatVariadic.h"
 
 namespace clang {
-namespace pseudo {
+namespace clangd {
 
 llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Token &T) {
   OS << llvm::formatv("{0} {1}:{2} ", clang::tok::getTokenName(T.Kind), T.Line,
@@ -126,5 +126,5 @@ TokenStream stripComments(const TokenStream &Input) {
   return Out;
 }
 
-} // namespace pseudo
+} // namespace clangd
 } // namespace clang
diff --git a/clang-tools-extra/pseudo/include/clang-pseudo/Token.h b/clang-tools-extra/clangd/support/Token.h
similarity index 98%
rename from clang-tools-extra/pseudo/include/clang-pseudo/Token.h
rename to clang-tools-extra/clangd/support/Token.h
index 859fd7d2b3dfe2..555b6b0e4ce570 100644
--- a/clang-tools-extra/pseudo/include/clang-pseudo/Token.h
+++ b/clang-tools-extra/clangd/support/Token.h
@@ -25,8 +25,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef CLANG_PSEUDO_TOKEN_H
-#define CLANG_PSEUDO_TOKEN_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_TOKEN_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_TOKEN_H
 
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/LangStandard.h"
@@ -41,7 +41,7 @@
 
 namespace clang {
 class LangOptions;
-namespace pseudo {
+namespace clangd {
 
 /// A single C++ or preprocessor token.
 ///
@@ -249,7 +249,7 @@ TokenStream cook(const TokenStream &, const clang::LangOptions &);
 /// Drops comment tokens.
 TokenStream stripComments(const TokenStream &);
 
-} // namespace pseudo
+} // namespace clangd
 } // namespace clang
 
-#endif // CLANG_PSEUDO_TOKEN_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_TOKEN_H
diff --git a/clang-tools-extra/pseudo/CMakeLists.txt b/clang-tools-extra/pseudo/CMakeLists.txt
deleted file mode 100644
index 24bc1530bb7d6f..00000000000000
--- a/clang-tools-extra/pseudo/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-include_directories(include)
-include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
-add_subdirectory(include)
-add_subdirectory(gen)
-add_subdirectory(lib)
-add_subdirectory(tool)
-add_subdirectory(fuzzer)
-add_subdirectory(benchmarks)
-if(CLANG_INCLUDE_TESTS)
-  add_subdirectory(unittests)
-  add_subdirectory(test)
-endif()
diff --git a/clang-tools-extra/pseudo/DesignNotes.md b/clang-tools-extra/pseudo/DesignNotes.md
deleted file mode 100644
index 421cc02aef7576..00000000000000
--- a/clang-tools-extra/pseudo/DesignNotes.md
+++ /dev/null
@@ -1,123 +0,0 @@
-# Error recovery (2022-05-07)
-
-Problem: we have two fairly generic cases of recovery bounded within a range:
- - sequences: `int x; this is absolute garbage; x++;`
- - brackets: `void foo() { this is garbage too }`
-
-So far, we've thought of these as different, and had precise ideas about
-brackets ("lazy parsing") and vague ones about sequences.
-Con we unify them instead?
-
-In both cases we want to recognize the bounds of the garbage item based on
-basic token-level features of the surrounding code, and avoid any interference
-with the surrounding code.
-
-## Brackets
-
-Consider a rule like `compound-stmt := { stmt-seq }`.
-
-The desired recovery is:
-- if we fail at `{ . stmt-seq }`
-- ... and we can find for the matching `}`
-- then consume up to that token as an opaque broken `stmt-seq`
-- ... and advance state to `{ stmt-seq . }`
-
-We can annotate the rule to describe this: `{ stmt-seq [recovery] }`.
-We can generalize as `{ stmt-seq [recovery=rbrace] }`, allowing for different
-**strategies** to find the resume point.
-
-(It's OK to assume we're skipping over one RHS nonterminal, we can always
-introduce a nonterminal for the bracket contents if necessary).
-
-## Sequences
-
-Can we apply the same technique to sequences?
-Simplest case: delimited right-recursive sequence.
-
-```
-param-list := param
-param-list := param , param-list
-```
-
-We need recovery in **both** rules.
-`param` in the first rule matches the *last* param in a list,
-in the second rule it matches all others. We want to recover in any position.
-
-If we want to be able to recovery `int x int y` as two parameters, then we
-should extract a `param-and-comma` rule that recovery could operate on.
-
-### Last vs not-last elements
-
-Sequences will usually have two rules with recovery, we discussed:
- - how to pick the correct one to recover with
- - in a left-recursive rule they correspond to last & not-last elements
- - the recovery strategy knows whether we're recoverying last or not-last
- - we could have the strategy return (pos, symbol parsed), and artificially
-   require distinct symbols (e.g. `stmt` vs `last_stmt`).
- - we can rewrite left-recursion in the grammar as right-recursion
-
-However, on reflection I think we can simply allow recovery according to both
-rules. The "wrong" recovery will produce a parse head that dies.
-
-## How recovery fits into GLR
-
-Recovery should kick in at the point where we would otherwise abandon all
-variants of an high-level parse.
-
-e.g. Suppose we're parsing `static_cast<foo bar baz>(1)` and are up to `bar`.
-Our GSS looks something like:
-
-```
-     "the static cast's type starts at foo"
----> {expr := static_cast < . type > ( expr )}
-         |     "foo... is a class name"
-         +---- {type := identifier .}
-         |     "foo... is a template ID"
-         +---- {type := identifier . < template-arg-list >}
-```
-
-Since `foo bar baz` isn't a valid class name or template ID, both active heads
-will soon die, as will the parent GSS Node - the latter should trigger recovery.
-
-- we need a refcount in GSS nodes so we can recognize never-reduced node death
-- when a node dies, we look up its recovery actions (symbol, strategy).
-  These are the union of the recovery actions for each item.
-  They can be stored in the action table.
-  Here: `actions[State, death] = Recovery(type, matching-angle-bracket)`
-- we try each strategy: feeding in the start position = token of the dying node
-  (`foo`) getting out the end position (`>`).
-- We form an opaque forest node with the correct symbol (`type`) spanning
-  [start, end)
-- We create a GSS node to represent the state after recovery.
-  The new state is found in the Goto table in the usual way.
-
-```
-     "the static cast's type starts at foo"
----> {expr := static_cast < . type > ( expr )}
-         |     "`foo bar baz` is an unparseable type"
-         +---- {expr := static_cast < type . > (expr)}
-```
-
-## Which recovery heads to activate
-
-We probably shouldn't *always* create active recovery heads when a recoverable
-node dies (and thus keep it alive).
-By design GLR creates multiple speculative parse heads and lets incorrect heads
-disappear.
-
-Concretely, the expression `(int *)(x)` is a valid cast, we probably shouldn't
-also parse it as a call whose callee is a broken expr.
-
-The simplest solution is to only create recovery heads if there are no normal
-heads remaining, i.e. if parsing is completely stuck. This is vulnerable if the
-"wrong" parse makes slightly more progress than the "right" parse which has
-better error recovery.
-
-A sophisticated variant might record recovery opportunities and pick the one
-with the rightmost *endpoint* when the last parse head dies.
-
-We should consider whether including every recovery in the parse forest might
-work after all - this would let disambiguation choose "broken" but likely parses
-over "valid" but unlikely ones.
-
-
diff --git a/clang-tools-extra/pseudo/Disambiguation.md b/clang-tools-extra/pseudo/Disambiguation.md
deleted file mode 100644
index 39e246a523beb9..00000000000000
--- a/clang-tools-extra/pseudo/Disambiguation.md
+++ /dev/null
@@ -1,367 +0,0 @@
-# Disambiguation
-
-The C++ grammar is highly ambiguous, so the GLR parser produces a forest of
-parses, represented compactly by a DAG.
-A real C++ parser finds the correct parse through semantic analysis: mostly
-resolving names. But we can't do that, as we don't parse the headers.
-
-Our disambiguation phase should take the parse forest, and choose a single parse
-tree that is most likely.
-It might **optionally** use some other hints (e.g. coding style, or what
-specific names tend to mean in this codebase).
-
-There are some grammatical ambiguities that can be resolved without semantic
-analysis, e.g. whether `int <declarator>{}` is a function-definition.
-We eliminate these earlier e.g., with rule guards. By "disambiguation" we mean
-choosing between interpretations that we can't reject confidently and locally.
-
-## Types of evidence
-
-We have limited information to go on, and strive to use similar heuristics a
-human reader might.
-
-### Likely and unlikely structure
-
-In some cases, the shape of a pa...
[truncated]

Copy link
Collaborator

@erichkeane erichkeane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the release note should be mroe detailed and give some help as to the WHY here, and not just 'we removed it'.

Copy link

github-actions bot commented Sep 18, 2024

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 40c45b6b43180221acb49f387e7d3158adf49e3e 896fd2d1b7d5da4ed825fd7082f8cb7099b7fbab --extensions h,cpp -- clang-tools-extra/clangd/SemanticSelection.cpp clang-tools-extra/clangd/support/Bracket.cpp clang-tools-extra/clangd/support/Bracket.h clang-tools-extra/clangd/support/DirectiveTree.cpp clang-tools-extra/clangd/support/DirectiveTree.h clang-tools-extra/clangd/support/Lex.cpp clang-tools-extra/clangd/support/Token.cpp clang-tools-extra/clangd/support/Token.h
View the diff from clang-format here.
diff --git a/clang-tools-extra/clangd/SemanticSelection.cpp b/clang-tools-extra/clangd/SemanticSelection.cpp
index dd7116e619..5afac55fe0 100644
--- a/clang-tools-extra/clangd/SemanticSelection.cpp
+++ b/clang-tools-extra/clangd/SemanticSelection.cpp
@@ -11,6 +11,9 @@
 #include "Protocol.h"
 #include "Selection.h"
 #include "SourceCode.h"
+#include "support/Bracket.h"
+#include "support/DirectiveTree.h"
+#include "support/Token.h"
 #include "clang/AST/DeclBase.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Basic/SourceManager.h"
@@ -22,9 +25,6 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/Error.h"
-#include "support/Bracket.h"
-#include "support/DirectiveTree.h"
-#include "support/Token.h"
 #include <optional>
 #include <queue>
 #include <vector>
diff --git a/clang-tools-extra/clangd/support/DirectiveTree.cpp b/clang-tools-extra/clangd/support/DirectiveTree.cpp
index d25da11168..fe9fa34834 100644
--- a/clang-tools-extra/clangd/support/DirectiveTree.cpp
+++ b/clang-tools-extra/clangd/support/DirectiveTree.cpp
@@ -148,9 +148,9 @@ struct Dumper {
   llvm::raw_ostream &OS;
   unsigned Indent = 0;
 
-  Dumper(llvm::raw_ostream& OS) : OS(OS) {}
-  void operator()(const DirectiveTree& Tree) {
-    for (const auto& Chunk : Tree.Chunks)
+  Dumper(llvm::raw_ostream &OS) : OS(OS) {}
+  void operator()(const DirectiveTree &Tree) {
+    for (const auto &Chunk : Tree.Chunks)
       std::visit(*this, Chunk);
   }
   void operator()(const DirectiveTree::Conditional &Conditional) {
@@ -185,7 +185,7 @@ DirectiveTree DirectiveTree::parse(const TokenStream &Code) {
 // Define operator<< in terms of dump() functions above.
 #define OSTREAM_DUMP(Type)                                                     \
   llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Type &T) {        \
-    Dumper{OS}(T);                                                         \
+    Dumper{OS}(T);                                                             \
     return OS;                                                                 \
   }
 OSTREAM_DUMP(DirectiveTree)

@@ -181,16 +181,16 @@ llvm::Expected<std::vector<FoldingRange>> getFoldingRanges(ParsedAST &AST) {
// Related issue: https://github.com/clangd/clangd/issues/310
llvm::Expected<std::vector<FoldingRange>>
getFoldingRanges(const std::string &Code, bool LineFoldingOnly) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we revert 70914aa instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have strong opinions one way or the other, but I figure the current approach retains the previous functionality and so is probably a reasonable way forward.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep it in this patch to avoid changing the current behavior of clangd.

@cor3ntin
Copy link
Contributor

Thanks for doing that Aaron.
LGTM on the clang side of things (and it does what the rfc proposed) - but I'll let a clangd maintainer approve.

I was really excited by the pseudo parser as I think it would have been a very useful tool with many use cases.
However, since the RFC was made, no one has stepped up to take on maitainership (and that would be a big commitment).

So I think ripping it out is the right thing to do.

@zyn0217
Copy link
Contributor

zyn0217 commented Sep 19, 2024

For visibility, see the last attempt at removal: #80081

AFAIK, some Clangd features e.g. code folding, are still relying on it, so ditching it completely is probably not an option at the moment.

@kadircet
Copy link
Member

thanks a lot for taking care of this @AaronBallman, I think the only concern here is not regressing clangd functionality. We can figure out how we should trim down the bits that're moving into clangd later if need be. I think this LG, but cc @hokein as well.

Copy link
Collaborator

@hokein hokein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

@@ -181,16 +181,16 @@ llvm::Expected<std::vector<FoldingRange>> getFoldingRanges(ParsedAST &AST) {
// Related issue: https://github.com/clangd/clangd/issues/310
llvm::Expected<std::vector<FoldingRange>>
getFoldingRanges(const std::string &Code, bool LineFoldingOnly) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep it in this patch to avoid changing the current behavior of clangd.

@AaronBallman AaronBallman merged commit ed8f788 into llvm:main Sep 19, 2024
8 of 9 checks passed
@AaronBallman AaronBallman deleted the aballman-remove-clang-pseudo branch September 19, 2024 11:54
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 19, 2024

LLVM Buildbot has detected a new failure on builder clang-ppc64le-linux-multistage running on ppc64le-clang-multistage-test while building clang-tools-extra,clang at step 4 "build stage 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/76/builds/2973

Here is the relevant piece of the build log for the reference
Step 4 (build stage 1) failure: 'ninja' (failure)
...
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘std::vector<llvm::InstrProfValueSiteRecord>& llvm::InstrProfRecord::getOrCreateValueSitesForKind(uint32_t)’:
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/llvm/include/llvm/ProfileData/InstrProf.h:972:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
            ~~~~~~~~~~~^~~~~~~~~~~~
[2064/6115] Building VEGenInstrInfo.inc...
[2065/6115] Building X86GenAsmWriter.inc...
[2066/6115] Building X86GenRegisterInfo.inc...
[2067/6115] Building CXX object tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o
[2068/6115] Building SystemZGenInstrInfo.inc...
[2069/6115] Linking CXX shared library lib/libclangdSupport.so.20.0git
FAILED: lib/libclangdSupport.so.20.0git 
: && /usr/lib64/ccache/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/./lib  -Wl,--gc-sections -shared -Wl,-soname,libclangdSupport.so.20.0git -o lib/libclangdSupport.so.20.0git tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Bracket.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Cancellation.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Context.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/FileCache.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Lex.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Logger.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Markup.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/MemoryTree.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Path.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Shutdown.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/ThreadCrashReporter.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Threading.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/ThreadsafeFS.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Token.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Trace.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/lib:"  -lpthread  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/lib && :
tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o: In function `std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<void (*)(clang::clangd::(anonymous namespace)::Dumper&, std::variant<clang::clangd::DirectiveTree::Code, clang::clangd::DirectiveTree::Directive, clang::clangd::DirectiveTree::Conditional> const&)>, std::tuple<std::variant<clang::clangd::DirectiveTree::Code, clang::clangd::DirectiveTree::Directive, clang::clangd::DirectiveTree::Conditional> const&>, std::integer_sequence<unsigned long, 1ul> >::__visit_invoke(clang::clangd::(anonymous namespace)::Dumper&, std::variant<clang::clangd::DirectiveTree::Code, clang::clangd::DirectiveTree::Directive, clang::clangd::DirectiveTree::Conditional> const&)':
DirectiveTree.cpp:(.text._ZNSt8__detail9__variant17__gen_vtable_implINS0_12_Multi_arrayIPFvRN5clang6clangd12_GLOBAL__N_16DumperERKSt7variantIJNS4_13DirectiveTree4CodeENS9_9DirectiveENS9_11ConditionalEEEEJEEESt5tupleIJSF_EESt16integer_sequenceImJLm1EEEE14__visit_invokeES7_SF_+0x3c): undefined reference to `clang::tok::getPPKeywordSpelling(clang::tok::PPKeywordKind)'
tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o: In function `std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<void (*)(clang::clangd::(anonymous namespace)::Dumper&, std::variant<clang::clangd::DirectiveTree::Code, clang::clangd::DirectiveTree::Directive, clang::clangd::DirectiveTree::Conditional> const&)>, std::tuple<std::variant<clang::clangd::DirectiveTree::Code, clang::clangd::DirectiveTree::Directive, clang::clangd::DirectiveTree::Conditional> const&>, std::integer_sequence<unsigned long, 2ul> >::__visit_invoke(clang::clangd::(anonymous namespace)::Dumper&, std::variant<clang::clangd::DirectiveTree::Code, clang::clangd::DirectiveTree::Directive, clang::clangd::DirectiveTree::Conditional> const&)':
DirectiveTree.cpp:(.text._ZNSt8__detail9__variant17__gen_vtable_implINS0_12_Multi_arrayIPFvRN5clang6clangd12_GLOBAL__N_16DumperERKSt7variantIJNS4_13DirectiveTree4CodeENS9_9DirectiveENS9_11ConditionalEEEEJEEESt5tupleIJSF_EESt16integer_sequenceImJLm2EEEE14__visit_invokeES7_SF_+0x104): undefined reference to `clang::tok::getPPKeywordSpelling(clang::tok::PPKeywordKind)'
DirectiveTree.cpp:(.text._ZNSt8__detail9__variant17__gen_vtable_implINS0_12_Multi_arrayIPFvRN5clang6clangd12_GLOBAL__N_16DumperERKSt7variantIJNS4_13DirectiveTree4CodeENS9_9DirectiveENS9_11ConditionalEEEEJEEESt5tupleIJSF_EESt16integer_sequenceImJLm2EEEE14__visit_invokeES7_SF_+0x250): undefined reference to `clang::tok::getPPKeywordSpelling(clang::tok::PPKeywordKind)'
DirectiveTree.cpp:(.text._ZNSt8__detail9__variant17__gen_vtable_implINS0_12_Multi_arrayIPFvRN5clang6clangd12_GLOBAL__N_16DumperERKSt7variantIJNS4_13DirectiveTree4CodeENS9_9DirectiveENS9_11ConditionalEEEEJEEESt5tupleIJSF_EESt16integer_sequenceImJLm2EEEE14__visit_invokeES7_SF_+0x310): undefined reference to `clang::tok::getPPKeywordSpelling(clang::tok::PPKeywordKind)'
tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o: In function `clang::clangd::operator<<(llvm::raw_ostream&, clang::clangd::DirectiveTree::Directive const&)':
DirectiveTree.cpp:(.text._ZN5clang6clangdlsERN4llvm11raw_ostreamERKNS0_13DirectiveTree9DirectiveE+0x3c): undefined reference to `clang::tok::getPPKeywordSpelling(clang::tok::PPKeywordKind)'
tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o:DirectiveTree.cpp:(.text._ZN5clang6clangdlsERN4llvm11raw_ostreamERKNS0_13DirectiveTree11ConditionalE+0xfc): more undefined references to `clang::tok::getPPKeywordSpelling(clang::tok::PPKeywordKind)' follow
tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o: In function `clang::clangd::(anonymous namespace)::DirectiveParser::parse(clang::clangd::DirectiveTree*, bool)':
DirectiveTree.cpp:(.text._ZN5clang6clangd12_GLOBAL__N_115DirectiveParser5parseEPNS0_13DirectiveTreeEb+0x6b8): undefined reference to `clang::IdentifierInfo::getPPKeywordID() const'
tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o: In function `clang::clangd::DirectiveTree::parse(clang::clangd::TokenStream const&)':
DirectiveTree.cpp:(.text._ZN5clang6clangd13DirectiveTree5parseERKNS0_11TokenStreamE+0x78): undefined reference to `clang::IdentifierTable::IdentifierTable(clang::IdentifierInfoLookup*)'
tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Lex.cpp.o:(.toc+0x18): undefined reference to `vtable for clang::PreprocessorLexer'
tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Lex.cpp.o: In function `clang::clangd::lex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, clang::LangOptions const&)':
Lex.cpp:(.text._ZN5clang6clangd3lexERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11LangOptionsE+0x50): undefined reference to `clang::Lexer::Lexer(clang::SourceLocation, clang::LangOptions const&, char const*, char const*, char const*, bool)'
Lex.cpp:(.text._ZN5clang6clangd3lexERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11LangOptionsE+0xfc): undefined reference to `clang::Lexer::Lex(clang::Token&)'
Lex.cpp:(.text._ZN5clang6clangd3lexERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11LangOptionsE+0x194): undefined reference to `clang::tok::isAnnotation(clang::tok::TokenKind)'
Lex.cpp:(.text._ZN5clang6clangd3lexERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11LangOptionsE+0x2e8): undefined reference to `clang::Lexer::Lex(clang::Token&)'
tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Lex.cpp.o: In function `clang::clangd::cook(clang::clangd::TokenStream const&, clang::LangOptions const&)':
Lex.cpp:(.text._ZN5clang6clangd4cookERKNS0_11TokenStreamERKNS_11LangOptionsE+0xec): undefined reference to `clang::IdentifierTable::IdentifierTable(clang::LangOptions const&, clang::IdentifierInfoLookup*)'
Lex.cpp:(.text._ZN5clang6clangd4cookERKNS0_11TokenStreamERKNS_11LangOptionsE+0x580): undefined reference to `clang::Lexer::getCharAndSizeSlowNoWarn(char const*, clang::LangOptions const&)'
Lex.cpp:(.text._ZN5clang6clangd4cookERKNS0_11TokenStreamERKNS_11LangOptionsE+0xb48): undefined reference to `clang::expandUCNs(llvm::SmallVectorImpl<char>&, llvm::StringRef)'
tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Token.cpp.o: In function `clang::clangd::operator<<(llvm::raw_ostream&, clang::clangd::Token const&)':
Token.cpp:(.text._ZN5clang6clangdlsERN4llvm11raw_ostreamERKNS0_5TokenE+0x30): undefined reference to `clang::tok::getTokenName(clang::tok::TokenKind)'
tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Token.cpp.o: In function `clang::clangd::operator<<(llvm::raw_ostream&, clang::clangd::TokenStream const&)':
Token.cpp:(.text._ZN5clang6clangdlsERN4llvm11raw_ostreamERKNS0_11TokenStreamE+0x1c8): undefined reference to `clang::tok::getTokenName(clang::tok::TokenKind)'
tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Token.cpp.o: In function `clang::clangd::genericLangOpts(clang::Language, clang::LangStandard::Kind)':
Token.cpp:(.text._ZN5clang6clangd15genericLangOptsENS_8LanguageENS_12LangStandard4KindE+0x2c): undefined reference to `clang::LangOptions::LangOptions()'
Token.cpp:(.text._ZN5clang6clangd15genericLangOptsENS_8LanguageENS_12LangStandard4KindE+0x84): undefined reference to `clang::LangOptions::setLangDefaults(clang::LangOptions&, clang::Language, llvm::Triple const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, clang::LangStandard::Kind)'
collect2: error: ld returned 1 exit status
[2070/6115] Building ARMGenDAGISel.inc...
[2071/6115] Building PPCGenInstrInfo.inc...
[2072/6115] Building RISCVGenRegisterInfo.inc...
[2073/6115] Building ARMGenFastISel.inc...
[2074/6115] Building RISCVGenMCPseudoLowering.inc...
[2075/6115] Building RISCVTargetParserDef.inc...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 19, 2024

LLVM Buildbot has detected a new failure on builder clang-ppc64le-rhel running on ppc64le-clang-rhel-test while building clang-tools-extra,clang at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/145/builds/1921

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
44.658 [1518/192/4541] Building CXX object tools/clang/tools/extra/include-cleaner/lib/CMakeFiles/obj.clangIncludeCleaner.dir/Types.cpp.o
44.663 [1517/192/4542] Building CXX object tools/clang/tools/amdgpu-arch/CMakeFiles/amdgpu-arch.dir/AMDGPUArch.cpp.o
44.675 [1516/192/4543] Building CXX object tools/clang/tools/amdgpu-arch/CMakeFiles/amdgpu-arch.dir/AMDGPUArchByHIP.cpp.o
44.680 [1515/192/4544] Building CXX object tools/clang/tools/nvptx-arch/CMakeFiles/nvptx-arch.dir/NVPTXArch.cpp.o
44.694 [1514/192/4545] Building CXX object tools/lli/ChildTarget/CMakeFiles/lli-child-target.dir/ChildTarget.cpp.o
44.704 [1513/192/4546] Building CXX object tools/llvm-as/CMakeFiles/llvm-as.dir/llvm-as.cpp.o
44.711 [1512/192/4547] Building CXX object tools/llvm-cgdata/CMakeFiles/llvm-cgdata.dir/llvm-cgdata-driver.cpp.o
44.717 [1511/192/4548] Building CXX object tools/llvm-dlang-demangle-fuzzer/CMakeFiles/llvm-dlang-demangle-fuzzer.dir/DummyDemanglerFuzzer.cpp.o
44.727 [1510/192/4549] Building CXX object tools/llvm-dlang-demangle-fuzzer/CMakeFiles/llvm-dlang-demangle-fuzzer.dir/llvm-dlang-demangle-fuzzer.cpp.o
44.731 [1509/192/4550] Linking CXX shared library lib/libclangdSupport.so.20.0git
FAILED: lib/libclangdSupport.so.20.0git 
: && /home/docker/llvm-external-buildbots/clang.17.0.6/bin/clang++ --gcc-toolchain=/gcc-toolchain/usr -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -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 -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete -Wl,--color-diagnostics   -Wl,--gc-sections -shared -Wl,-soname,libclangdSupport.so.20.0git -o lib/libclangdSupport.so.20.0git tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Bracket.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Cancellation.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Context.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/FileCache.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Lex.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Logger.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Markup.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/MemoryTree.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Path.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Shutdown.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/ThreadCrashReporter.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Threading.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/ThreadsafeFS.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Token.cpp.o tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Trace.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/lib:"  -lpthread  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/lib && :
ld.lld: error: undefined symbol: clang::IdentifierTable::IdentifierTable(clang::IdentifierInfoLookup*)
>>> referenced by DirectiveTree.cpp
>>>               tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o:(clang::clangd::DirectiveTree::parse(clang::clangd::TokenStream const&))

ld.lld: error: undefined symbol: clang::tok::getPPKeywordSpelling(clang::tok::PPKeywordKind)
>>> referenced by DirectiveTree.cpp
>>>               tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o:(clang::clangd::operator<<(llvm::raw_ostream&, clang::clangd::DirectiveTree const&))
>>> referenced by DirectiveTree.cpp
>>>               tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o:(clang::clangd::operator<<(llvm::raw_ostream&, clang::clangd::DirectiveTree::Directive const&))
>>> referenced by DirectiveTree.cpp
>>>               tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o:(clang::clangd::(anonymous namespace)::Dumper::operator()(clang::clangd::DirectiveTree::Conditional const&))
>>> referenced 2 more times

ld.lld: error: undefined symbol: clang::IdentifierInfo::getPPKeywordID() const
>>> referenced by DirectiveTree.cpp
>>>               tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/DirectiveTree.cpp.o:(clang::clangd::(anonymous namespace)::DirectiveParser::parse(clang::clangd::DirectiveTree*, bool))

ld.lld: error: undefined symbol: clang::Lexer::Lexer(clang::SourceLocation, clang::LangOptions const&, char const*, char const*, char const*, bool)
>>> referenced by Lex.cpp
>>>               tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Lex.cpp.o:(clang::clangd::lex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, clang::LangOptions const&))

ld.lld: error: undefined symbol: clang::Lexer::Lex(clang::Token&)
>>> referenced by Lex.cpp
>>>               tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Lex.cpp.o:(clang::clangd::lex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, clang::LangOptions const&))
>>> referenced by Lex.cpp
>>>               tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Lex.cpp.o:(clang::clangd::lex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, clang::LangOptions const&))

ld.lld: error: undefined symbol: clang::tok::isAnnotation(clang::tok::TokenKind)
>>> referenced by Lex.cpp
>>>               tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Lex.cpp.o:(clang::clangd::lex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, clang::LangOptions const&))

ld.lld: error: undefined symbol: clang::IdentifierTable::IdentifierTable(clang::LangOptions const&, clang::IdentifierInfoLookup*)
>>> referenced by Lex.cpp
>>>               tools/clang/tools/extra/clangd/support/CMakeFiles/obj.clangdSupport.dir/Lex.cpp.o:(clang::clangd::cook(clang::clangd::TokenStream const&, clang::LangOptions const&))

ld.lld: error: undefined symbol: clang::Lexer::getCharAndSizeSlowNoWarn(char const*, clang::LangOptions const&)
>>> referenced by Lex.cpp

@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 19, 2024

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve-vla-2stage running on linaro-g3-02 while building clang-tools-extra,clang at step 11 "build stage 2".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/41/builds/2164

Here is the relevant piece of the build log for the reference
Step 11 (build stage 2) failure: 'ninja' (failure)
...
[7813/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/attr.cpp.o
[7814/8663] Linking CXX executable bin/c-arcmt-test
clang++: warning: argument unused during compilation: '-mllvm -scalable-vectorization=preferred' [-Wunused-command-line-argument]
clang++: warning: argument unused during compilation: '-mllvm -treat-scalable-fixed-error-as-warning=false' [-Wunused-command-line-argument]
[7815/8663] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/executable-parsers.cpp.o
[7816/8663] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/program-parsers.cpp.o
[7817/8663] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/openacc-parsers.cpp.o
[7818/8663] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/tools.cpp.o
[7819/8663] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/openmp-parsers.cpp.o
[7820/8663] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/OpenMP.cpp.o
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/OpenMP.cpp.o 
/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage1.install/bin/clang++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/flang/lib/Lower -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/flang/lib/Lower -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/flang/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/flang/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/llvm/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/llvm/../mlir/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/mlir/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/clang/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/llvm/../clang/include -mcpu=neoverse-512tvb -mllvm -scalable-vectorization=preferred -mllvm -treat-scalable-fixed-error-as-warning=false -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 -Wno-deprecated-copy -Wno-string-conversion -Wno-ctad-maybe-unsupported -Wno-unused-command-line-argument -Wstring-conversion           -Wcovered-switch-default -Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/OpenMP.cpp.o -MF tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/OpenMP.cpp.o.d -o tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/OpenMP.cpp.o -c /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/flang/lib/Lower/OpenMP/OpenMP.cpp
Killed
[7821/8663] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/DataSharingProcessor.cpp.o
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/DataSharingProcessor.cpp.o 
/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage1.install/bin/clang++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/flang/lib/Lower -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/flang/lib/Lower -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/flang/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/flang/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/llvm/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/llvm/../mlir/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/mlir/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/clang/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/llvm/../clang/include -mcpu=neoverse-512tvb -mllvm -scalable-vectorization=preferred -mllvm -treat-scalable-fixed-error-as-warning=false -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 -Wno-deprecated-copy -Wno-string-conversion -Wno-ctad-maybe-unsupported -Wno-unused-command-line-argument -Wstring-conversion           -Wcovered-switch-default -Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/DataSharingProcessor.cpp.o -MF tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/DataSharingProcessor.cpp.o.d -o tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/DataSharingProcessor.cpp.o -c /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
Killed
[7822/8663] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Bridge.cpp.o
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Bridge.cpp.o 
/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage1.install/bin/clang++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/flang/lib/Lower -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/flang/lib/Lower -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/flang/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/flang/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/llvm/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/llvm/../mlir/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/mlir/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/clang/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/llvm/../clang/include -mcpu=neoverse-512tvb -mllvm -scalable-vectorization=preferred -mllvm -treat-scalable-fixed-error-as-warning=false -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 -Wno-deprecated-copy -Wno-string-conversion -Wno-ctad-maybe-unsupported -Wno-unused-command-line-argument -Wstring-conversion           -Wcovered-switch-default -Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Bridge.cpp.o -MF tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Bridge.cpp.o.d -o tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Bridge.cpp.o -c /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/flang/lib/Lower/Bridge.cpp
Killed
[7823/8663] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o 
/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage1.install/bin/clang++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/flang/lib/Lower -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/flang/lib/Lower -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/flang/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/flang/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/include -I/home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/llvm/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/llvm/../mlir/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/mlir/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/stage2/tools/clang/include -isystem /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/llvm/../clang/include -mcpu=neoverse-512tvb -mllvm -scalable-vectorization=preferred -mllvm -treat-scalable-fixed-error-as-warning=false -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 -Wno-deprecated-copy -Wno-string-conversion -Wno-ctad-maybe-unsupported -Wno-unused-command-line-argument -Wstring-conversion           -Wcovered-switch-default -Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o -MF tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o.d -o tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.o -c /home/tcwg-buildbot/worker/clang-aarch64-sve-vla-2stage/llvm/flang/lib/Lower/OpenACC.cpp
Killed
[7824/8663] Building CXX object tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Runtime.cpp.o
[7825/8663] Building CXX object tools/flang/lib/Parser/CMakeFiles/FortranParser.dir/user-state.cpp.o
[7826/8663] Linking CXX executable bin/c-index-test
clang++: warning: argument unused during compilation: '-mllvm -scalable-vectorization=preferred' [-Wunused-command-line-argument]
clang++: warning: argument unused during compilation: '-mllvm -treat-scalable-fixed-error-as-warning=false' [-Wunused-command-line-argument]
[7827/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/program-tree.cpp.o
[7828/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/resolve-labels.cpp.o
[7829/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-deallocate.cpp.o
[7830/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-nullify.cpp.o
[7831/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-purity.cpp.o
[7832/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/rewrite-directives.cpp.o
[7833/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/definable.cpp.o
[7834/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-case.cpp.o
[7835/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-namelist.cpp.o
[7836/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-select-type.cpp.o
[7837/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/pointer-assignment.cpp.o
[7838/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-coarray.cpp.o
[7839/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-acc-structure.cpp.o
[7840/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-return.cpp.o
[7841/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-if-stmt.cpp.o
[7842/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/data-to-inits.cpp.o
[7843/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/compute-offsets.cpp.o
[7844/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/resolve-names.cpp.o
[7845/8663] Building CXX object tools/flang/lib/Semantics/CMakeFiles/FortranSemantics.dir/check-io.cpp.o

Zentrik added a commit to Zentrik/Yggdrasil that referenced this pull request Sep 19, 2024
Zentrik added a commit to Zentrik/Yggdrasil that referenced this pull request Sep 19, 2024
tmsri pushed a commit to tmsri/llvm-project that referenced this pull request Sep 19, 2024
The functionality is incomplete and the authors have since shifted gears
to other work, so this is effectively unmaintained.

The original design document for clang-pseudo can be found at:

https://docs.google.com/document/d/1eGkTOsFja63wsv8v0vd5JdoTonj-NlN3ujGF0T7xDbM/edit
in case anyone wishes to pick this project back up again in the future.

Original RFC: https://discourse.llvm.org/t/removing-pseudo-parser/71131/
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 21, 2024

LLVM Buildbot has detected a new failure on builder clang-s390x-linux-lnt running on systemz-1 while building clang-tools-extra,clang at step 7 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/136/builds/972

Here is the relevant piece of the build log for the reference
Step 7 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'libFuzzer-s390x-default-Linux :: fuzzer-timeout.test' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/lib/fuzzer  /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/fuzzer/TimeoutTest.cpp -o /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/lib/fuzzer /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/fuzzer/TimeoutTest.cpp -o /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest
RUN: at line 2: /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/lib/fuzzer  /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/fuzzer/TimeoutEmptyTest.cpp -o /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutEmptyTest
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/lib/fuzzer /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/fuzzer/TimeoutEmptyTest.cpp -o /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutEmptyTest
RUN: at line 3: not  /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest -timeout=1 2>&1 | FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/fuzzer/fuzzer-timeout.test --check-prefix=TimeoutTest
+ not /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest -timeout=1
+ FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/fuzzer/fuzzer-timeout.test --check-prefix=TimeoutTest
RUN: at line 12: not  /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest -timeout=1 /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/fuzzer/hi.txt 2>&1 | FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/fuzzer/fuzzer-timeout.test --check-prefix=SingleInputTimeoutTest
+ not /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest -timeout=1 /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/fuzzer/hi.txt
+ FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/fuzzer/fuzzer-timeout.test --check-prefix=SingleInputTimeoutTest
RUN: at line 16: /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest -timeout=1 -timeout_exitcode=0
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest -timeout=1 -timeout_exitcode=0
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 3598032204
INFO: Loaded 1 modules   (13 inline 8-bit counters): 13 [0x2aa37969e50, 0x2aa37969e5d), 
INFO: Loaded 1 PC tables (13 PCs): 13 [0x2aa37969e60,0x2aa37969f30), 
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: A corpus is not provided, starting from an empty corpus
#2	INITED cov: 2 ft: 2 corp: 1/1b exec/s: 0 rss: 32Mb
#3682	NEW    cov: 3 ft: 3 corp: 2/2b lim: 38 exec/s: 0 rss: 32Mb L: 1/1 MS: 5 ShuffleBytes-ChangeBit-CrossOver-EraseBytes-ChangeBit-
#3683	NEW    cov: 4 ft: 4 corp: 3/4b lim: 38 exec/s: 0 rss: 32Mb L: 2/2 MS: 1 CrossOver-
#20489	NEW    cov: 5 ft: 5 corp: 4/96b lim: 198 exec/s: 0 rss: 34Mb L: 92/92 MS: 1 InsertRepeatedBytes-
#20511	REDUCE cov: 5 ft: 5 corp: 4/73b lim: 198 exec/s: 0 rss: 34Mb L: 69/69 MS: 2 InsertRepeatedBytes-EraseBytes-
#20522	REDUCE cov: 5 ft: 5 corp: 4/67b lim: 198 exec/s: 0 rss: 34Mb L: 63/63 MS: 1 EraseBytes-
#20566	REDUCE cov: 5 ft: 5 corp: 4/52b lim: 198 exec/s: 0 rss: 34Mb L: 48/48 MS: 4 ChangeBit-ShuffleBytes-ShuffleBytes-EraseBytes-
#20577	REDUCE cov: 5 ft: 5 corp: 4/30b lim: 198 exec/s: 0 rss: 34Mb L: 26/26 MS: 1 EraseBytes-
#20588	REDUCE cov: 5 ft: 5 corp: 4/26b lim: 198 exec/s: 0 rss: 34Mb L: 22/22 MS: 1 EraseBytes-
#20720	REDUCE cov: 5 ft: 5 corp: 4/18b lim: 198 exec/s: 0 rss: 34Mb L: 14/14 MS: 2 ShuffleBytes-EraseBytes-
#21058	REDUCE cov: 5 ft: 5 corp: 4/17b lim: 198 exec/s: 0 rss: 34Mb L: 13/13 MS: 3 ChangeByte-CrossOver-EraseBytes-
#21126	REDUCE cov: 5 ft: 5 corp: 4/13b lim: 198 exec/s: 0 rss: 34Mb L: 9/9 MS: 3 ChangeBit-CMP-EraseBytes- DE: "\000\000\000\000\000\000\000\027"-
#21275	REDUCE cov: 5 ft: 5 corp: 4/10b lim: 198 exec/s: 0 rss: 34Mb L: 6/6 MS: 4 ChangeBit-CopyPart-InsertByte-EraseBytes-
#21302	REDUCE cov: 5 ft: 5 corp: 4/9b lim: 198 exec/s: 0 rss: 34Mb L: 5/5 MS: 2 CrossOver-EraseBytes-
#21324	REDUCE cov: 5 ft: 5 corp: 4/7b lim: 198 exec/s: 0 rss: 34Mb L: 3/3 MS: 2 CopyPart-EraseBytes-
#21446	REDUCE cov: 6 ft: 6 corp: 5/9b lim: 198 exec/s: 0 rss: 34Mb L: 2/3 MS: 2 ChangeBinInt-EraseBytes-
ALARM: working on the last Unit for 1 seconds
       and the timeout value is 1 (use -timeout=N to change)
MS: 1 ChangeBit-; base unit: f876e303b49daed7058104d8245ebd17e64d04f0
0x48,0x69,0x21,
Hi!
artifact_prefix='./'; Test unit written to ./timeout-c0a0ad26a634840c67a210fefdda76577b03a111
Base64: SGkh
==3850495== ERROR: libFuzzer: timeout after 1 seconds
AddressSanitizer:DEADLYSIGNAL
=================================================================
AddressSanitizer:DEADLYSIGNAL
...

DavidKorczynski added a commit to google/oss-fuzz that referenced this pull request Oct 10, 2024
`clang-pseudo-fuzzer` is available no more following llvm/llvm-project#109154
AdamKorcz pushed a commit to google/oss-fuzz that referenced this pull request Oct 10, 2024
`clang-pseudo-fuzzer` is available no more following
llvm/llvm-project#109154
weliveindetail added a commit to weliveindetail/swift that referenced this pull request Oct 17, 2024
pseudo was removed from clang-tools-extra in upstream PR llvm/llvm-project#109154
Drop two explicit references in swift and unblock Windows CI
milkice233 pushed a commit to fedora-riscv/llvm that referenced this pull request Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category clang-tools-extra clangd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants