Repository: llvm/llvm-project
Pull request #140629: [Clang] add typo correction for unknown attribute names
Author: login: a-tarasyuk
Labels: name: clang
description: Clang issues not falling into any other category
name: clang:frontend
description: Language frontend issues, e.g. anything involving "Sema"
Created: 2025-05-19T21:47:42Z | Merged: 2025-05-22T14:03:33Z

This patch enhances Clang's diagnosis for unknown attributes by providing typo correction suggestions for known attributes.

```cpp
[[gmu::deprected]] // expected-warning {{unknown attribute 'gmu::deprected' ignored; did you mean 'gnu::deprecated'?}}
int f1(void) {
  return 0;
}

[[deprected]] // expected-warning {{unknown attribute 'deprected' ignored; did you mean 'deprecated'?}}
int f2(void) {
  return 0;
}
```


Diff:
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 648b32c659b4f..b9b6abd26a080 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -561,6 +561,8 @@ Improvements to Clang's diagnostics
 - Fixed a crash when checking a ``__thread``-specified variable declaration
   with a dependent type in C++. (#GH140509)
 
+- Clang now suggests corrections for unknown attribute names.
+
 Improvements to Clang's time-trace
 ----------------------------------
 
diff --git a/clang/include/clang/Basic/AttributeCommonInfo.h b/clang/include/clang/Basic/AttributeCommonInfo.h
index 6db7b53317e7d..b4b8345b4ed40 100644
--- a/clang/include/clang/Basic/AttributeCommonInfo.h
+++ b/clang/include/clang/Basic/AttributeCommonInfo.h
@@ -21,6 +21,8 @@ namespace clang {
 
 class ASTRecordWriter;
 class IdentifierInfo;
+class LangOptions;
+class TargetInfo;
 
 class AttributeCommonInfo {
 public:
@@ -196,6 +198,9 @@ class AttributeCommonInfo {
   /// with surrounding underscores removed as appropriate (e.g.
   /// __gnu__::__attr__ will be normalized to gnu::attr).
   std::string getNormalizedFullName() const;
+  std::optional<std::string>
+  getCorrectedFullName(const TargetInfo &Target,
+                       const LangOptions &LangOpts) const;
   SourceRange getNormalizedRange() const;
 
   bool isDeclspecAttribute() const { return SyntaxUsed == AS_Declspec; }
diff --git a/clang/include/clang/Basic/Attributes.h b/clang/include/clang/Basic/Attributes.h
index 99bb668fe32d0..9cf6fb3d89019 100644
--- a/clang/include/clang/Basic/Attributes.h
+++ b/clang/include/clang/Basic/Attributes.h
@@ -19,6 +19,10 @@ class TargetInfo;
 
 /// Return the version number associated with the attribute if we
 /// recognize and implement the attribute specified by the given information.
+int hasAttribute(AttributeCommonInfo::Syntax Syntax, llvm::StringRef ScopeName,
+                 llvm::StringRef AttrName, const TargetInfo &Target,
+                 const LangOptions &LangOpts, bool CheckPlugins);
+
 int hasAttribute(AttributeCommonInfo::Syntax Syntax,
                  const IdentifierInfo *Scope, const IdentifierInfo *Attr,
                  const TargetInfo &Target, const LangOptions &LangOpts);
diff --git a/clang/include/clang/Basic/CMakeLists.txt b/clang/include/clang/Basic/CMakeLists.txt
index 477f33b880c22..1349372a8330b 100644
--- a/clang/include/clang/Basic/CMakeLists.txt
+++ b/clang/include/clang/Basic/CMakeLists.txt
@@ -79,6 +79,12 @@ clang_tablegen(CXX11AttributeInfo.inc -gen-cxx11-attribute-info
   TARGET CXX11AttributeInfo
   )
 
+  clang_tablegen(AttributeSpellingList.inc -gen-attribute-spelling-list
+  -I ${CMAKE_CURRENT_SOURCE_DIR}/../../
+  SOURCE Attr.td
+  TARGET AttributeSpellingList
+  )
+
 clang_tablegen(Builtins.inc -gen-clang-builtins
   SOURCE Builtins.td
   TARGET ClangBuiltins)
diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td
index e4d94fefbbf3d..0bd8a423c393e 100644
--- a/clang/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td
@@ -181,6 +181,8 @@ def err_opencl_unknown_type_specifier : Error<
 
 def warn_unknown_attribute_ignored : Warning<
   "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
+def warn_unknown_attribute_ignored_suggestion : Warning<
+  "unknown attribute %0 ignored; did you mean '%1'?">, InGroup<UnknownAttributes>;
 def warn_attribute_ignored : Warning<"%0 attribute ignored">,
   InGroup<IgnoredAttributes>;
 def err_keyword_not_supported_on_target : Error<
diff --git a/clang/include/clang/Basic/SimpleTypoCorrection.h b/clang/include/clang/Basic/SimpleTypoCorrection.h
new file mode 100644
index 0000000000000..49ef8bd0f3414
--- /dev/null
+++ b/clang/include/clang/Basic/SimpleTypoCorrection.h
@@ -0,0 +1,48 @@
+//===- SimpleTypoCorrection.h - Basic typo correction utility -*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the SimpleTypoCorrection class, which performs basic
+// typo correction using string similarity based on edit distance.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_BASIC_SIMPLETYPOCORRECTION_H
+#define LLVM_CLANG_BASIC_SIMPLETYPOCORRECTION_H
+
+#include "clang/Basic/LLVM.h"
+#include "llvm/ADT/StringRef.h"
+
+namespace clang {
+
+class IdentifierInfo;
+
+class SimpleTypoCorrection {
+  StringRef BestCandidate;
+  StringRef Typo;
+
+  const unsigned MaxEditDistance;
+  unsigned BestEditDistance;
+  unsigned BestIndex;
+  unsigned NextIndex;
+
+public:
+  explicit SimpleTypoCorrection(StringRef Typo)
+      : BestCandidate(), Typo(Typo), MaxEditDistance((Typo.size() + 2) / 3),
+        BestEditDistance(MaxEditDistance + 1), BestIndex(0), NextIndex(0) {}
+
+  void add(const StringRef Candidate);
+  void add(const char *Candidate);
+  void add(const IdentifierInfo *Candidate);
+
+  std::optional<StringRef> getCorrection() const;
+  bool hasCorrection() const;
+  unsigned getCorrectionIndex() const;
+};
+} // namespace clang
+
+#endif // LLVM_CLANG_BASIC_SIMPLETYPOCORRECTION_H
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index a994b845e11fc..4733ed2ee9452 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -5033,6 +5033,8 @@ class Sema final : public SemaBase {
   /// which might be lying around on it.
   void checkUnusedDeclAttributes(Declarator &D);
 
+  void DiagnoseUnknownAttribute(const ParsedAttr &AL);
+
   /// DeclClonePragmaWeak - clone existing decl (maybe definition),
   /// \#pragma weak needs a non-definition decl and source may not have one.
   NamedDecl *DeclClonePragmaWeak(NamedDecl *ND, const IdentifierInfo *II,
diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp
index bd2206bb8a3bc..fb745fc560d2f 100644
--- a/clang/lib/AST/CommentSema.cpp
+++ b/clang/lib/AST/CommentSema.cpp
@@ -13,6 +13,7 @@
 #include "clang/AST/DeclTemplate.h"
 #include "clang/Basic/DiagnosticComment.h"
 #include "clang/Basic/LLVM.h"
+#include "clang/Basic/SimpleTypoCorrection.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Lex/Preprocessor.h"
 #include "llvm/ADT/StringSwitch.h"
@@ -975,69 +976,22 @@ unsigned Sema::resolveParmVarReference(StringRef Name,
   return ParamCommandComment::InvalidParamIndex;
 }
 
-namespace {
-class SimpleTypoCorrector {
-  const NamedDecl *BestDecl;
-
-  StringRef Typo;
-  const unsigned MaxEditDistance;
-
-  unsigned BestEditDistance;
-  unsigned BestIndex;
-  unsigned NextIndex;
-
-public:
-  explicit SimpleTypoCorrector(StringRef Typo)
-      : BestDecl(nullptr), Typo(Typo), MaxEditDistance((Typo.size() + 2) / 3),
-        BestEditDistance(MaxEditDistance + 1), BestIndex(0), NextIndex(0) {}
-
-  void addDecl(const NamedDecl *ND);
-
-  const NamedDecl *getBestDecl() const {
-    if (BestEditDistance > MaxEditDistance)
-      return nullptr;
-
-    return BestDecl;
-  }
+unsigned
+Sema::correctTypoInParmVarReference(StringRef Typo,
+                                    ArrayRef<const ParmVarDecl *> ParamVars) {
+  SimpleTypoCorrection STC(Typo);
+  for (unsigned i = 0, e = ParamVars.size(); i != e; ++i) {
+    const ParmVarDecl *Param = ParamVars[i];
+    if (!Param)
+      continue;
 
-  unsigned getBestDeclIndex() const {
-    assert(getBestDecl());
-    return BestIndex;
+    STC.add(Param->getIdentifier());
   }
-};
-
-void SimpleTypoCorrector::addDecl(const NamedDecl *ND) {
-  unsigned CurrIndex = NextIndex++;
-
-  const IdentifierInfo *II = ND->getIdentifier();
-  if (!II)
-    return;
 
-  StringRef Name = II->getName();
-  unsigned MinPossibleEditDistance = abs((int)Name.size() - (int)Typo.size());
-  if (MinPossibleEditDistance > 0 &&
-      Typo.size() / MinPossibleEditDistance < 3)
-    return;
+  if (STC.hasCorrection())
+    return STC.getCorrectionIndex();
 
-  unsigned EditDistance = Typo.edit_distance(Name, true, MaxEditDistance);
-  if (EditDistance < BestEditDistance) {
-    BestEditDistance = EditDistance;
-    BestDecl = ND;
-    BestIndex = CurrIndex;
-  }
-}
-} // end anonymous namespace
-
-unsigned Sema::correctTypoInParmVarReference(
-                                    StringRef Typo,
-                                    ArrayRef<const ParmVarDecl *> ParamVars) {
-  SimpleTypoCorrector Corrector(Typo);
-  for (unsigned i = 0, e = ParamVars.size(); i != e; ++i)
-    Corrector.addDecl(ParamVars[i]);
-  if (Corrector.getBestDecl())
-    return Corrector.getBestDeclIndex();
-  else
-    return ParamCommandComment::InvalidParamIndex;
+  return ParamCommandComment::InvalidParamIndex;
 }
 
 namespace {
@@ -1079,16 +1033,18 @@ bool Sema::resolveTParamReference(
 
 namespace {
 void CorrectTypoInTParamReferenceHelper(
-                            const TemplateParameterList *TemplateParameters,
-                            SimpleTypoCorrector &Corrector) {
+    const TemplateParameterList *TemplateParameters,
+    SimpleTypoCorrection &STC) {
   for (unsigned i = 0, e = TemplateParameters->size(); i != e; ++i) {
     const NamedDecl *Param = TemplateParameters->getParam(i);
-    Corrector.addDecl(Param);
+    if (!Param)
+      continue;
+
+    STC.add(Param->getIdentifier());
 
     if (const TemplateTemplateParmDecl *TTP =
             dyn_cast<TemplateTemplateParmDecl>(Param))
-      CorrectTypoInTParamReferenceHelper(TTP->getTemplateParameters(),
-                                         Corrector);
+      CorrectTypoInTParamReferenceHelper(TTP->getTemplateParameters(), STC);
   }
 }
 } // end anonymous namespace
@@ -1096,13 +1052,12 @@ void CorrectTypoInTParamReferenceHelper(
 StringRef Sema::correctTypoInTParamReference(
                             StringRef Typo,
                             const TemplateParameterList *TemplateParameters) {
-  SimpleTypoCorrector Corrector(Typo);
-  CorrectTypoInTParamReferenceHelper(TemplateParameters, Corrector);
-  if (const NamedDecl *ND = Corrector.getBestDecl()) {
-    const IdentifierInfo *II = ND->getIdentifier();
-    assert(II && "SimpleTypoCorrector should not return this decl");
-    return II->getName();
-  }
+  SimpleTypoCorrection STC(Typo);
+  CorrectTypoInTParamReferenceHelper(TemplateParameters, STC);
+
+  if (auto CorrectedTParamReference = STC.getCorrection())
+    return *CorrectedTParamReference;
+
   return StringRef();
 }
 
diff --git a/clang/lib/Basic/Attributes.cpp b/clang/lib/Basic/Attributes.cpp
index 8ff5cc54ccc93..c2f3120aed5d0 100644
--- a/clang/lib/Basic/Attributes.cpp
+++ b/clang/lib/Basic/Attributes.cpp
@@ -15,6 +15,7 @@
 #include "clang/Basic/IdentifierTable.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/ParsedAttrInfo.h"
+#include "clang/Basic/SimpleTypoCorrection.h"
 #include "clang/Basic/TargetInfo.h"
 
 #include "llvm/ADT/StringMap.h"
@@ -22,30 +23,37 @@
 
 using namespace clang;
 
-static int hasAttributeImpl(AttributeCommonInfo::Syntax Syntax, StringRef Name,
-                            StringRef ScopeName, const TargetInfo &Target,
-                            const LangOptions &LangOpts) {
+static StringRef canonicalizeScopeName(StringRef Name) {
+  // Normalize the scope name, but only for gnu and clang attributes.
+  if (Name == "__gnu__")
+    return "gnu";
 
-#include "clang/Basic/AttrHasAttributeImpl.inc"
+  if (Name == "_Clang")
+    return "clang";
 
-  return 0;
+  return Name;
 }
 
-int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
-                        const IdentifierInfo *Scope, const IdentifierInfo *Attr,
-                        const TargetInfo &Target, const LangOptions &LangOpts,
-                        bool CheckPlugins) {
-  StringRef Name = Attr->getName();
+static StringRef canonicalizeAttrName(StringRef Name) {
   // Normalize the attribute name, __foo__ becomes foo.
   if (Name.size() >= 4 && Name.starts_with("__") && Name.ends_with("__"))
-    Name = Name.substr(2, Name.size() - 4);
+    return Name.substr(2, Name.size() - 4);
 
-  // Normalize the scope name, but only for gnu and clang attributes.
-  StringRef ScopeName = Scope ? Scope->getName() : "";
-  if (ScopeName == "__gnu__")
-    ScopeName = "gnu";
-  else if (ScopeName == "_Clang")
-    ScopeName = "clang";
+  return Name;
+}
+
+static int hasAttributeImpl(AttributeCommonInfo::Syntax Syntax, StringRef Name,
+                            StringRef ScopeName, const TargetInfo &Target,
+                            const LangOptions &LangOpts) {
+#include "clang/Basic/AttrHasAttributeImpl.inc"
+  return 0;
+}
+
+int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax, StringRef ScopeName,
+                        StringRef Name, const TargetInfo &Target,
+                        const LangOptions &LangOpts, bool CheckPlugins) {
+  ScopeName = canonicalizeScopeName(ScopeName);
+  Name = canonicalizeAttrName(Name);
 
   // As a special case, look for the omp::sequence and omp::directive
   // attributes. We support those, but not through the typical attribute
@@ -72,6 +80,14 @@ int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
   return 0;
 }
 
+int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
+                        const IdentifierInfo *Scope, const IdentifierInfo *Attr,
+                        const TargetInfo &Target, const LangOptions &LangOpts,
+                        bool CheckPlugins) {
+  return hasAttribute(Syntax, Scope ? Scope->getName() : "", Attr->getName(),
+                      Target, LangOpts, CheckPlugins);
+}
+
 int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
                         const IdentifierInfo *Scope, const IdentifierInfo *Attr,
                         const TargetInfo &Target, const LangOptions &LangOpts) {
@@ -90,25 +106,25 @@ const char *attr::getSubjectMatchRuleSpelling(attr::SubjectMatchRule Rule) {
 }
 
 static StringRef
-normalizeAttrScopeName(const IdentifierInfo *Scope,
+normalizeAttrScopeName(StringRef ScopeName,
                        AttributeCommonInfo::Syntax SyntaxUsed) {
-  if (!Scope)
-    return "";
-
-  // Normalize the "__gnu__" scope name to be "gnu" and the "_Clang" scope name
-  // to be "clang".
-  StringRef ScopeName = Scope->getName();
   if (SyntaxUsed == AttributeCommonInfo::AS_CXX11 ||
-      SyntaxUsed == AttributeCommonInfo::AS_C23) {
-    if (ScopeName == "__gnu__")
-      ScopeName = "gnu";
-    else if (ScopeName == "_Clang")
-      ScopeName = "clang";
-  }
+      SyntaxUsed == AttributeCommonInfo::AS_C23)
+    return canonicalizeScopeName(ScopeName);
+
   return ScopeName;
 }
 
-static StringRef normalizeAttrName(const IdentifierInfo *Name,
+static StringRef
+normalizeAttrScopeName(const IdentifierInfo *ScopeName,
+                       AttributeCommonInfo::Syntax SyntaxUsed) {
+  if (ScopeName)
+    return normalizeAttrScopeName(ScopeName->getName(), SyntaxUsed);
+
+  return "";
+}
+
+static StringRef normalizeAttrName(StringRef AttrName,
                                    StringRef NormalizedScopeName,
                                    AttributeCommonInfo::Syntax SyntaxUsed) {
   // Normalize the attribute name, __foo__ becomes foo. This is only allowable
@@ -119,10 +135,9 @@ static StringRef normalizeAttrName(const IdentifierInfo *Name,
         SyntaxUsed == AttributeCommonInfo::AS_C23) &&
        (NormalizedScopeName.empty() || NormalizedScopeName == "gnu" ||
         NormalizedScopeName == "clang"));
-  StringRef AttrName = Name->getName();
-  if (ShouldNormalize && AttrName.size() >= 4 && AttrName.starts_with("__") &&
-      AttrName.ends_with("__"))
-    AttrName = AttrName.slice(2, AttrName.size() - 2);
+
+  if (ShouldNormalize)
+    return canonicalizeAttrName(AttrName);
 
   return AttrName;
 }
@@ -137,16 +152,11 @@ bool AttributeCommonInfo::isClangScope() const {
 
 #include "clang/Sema/AttrParsedAttrKinds.inc"
 
-static SmallString<64> normalizeName(const IdentifierInfo *Name,
-                                     const IdentifierInfo *Scope,
+static SmallString<64> normalizeName(StringRef AttrName, StringRef ScopeName,
                                      AttributeCommonInfo::Syntax SyntaxUsed) {
-  StringRef ScopeName = normalizeAttrScopeName(Scope, SyntaxUsed);
-  StringRef AttrName = normalizeAttrName(Name, ScopeName, SyntaxUsed);
-
-  std::string StrAttrName = AttrName.str();
-  if (SyntaxUsed == AttributeCommonInfo::AS_HLSLAnnotation)
-    StrAttrName = AttrName.lower();
-
+  std::string StrAttrName = SyntaxUsed == AttributeCommonInfo::AS_HLSLAnnotation
+                                ? AttrName.lower()
+                                : AttrName.str();
   SmallString<64> FullName = ScopeName;
   if (!ScopeName.empty()) {
     assert(SyntaxUsed == AttributeCommonInfo::AS_CXX11 ||
@@ -154,10 +164,18 @@ static SmallString<64> normalizeName(const IdentifierInfo *Name,
     FullName += "::";
   }
   FullName += StrAttrName;
-
   return FullName;
 }
 
+static SmallString<64> normalizeName(const IdentifierInfo *Name,
+                                     const IdentifierInfo *Scope,
+                                     AttributeCommonInfo::Syntax SyntaxUsed) {
+  StringRef ScopeName = normalizeAttrScopeName(Scope, SyntaxUsed);
+  StringRef AttrName =
+      normalizeAttrName(Name->getName(), ScopeName, SyntaxUsed);
+  return normalizeName(AttrName, ScopeName, SyntaxUsed);
+}
+
 AttributeCommonInfo::Kind
 AttributeCommonInfo::getParsedKind(const IdentifierInfo *Name,
                                    const IdentifierInfo *ScopeName,
@@ -167,8 +185,8 @@ AttributeCommonInfo::getParsedKind(const IdentifierInfo *Name,
 
 AttributeCommonInfo::AttrArgsInfo
 AttributeCommonInfo::getCXX11AttrArgsInfo(const IdentifierInfo *Name) {
-  StringRef AttrName =
-      normalizeAttrName(Name, /*NormalizedScopeName*/ "", Syntax::AS_CXX11);
+  StringRef AttrName = normalizeAttrName(
+      Name->getName(), /*NormalizedScopeName*/ "", Syntax::AS_CXX11);
 #define CXX11_ATTR_ARGS_INFO
   return llvm::StringSwitch<AttributeCommonInfo::AttrArgsInfo>(AttrName)
 #include "clang/Basic/CXX11AttributeInfo.inc"
@@ -203,10 +221,57 @@ unsigned AttributeCommonInfo::calculateAttributeSpellingListIndex() const {
   // attribute spell list index matching code.
   auto Syntax = static_cast<AttributeCommonInfo::Syntax>(getSyntax());
   StringRef ScopeName = normalizeAttrScopeName(getScopeName(), Syntax);
-  StringRef Name = normalizeAttrName(getAttrName(), ScopeName, Syntax);
-
+  StringRef Name =
+      normalizeAttrName(getAttrName()->getName(), ScopeName, Syntax);
   AttributeCommonInfo::Scope ComputedScope =
       getScopeFromNormalizedScopeName(ScopeName);
 
 #include "clang/Sema/AttrSpellingListIndex.inc"
 }
+
+#define ATTR_NAME(NAME) NAME,
+static constexpr const char *AttrSpellingList[] = {
+#include "clang/Basic/AttributeSpellingList.inc"
+};
+#undef ATTR_NAME
+
+#define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME,
+static constexpr const char *AttrScopeSpellingList[] = {
+#include "clang/Basic/AttributeSpellingList.inc"
+};
+#undef ATTR_SCOPE_SCOPE
+
+std::optional<std::string>
+AttributeCommonInfo::getCorrectedFullName(const TargetInfo &Target,
+                                          const LangOptions &LangOpts) const {
+  StringRef ScopeName = normalizeAttrScopeName(getScopeName(), getSyntax());
+  if (ScopeName.size() > 0 &&
+      llvm::none_of(AttrScopeSpellingList,
+                    [&](const char *S) { return S == ScopeName; })) {
+    SimpleTypoCorrection STC(ScopeName);
+    for (const auto &Scope : AttrScopeSpellingList)
+      STC.add(Scope);
+
+    if (auto CorrectedScopeName = STC.getCorrection())
+      ScopeName = *CorrectedScopeName;
+  }
+
+  StringRef AttrName =
+      normalizeAttrName(getAttrName()->getName(), ScopeName, getSyntax());
+  if (llvm::none_of(AttrSpellingList,
+                    [&](const char *A) { return A == AttrName; })) {
+    SimpleTypoCorrection STC(AttrName);
+    for (const auto &Attr : AttrSpellingList)
+      STC.add(Attr);
+
+    if (auto CorrectedAttrName = STC.getCorrection())
+      AttrName = *CorrectedAttrName;
+  }
+
+  if (hasAttribute(getSyntax(), ScopeName, AttrName, Target, LangOpts,
+                   /*CheckPlugins=*/true))
+    return static_cast<std::string>(
+        normalizeName(AttrName, ScopeName, getSyntax()));
+
+  return std::nullopt;
+}
diff --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt
index 0eacf79f5d478..f8a31c890ac4d 100644
--- a/clang/lib/Basic/CMakeLists.txt
+++ b/clang/lib/Basic/CMakeLists.txt
@@ -86,6 +86,7 @@ add_clang_library(clangBasic
   SanitizerSpecialCaseList.cpp
   Sanitizers.cpp
   Sarif.cpp
+  SimpleTypoCorrection.cpp
   SourceLocation.cpp
   SourceManager.cpp
   SourceMgrAdapter.cpp
diff --git a/clang/lib/Basic/SimpleTypoCorrection.cpp b/clang/lib/Basic/SimpleTypoCorrection.cpp
new file mode 100644
index 0000000000000..e41abf8609344
--- /dev/null
+++ b/clang/lib/Basic/SimpleTypoCorrection.cpp
@@ -0,0 +1,63 @@
+//===- SimpleTypoCorrection.cpp - Basic typo correction utility -----------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the SimpleTypoCorrection class, which performs basic
+// typo correction using string similarity based on edit distance.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Basic/SimpleTypoCorrection.h"
+#include "clang/Basic/IdentifierTable.h"
+#include "clang/Basic/LLVM.h"
+#include "llvm/ADT/StringRef.h"
+
+using namespace clang;
+
+void SimpleTypoCorrection::add(const StringRef Candidate) {
+  if (Candidate.empty())
+    return;
+
+  unsigned MinPossibleEditDistance =
+      abs(static_cast<int>(Candidate.size()) - static_cast<int>(Typo.size()));
+
+  if (MinPossibleEditDistance > 0 && Typo.size() / MinPossibleEditDistance < 3)
+    return;
+
+  unsigned EditDistance = Typo.edit_distance(
+      Candidate, /*AllowReplacements*/ true, MaxEditDistance);
+
+  if (EditDistance < BestEditDistance) {
+    BestCandidate = Candidate;
+    BestEditDistance = EditDistance;
+    BestIndex = NextIndex;
+  }
+
+  ++NextIndex;
+}
+
+void SimpleTypoCorrection::add(const char *Candidate) {
+  if (Candidate)
+    add(StringRef(Candidate));
+}
+
+void SimpleTypoCorrection::add(const IdentifierInfo *Candidate) {
+  if (Candidate)
+    add(Candidate->getName());
+}
+
+unsigned SimpleTypoCorrection::getCorrectionIndex() const { return BestIndex; }
+
+std::optional<StringRef> SimpleTypoCorrection::getCorrection() const {
+  if (hasCorrection())
+    return BestCandidate;
+  return std::nullopt;
+}
+
+bool SimpleTypoCorrection::hasCorrection() const {
+  return BestEditDistance <= MaxEditDistance;
+}
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index ac77a7c2c58a5..8ce51cc2882bf 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -6869,9 +6869,7 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL,
                               : diag::warn_unhandled_ms_attribute_ignored)
           << AL.getAttrName() << AL.getRange();
     } else {
-      S.Diag(AL.getNormalizedRange().getBegin(),
-             diag::warn_unknown_attribute_ignored)
-          << "'" + AL.getNormalizedFullName() + "'" << AL.getNormalizedRange();
+      S.DiagnoseUnknownAttribute(AL);
     }
     return;
   }
@@ -7867,6 +7865,20 @@ void Sema::checkUnusedDeclAttributes(Declarator &D) {
     ::checkUnusedDeclAttributes(*this, D.getTypeObject(i).getAttrs());
 }
 
+void Sema::DiagnoseUnknownAttribute(const ParsedAttr &AL) {
+  std::string NormalizedFullName = '\'' + AL.getNormalizedFullName() + '\'';
+  if (auto CorrectedFullName =
+          AL.getCorrectedFullName(Context.getTargetInfo(), getLangOpts())) {
+    Diag(AL.getNormalizedRange().getBegin(),
+         diag::warn_unknown_attribute_ignored_suggestion)
+        << NormalizedFullName << *CorrectedFullName << AL.getNormalizedRange();
+  } else {
+    Diag(AL.getNormalizedRange().getBegin(),
+         diag::warn_unknown_attribute_ignored)
+        << NormalizedFullName << AL.getNormalizedRange();
+  }
+}
+
 NamedDecl *Sema::DeclClonePragmaWeak(NamedDecl *ND, const IdentifierInfo *II,
                                      SourceLocation Loc) {
   assert(isa<FunctionDecl>(ND) || isa<VarDecl>(ND));
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 28d441234262b..5f28df946b5e8 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -8788,9 +8788,7 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type,
 
     case ParsedAttr::UnknownAttribute:
       if (attr.isStandardAttributeSyntax()) {
-        state.getSema().Diag(attr.getLoc(),
-                             diag::warn_unknown_attribute_ignored)
-            << attr << attr.getRange();
+        state.getSema().DiagnoseUnknownAttribute(attr);
         // Mark the attribute as invalid so we don't emit the same diagnostic
         // multiple times.
         attr.setInvalid();
diff --git a/clang/test/Parser/cxx0x-attributes.cpp b/clang/test/Parser/cxx0x-attributes.cpp
index 6e0904e94fecc..372a373a49ec5 100644
--- a/clang/test/Parser/cxx0x-attributes.cpp
+++ b/clang/test/Parser/cxx0x-attributes.cpp
@@ -344,7 +344,7 @@ enum class [[]] EvenMoreSecrets {};
 
 namespace arguments {
   void f[[gnu::format(printf, 1, 2)]](const char*, ...);
-  void g() [[unknown::foo(ignore arguments for unknown attributes, even with symbols!)]]; // expected-warning {{unknown attribute 'foo' ignored}}
+  void g() [[unknown::foo(ignore arguments for unknown attributes, even with symbols!)]]; // expected-warning {{unknown attribute 'unknown::foo' ignored}}
   [[deprecated("with argument")]] int i;
   // expected-warning@-1 {{use of the 'deprecated' attribute is a C++14 extension}}
 }
diff --git a/clang/test/Sema/attr-c2x.c b/clang/test/Sema/attr-c2x.c
index c774cc68eb890..eff90d639c0c0 100644
--- a/clang/test/Sema/attr-c2x.c
+++ b/clang/test/Sema/attr-c2x.c
@@ -39,5 +39,5 @@ void bar(void) {
 [[__gnu__::__hot__]] void hot_func4(void);
 
 // Note how not all GCC attributes are supported in C.
-[[gnu::abi_tag("")]] void abi_func(void); // expected-warning {{unknown attribute 'abi_tag' ignored}}
-struct S s [[gnu::init_priority(1)]]; // expected-warning {{unknown attribute 'init_priority' ignored}}
+[[gnu::abi_tag("")]] void abi_func(void); // expected-warning {{unknown attribute 'gnu::abi_tag' ignored}}
+struct S s [[gnu::init_priority(1)]]; // expected-warning {{unknown attribute 'gnu::init_priority' ignored}}
diff --git a/clang/test/Sema/unknown-attributes.c b/clang/test/Sema/unknown-attributes.c
index 1f6708fc7219f..a701650c9e056 100644
--- a/clang/test/Sema/unknown-attributes.c
+++ b/clang/test/Sema/unknown-attributes.c
@@ -1,12 +1,22 @@
 // RUN: %clang_cc1 -Wunknown-attributes -fsyntax-only -verify %s
-// RUN: %clang_cc1 -x c++ -fsyntax-only -Wunknown-attributes -verify %s
+// RUN: %clang_cc1 -x c++ -Wunknown-attributes -fsyntax-only -verify %s
 
-[[foo::a]] // expected-warning {{unknown attribute 'foo::a' ignored}}
+[[gmu::deprected]] // expected-warning {{unknown attribute 'gmu::deprected' ignored; did you mean 'gnu::deprecated'?}}
 int f1(void) {
   return 0;
 }
 
-[[clan::deprecated]] // expected-warning {{unknown attribute 'clan::deprecated' ignored}}
+[[gmu::deprecated]] // expected-warning {{unknown attribute 'gmu::deprecated' ignored; did you mean 'gnu::deprecated'?}}
 int f2(void) {
   return 0;
 }
+
+[[gnu::deprected]] // expected-warning {{unknown attribute 'gnu::deprected' ignored; did you mean 'gnu::deprecated'?}}
+int f3(void) {
+  return 0;
+}
+
+[[deprected]] // expected-warning {{unknown attribute 'deprected' ignored; did you mean 'deprecated'?}}
+int f4(void) {
+  return 0;
+}
diff --git a/clang/test/SemaCXX/cxx11-gnu-attrs.cpp b/clang/test/SemaCXX/cxx11-gnu-attrs.cpp
index a91cb278b4d24..b8d914a6791a9 100644
--- a/clang/test/SemaCXX/cxx11-gnu-attrs.cpp
+++ b/clang/test/SemaCXX/cxx11-gnu-attrs.cpp
@@ -3,7 +3,7 @@
 // Error cases.
 
 [[gnu::this_attribute_does_not_exist]] int unknown_attr;
-// expected-warning@-1 {{unknown attribute 'this_attribute_does_not_exist' ignored}}
+// expected-warning@-1 {{unknown attribute 'gnu::this_attribute_does_not_exist' ignored}}
 int [[gnu::unused]] attr_on_type;
 // expected-error@-1 {{'unused' attribute cannot be applied to types}}
 int *[[gnu::unused]] attr_on_ptr;
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 45fb0d4735c86..f6c5c84602762 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -4125,6 +4125,37 @@ void EmitClangAttrParsedAttrList(const RecordKeeper &Records, raw_ostream &OS) {
   }
 }
 
+void EmitAttributeSpellingList(const RecordKeeper &Records, raw_ostream &OS) {
+  emitSourceFileHeader("List of attribute names", OS, Records);
+
+  std::set<StringRef> AttrSpellingList;
+  std::set<StringRef> AttrScopeSpellingList;
+
+  for (const auto *A : Records.getAllDerivedDefinitions("Attr")) {
+    for (const auto &S : GetFlattenedSpellings(*A)) {
+      AttrSpellingList.insert(S.name());
+      if (S.nameSpace().size())
+        AttrScopeSpellingList.insert(S.nameSpace());
+    }
+  }
+
+  OS << "#ifndef ATTR_NAME" << "\n";
+  OS << "#define ATTR_NAME(NAME) NAME" << "\n";
+  OS << "#endif" << "\n" << "\n";
+  for (const auto &AttrName : AttrSpellingList) {
+    OS << "ATTR_NAME(\"" << AttrName << "\")\n";
+  }
+  OS << "\n";
+
+  OS << "#ifndef ATTR_SCOPE_SCOPE" << "\n";
+  OS << "#define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME" << "\n";
+  OS << "#endif" << "\n" << "\n";
+  for (const auto &AttrScopeName : AttrScopeSpellingList) {
+    OS << "ATTR_SCOPE_SCOPE(\"" << AttrScopeName << "\")\n";
+  }
+  OS << "\n";
+}
+
 static bool isArgVariadic(const Record &R, StringRef AttrName) {
   return createArgument(R, AttrName)->isVariadic();
 }
diff --git a/clang/utils/TableGen/TableGen.cpp b/clang/utils/TableGen/TableGen.cpp
index 8539bdfbb1245..98c4a07a99c42 100644
--- a/clang/utils/TableGen/TableGen.cpp
+++ b/clang/utils/TableGen/TableGen.cpp
@@ -73,6 +73,7 @@ enum ActionType {
   GenClangOpenCLBuiltinHeader,
   GenClangOpenCLBuiltinTests,
   GenCXX11AttributeInfo,
+  GenAttributeSpellingList,
   GenArmNeon,
   GenArmFP16,
   GenArmBF16,
@@ -243,6 +244,8 @@ cl::opt<ActionType> Action(
                    "Generate OpenCL builtin declaration tests"),
         clEnumValN(GenCXX11AttributeInfo, "gen-cxx11-attribute-info",
                    "Generate CXX11 attributes info"),
+        clEnumValN(GenAttributeSpellingList, "gen-attribute-spelling-list",
+                   "Generate attribute spelling list"),
         clEnumValN(GenArmNeon, "gen-arm-neon", "Generate arm_neon.h for clang"),
         clEnumValN(GenArmFP16, "gen-arm-fp16", "Generate arm_fp16.h for clang"),
         clEnumValN(GenArmBF16, "gen-arm-bf16", "Generate arm_bf16.h for clang"),
@@ -363,6 +366,9 @@ bool ClangTableGenMain(raw_ostream &OS, const RecordKeeper &Records) {
   case GenCXX11AttributeInfo:
     EmitCXX11AttributeInfo(Records, OS);
     break;
+  case GenAttributeSpellingList:
+    EmitAttributeSpellingList(Records, OS);
+    break;
   case GenClangAttrImpl:
     EmitClangAttrImpl(Records, OS);
     break;
diff --git a/clang/utils/TableGen/TableGenBackends.h b/clang/utils/TableGen/TableGenBackends.h
index 54031147d38e1..79b1f66d0e49e 100644
--- a/clang/utils/TableGen/TableGenBackends.h
+++ b/clang/utils/TableGen/TableGenBackends.h
@@ -51,6 +51,8 @@ void EmitClangAttrSubjectMatchRulesParserStringSwitches(
     const llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
 void EmitCXX11AttributeInfo(const llvm::RecordKeeper &Records,
                             llvm::raw_ostream &OS);
+void EmitAttributeSpellingList(const llvm::RecordKeeper &Records,
+                               llvm::raw_ostream &OS);
 void EmitClangAttrClass(const llvm::RecordKeeper &Records,
                         llvm::raw_ostream &OS);
 void EmitClangAttrImpl(const llvm::RecordKeeper &Records,


Reviews:
user: login: AaronBallman
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-20T17:04:10Z
user: login: a-tarasyuk
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-20T18:06:55Z
user: login: AaronBallman
body: LGTM but please wait a day before landing in case @erichkeane has comments.
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-21T12:17:32Z
user: login: erichkeane
body: 1 nit, else lgtm.
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-21T12:29:17Z
user: login: erichkeane
body: Thought I'd already +1ed!  with teh copyright headers, this LGTM.
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-21T13:21:26Z
user: login: a-tarasyuk
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-21T14:40:36Z

Review comments:
diff_hunk: @@ -203,10 +221,47 @@ unsigned AttributeCommonInfo::calculateAttributeSpellingListIndex() const {
   // attribute spell list index matching code.
   auto Syntax = static_cast<AttributeCommonInfo::Syntax>(getSyntax());
   StringRef ScopeName = normalizeAttrScopeName(getScopeName(), Syntax);
-  StringRef Name = normalizeAttrName(getAttrName(), ScopeName, Syntax);
-
+  StringRef Name =
+      normalizeAttrName(getAttrName()->getName(), ScopeName, Syntax);
   AttributeCommonInfo::Scope ComputedScope =
       getScopeFromNormalizedScopeName(ScopeName);
 
 #include "clang/Sema/AttrSpellingListIndex.inc"
 }
+
+#include "clang/Basic/AttributeSpellingList.inc"
path: clang/lib/Basic/Attributes.cpp
user: login: AaronBallman
body: It's hard to understand what's going on here because the tablegen hides the fact that this is introducing new declarations. I think a more general approach would be:
```
#define NAME(X) X
static constexpr const char *AttrSpellingList[] = {
#include "clang/Basic/AttributeSpellingList.inc"
};
#undef NAME

#define SCOPE(X) X
static constexpr const char *AttrScopeSpellingList[] = {
#include "clang/Basic/AttributeSpellingList.inc"
};
#undef SCOPE
```
WDYT?
created_at: 2025-05-20T17:03:36Z
author_association: COLLABORATOR
diff_hunk: @@ -203,10 +221,47 @@ unsigned AttributeCommonInfo::calculateAttributeSpellingListIndex() const {
   // attribute spell list index matching code.
   auto Syntax = static_cast<AttributeCommonInfo::Syntax>(getSyntax());
   StringRef ScopeName = normalizeAttrScopeName(getScopeName(), Syntax);
-  StringRef Name = normalizeAttrName(getAttrName(), ScopeName, Syntax);
-
+  StringRef Name =
+      normalizeAttrName(getAttrName()->getName(), ScopeName, Syntax);
   AttributeCommonInfo::Scope ComputedScope =
       getScopeFromNormalizedScopeName(ScopeName);
 
 #include "clang/Sema/AttrSpellingListIndex.inc"
 }
+
+#include "clang/Basic/AttributeSpellingList.inc"
path: clang/lib/Basic/Attributes.cpp
user: login: a-tarasyuk
body: Thanks for the feedback. I've changed to use _general approach_
created_at: 2025-05-20T18:06:55Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,35 @@
+#ifndef LLVM_CLANG_BASIC_SIMPLETYPOCORRECTION_H
path: clang/include/clang/Basic/SimpleTypoCorrection.h
user: login: erichkeane
body: Pretty sure this still needs the copyright header, even though it can be a simplified one these days.
created_at: 2025-05-21T12:25:45Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,35 @@
+#ifndef LLVM_CLANG_BASIC_SIMPLETYPOCORRECTION_H
path: clang/include/clang/Basic/SimpleTypoCorrection.h
user: login: a-tarasyuk
body: @erichkeane thanks for the review. I’ve added copyright headers 
created_at: 2025-05-21T14:40:36Z
author_association: MEMBER

PR comments:
user: login: llvmbot
created_at: 2025-05-19T21:48:21Z
body: 
<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Oleksandr T. (a-tarasyuk)

<details>
<summary>Changes</summary>

This patch enhances Clang's diagnosis for unknown attributes by providing typo correction suggestions for known attributes.

```cpp
[[gmu::deprected]] // expected-warning {{unknown attribute 'gmu::deprected' ignored; did you mean 'gnu::deprecated'?}}
int f1(void) {
  return 0;
}

[[deprected]] // expected-warning {{unknown attribute 'deprected' ignored; did you mean 'deprecated'?}}
int f2(void) {
  return 0;
}
```

---

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


20 Files Affected:

- (modified) clang/docs/ReleaseNotes.rst (+2) 
- (modified) clang/include/clang/Basic/AttributeCommonInfo.h (+5) 
- (modified) clang/include/clang/Basic/Attributes.h (+4) 
- (modified) clang/include/clang/Basic/CMakeLists.txt (+6) 
- (modified) clang/include/clang/Basic/DiagnosticCommonKinds.td (+2) 
- (added) clang/include/clang/Basic/SimpleTypoCorrection.h (+35) 
- (modified) clang/include/clang/Sema/Sema.h (+2) 
- (modified) clang/lib/AST/CommentSema.cpp (+26-71) 
- (modified) clang/lib/Basic/Attributes.cpp (+104-49) 
- (modified) clang/lib/Basic/CMakeLists.txt (+1) 
- (added) clang/lib/Basic/SimpleTypoCorrection.cpp (+52) 
- (modified) clang/lib/Sema/SemaDeclAttr.cpp (+15-3) 
- (modified) clang/lib/Sema/SemaType.cpp (+1-3) 
- (modified) clang/test/Parser/cxx0x-attributes.cpp (+1-1) 
- (modified) clang/test/Sema/attr-c2x.c (+2-2) 
- (modified) clang/test/Sema/unknown-attributes.c (+13-3) 
- (modified) clang/test/SemaCXX/cxx11-gnu-attrs.cpp (+1-1) 
- (modified) clang/utils/TableGen/ClangAttrEmitter.cpp (+27) 
- (modified) clang/utils/TableGen/TableGen.cpp (+6) 
- (modified) clang/utils/TableGen/TableGenBackends.h (+2) 


``````````diff
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index ac9baf229b489..deee00128c1fa 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -561,6 +561,8 @@ Improvements to Clang's diagnostics
 - Fixed a crash when checking a ``__thread``-specified variable declaration
   with a dependent type in C++. (#GH140509)
 
+- Clang now suggests corrections for unknown attribute names.
+
 Improvements to Clang's time-trace
 ----------------------------------
 
diff --git a/clang/include/clang/Basic/AttributeCommonInfo.h b/clang/include/clang/Basic/AttributeCommonInfo.h
index 6db7b53317e7d..b4b8345b4ed40 100644
--- a/clang/include/clang/Basic/AttributeCommonInfo.h
+++ b/clang/include/clang/Basic/AttributeCommonInfo.h
@@ -21,6 +21,8 @@ namespace clang {
 
 class ASTRecordWriter;
 class IdentifierInfo;
+class LangOptions;
+class TargetInfo;
 
 class AttributeCommonInfo {
 public:
@@ -196,6 +198,9 @@ class AttributeCommonInfo {
   /// with surrounding underscores removed as appropriate (e.g.
   /// __gnu__::__attr__ will be normalized to gnu::attr).
   std::string getNormalizedFullName() const;
+  std::optional<std::string>
+  getCorrectedFullName(const TargetInfo &Target,
+                       const LangOptions &LangOpts) const;
   SourceRange getNormalizedRange() const;
 
   bool isDeclspecAttribute() const { return SyntaxUsed == AS_Declspec; }
diff --git a/clang/include/clang/Basic/Attributes.h b/clang/include/clang/Basic/Attributes.h
index 99bb668fe32d0..9cf6fb3d89019 100644
--- a/clang/include/clang/Basic/Attributes.h
+++ b/clang/include/clang/Basic/Attributes.h
@@ -19,6 +19,10 @@ class TargetInfo;
 
 /// Return the version number associated with the attribute if we
 /// recognize and implement the attribute specified by the given information.
+int hasAttribute(AttributeCommonInfo::Syntax Syntax, llvm::StringRef ScopeName,
+                 llvm::StringRef AttrName, const TargetInfo &Target,
+                 const LangOptions &LangOpts, bool CheckPlugins);
+
 int hasAttribute(AttributeCommonInfo::Syntax Syntax,
                  const IdentifierInfo *Scope, const IdentifierInfo *Attr,
                  const TargetInfo &Target, const LangOptions &LangOpts);
diff --git a/clang/include/clang/Basic/CMakeLists.txt b/clang/include/clang/Basic/CMakeLists.txt
index 265ea1fc06494..1873878e2e46b 100644
--- a/clang/include/clang/Basic/CMakeLists.txt
+++ b/clang/include/clang/Basic/CMakeLists.txt
@@ -79,6 +79,12 @@ clang_tablegen(CXX11AttributeInfo.inc -gen-cxx11-attribute-info
   TARGET CXX11AttributeInfo
   )
 
+  clang_tablegen(AttributeSpellingList.inc -gen-attribute-spelling-list
+  -I ${CMAKE_CURRENT_SOURCE_DIR}/../../
+  SOURCE Attr.td
+  TARGET AttributeSpellingList
+  )
+
 clang_tablegen(Builtins.inc -gen-clang-builtins
   SOURCE Builtins.td
   TARGET ClangBuiltins)
diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td
index e4d94fefbbf3d..0bd8a423c393e 100644
--- a/clang/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td
@@ -181,6 +181,8 @@ def err_opencl_unknown_type_specifier : Error<
 
 def warn_unknown_attribute_ignored : Warning<
   "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
+def warn_unknown_attribute_ignored_suggestion : Warning<
+  "unknown attribute %0 ignored; did you mean '%1'?">, InGroup<UnknownAttributes>;
 def warn_attribute_ignored : Warning<"%0 attribute ignored">,
   InGroup<IgnoredAttributes>;
 def err_keyword_not_supported_on_target : Error<
diff --git a/clang/include/clang/Basic/SimpleTypoCorrection.h b/clang/include/clang/Basic/SimpleTypoCorrection.h
new file mode 100644
index 0000000000000..4cd104f79aebe
--- /dev/null
+++ b/clang/include/clang/Basic/SimpleTypoCorrection.h
@@ -0,0 +1,35 @@
+#ifndef LLVM_CLANG_BASIC_SIMPLETYPOCORRECTION_H
+#define LLVM_CLANG_BASIC_SIMPLETYPOCORRECTION_H
+
+#include "clang/Basic/LLVM.h"
+#include "llvm/ADT/StringRef.h"
+
+namespace clang {
+
+class IdentifierInfo;
+
+class SimpleTypoCorrection {
+  StringRef BestCandidate;
+  StringRef Typo;
+
+  const unsigned MaxEditDistance;
+  unsigned BestEditDistance;
+  unsigned BestIndex;
+  unsigned NextIndex;
+
+public:
+  explicit SimpleTypoCorrection(StringRef Typo)
+      : BestCandidate(), Typo(Typo), MaxEditDistance((Typo.size() + 2) / 3),
+        BestEditDistance(MaxEditDistance + 1), BestIndex(0), NextIndex(0) {}
+
+  void add(const StringRef Candidate);
+  void add(const char *Candidate);
+  void add(const IdentifierInfo *Candidate);
+
+  std::optional<StringRef> getCorrection() const;
+  bool hasCorrection() const;
+  unsigned getCorrectionIndex() const;
+};
+} // namespace clang
+
+#endif // LLVM_CLANG_BASIC_SIMPLETYPOCORRECTION_H
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 5ec67087aeea4..d7a3a81065d33 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -5033,6 +5033,8 @@ class Sema final : public SemaBase {
   /// which might be lying around on it.
   void checkUnusedDeclAttributes(Declarator &D);
 
+  void DiagnoseUnknownAttribute(const ParsedAttr &AL);
+
   /// DeclClonePragmaWeak - clone existing decl (maybe definition),
   /// \#pragma weak needs a non-definition decl and source may not have one.
   NamedDecl *DeclClonePragmaWeak(NamedDecl *ND, const IdentifierInfo *II,
diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp
index bd2206bb8a3bc..fb745fc560d2f 100644
--- a/clang/lib/AST/CommentSema.cpp
+++ b/clang/lib/AST/CommentSema.cpp
@@ -13,6 +13,7 @@
 #include "clang/AST/DeclTemplate.h"
 #include "clang/Basic/DiagnosticComment.h"
 #include "clang/Basic/LLVM.h"
+#include "clang/Basic/SimpleTypoCorrection.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Lex/Preprocessor.h"
 #include "llvm/ADT/StringSwitch.h"
@@ -975,69 +976,22 @@ unsigned Sema::resolveParmVarReference(StringRef Name,
   return ParamCommandComment::InvalidParamIndex;
 }
 
-namespace {
-class SimpleTypoCorrector {
-  const NamedDecl *BestDecl;
-
-  StringRef Typo;
-  const unsigned MaxEditDistance;
-
-  unsigned BestEditDistance;
-  unsigned BestIndex;
-  unsigned NextIndex;
-
-public:
-  explicit SimpleTypoCorrector(StringRef Typo)
-      : BestDecl(nullptr), Typo(Typo), MaxEditDistance((Typo.size() + 2) / 3),
-        BestEditDistance(MaxEditDistance + 1), BestIndex(0), NextIndex(0) {}
-
-  void addDecl(const NamedDecl *ND);
-
-  const NamedDecl *getBestDecl() const {
-    if (BestEditDistance > MaxEditDistance)
-      return nullptr;
-
-    return BestDecl;
-  }
+unsigned
+Sema::correctTypoInParmVarReference(StringRef Typo,
+                                    ArrayRef<const ParmVarDecl *> ParamVars) {
+  SimpleTypoCorrection STC(Typo);
+  for (unsigned i = 0, e = ParamVars.size(); i != e; ++i) {
+    const ParmVarDecl *Param = ParamVars[i];
+    if (!Param)
+      continue;
 
-  unsigned getBestDeclIndex() const {
-    assert(getBestDecl());
-    return BestIndex;
+    STC.add(Param->getIdentifier());
   }
-};
-
-void SimpleTypoCorrector::addDecl(const NamedDecl *ND) {
-  unsigned CurrIndex = NextIndex++;
-
-  const IdentifierInfo *II = ND->getIdentifier();
-  if (!II)
-    return;
 
-  StringRef Name = II->getName();
-  unsigned MinPossibleEditDistance = abs((int)Name.size() - (int)Typo.size());
-  if (MinPossibleEditDistance > 0 &&
-      Typo.size() / MinPossibleEditDistance < 3)
-    return;
+  if (STC.hasCorrection())
+    return STC.getCorrectionIndex();
 
-  unsigned EditDistance = Typo.edit_distance(Name, true, MaxEditDistance);
-  if (EditDistance < BestEditDistance) {
-    BestEditDistance = EditDistance;
-    BestDecl = ND;
-    BestIndex = CurrIndex;
-  }
-}
-} // end anonymous namespace
-
-unsigned Sema::correctTypoInParmVarReference(
-                                    StringRef Typo,
-                                    ArrayRef<const ParmVarDecl *> ParamVars) {
-  SimpleTypoCorrector Corrector(Typo);
-  for (unsigned i = 0, e = ParamVars.size(); i != e; ++i)
-    Corrector.addDecl(ParamVars[i]);
-  if (Corrector.getBestDecl())
-    return Corrector.getBestDeclIndex();
-  else
-    return ParamCommandComment::InvalidParamIndex;
+  return ParamCommandComment::InvalidParamIndex;
 }
 
 namespace {
@@ -1079,16 +1033,18 @@ bool Sema::resolveTParamReference(
 
 namespace {
 void CorrectTypoInTParamReferenceHelper(
-                            const TemplateParameterList *TemplateParameters,
-                            SimpleTypoCorrector &Corrector) {
+    const TemplateParameterList *TemplateParameters,
+    SimpleTypoCorrection &STC) {
   for (unsigned i = 0, e = TemplateParameters->size(); i != e; ++i) {
     const NamedDecl *Param = TemplateParameters->getParam(i);
-    Corrector.addDecl(Param);
+    if (!Param)
+      continue;
+
+    STC.add(Param->getIdentifier());
 
     if (const TemplateTemplateParmDecl *TTP =
             dyn_cast<TemplateTemplateParmDecl>(Param))
-      CorrectTypoInTParamReferenceHelper(TTP->getTemplateParameters(),
-                                         Corrector);
+      CorrectTypoInTParamReferenceHelper(TTP->getTemplateParameters(), STC);
   }
 }
 } // end anonymous namespace
@@ -1096,13 +1052,12 @@ void CorrectTypoInTParamReferenceHelper(
 StringRef Sema::correctTypoInTParamReference(
                             StringRef Typo,
                             const TemplateParameterList *TemplateParameters) {
-  SimpleTypoCorrector Corrector(Typo);
-  CorrectTypoInTParamReferenceHelper(TemplateParameters, Corrector);
-  if (const NamedDecl *ND = Corrector.getBestDecl()) {
-    const IdentifierInfo *II = ND->getIdentifier();
-    assert(II && "SimpleTypoCorrector should not return this decl");
-    return II->getName();
-  }
+  SimpleTypoCorrection STC(Typo);
+  CorrectTypoInTParamReferenceHelper(TemplateParameters, STC);
+
+  if (auto CorrectedTParamReference = STC.getCorrection())
+    return *CorrectedTParamReference;
+
   return StringRef();
 }
 
diff --git a/clang/lib/Basic/Attributes.cpp b/clang/lib/Basic/Attributes.cpp
index 8ff5cc54ccc93..0c0a816c78039 100644
--- a/clang/lib/Basic/Attributes.cpp
+++ b/clang/lib/Basic/Attributes.cpp
@@ -15,6 +15,7 @@
 #include "clang/Basic/IdentifierTable.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/ParsedAttrInfo.h"
+#include "clang/Basic/SimpleTypoCorrection.h"
 #include "clang/Basic/TargetInfo.h"
 
 #include "llvm/ADT/StringMap.h"
@@ -22,30 +23,37 @@
 
 using namespace clang;
 
-static int hasAttributeImpl(AttributeCommonInfo::Syntax Syntax, StringRef Name,
-                            StringRef ScopeName, const TargetInfo &Target,
-                            const LangOptions &LangOpts) {
+static StringRef canonicalizeScopeName(StringRef Name) {
+  // Normalize the scope name, but only for gnu and clang attributes.
+  if (Name == "__gnu__")
+    return "gnu";
 
-#include "clang/Basic/AttrHasAttributeImpl.inc"
+  if (Name == "_Clang")
+    return "clang";
 
-  return 0;
+  return Name;
 }
 
-int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
-                        const IdentifierInfo *Scope, const IdentifierInfo *Attr,
-                        const TargetInfo &Target, const LangOptions &LangOpts,
-                        bool CheckPlugins) {
-  StringRef Name = Attr->getName();
+static StringRef canonicalizeAttrName(StringRef Name) {
   // Normalize the attribute name, __foo__ becomes foo.
   if (Name.size() >= 4 && Name.starts_with("__") && Name.ends_with("__"))
-    Name = Name.substr(2, Name.size() - 4);
+    return Name.substr(2, Name.size() - 4);
 
-  // Normalize the scope name, but only for gnu and clang attributes.
-  StringRef ScopeName = Scope ? Scope->getName() : "";
-  if (ScopeName == "__gnu__")
-    ScopeName = "gnu";
-  else if (ScopeName == "_Clang")
-    ScopeName = "clang";
+  return Name;
+}
+
+static int hasAttributeImpl(AttributeCommonInfo::Syntax Syntax, StringRef Name,
+                            StringRef ScopeName, const TargetInfo &Target,
+                            const LangOptions &LangOpts) {
+#include "clang/Basic/AttrHasAttributeImpl.inc"
+  return 0;
+}
+
+int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax, StringRef ScopeName,
+                        StringRef Name, const TargetInfo &Target,
+                        const LangOptions &LangOpts, bool CheckPlugins) {
+  ScopeName = canonicalizeScopeName(ScopeName);
+  Name = canonicalizeAttrName(Name);
 
   // As a special case, look for the omp::sequence and omp::directive
   // attributes. We support those, but not through the typical attribute
@@ -72,6 +80,14 @@ int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
   return 0;
 }
 
+int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
+                        const IdentifierInfo *Scope, const IdentifierInfo *Attr,
+                        const TargetInfo &Target, const LangOptions &LangOpts,
+                        bool CheckPlugins) {
+  return hasAttribute(Syntax, Scope ? Scope->getName() : "", Attr->getName(),
+                      Target, LangOpts, CheckPlugins);
+}
+
 int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
                         const IdentifierInfo *Scope, const IdentifierInfo *Attr,
                         const TargetInfo &Target, const LangOptions &LangOpts) {
@@ -90,25 +106,25 @@ const char *attr::getSubjectMatchRuleSpelling(attr::SubjectMatchRule Rule) {
 }
 
 static StringRef
-normalizeAttrScopeName(const IdentifierInfo *Scope,
+normalizeAttrScopeName(StringRef ScopeName,
                        AttributeCommonInfo::Syntax SyntaxUsed) {
-  if (!Scope)
-    return "";
-
-  // Normalize the "__gnu__" scope name to be "gnu" and the "_Clang" scope name
-  // to be "clang".
-  StringRef ScopeName = Scope->getName();
   if (SyntaxUsed == AttributeCommonInfo::AS_CXX11 ||
-      SyntaxUsed == AttributeCommonInfo::AS_C23) {
-    if (ScopeName == "__gnu__")
-      ScopeName = "gnu";
-    else if (ScopeName == "_Clang")
-      ScopeName = "clang";
-  }
+      SyntaxUsed == AttributeCommonInfo::AS_C23)
+    return canonicalizeScopeName(ScopeName);
+
   return ScopeName;
 }
 
-static StringRef normalizeAttrName(const IdentifierInfo *Name,
+static StringRef
+normalizeAttrScopeName(const IdentifierInfo *ScopeName,
+                       AttributeCommonInfo::Syntax SyntaxUsed) {
+  if (ScopeName)
+    return normalizeAttrScopeName(ScopeName->getName(), SyntaxUsed);
+
+  return "";
+}
+
+static StringRef normalizeAttrName(StringRef AttrName,
                                    StringRef NormalizedScopeName,
                                    AttributeCommonInfo::Syntax SyntaxUsed) {
   // Normalize the attribute name, __foo__ becomes foo. This is only allowable
@@ -119,10 +135,9 @@ static StringRef normalizeAttrName(const IdentifierInfo *Name,
         SyntaxUsed == AttributeCommonInfo::AS_C23) &&
        (NormalizedScopeName.empty() || NormalizedScopeName == "gnu" ||
         NormalizedScopeName == "clang"));
-  StringRef AttrName = Name->getName();
-  if (ShouldNormalize && AttrName.size() >= 4 && AttrName.starts_with("__") &&
-      AttrName.ends_with("__"))
-    AttrName = AttrName.slice(2, AttrName.size() - 2);
+
+  if (ShouldNormalize)
+    return canonicalizeAttrName(AttrName);
 
   return AttrName;
 }
@@ -137,16 +152,11 @@ bool AttributeCommonInfo::isClangScope() const {
 
 #include "clang/Sema/AttrParsedAttrKinds.inc"
 
-static SmallString<64> normalizeName(const IdentifierInfo *Name,
-                                     const IdentifierInfo *Scope,
+static SmallString<64> normalizeName(StringRef AttrName, StringRef ScopeName,
                                      AttributeCommonInfo::Syntax SyntaxUsed) {
-  StringRef ScopeName = normalizeAttrScopeName(Scope, SyntaxUsed);
-  StringRef AttrName = normalizeAttrName(Name, ScopeName, SyntaxUsed);
-
-  std::string StrAttrName = AttrName.str();
-  if (SyntaxUsed == AttributeCommonInfo::AS_HLSLAnnotation)
-    StrAttrName = AttrName.lower();
-
+  std::string StrAttrName = SyntaxUsed == AttributeCommonInfo::AS_HLSLAnnotation
+                                ? AttrName.lower()
+                                : AttrName.str();
   SmallString<64> FullName = ScopeName;
   if (!ScopeName.empty()) {
     assert(SyntaxUsed == AttributeCommonInfo::AS_CXX11 ||
@@ -154,10 +164,18 @@ static SmallString<64> normalizeName(const IdentifierInfo *Name,
     FullName += "::";
   }
   FullName += StrAttrName;
-
   return FullName;
 }
 
+static SmallString<64> normalizeName(const IdentifierInfo *Name,
+                                     const IdentifierInfo *Scope,
+                                     AttributeCommonInfo::Syntax SyntaxUsed) {
+  StringRef ScopeName = normalizeAttrScopeName(Scope, SyntaxUsed);
+  StringRef AttrName =
+      normalizeAttrName(Name->getName(), ScopeName, SyntaxUsed);
+  return normalizeName(AttrName, ScopeName, SyntaxUsed);
+}
+
 AttributeCommonInfo::Kind
 AttributeCommonInfo::getParsedKind(const IdentifierInfo *Name,
                                    const IdentifierInfo *ScopeName,
@@ -167,8 +185,8 @@ AttributeCommonInfo::getParsedKind(const IdentifierInfo *Name,
 
 AttributeCommonInfo::AttrArgsInfo
 AttributeCommonInfo::getCXX11AttrArgsInfo(const IdentifierInfo *Name) {
-  StringRef AttrName =
-      normalizeAttrName(Name, /*NormalizedScopeName*/ "", Syntax::AS_CXX11);
+  StringRef AttrName = normalizeAttrName(
+      Name->getName(), /*NormalizedScopeName*/ "", Syntax::AS_CXX11);
 #define CXX11_ATTR_ARGS_INFO
   return llvm::StringSwitch<AttributeCommonInfo::AttrArgsInfo>(AttrName)
 #include "clang/Basic/CXX11AttributeInfo.inc"
@@ -203,10 +221,47 @@ unsigned AttributeCommonInfo::calculateAttributeSpellingListIndex() const {
   // attribute spell list index matching code.
   auto Syntax = static_cast<AttributeCommonInfo::Syntax>(getSyntax());
   StringRef ScopeName = normalizeAttrScopeName(getScopeName(), Syntax);
-  StringRef Name = normalizeAttrName(getAttrName(), ScopeName, Syntax);
-
+  StringRef Name =
+      normalizeAttrName(getAttrName()->getName(), ScopeName, Syntax);
   AttributeCommonInfo::Scope ComputedScope =
       getScopeFromNormalizedScopeName(ScopeName);
 
 #include "clang/Sema/AttrSpellingListIndex.inc"
 }
+
+#include "clang/Basic/AttributeSpellingList.inc"
+
+std::optional<std::string>
+AttributeCommonInfo::getCorrectedFullName(const TargetInfo &Target,
+                                          const LangOptions &LangOpts) const {
+  StringRef ScopeName = normalizeAttrScopeName(getScopeName(), getSyntax());
+  if (ScopeName.size() > 0 &&
+      llvm::none_of(AttrScopeSpellingList,
+                    [&](const char *S) { return S == ScopeName; })) {
+    SimpleTypoCorrection STC(ScopeName);
+    for (const auto &Scope : AttrScopeSpellingList)
+      STC.add(Scope);
+
+    if (auto CorrectedScopeName = STC.getCorrection())
+      ScopeName = *CorrectedScopeName;
+  }
+
+  StringRef AttrName =
+      normalizeAttrName(getAttrName()->getName(), ScopeName, getSyntax());
+  if (llvm::none_of(AttrSpellingList,
+                    [&](const char *A) { return A == AttrName; })) {
+    SimpleTypoCorrection STC(AttrName);
+    for (const auto &Attr : AttrSpellingList)
+      STC.add(Attr);
+
+    if (auto CorrectedAttrName = STC.getCorrection())
+      AttrName = *CorrectedAttrName;
+  }
+
+  if (hasAttribute(getSyntax(), ScopeName, AttrName, Target, LangOpts,
+                   /*CheckPlugins=*/true))
+    return static_cast<std::string>(
+        normalizeName(AttrName, ScopeName, getSyntax()));
+
+  return std::nullopt;
+}
diff --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt
index 0eacf79f5d478..f8a31c890ac4d 100644
--- a/clang/lib/Basic/CMakeLists.txt
+++ b/clang/lib/Basic/CMakeLists.txt
@@ -86,6 +86,7 @@ add_clang_library(clangBasic
   SanitizerSpecialCaseList.cpp
   Sanitizers.cpp
   Sarif.cpp
+  SimpleTypoCorrection.cpp
   SourceLocation.cpp
   SourceManager.cpp
   SourceMgrAdapter.cpp
diff --git a/clang/lib/Basic/SimpleTypoCorrection.cpp b/clang/lib/Basic/SimpleTypoCorrection.cpp
new file mode 100644
index 0000000000000..c98b89d9f080d
--- /dev/null
+++ b/clang/lib/Basic/SimpleTypoCorrection.cpp
@@ -0,0 +1,52 @@
+#include "clang/Basic/SimpleTypoCorrection.h"
+#include "clang/Basic/IdentifierTable.h"
+#include "clang/Basic/LLVM.h"
+#include "llvm/ADT/StringRef.h"
+
+using namespace clang;
+
+void SimpleTypoCorr...
[truncated]

``````````

</details>

author_association: MEMBER
user: login: github-actions[bot]
created_at: 2025-05-19T21:50:20Z
body: <!--LLVM CODE FORMAT COMMENT: {clang-format}-->

:white_check_mark: With the latest revision this PR passed the C/C++ code formatter.
author_association: NONE
user: login: kazutakahirata
created_at: 2025-05-22T14:44:10Z
body: @a-tarasyuk I'm getting the following warnings.  Would you mind taking a look?

```
clang/lib/Basic/Attributes.cpp:238:9: error: 'ATTR_SCOPE_SCOPE' macro redefined [-Werror,-Wmacro-redefined]
  238 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME,
      |         ^
tools/clang/include/clang/Basic/AttributeSpellingList.inc:528:9: note: previous definition is here
  528 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME
      |         ^
1 error generated.
```

author_association: CONTRIBUTOR
user: login: a-tarasyuk
created_at: 2025-05-22T14:45:15Z
body: @kazutakahirata Sure, I'll create PR to fix it
author_association: MEMBER
user: login: llvm-ci
created_at: 2025-05-22T15:03:36Z
body: LLVM Buildbot has detected a new failure on builder `sanitizer-ppc64le-linux` running on `ppc64le-sanitizer` while building `clang` at step 2 "annotate".

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

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
[3330/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/SPIRV.cpp.o
[3331/4221] Building CXX object tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ASTConsumer.cpp.o
[3332/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/DragonFly.cpp.o
[3333/4221] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/M68k.cpp.o
[3334/4221] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/InterpolatingCompilationDatabase.cpp.o
[3335/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Haiku.cpp.o
[3336/4221] Building CXX object tools/clang/lib/Format/CMakeFiles/obj.clangFormat.dir/AffectedRangeManager.cpp.o
[3337/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/AMDGPUOpenMP.cpp.o
[3338/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/CrossWindows.cpp.o
[3339/4221] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm_build0/bin/clang++ -DCLANG_EXPORTS -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/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/llvm/include -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 -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -MF tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o.d -o tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic/Attributes.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic/Attributes.cpp:238:9: error: 'ATTR_SCOPE_SCOPE' macro redefined [-Werror,-Wmacro-redefined]
  238 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME,
      |         ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/include/clang/Basic/AttributeSpellingList.inc:528:9: note: previous definition is here
  528 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME
      |         ^
1 error generated.
[3340/4221] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/MacroInfo.cpp.o
[3341/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/UEFI.cpp.o
[3342/4221] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/FixIt.cpp.o
[3343/4221] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/DiagnosticRenderer.cpp.o
[3344/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/Compilation.cpp.o
[3345/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/NaCl.cpp.o
[3346/4221] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/PreprocessorLexer.cpp.o
[3347/4221] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/RewriteTest.cpp.o
[3348/4221] Building CXX object tools/clang/tools/diagtool/CMakeFiles/diagtool.dir/DiagnosticNames.cpp.o
[3349/4221] Building CXX object tools/clang/lib/Analysis/FlowSensitive/CMakeFiles/obj.clangAnalysisFlowSensitive.dir/DebugSupport.cpp.o
[3350/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Arch/LoongArch.cpp.o
[3351/4221] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/TokenConcatenation.cpp.o
[3352/4221] Building CXX object tools/clang/lib/Serialization/CMakeFiles/obj.clangSerialization.dir/ModuleFile.cpp.o
[3353/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/Job.cpp.o
[3354/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/HIPSPV.cpp.o
[3355/4221] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/FileList.cpp.o
[3356/4221] Building CXX object tools/clang/lib/Format/CMakeFiles/obj.clangFormat.dir/IntegerLiteralSeparatorFixer.cpp.o
[3357/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Hurd.cpp.o
[3358/4221] Building CXX object tools/clang/lib/Format/CMakeFiles/obj.clangFormat.dir/DefinitionBlockSeparator.cpp.o
[3359/4221] Building CXX object tools/clang/tools/diagtool/CMakeFiles/diagtool.dir/FindDiagnosticID.cpp.o
[3360/4221] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/FunctionSummary.cpp.o
[3361/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Arch/X86.cpp.o
[3362/4221] Building CXX object tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/CommentLexer.cpp.o
[3363/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Arch/AArch64.cpp.o
[3364/4221] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/MacroArgs.cpp.o
[3365/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/ZOS.cpp.o
[3366/4221] Building CXX object tools/clang/lib/Format/CMakeFiles/obj.clangFormat.dir/MacroCallReconstructor.cpp.o
[3367/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/CSKYToolChain.cpp.o
[3368/4221] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/WebAssembly.cpp.o
[3369/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/NetBSD.cpp.o
Step 8 (build compiler-rt debug) failure: build compiler-rt debug (failure)
...
[3330/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/SPIRV.cpp.o
[3331/4221] Building CXX object tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ASTConsumer.cpp.o
[3332/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/DragonFly.cpp.o
[3333/4221] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/M68k.cpp.o
[3334/4221] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/InterpolatingCompilationDatabase.cpp.o
[3335/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Haiku.cpp.o
[3336/4221] Building CXX object tools/clang/lib/Format/CMakeFiles/obj.clangFormat.dir/AffectedRangeManager.cpp.o
[3337/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/AMDGPUOpenMP.cpp.o
[3338/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/CrossWindows.cpp.o
[3339/4221] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm_build0/bin/clang++ -DCLANG_EXPORTS -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/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/llvm/include -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 -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -MF tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o.d -o tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic/Attributes.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic/Attributes.cpp:238:9: error: 'ATTR_SCOPE_SCOPE' macro redefined [-Werror,-Wmacro-redefined]
  238 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME,
      |         ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/include/clang/Basic/AttributeSpellingList.inc:528:9: note: previous definition is here
  528 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME
      |         ^
1 error generated.
[3340/4221] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/MacroInfo.cpp.o
[3341/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/UEFI.cpp.o
[3342/4221] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/FixIt.cpp.o
[3343/4221] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/DiagnosticRenderer.cpp.o
[3344/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/Compilation.cpp.o
[3345/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/NaCl.cpp.o
[3346/4221] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/PreprocessorLexer.cpp.o
[3347/4221] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/RewriteTest.cpp.o
[3348/4221] Building CXX object tools/clang/tools/diagtool/CMakeFiles/diagtool.dir/DiagnosticNames.cpp.o
[3349/4221] Building CXX object tools/clang/lib/Analysis/FlowSensitive/CMakeFiles/obj.clangAnalysisFlowSensitive.dir/DebugSupport.cpp.o
[3350/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Arch/LoongArch.cpp.o
[3351/4221] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/TokenConcatenation.cpp.o
[3352/4221] Building CXX object tools/clang/lib/Serialization/CMakeFiles/obj.clangSerialization.dir/ModuleFile.cpp.o
[3353/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/Job.cpp.o
[3354/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/HIPSPV.cpp.o
[3355/4221] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/FileList.cpp.o
[3356/4221] Building CXX object tools/clang/lib/Format/CMakeFiles/obj.clangFormat.dir/IntegerLiteralSeparatorFixer.cpp.o
[3357/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Hurd.cpp.o
[3358/4221] Building CXX object tools/clang/lib/Format/CMakeFiles/obj.clangFormat.dir/DefinitionBlockSeparator.cpp.o
[3359/4221] Building CXX object tools/clang/tools/diagtool/CMakeFiles/diagtool.dir/FindDiagnosticID.cpp.o
[3360/4221] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/FunctionSummary.cpp.o
[3361/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Arch/X86.cpp.o
[3362/4221] Building CXX object tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/CommentLexer.cpp.o
[3363/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Arch/AArch64.cpp.o
[3364/4221] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/MacroArgs.cpp.o
[3365/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/ZOS.cpp.o
[3366/4221] Building CXX object tools/clang/lib/Format/CMakeFiles/obj.clangFormat.dir/MacroCallReconstructor.cpp.o
[3367/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/CSKYToolChain.cpp.o
[3368/4221] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/WebAssembly.cpp.o
[3369/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/NetBSD.cpp.o
Step 9 (test compiler-rt debug) failure: test compiler-rt debug (failure)
@@@BUILD_STEP test compiler-rt debug@@@
ninja: Entering directory `build_default'
[1/46] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm_build0/bin/clang++ -DCLANG_EXPORTS -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/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/llvm/include -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 -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -MF tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o.d -o tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic/Attributes.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic/Attributes.cpp:238:9: error: 'ATTR_SCOPE_SCOPE' macro redefined [-Werror,-Wmacro-redefined]
  238 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME,
      |         ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/include/clang/Basic/AttributeSpellingList.inc:528:9: note: previous definition is here
  528 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME
      |         ^
1 error generated.
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild




Step 10 (build compiler-rt tsan_debug) failure: build compiler-rt tsan_debug (failure)
...
[3837/4202] Linking CXX static library lib/libLLVMBitReader.a
[3838/4202] Linking CXX static library lib/libLLVMMCA.a
[3839/4202] Linking CXX static library lib/libLLVMPowerPCDisassembler.a
[3840/4202] Linking CXX static library lib/libLLVMPowerPCDesc.a
[3841/4202] Linking CXX static library lib/libLLVMIRReader.a
[3842/4202] Linking CXX executable bin/llvm-bcanalyzer
[3843/4202] Linking CXX executable bin/llvm-stress
[3844/4202] Linking CXX executable bin/llvm-dis
[3845/4202] Linking CXX executable bin/llvm-diff
[3846/4202] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm_build0/bin/clang++ -DCLANG_EXPORTS -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/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/llvm/include -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 -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -MF tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o.d -o tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic/Attributes.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic/Attributes.cpp:238:9: error: 'ATTR_SCOPE_SCOPE' macro redefined [-Werror,-Wmacro-redefined]
  238 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME,
      |         ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/include/clang/Basic/AttributeSpellingList.inc:528:9: note: previous definition is here
  528 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME
      |         ^
1 error generated.
[3847/4202] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/HIPUtility.cpp.o
[3848/4202] Building CXX object lib/MC/MCParser/CMakeFiles/LLVMMCParser.dir/AsmParser.cpp.o
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild




Step 11 (build compiler-rt default) failure: build compiler-rt default (failure)
...
[3856/4221] Linking CXX executable bin/llvm-rust-demangle-fuzzer
[3857/4221] Linking CXX executable bin/llvm-dlang-demangle-fuzzer
[3858/4221] Linking CXX executable bin/llvm-itanium-demangle-fuzzer
[3859/4221] Linking CXX executable bin/llvm-jitlink-executor
[3860/4221] Linking CXX static library lib/libLLVMIRReader.a
[3861/4221] Linking CXX executable bin/llvm-bcanalyzer
[3862/4221] Linking CXX executable bin/llvm-stress
[3863/4221] Linking CXX executable bin/llvm-dis
[3864/4221] Linking CXX executable bin/llvm-diff
[3865/4221] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm_build0/bin/clang++ -DCLANG_EXPORTS -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/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/llvm/include -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 -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -MF tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o.d -o tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic/Attributes.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic/Attributes.cpp:238:9: error: 'ATTR_SCOPE_SCOPE' macro redefined [-Werror,-Wmacro-redefined]
  238 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME,
      |         ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/include/clang/Basic/AttributeSpellingList.inc:528:9: note: previous definition is here
  528 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME
      |         ^
1 error generated.
[3866/4221] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/HIPUtility.cpp.o
[3867/4221] Building CXX object lib/MC/MCParser/CMakeFiles/LLVMMCParser.dir/AsmParser.cpp.o
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild




Step 12 (test compiler-rt default) failure: test compiler-rt default (failure)
...
[189/243] Linking CXX static library lib/liblldMachO.a
[190/243] Linking CXX static library lib/liblldELF.a
[191/243] Linking CXX static library lib/libLLVMOrcDebugging.a
[192/243] Linking CXX static library lib/liblldMinGW.a
[193/243] Linking CXX executable bin/llvm-jitlink
[194/243] Linking CXX executable bin/lli
[195/243] Linking CXX executable bin/llvm-lto
[196/243] Linking CXX executable bin/lld
[197/243] Linking CXX executable bin/opt
[198/243] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm_build0/bin/clang++ -DCLANG_EXPORTS -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/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/llvm/include -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 -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -MF tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o.d -o tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic/Attributes.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/Basic/Attributes.cpp:238:9: error: 'ATTR_SCOPE_SCOPE' macro redefined [-Werror,-Wmacro-redefined]
  238 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME,
      |         ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/include/clang/Basic/AttributeSpellingList.inc:528:9: note: previous definition is here
  528 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME
      |         ^
1 error generated.
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild




Step 13 (build standalone compiler-rt) failure: build standalone compiler-rt (failure)
...
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Didn't find assembler
CMake Error at CMakeLists.txt:22 (project):
  The CMAKE_C_COMPILER:

    /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/bin/clang

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:22 (project):
  The CMAKE_CXX_COMPILER:

    /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/bin/clang++

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:22 (project):
  No CMAKE_ASM_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.
-- Warning: Did not find file Compiler/-ASM
-- Configuring incomplete, errors occurred!

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild




ninja: Entering directory `compiler_rt_build'

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild


ninja: error: loading 'build.ninja': No such file or directory


Step 14 (test standalone compiler-rt) failure: test standalone compiler-rt (failure)
@@@BUILD_STEP test standalone compiler-rt@@@
ninja: Entering directory `compiler_rt_build'

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild


ninja: error: loading 'build.ninja': No such file or directory



```

</details>
author_association: NONE
user: login: llvm-ci
created_at: 2025-05-22T15:05:07Z
body: LLVM Buildbot has detected a new failure on builder `ppc64le-lld-multistage-test` running on `ppc64le-lld-multistage-test` while building `clang` at step 12 "build-stage2-unified-tree".

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

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 12 (build-stage2-unified-tree) failure: build (failure)
...
193.958 [1575/1154/3841] Building CXX object lib/ExecutionEngine/JITLink/CMakeFiles/LLVMJITLink.dir/aarch32.cpp.o
193.998 [1574/1154/3842] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/Xtensa.cpp.o
194.030 [1573/1154/3843] Building CXX object tools/clang/lib/Serialization/CMakeFiles/obj.clangSerialization.dir/GlobalModuleIndex.cpp.o
194.059 [1572/1154/3844] Building CXX object tools/clang/lib/ExtractAPI/CMakeFiles/obj.clangExtractAPI.dir/TypedefUnderlyingTypeResolver.cpp.o
194.088 [1571/1154/3845] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/MachO.cpp.o
194.118 [1570/1154/3846] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/ProfileList.cpp.o
194.430 [1569/1154/3847] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/VE.cpp.o
194.480 [1568/1154/3848] Building CXX object lib/Target/SystemZ/MCTargetDesc/CMakeFiles/LLVMSystemZDesc.dir/SystemZHLASMAsmStreamer.cpp.o
194.640 [1567/1154/3849] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Builtins.cpp.o
194.670 [1566/1154/3850] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o 
ccache /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/install/stage1/bin/clang++ -DCLANG_EXPORTS -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/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage2/tools/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage2/tools/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage2/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/include -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 -Wno-unnecessary-virtual-specifier -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 -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -MF tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o.d -o tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/lib/Basic/Attributes.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/lib/Basic/Attributes.cpp:238:9: error: 'ATTR_SCOPE_SCOPE' macro redefined [-Werror,-Wmacro-redefined]
  238 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME,
      |         ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage2/tools/clang/include/clang/Basic/AttributeSpellingList.inc:528:9: note: previous definition is here
  528 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME
      |         ^
1 error generated.
194.672 [1566/1153/3851] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/NVPTX.cpp.o
194.675 [1566/1152/3852] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonCFGOptimizer.cpp.o
194.750 [1566/1151/3853] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/SystemZ.cpp.o
194.753 [1566/1150/3854] Building CXX object lib/ExecutionEngine/JITLink/CMakeFiles/LLVMJITLink.dir/JITLinkGeneric.cpp.o
194.910 [1566/1149/3855] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMConstantPoolValue.cpp.o
194.980 [1566/1148/3856] Building CXX object tools/clang/lib/ExtractAPI/CMakeFiles/obj.clangExtractAPI.dir/API.cpp.o
195.110 [1566/1147/3857] Building CXX object tools/clang/lib/Analysis/CMakeFiles/obj.clangAnalysis.dir/ReachableCode.cpp.o
195.340 [1566/1146/3858] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/RDFCopy.cpp.o
195.390 [1566/1145/3859] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/CommonArgs.cpp.o
195.420 [1566/1144/3860] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/M68k.cpp.o
195.506 [1566/1143/3861] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonGenExtract.cpp.o
195.560 [1566/1142/3862] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/Preprocessor.cpp.o
195.581 [1566/1141/3863] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ContainerModeling.cpp.o
195.601 [1566/1140/3864] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/AssumeModeling.cpp.o
195.640 [1566/1139/3865] Building CXX object lib/Target/WebAssembly/CMakeFiles/LLVMWebAssemblyCodeGen.dir/WebAssemblyOptimizeReturned.cpp.o
195.661 [1566/1138/3866] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/CompileOnDemandLayer.cpp.o
195.700 [1566/1137/3867] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/Checker.cpp.o
195.702 [1566/1136/3868] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ConstraintManager.cpp.o
195.790 [1566/1135/3869] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/SPIR.cpp.o
195.810 [1566/1134/3870] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/RDFDeadCode.cpp.o
195.870 [1566/1133/3871] Building CXX object tools/clang/lib/APINotes/CMakeFiles/obj.clangAPINotes.dir/APINotesReader.cpp.o
195.910 [1566/1132/3872] Building CXX object lib/Target/ARM/MCTargetDesc/CMakeFiles/LLVMARMDesc.dir/ARMELFStreamer.cpp.o
195.914 [1566/1131/3873] Building CXX object lib/Target/BPF/MCTargetDesc/CMakeFiles/LLVMBPFDesc.dir/BPFInstPrinter.cpp.o
195.975 [1566/1130/3874] Building CXX object lib/Target/LoongArch/MCTargetDesc/CMakeFiles/LLVMLoongArchDesc.dir/LoongArchMCTargetDesc.cpp.o
195.978 [1566/1129/3875] Building CXX object lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/COFFVCRuntimeSupport.cpp.o
196.020 [1566/1128/3876] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/TaintTesterChecker.cpp.o
196.021 [1566/1127/3877] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/FileManager.cpp.o
196.032 [1566/1126/3878] Building CXX object lib/Target/Mips/MCTargetDesc/CMakeFiles/LLVMMipsDesc.dir/MipsTargetStreamer.cpp.o
196.530 [1566/1125/3879] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/HeaderSearch.cpp.o
196.550 [1566/1124/3880] Building CXX object lib/Target/Lanai/CMakeFiles/LLVMLanaiCodeGen.dir/LanaiRegisterInfo.cpp.o

```

</details>
author_association: NONE
user: login: llvm-ci
created_at: 2025-05-22T15:10:00Z
body: LLVM Buildbot has detected a new failure on builder `sanitizer-x86_64-linux-android` running on `sanitizer-buildbot-android` while building `clang` at step 2 "annotate".

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

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
[3589/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/FileSystemStatCache.cpp.o
[3590/5523] Building X86GenSubtargetInfo.inc...
[3591/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/LangOptions.cpp.o
[3592/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/LangStandards.cpp.o
[3593/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/MakeSupport.cpp.o
[3594/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Module.cpp.o
[3595/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/ObjCRuntime.cpp.o
[3596/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/OffloadArch.cpp.o
[3597/5523] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o
[3598/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build0/bin/clang++ -DCLANG_EXPORTS -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/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/tools/clang/lib/Basic -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/lib/Basic -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/include -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/tools/clang/include -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/include -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/llvm/include -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 -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -MF tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o.d -o tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -c /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/lib/Basic/Attributes.cpp
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/lib/Basic/Attributes.cpp:238:9: error: 'ATTR_SCOPE_SCOPE' macro redefined [-Werror,-Wmacro-redefined]
  238 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME,
      |         ^
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/tools/clang/include/clang/Basic/AttributeSpellingList.inc:528:9: note: previous definition is here
  528 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME
      |         ^
1 error generated.
[3599/5523] Building X86GenInstrInfo.inc...
[3600/5523] Building CXX object tools/clang/lib/APINotes/CMakeFiles/obj.clangAPINotes.dir/APINotesManager.cpp.o
[3601/5523] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/InitHeaderSearch.cpp.o
[3602/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/OpenCLOptions.cpp.o
[3603/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Builtins.cpp.o
[3604/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/OpenMPKinds.cpp.o
[3605/5523] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/LiteralSupport.cpp.o
[3606/5523] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/Lexer.cpp.o
[3607/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Diagnostic.cpp.o
[3608/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/IdentifierTable.cpp.o
[3609/5523] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/HeaderSearch.cpp.o
[3610/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/DiagnosticIDs.cpp.o
[3611/5523] Building InstCombineTables.inc...
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild


@@@STEP_FAILURE@@@

@@@STEP_FAILURE@@@

@@@STEP_FAILURE@@@
Step 8 (bootstrap clang) failure: bootstrap clang (failure)
...
[3589/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/FileSystemStatCache.cpp.o
[3590/5523] Building X86GenSubtargetInfo.inc...
[3591/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/LangOptions.cpp.o
[3592/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/LangStandards.cpp.o
[3593/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/MakeSupport.cpp.o
[3594/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Module.cpp.o
[3595/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/ObjCRuntime.cpp.o
[3596/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/OffloadArch.cpp.o
[3597/5523] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o
[3598/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build0/bin/clang++ -DCLANG_EXPORTS -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/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/tools/clang/lib/Basic -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/lib/Basic -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/include -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/tools/clang/include -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/include -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/llvm/include -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 -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -MF tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o.d -o tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -c /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/lib/Basic/Attributes.cpp
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/lib/Basic/Attributes.cpp:238:9: error: 'ATTR_SCOPE_SCOPE' macro redefined [-Werror,-Wmacro-redefined]
  238 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME,
      |         ^
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/tools/clang/include/clang/Basic/AttributeSpellingList.inc:528:9: note: previous definition is here
  528 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME
      |         ^
1 error generated.
[3599/5523] Building X86GenInstrInfo.inc...
[3600/5523] Building CXX object tools/clang/lib/APINotes/CMakeFiles/obj.clangAPINotes.dir/APINotesManager.cpp.o
[3601/5523] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/InitHeaderSearch.cpp.o
[3602/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/OpenCLOptions.cpp.o
[3603/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Builtins.cpp.o
[3604/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/OpenMPKinds.cpp.o
[3605/5523] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/LiteralSupport.cpp.o
[3606/5523] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/Lexer.cpp.o
[3607/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Diagnostic.cpp.o
[3608/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/IdentifierTable.cpp.o
[3609/5523] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/HeaderSearch.cpp.o
[3610/5523] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/DiagnosticIDs.cpp.o
[3611/5523] Building InstCombineTables.inc...
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild




program finished with exit code 2
elapsedTime=169.376020

```

</details>
author_association: NONE
user: login: llvm-ci
created_at: 2025-05-22T15:55:51Z
body: LLVM Buildbot has detected a new failure on builder `clang-ppc64le-rhel` running on `ppc64le-clang-rhel-test` while building `clang` at step 5 "build-unified-tree".

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

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 5 (build-unified-tree) failure: build (failure)
...
58.602 [2157/192/4196] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o
58.674 [2156/192/4197] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Stack.cpp.o
59.263 [2155/192/4198] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/PPCallbacks.cpp.o
59.278 [2154/192/4199] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/PPConditionalDirectiveRecord.cpp.o
59.350 [2153/192/4200] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/TargetID.cpp.o
61.493 [2152/192/4201] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Builtins.cpp.o
62.171 [2151/192/4202] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/ParsedAttrInfo.cpp.o
62.238 [2150/192/4203] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/PreprocessingRecord.cpp.o
62.387 [2149/192/4204] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/ARC.cpp.o
62.509 [2148/192/4205] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o 
ccache /home/buildbots/llvm-external-buildbots/clang.19.1.7/bin/clang++ --gcc-toolchain=/gcc-toolchain/usr -DCLANG_EXPORTS -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/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/clang/lib/Basic -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/include -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 -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -MF tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o.d -o tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/clang/lib/Basic/Attributes.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/clang/lib/Basic/Attributes.cpp:238:9: error: 'ATTR_SCOPE_SCOPE' macro redefined [-Werror,-Wmacro-redefined]
  238 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME,
      |         ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/include/clang/Basic/AttributeSpellingList.inc:528:9: note: previous definition is here
  528 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME
      |         ^
1 error generated.
63.102 [2148/191/4206] Building CXX object tools/clang/lib/Analysis/CMakeFiles/obj.clangAnalysis.dir/CocoaConventions.cpp.o
63.194 [2148/190/4207] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/SimpleTypoCorrection.cpp.o
63.758 [2148/189/4208] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/TokenConcatenation.cpp.o
63.868 [2148/188/4209] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/PreprocessorLexer.cpp.o
63.935 [2148/187/4210] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/MacroArgs.cpp.o
64.571 [2148/186/4211] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/StackExhaustionHandler.cpp.o
64.710 [2148/185/4212] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/PPCaching.cpp.o
64.799 [2148/184/4213] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/MacroInfo.cpp.o
64.818 [2148/183/4214] Building CXX object tools/clang/lib/APINotes/CMakeFiles/obj.clangAPINotes.dir/APINotesManager.cpp.o
66.032 [2148/182/4215] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/InitHeaderSearch.cpp.o
67.117 [2148/181/4216] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/TokenLexer.cpp.o
67.370 [2148/180/4217] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/NoSanitizeList.cpp.o
68.491 [2148/179/4218] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/SourceLocation.cpp.o
68.511 [2148/178/4219] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/OpenMPKinds.cpp.o
68.555 [2148/177/4220] Building CXX object tools/clang/lib/Parse/CMakeFiles/obj.clangParse.dir/ParseHLSLRootSignature.cpp.o
68.900 [2148/176/4221] Building CXX object tools/clang/lib/ASTMatchers/CMakeFiles/obj.clangASTMatchers.dir/LowLevelHelpers.cpp.o
69.114 [2148/175/4222] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/ProfileList.cpp.o
69.601 [2148/174/4223] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/OpenCLOptions.cpp.o
70.072 [2148/173/4224] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/SourceMgrAdapter.cpp.o
70.312 [2148/172/4225] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/PPExpressions.cpp.o
70.896 [2148/171/4226] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/LiteralSupport.cpp.o
70.944 [2148/170/4227] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/PPLexerChange.cpp.o
71.151 [2148/169/4228] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Diagnostic.cpp.o
71.576 [2148/168/4229] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/ModuleMapFile.cpp.o
71.899 [2148/167/4230] Building CXX object tools/clang/lib/Analysis/CMakeFiles/obj.clangAnalysis.dir/BodyFarm.cpp.o
72.673 [2148/166/4231] Building CXX object tools/clang/lib/Analysis/CMakeFiles/obj.clangAnalysis.dir/CFGReachabilityAnalysis.cpp.o
73.025 [2148/165/4232] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/TargetInfo.cpp.o
73.072 [2148/164/4233] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/DiagnosticIDs.cpp.o
73.507 [2148/163/4234] Building CXX object tools/clang/lib/Analysis/CMakeFiles/obj.clangAnalysis.dir/CFGStmtMap.cpp.o
73.947 [2148/162/4235] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/Pragma.cpp.o

```

</details>
author_association: NONE
user: login: llvm-ci
created_at: 2025-05-22T19:27:58Z
body: LLVM Buildbot has detected a new failure on builder `clang-ppc64-aix` running on `aix-ppc64` while building `clang` at step 5 "build-unified-tree".

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

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 5 (build-unified-tree) failure: build (failure)
...
717.132 [4119/10/1282] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/ASTSourceDescriptor.cpp.o
717.841 [4118/10/1283] Building CXX object lib/Frontend/HLSL/CMakeFiles/LLVMFrontendHLSL.dir/CBuffer.cpp.o
718.250 [4117/10/1284] Building CXX object lib/Frontend/OpenMP/CMakeFiles/LLVMFrontendOpenMP.dir/OMPContext.cpp.o
718.331 [4116/10/1285] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/HeaderMap.cpp.o
718.740 [4115/10/1286] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/CLWarnings.cpp.o
719.006 [4114/10/1287] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o
719.086 [4113/10/1288] Building CXX object lib/Frontend/HLSL/CMakeFiles/LLVMFrontendHLSL.dir/HLSLRootSignature.cpp.o
719.770 [4112/10/1289] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/CharInfo.cpp.o
720.469 [4111/10/1290] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Cuda.cpp.o
720.635 [4110/10/1291] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o 
/home/llvm/llvm-external-buildbots/clang.19.1.2/bin/clang++ -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_LARGE_FILE_API -D_XOPEN_SOURCE=700 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/tools/clang/lib/Basic -I/home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/clang/lib/Basic -I/home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/clang/include -I/home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/tools/clang/include -I/home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/include -I/home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/include -mcmodel=large -fPIC -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 -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -pthread -MD -MT tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -MF tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o.d -o tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Attributes.cpp.o -c /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/clang/lib/Basic/Attributes.cpp
/home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/clang/lib/Basic/Attributes.cpp:238:9: error: 'ATTR_SCOPE_SCOPE' macro redefined [-Werror,-Wmacro-redefined]
  238 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME,
      |         ^
/home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/build/tools/clang/include/clang/Basic/AttributeSpellingList.inc:528:9: note: previous definition is here
  528 | #define ATTR_SCOPE_SCOPE(SCOPE_NAME) SCOPE_NAME
      |         ^
1 error generated.
720.934 [4110/9/1292] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/CodeGenOptions.cpp.o
721.567 [4110/8/1293] Building CXX object lib/Frontend/OpenMP/CMakeFiles/LLVMFrontendOpenMP.dir/OMP.cpp.o
722.071 [4110/7/1294] Building CXX object lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/SimpleLoopUnswitch.cpp.o
722.072 [4110/6/1295] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/DiagnosticOptions.cpp.o
722.142 [4110/5/1296] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Builtins.cpp.o
723.342 [4110/4/1297] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/DarwinSDKInfo.cpp.o
727.371 [4110/3/1298] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Diagnostic.cpp.o
727.712 [4110/2/1299] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/DiagnosticIDs.cpp.o
752.790 [4110/1/1300] Building CXX object lib/Frontend/OpenMP/CMakeFiles/LLVMFrontendOpenMP.dir/OMPIRBuilder.cpp.o
ninja: build stopped: subcommand failed.

```

</details>
author_association: NONE