Skip to content

Convert SpecialCaseList::Sections from StringMap to vector. #140115

New issue

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

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

Already on GitHub? Sign in to your account

Conversation

qinkunbao
Copy link
Member

@qinkunbao qinkunbao commented May 15, 2025

As discussed in #139772, SpecialCaseList::Sections can keep the order of Sections
when parsing the case list.

Created using spr 1.3.6
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" llvm:support labels May 15, 2025
@llvmbot
Copy link
Member

llvmbot commented May 15, 2025

@llvm/pr-subscribers-llvm-analysis
@llvm/pr-subscribers-clangir
@llvm/pr-subscribers-llvm-transforms
@llvm/pr-subscribers-flang-openmp
@llvm/pr-subscribers-llvm-binary-utilities
@llvm/pr-subscribers-flang-parser
@llvm/pr-subscribers-llvm-ir
@llvm/pr-subscribers-llvm-adt
@llvm/pr-subscribers-mlir-scf
@llvm/pr-subscribers-platform-windows
@llvm/pr-subscribers-mlir-quant
@llvm/pr-subscribers-mlir-sparse
@llvm/pr-subscribers-backend-directx
@llvm/pr-subscribers-lto
@llvm/pr-subscribers-bolt
@llvm/pr-subscribers-backend-m68k
@llvm/pr-subscribers-clang-static-analyzer-1
@llvm/pr-subscribers-tablegen
@llvm/pr-subscribers-clang-codegen
@llvm/pr-subscribers-mlir-core
@llvm/pr-subscribers-backend-x86
@llvm/pr-subscribers-backend-arm
@llvm/pr-subscribers-lld

@llvm/pr-subscribers-llvm-support

Author: Qinkun Bao (qinkunbao)

Changes

In this way, SpecialCaseList::Sections can keep the order of Sections
when parsing the case list.


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

5 Files Affected:

  • (modified) clang/lib/Basic/Diagnostic.cpp (+89-77)
  • (modified) clang/lib/Basic/ProfileList.cpp (+1-1)
  • (modified) clang/lib/Basic/SanitizerSpecialCaseList.cpp (+2-3)
  • (modified) llvm/include/llvm/Support/SpecialCaseList.h (+6-4)
  • (modified) llvm/lib/Support/SpecialCaseList.cpp (+16-13)
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 538c1d18a8ac1..fcf86cc4c234c 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -67,12 +67,12 @@ const StreamingDiagnostic &clang::operator<<(const StreamingDiagnostic &DB,
   return DB;
 }
 
-static void DummyArgToStringFn(DiagnosticsEngine::ArgumentKind AK, intptr_t QT,
-                            StringRef Modifier, StringRef Argument,
-                            ArrayRef<DiagnosticsEngine::ArgumentValue> PrevArgs,
-                            SmallVectorImpl<char> &Output,
-                            void *Cookie,
-                            ArrayRef<intptr_t> QualTypeVals) {
+static void
+DummyArgToStringFn(DiagnosticsEngine::ArgumentKind AK, intptr_t QT,
+                   StringRef Modifier, StringRef Argument,
+                   ArrayRef<DiagnosticsEngine::ArgumentValue> PrevArgs,
+                   SmallVectorImpl<char> &Output, void *Cookie,
+                   ArrayRef<intptr_t> QualTypeVals) {
   StringRef Str = "<can't format argument>";
   Output.append(Str.begin(), Str.end());
 }
@@ -94,9 +94,7 @@ DiagnosticsEngine::~DiagnosticsEngine() {
   setClient(nullptr);
 }
 
-void DiagnosticsEngine::dump() const {
-  DiagStatesByLoc.dump(*SourceMgr);
-}
+void DiagnosticsEngine::dump() const { DiagStatesByLoc.dump(*SourceMgr); }
 
 void DiagnosticsEngine::dump(StringRef DiagName) const {
   DiagStatesByLoc.dump(*SourceMgr, DiagName);
@@ -259,7 +257,8 @@ void DiagnosticsEngine::DiagStateMap::dump(SourceManager &SrcMgr,
 
     bool PrintedOuterHeading = false;
     auto PrintOuterHeading = [&] {
-      if (PrintedOuterHeading) return;
+      if (PrintedOuterHeading)
+        return;
       PrintedOuterHeading = true;
 
       llvm::errs() << "File " << &File << " <FileID " << ID.getHashValue()
@@ -272,8 +271,8 @@ void DiagnosticsEngine::DiagStateMap::dump(SourceManager &SrcMgr,
         llvm::errs() << " parent " << File.Parent << " <FileID "
                      << Decomp.first.getHashValue() << "> ";
         SrcMgr.getLocForStartOfFile(Decomp.first)
-              .getLocWithOffset(Decomp.second)
-              .print(llvm::errs(), SrcMgr);
+            .getLocWithOffset(Decomp.second)
+            .print(llvm::errs(), SrcMgr);
       }
       if (File.HasLocalTransitions)
         llvm::errs() << " has_local_transitions";
@@ -286,14 +285,15 @@ void DiagnosticsEngine::DiagStateMap::dump(SourceManager &SrcMgr,
     for (DiagStatePoint &Transition : File.StateTransitions) {
       bool PrintedInnerHeading = false;
       auto PrintInnerHeading = [&] {
-        if (PrintedInnerHeading) return;
+        if (PrintedInnerHeading)
+          return;
         PrintedInnerHeading = true;
 
         PrintOuterHeading();
         llvm::errs() << "  ";
         SrcMgr.getLocForStartOfFile(ID)
-              .getLocWithOffset(Transition.Offset)
-              .print(llvm::errs(), SrcMgr);
+            .getLocWithOffset(Transition.Offset)
+            .print(llvm::errs(), SrcMgr);
         llvm::errs() << ": state " << Transition.State << ":\n";
       };
 
@@ -316,11 +316,21 @@ void DiagnosticsEngine::DiagStateMap::dump(SourceManager &SrcMgr,
         llvm::errs() << ": ";
 
         switch (Mapping.second.getSeverity()) {
-        case diag::Severity::Ignored: llvm::errs() << "ignored"; break;
-        case diag::Severity::Remark: llvm::errs() << "remark"; break;
-        case diag::Severity::Warning: llvm::errs() << "warning"; break;
-        case diag::Severity::Error: llvm::errs() << "error"; break;
-        case diag::Severity::Fatal: llvm::errs() << "fatal"; break;
+        case diag::Severity::Ignored:
+          llvm::errs() << "ignored";
+          break;
+        case diag::Severity::Remark:
+          llvm::errs() << "remark";
+          break;
+        case diag::Severity::Warning:
+          llvm::errs() << "warning";
+          break;
+        case diag::Severity::Error:
+          llvm::errs() << "error";
+          break;
+        case diag::Severity::Fatal:
+          llvm::errs() << "fatal";
+          break;
         }
 
         if (!Mapping.second.isUser())
@@ -533,16 +543,20 @@ void WarningsSpecialCaseList::processSections(DiagnosticsEngine &Diags) {
   // Drop the default section introduced by special case list, we only support
   // exact diagnostic group names.
   // FIXME: We should make this configurable in the parser instead.
-  Sections.erase("*");
+  // FIXME: C++20 can use std::erase_if(Sections, [](Section &sec) { return
+  // sec.SectionStr == "*"; });
+  Sections.erase(
+      std::remove_if(Sections.begin(), Sections.end(),
+                     [](Section &sec) { return sec.SectionStr == "*"; }),
+      Sections.end());
   // Make sure we iterate sections by their line numbers.
-  std::vector<std::pair<unsigned, const llvm::StringMapEntry<Section> *>>
-      LineAndSectionEntry;
+  std::vector<std::pair<unsigned, const Section *>> LineAndSectionEntry;
   LineAndSectionEntry.reserve(Sections.size());
   for (const auto &Entry : Sections) {
-    StringRef DiagName = Entry.getKey();
+    StringRef DiagName = Entry.SectionStr;
     // Each section has a matcher with that section's name, attached to that
     // line.
-    const auto &DiagSectionMatcher = Entry.getValue().SectionMatcher;
+    const auto &DiagSectionMatcher = Entry.SectionMatcher;
     unsigned DiagLine = DiagSectionMatcher->Globs.at(DiagName).second;
     LineAndSectionEntry.emplace_back(DiagLine, &Entry);
   }
@@ -550,7 +564,7 @@ void WarningsSpecialCaseList::processSections(DiagnosticsEngine &Diags) {
   static constexpr auto WarningFlavor = clang::diag::Flavor::WarningOrError;
   for (const auto &[_, SectionEntry] : LineAndSectionEntry) {
     SmallVector<diag::kind> GroupDiags;
-    StringRef DiagGroup = SectionEntry->getKey();
+    StringRef DiagGroup = SectionEntry->SectionStr;
     if (Diags.getDiagnosticIDs()->getDiagnosticsInGroup(
             WarningFlavor, DiagGroup, GroupDiags)) {
       StringRef Suggestion =
@@ -563,7 +577,7 @@ void WarningsSpecialCaseList::processSections(DiagnosticsEngine &Diags) {
     for (diag::kind Diag : GroupDiags)
       // We're intentionally overwriting any previous mappings here to make sure
       // latest one takes precedence.
-      DiagToSection[Diag] = &SectionEntry->getValue();
+      DiagToSection[Diag] = SectionEntry;
   }
 }
 
@@ -662,8 +676,8 @@ bool DiagnosticsEngine::EmitDiagnostic(const DiagnosticBuilder &DB,
     Diagnostic Info(this, DB);
 
     // Figure out the diagnostic level of this message.
-    DiagnosticIDs::Level DiagLevel
-      = Diags->getDiagnosticLevel(Info.getID(), Info.getLocation(), *this);
+    DiagnosticIDs::Level DiagLevel =
+        Diags->getDiagnosticLevel(Info.getID(), Info.getLocation(), *this);
 
     Emitted = (DiagLevel != DiagnosticIDs::Ignored);
     if (Emitted) {
@@ -715,7 +729,7 @@ Diagnostic::Diagnostic(const DiagnosticsEngine *DO, SourceLocation DiagLoc,
 DiagnosticConsumer::~DiagnosticConsumer() = default;
 
 void DiagnosticConsumer::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
-                                        const Diagnostic &Info) {
+                                          const Diagnostic &Info) {
   if (!IncludeInDiagnosticCounts())
     return;
 
@@ -729,7 +743,7 @@ void DiagnosticConsumer::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
 template <std::size_t StrLen>
 static bool ModifierIs(const char *Modifier, unsigned ModifierLen,
                        const char (&Str)[StrLen]) {
-  return StrLen-1 == ModifierLen && memcmp(Modifier, Str, StrLen-1) == 0;
+  return StrLen - 1 == ModifierLen && memcmp(Modifier, Str, StrLen - 1) == 0;
 }
 
 /// ScanForward - Scans forward, looking for the given character, skipping
@@ -737,20 +751,25 @@ static bool ModifierIs(const char *Modifier, unsigned ModifierLen,
 static const char *ScanFormat(const char *I, const char *E, char Target) {
   unsigned Depth = 0;
 
-  for ( ; I != E; ++I) {
-    if (Depth == 0 && *I == Target) return I;
-    if (Depth != 0 && *I == '}') Depth--;
+  for (; I != E; ++I) {
+    if (Depth == 0 && *I == Target)
+      return I;
+    if (Depth != 0 && *I == '}')
+      Depth--;
 
     if (*I == '%') {
       I++;
-      if (I == E) break;
+      if (I == E)
+        break;
 
       // Escaped characters get implicitly skipped here.
 
       // Format specifier.
       if (!isDigit(*I) && !isPunctuation(*I)) {
-        for (I++; I != E && !isDigit(*I) && *I != '{'; I++) ;
-        if (I == E) break;
+        for (I++; I != E && !isDigit(*I) && *I != '{'; I++)
+          ;
+        if (I == E)
+          break;
         if (*I == '{')
           Depth++;
       }
@@ -767,14 +786,15 @@ static const char *ScanFormat(const char *I, const char *E, char Target) {
 static void HandleSelectModifier(const Diagnostic &DInfo, unsigned ValNo,
                                  const char *Argument, unsigned ArgumentLen,
                                  SmallVectorImpl<char> &OutStr) {
-  const char *ArgumentEnd = Argument+ArgumentLen;
+  const char *ArgumentEnd = Argument + ArgumentLen;
 
   // Skip over 'ValNo' |'s.
   while (ValNo) {
     const char *NextVal = ScanFormat(Argument, ArgumentEnd, '|');
-    assert(NextVal != ArgumentEnd && "Value for integer select modifier was"
+    assert(NextVal != ArgumentEnd &&
+           "Value for integer select modifier was"
            " larger than the number of options in the diagnostic string!");
-    Argument = NextVal+1;  // Skip this string.
+    Argument = NextVal + 1; // Skip this string.
     --ValNo;
   }
 
@@ -973,15 +993,13 @@ static const char *getTokenDescForDiagnostic(tok::TokenKind Kind) {
 /// FormatDiagnostic - Format this diagnostic into a string, substituting the
 /// formal arguments into the %0 slots.  The result is appended onto the Str
 /// array.
-void Diagnostic::
-FormatDiagnostic(SmallVectorImpl<char> &OutStr) const {
+void Diagnostic::FormatDiagnostic(SmallVectorImpl<char> &OutStr) const {
   if (StoredDiagMessage.has_value()) {
     OutStr.append(StoredDiagMessage->begin(), StoredDiagMessage->end());
     return;
   }
 
-  StringRef Diag =
-    getDiags()->getDiagnosticIDs()->getDescription(getID());
+  StringRef Diag = getDiags()->getDiagnosticIDs()->getDescription(getID());
 
   FormatDiagnostic(Diag.begin(), Diag.end(), OutStr);
 }
@@ -1031,9 +1049,8 @@ void clang::EscapeStringForDiagnostic(StringRef Str,
   }
 }
 
-void Diagnostic::
-FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
-                 SmallVectorImpl<char> &OutStr) const {
+void Diagnostic::FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
+                                  SmallVectorImpl<char> &OutStr) const {
   // When the diagnostic string is only "%0", the entire string is being given
   // by an outside source.  Remove unprintable characters from this string
   // and skip all the other string processing.
@@ -1067,7 +1084,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
       DiagStr = StrEnd;
       continue;
     } else if (isPunctuation(DiagStr[1])) {
-      OutStr.push_back(DiagStr[1]);  // %% -> %.
+      OutStr.push_back(DiagStr[1]); // %% -> %.
       DiagStr += 2;
       continue;
     }
@@ -1086,10 +1103,9 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
     // Check to see if we have a modifier.  If so eat it.
     if (!isDigit(DiagStr[0])) {
       Modifier = DiagStr;
-      while (DiagStr[0] == '-' ||
-             (DiagStr[0] >= 'a' && DiagStr[0] <= 'z'))
+      while (DiagStr[0] == '-' || (DiagStr[0] >= 'a' && DiagStr[0] <= 'z'))
         ++DiagStr;
-      ModifierLen = DiagStr-Modifier;
+      ModifierLen = DiagStr - Modifier;
 
       // If we have an argument, get it next.
       if (DiagStr[0] == '{') {
@@ -1098,8 +1114,8 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
 
         DiagStr = ScanFormat(DiagStr, DiagEnd, '}');
         assert(DiagStr != DiagEnd && "Mismatched {}'s in diagnostic string!");
-        ArgumentLen = DiagStr-Argument;
-        ++DiagStr;  // Skip }.
+        ArgumentLen = DiagStr - Argument;
+        ++DiagStr; // Skip }.
       }
     }
 
@@ -1113,7 +1129,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
     if (ModifierIs(Modifier, ModifierLen, "diff")) {
       assert(*DiagStr == ',' && isDigit(*(DiagStr + 1)) &&
              "Invalid format for diff modifier");
-      ++DiagStr;  // Comma.
+      ++DiagStr; // Comma.
       ArgNo2 = *DiagStr++ - '0';
       DiagnosticsEngine::ArgumentKind Kind2 = getArgKind(ArgNo2);
       if (Kind == DiagnosticsEngine::ak_qualtype &&
@@ -1131,8 +1147,8 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
                "Found too many '|'s in a %diff modifier!");
         const char *FirstDollar = ScanFormat(Argument, Pipe, '$');
         const char *SecondDollar = ScanFormat(FirstDollar + 1, Pipe, '$');
-        const char ArgStr1[] = { '%', static_cast<char>('0' + ArgNo) };
-        const char ArgStr2[] = { '%', static_cast<char>('0' + ArgNo2) };
+        const char ArgStr1[] = {'%', static_cast<char>('0' + ArgNo)};
+        const char ArgStr2[] = {'%', static_cast<char>('0' + ArgNo2)};
         FormatDiagnostic(Argument, FirstDollar, OutStr);
         FormatDiagnostic(ArgStr1, ArgStr1 + 2, OutStr);
         FormatDiagnostic(FirstDollar + 1, SecondDollar, OutStr);
@@ -1256,8 +1272,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
       getDiags()->ConvertArgToString(Kind, getRawArg(ArgNo),
                                      StringRef(Modifier, ModifierLen),
                                      StringRef(Argument, ArgumentLen),
-                                     FormattedArgs,
-                                     OutStr, QualTypeVals);
+                                     FormattedArgs, OutStr, QualTypeVals);
       break;
     case DiagnosticsEngine::ak_qualtype_pair: {
       // Create a struct with all the info needed for printing.
@@ -1280,8 +1295,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
         getDiags()->ConvertArgToString(Kind, val,
                                        StringRef(Modifier, ModifierLen),
                                        StringRef(Argument, ArgumentLen),
-                                       FormattedArgs,
-                                       Tree, QualTypeVals);
+                                       FormattedArgs, Tree, QualTypeVals);
         // If there is no tree information, fall back to regular printing.
         if (!Tree.empty()) {
           FormatDiagnostic(Pipe + 1, ArgumentEnd, OutStr);
@@ -1303,11 +1317,10 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
       getDiags()->ConvertArgToString(Kind, val,
                                      StringRef(Modifier, ModifierLen),
                                      StringRef(Argument, ArgumentLen),
-                                     FormattedArgs,
-                                     OutStr, QualTypeVals);
+                                     FormattedArgs, OutStr, QualTypeVals);
       if (!TDT.TemplateDiffUsed)
-        FormattedArgs.push_back(std::make_pair(DiagnosticsEngine::ak_qualtype,
-                                               TDT.FromType));
+        FormattedArgs.push_back(
+            std::make_pair(DiagnosticsEngine::ak_qualtype, TDT.FromType));
 
       // Append middle text
       FormatDiagnostic(FirstDollar + 1, SecondDollar, OutStr);
@@ -1317,11 +1330,10 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
       getDiags()->ConvertArgToString(Kind, val,
                                      StringRef(Modifier, ModifierLen),
                                      StringRef(Argument, ArgumentLen),
-                                     FormattedArgs,
-                                     OutStr, QualTypeVals);
+                                     FormattedArgs, OutStr, QualTypeVals);
       if (!TDT.TemplateDiffUsed)
-        FormattedArgs.push_back(std::make_pair(DiagnosticsEngine::ak_qualtype,
-                                               TDT.ToType));
+        FormattedArgs.push_back(
+            std::make_pair(DiagnosticsEngine::ak_qualtype, TDT.ToType));
 
       // Append end text
       FormatDiagnostic(SecondDollar + 1, Pipe, OutStr);
@@ -1337,8 +1349,9 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
     else if (Kind != DiagnosticsEngine::ak_std_string)
       FormattedArgs.push_back(std::make_pair(Kind, getRawArg(ArgNo)));
     else
-      FormattedArgs.push_back(std::make_pair(DiagnosticsEngine::ak_c_string,
-                                        (intptr_t)getArgStdStr(ArgNo).c_str()));
+      FormattedArgs.push_back(
+          std::make_pair(DiagnosticsEngine::ak_c_string,
+                         (intptr_t)getArgStdStr(ArgNo).c_str()));
   }
 
   // Append the type tree to the end of the diagnostics.
@@ -1352,8 +1365,9 @@ StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
 StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level,
                                    const Diagnostic &Info)
     : ID(Info.getID()), Level(Level) {
-  assert((Info.getLocation().isInvalid() || Info.hasSourceManager()) &&
-       "Valid source location without setting a source manager for diagnostic");
+  assert(
+      (Info.getLocation().isInvalid() || Info.hasSourceManager()) &&
+      "Valid source location without setting a source manager for diagnostic");
   if (Info.getLocation().isValid())
     Loc = FullSourceLoc(Info.getLocation(), Info.getSourceManager());
   SmallString<64> Message;
@@ -1368,9 +1382,8 @@ StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
                                    ArrayRef<CharSourceRange> Ranges,
                                    ArrayRef<FixItHint> FixIts)
     : ID(ID), Level(Level), Loc(Loc), Message(Message),
-      Ranges(Ranges.begin(), Ranges.end()), FixIts(FixIts.begin(), FixIts.end())
-{
-}
+      Ranges(Ranges.begin(), Ranges.end()),
+      FixIts(FixIts.begin(), FixIts.end()) {}
 
 llvm::raw_ostream &clang::operator<<(llvm::raw_ostream &OS,
                                      const StoredDiagnostic &SD) {
@@ -1391,8 +1404,7 @@ void IgnoringDiagConsumer::anchor() {}
 ForwardingDiagnosticConsumer::~ForwardingDiagnosticConsumer() = default;
 
 void ForwardingDiagnosticConsumer::HandleDiagnostic(
-       DiagnosticsEngine::Level DiagLevel,
-       const Diagnostic &Info) {
+    DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) {
   Target.HandleDiagnostic(DiagLevel, Info);
 }
 
diff --git a/clang/lib/Basic/ProfileList.cpp b/clang/lib/Basic/ProfileList.cpp
index 01b8d7a073432..f2383c76853ec 100644
--- a/clang/lib/Basic/ProfileList.cpp
+++ b/clang/lib/Basic/ProfileList.cpp
@@ -37,7 +37,7 @@ class ProfileSpecialCaseList : public llvm::SpecialCaseList {
 
   bool hasPrefix(StringRef Prefix) const {
     for (const auto &It : Sections)
-      if (It.second.Entries.count(Prefix) > 0)
+      if (It.Entries.count(Prefix) > 0)
         return true;
     return false;
   }
diff --git a/clang/lib/Basic/SanitizerSpecialCaseList.cpp b/clang/lib/Basic/SanitizerSpecialCaseList.cpp
index b02e868cdaa44..1c1e51632bd8a 100644
--- a/clang/lib/Basic/SanitizerSpecialCaseList.cpp
+++ b/clang/lib/Basic/SanitizerSpecialCaseList.cpp
@@ -38,11 +38,10 @@ SanitizerSpecialCaseList::createOrDie(const std::vector<std::string> &Paths,
 
 void SanitizerSpecialCaseList::createSanitizerSections() {
   for (auto &It : Sections) {
-    auto &S = It.second;
     SanitizerMask Mask;
 
 #define SANITIZER(NAME, ID)                                                    \
-  if (S.SectionMatcher->match(NAME))                                           \
+  if (It.SectionMatcher->match(NAME))                                           \
     Mask |= SanitizerKind::ID;
 #define SANITIZER_GROUP(NAME, ID, ALIAS) SANITIZER(NAME, ID)
 
@@ -50,7 +49,7 @@ void SanitizerSpecialCaseList::createSanitizerSections() {
 #undef SANITIZER
 #undef SANITIZER_GROUP
 
-    SanitizerSections.emplace_back(Mask, S.Entries);
+    SanitizerSections.emplace_back(Mask, It.Entries);
   }
 }
 
diff --git a/llvm/include/llvm/Support/SpecialCaseList.h b/llvm/include/llvm/Support/SpecialCaseList.h
index ca2030abdc1f5..4f4c097c7162a 100644
--- a/llvm/include/llvm/Support/SpecialCaseList.h
+++ b/llvm/include/llvm/Support/SpecialCaseList...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented May 15, 2025

@llvm/pr-subscribers-clang

Author: Qinkun Bao (qinkunbao)

Changes

In this way, SpecialCaseList::Sections can keep the order of Sections
when parsing the case list.


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

5 Files Affected:

  • (modified) clang/lib/Basic/Diagnostic.cpp (+89-77)
  • (modified) clang/lib/Basic/ProfileList.cpp (+1-1)
  • (modified) clang/lib/Basic/SanitizerSpecialCaseList.cpp (+2-3)
  • (modified) llvm/include/llvm/Support/SpecialCaseList.h (+6-4)
  • (modified) llvm/lib/Support/SpecialCaseList.cpp (+16-13)
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 538c1d18a8ac1..fcf86cc4c234c 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -67,12 +67,12 @@ const StreamingDiagnostic &clang::operator<<(const StreamingDiagnostic &DB,
   return DB;
 }
 
-static void DummyArgToStringFn(DiagnosticsEngine::ArgumentKind AK, intptr_t QT,
-                            StringRef Modifier, StringRef Argument,
-                            ArrayRef<DiagnosticsEngine::ArgumentValue> PrevArgs,
-                            SmallVectorImpl<char> &Output,
-                            void *Cookie,
-                            ArrayRef<intptr_t> QualTypeVals) {
+static void
+DummyArgToStringFn(DiagnosticsEngine::ArgumentKind AK, intptr_t QT,
+                   StringRef Modifier, StringRef Argument,
+                   ArrayRef<DiagnosticsEngine::ArgumentValue> PrevArgs,
+                   SmallVectorImpl<char> &Output, void *Cookie,
+                   ArrayRef<intptr_t> QualTypeVals) {
   StringRef Str = "<can't format argument>";
   Output.append(Str.begin(), Str.end());
 }
@@ -94,9 +94,7 @@ DiagnosticsEngine::~DiagnosticsEngine() {
   setClient(nullptr);
 }
 
-void DiagnosticsEngine::dump() const {
-  DiagStatesByLoc.dump(*SourceMgr);
-}
+void DiagnosticsEngine::dump() const { DiagStatesByLoc.dump(*SourceMgr); }
 
 void DiagnosticsEngine::dump(StringRef DiagName) const {
   DiagStatesByLoc.dump(*SourceMgr, DiagName);
@@ -259,7 +257,8 @@ void DiagnosticsEngine::DiagStateMap::dump(SourceManager &SrcMgr,
 
     bool PrintedOuterHeading = false;
     auto PrintOuterHeading = [&] {
-      if (PrintedOuterHeading) return;
+      if (PrintedOuterHeading)
+        return;
       PrintedOuterHeading = true;
 
       llvm::errs() << "File " << &File << " <FileID " << ID.getHashValue()
@@ -272,8 +271,8 @@ void DiagnosticsEngine::DiagStateMap::dump(SourceManager &SrcMgr,
         llvm::errs() << " parent " << File.Parent << " <FileID "
                      << Decomp.first.getHashValue() << "> ";
         SrcMgr.getLocForStartOfFile(Decomp.first)
-              .getLocWithOffset(Decomp.second)
-              .print(llvm::errs(), SrcMgr);
+            .getLocWithOffset(Decomp.second)
+            .print(llvm::errs(), SrcMgr);
       }
       if (File.HasLocalTransitions)
         llvm::errs() << " has_local_transitions";
@@ -286,14 +285,15 @@ void DiagnosticsEngine::DiagStateMap::dump(SourceManager &SrcMgr,
     for (DiagStatePoint &Transition : File.StateTransitions) {
       bool PrintedInnerHeading = false;
       auto PrintInnerHeading = [&] {
-        if (PrintedInnerHeading) return;
+        if (PrintedInnerHeading)
+          return;
         PrintedInnerHeading = true;
 
         PrintOuterHeading();
         llvm::errs() << "  ";
         SrcMgr.getLocForStartOfFile(ID)
-              .getLocWithOffset(Transition.Offset)
-              .print(llvm::errs(), SrcMgr);
+            .getLocWithOffset(Transition.Offset)
+            .print(llvm::errs(), SrcMgr);
         llvm::errs() << ": state " << Transition.State << ":\n";
       };
 
@@ -316,11 +316,21 @@ void DiagnosticsEngine::DiagStateMap::dump(SourceManager &SrcMgr,
         llvm::errs() << ": ";
 
         switch (Mapping.second.getSeverity()) {
-        case diag::Severity::Ignored: llvm::errs() << "ignored"; break;
-        case diag::Severity::Remark: llvm::errs() << "remark"; break;
-        case diag::Severity::Warning: llvm::errs() << "warning"; break;
-        case diag::Severity::Error: llvm::errs() << "error"; break;
-        case diag::Severity::Fatal: llvm::errs() << "fatal"; break;
+        case diag::Severity::Ignored:
+          llvm::errs() << "ignored";
+          break;
+        case diag::Severity::Remark:
+          llvm::errs() << "remark";
+          break;
+        case diag::Severity::Warning:
+          llvm::errs() << "warning";
+          break;
+        case diag::Severity::Error:
+          llvm::errs() << "error";
+          break;
+        case diag::Severity::Fatal:
+          llvm::errs() << "fatal";
+          break;
         }
 
         if (!Mapping.second.isUser())
@@ -533,16 +543,20 @@ void WarningsSpecialCaseList::processSections(DiagnosticsEngine &Diags) {
   // Drop the default section introduced by special case list, we only support
   // exact diagnostic group names.
   // FIXME: We should make this configurable in the parser instead.
-  Sections.erase("*");
+  // FIXME: C++20 can use std::erase_if(Sections, [](Section &sec) { return
+  // sec.SectionStr == "*"; });
+  Sections.erase(
+      std::remove_if(Sections.begin(), Sections.end(),
+                     [](Section &sec) { return sec.SectionStr == "*"; }),
+      Sections.end());
   // Make sure we iterate sections by their line numbers.
-  std::vector<std::pair<unsigned, const llvm::StringMapEntry<Section> *>>
-      LineAndSectionEntry;
+  std::vector<std::pair<unsigned, const Section *>> LineAndSectionEntry;
   LineAndSectionEntry.reserve(Sections.size());
   for (const auto &Entry : Sections) {
-    StringRef DiagName = Entry.getKey();
+    StringRef DiagName = Entry.SectionStr;
     // Each section has a matcher with that section's name, attached to that
     // line.
-    const auto &DiagSectionMatcher = Entry.getValue().SectionMatcher;
+    const auto &DiagSectionMatcher = Entry.SectionMatcher;
     unsigned DiagLine = DiagSectionMatcher->Globs.at(DiagName).second;
     LineAndSectionEntry.emplace_back(DiagLine, &Entry);
   }
@@ -550,7 +564,7 @@ void WarningsSpecialCaseList::processSections(DiagnosticsEngine &Diags) {
   static constexpr auto WarningFlavor = clang::diag::Flavor::WarningOrError;
   for (const auto &[_, SectionEntry] : LineAndSectionEntry) {
     SmallVector<diag::kind> GroupDiags;
-    StringRef DiagGroup = SectionEntry->getKey();
+    StringRef DiagGroup = SectionEntry->SectionStr;
     if (Diags.getDiagnosticIDs()->getDiagnosticsInGroup(
             WarningFlavor, DiagGroup, GroupDiags)) {
       StringRef Suggestion =
@@ -563,7 +577,7 @@ void WarningsSpecialCaseList::processSections(DiagnosticsEngine &Diags) {
     for (diag::kind Diag : GroupDiags)
       // We're intentionally overwriting any previous mappings here to make sure
       // latest one takes precedence.
-      DiagToSection[Diag] = &SectionEntry->getValue();
+      DiagToSection[Diag] = SectionEntry;
   }
 }
 
@@ -662,8 +676,8 @@ bool DiagnosticsEngine::EmitDiagnostic(const DiagnosticBuilder &DB,
     Diagnostic Info(this, DB);
 
     // Figure out the diagnostic level of this message.
-    DiagnosticIDs::Level DiagLevel
-      = Diags->getDiagnosticLevel(Info.getID(), Info.getLocation(), *this);
+    DiagnosticIDs::Level DiagLevel =
+        Diags->getDiagnosticLevel(Info.getID(), Info.getLocation(), *this);
 
     Emitted = (DiagLevel != DiagnosticIDs::Ignored);
     if (Emitted) {
@@ -715,7 +729,7 @@ Diagnostic::Diagnostic(const DiagnosticsEngine *DO, SourceLocation DiagLoc,
 DiagnosticConsumer::~DiagnosticConsumer() = default;
 
 void DiagnosticConsumer::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
-                                        const Diagnostic &Info) {
+                                          const Diagnostic &Info) {
   if (!IncludeInDiagnosticCounts())
     return;
 
@@ -729,7 +743,7 @@ void DiagnosticConsumer::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
 template <std::size_t StrLen>
 static bool ModifierIs(const char *Modifier, unsigned ModifierLen,
                        const char (&Str)[StrLen]) {
-  return StrLen-1 == ModifierLen && memcmp(Modifier, Str, StrLen-1) == 0;
+  return StrLen - 1 == ModifierLen && memcmp(Modifier, Str, StrLen - 1) == 0;
 }
 
 /// ScanForward - Scans forward, looking for the given character, skipping
@@ -737,20 +751,25 @@ static bool ModifierIs(const char *Modifier, unsigned ModifierLen,
 static const char *ScanFormat(const char *I, const char *E, char Target) {
   unsigned Depth = 0;
 
-  for ( ; I != E; ++I) {
-    if (Depth == 0 && *I == Target) return I;
-    if (Depth != 0 && *I == '}') Depth--;
+  for (; I != E; ++I) {
+    if (Depth == 0 && *I == Target)
+      return I;
+    if (Depth != 0 && *I == '}')
+      Depth--;
 
     if (*I == '%') {
       I++;
-      if (I == E) break;
+      if (I == E)
+        break;
 
       // Escaped characters get implicitly skipped here.
 
       // Format specifier.
       if (!isDigit(*I) && !isPunctuation(*I)) {
-        for (I++; I != E && !isDigit(*I) && *I != '{'; I++) ;
-        if (I == E) break;
+        for (I++; I != E && !isDigit(*I) && *I != '{'; I++)
+          ;
+        if (I == E)
+          break;
         if (*I == '{')
           Depth++;
       }
@@ -767,14 +786,15 @@ static const char *ScanFormat(const char *I, const char *E, char Target) {
 static void HandleSelectModifier(const Diagnostic &DInfo, unsigned ValNo,
                                  const char *Argument, unsigned ArgumentLen,
                                  SmallVectorImpl<char> &OutStr) {
-  const char *ArgumentEnd = Argument+ArgumentLen;
+  const char *ArgumentEnd = Argument + ArgumentLen;
 
   // Skip over 'ValNo' |'s.
   while (ValNo) {
     const char *NextVal = ScanFormat(Argument, ArgumentEnd, '|');
-    assert(NextVal != ArgumentEnd && "Value for integer select modifier was"
+    assert(NextVal != ArgumentEnd &&
+           "Value for integer select modifier was"
            " larger than the number of options in the diagnostic string!");
-    Argument = NextVal+1;  // Skip this string.
+    Argument = NextVal + 1; // Skip this string.
     --ValNo;
   }
 
@@ -973,15 +993,13 @@ static const char *getTokenDescForDiagnostic(tok::TokenKind Kind) {
 /// FormatDiagnostic - Format this diagnostic into a string, substituting the
 /// formal arguments into the %0 slots.  The result is appended onto the Str
 /// array.
-void Diagnostic::
-FormatDiagnostic(SmallVectorImpl<char> &OutStr) const {
+void Diagnostic::FormatDiagnostic(SmallVectorImpl<char> &OutStr) const {
   if (StoredDiagMessage.has_value()) {
     OutStr.append(StoredDiagMessage->begin(), StoredDiagMessage->end());
     return;
   }
 
-  StringRef Diag =
-    getDiags()->getDiagnosticIDs()->getDescription(getID());
+  StringRef Diag = getDiags()->getDiagnosticIDs()->getDescription(getID());
 
   FormatDiagnostic(Diag.begin(), Diag.end(), OutStr);
 }
@@ -1031,9 +1049,8 @@ void clang::EscapeStringForDiagnostic(StringRef Str,
   }
 }
 
-void Diagnostic::
-FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
-                 SmallVectorImpl<char> &OutStr) const {
+void Diagnostic::FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
+                                  SmallVectorImpl<char> &OutStr) const {
   // When the diagnostic string is only "%0", the entire string is being given
   // by an outside source.  Remove unprintable characters from this string
   // and skip all the other string processing.
@@ -1067,7 +1084,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
       DiagStr = StrEnd;
       continue;
     } else if (isPunctuation(DiagStr[1])) {
-      OutStr.push_back(DiagStr[1]);  // %% -> %.
+      OutStr.push_back(DiagStr[1]); // %% -> %.
       DiagStr += 2;
       continue;
     }
@@ -1086,10 +1103,9 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
     // Check to see if we have a modifier.  If so eat it.
     if (!isDigit(DiagStr[0])) {
       Modifier = DiagStr;
-      while (DiagStr[0] == '-' ||
-             (DiagStr[0] >= 'a' && DiagStr[0] <= 'z'))
+      while (DiagStr[0] == '-' || (DiagStr[0] >= 'a' && DiagStr[0] <= 'z'))
         ++DiagStr;
-      ModifierLen = DiagStr-Modifier;
+      ModifierLen = DiagStr - Modifier;
 
       // If we have an argument, get it next.
       if (DiagStr[0] == '{') {
@@ -1098,8 +1114,8 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
 
         DiagStr = ScanFormat(DiagStr, DiagEnd, '}');
         assert(DiagStr != DiagEnd && "Mismatched {}'s in diagnostic string!");
-        ArgumentLen = DiagStr-Argument;
-        ++DiagStr;  // Skip }.
+        ArgumentLen = DiagStr - Argument;
+        ++DiagStr; // Skip }.
       }
     }
 
@@ -1113,7 +1129,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
     if (ModifierIs(Modifier, ModifierLen, "diff")) {
       assert(*DiagStr == ',' && isDigit(*(DiagStr + 1)) &&
              "Invalid format for diff modifier");
-      ++DiagStr;  // Comma.
+      ++DiagStr; // Comma.
       ArgNo2 = *DiagStr++ - '0';
       DiagnosticsEngine::ArgumentKind Kind2 = getArgKind(ArgNo2);
       if (Kind == DiagnosticsEngine::ak_qualtype &&
@@ -1131,8 +1147,8 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
                "Found too many '|'s in a %diff modifier!");
         const char *FirstDollar = ScanFormat(Argument, Pipe, '$');
         const char *SecondDollar = ScanFormat(FirstDollar + 1, Pipe, '$');
-        const char ArgStr1[] = { '%', static_cast<char>('0' + ArgNo) };
-        const char ArgStr2[] = { '%', static_cast<char>('0' + ArgNo2) };
+        const char ArgStr1[] = {'%', static_cast<char>('0' + ArgNo)};
+        const char ArgStr2[] = {'%', static_cast<char>('0' + ArgNo2)};
         FormatDiagnostic(Argument, FirstDollar, OutStr);
         FormatDiagnostic(ArgStr1, ArgStr1 + 2, OutStr);
         FormatDiagnostic(FirstDollar + 1, SecondDollar, OutStr);
@@ -1256,8 +1272,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
       getDiags()->ConvertArgToString(Kind, getRawArg(ArgNo),
                                      StringRef(Modifier, ModifierLen),
                                      StringRef(Argument, ArgumentLen),
-                                     FormattedArgs,
-                                     OutStr, QualTypeVals);
+                                     FormattedArgs, OutStr, QualTypeVals);
       break;
     case DiagnosticsEngine::ak_qualtype_pair: {
       // Create a struct with all the info needed for printing.
@@ -1280,8 +1295,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
         getDiags()->ConvertArgToString(Kind, val,
                                        StringRef(Modifier, ModifierLen),
                                        StringRef(Argument, ArgumentLen),
-                                       FormattedArgs,
-                                       Tree, QualTypeVals);
+                                       FormattedArgs, Tree, QualTypeVals);
         // If there is no tree information, fall back to regular printing.
         if (!Tree.empty()) {
           FormatDiagnostic(Pipe + 1, ArgumentEnd, OutStr);
@@ -1303,11 +1317,10 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
       getDiags()->ConvertArgToString(Kind, val,
                                      StringRef(Modifier, ModifierLen),
                                      StringRef(Argument, ArgumentLen),
-                                     FormattedArgs,
-                                     OutStr, QualTypeVals);
+                                     FormattedArgs, OutStr, QualTypeVals);
       if (!TDT.TemplateDiffUsed)
-        FormattedArgs.push_back(std::make_pair(DiagnosticsEngine::ak_qualtype,
-                                               TDT.FromType));
+        FormattedArgs.push_back(
+            std::make_pair(DiagnosticsEngine::ak_qualtype, TDT.FromType));
 
       // Append middle text
       FormatDiagnostic(FirstDollar + 1, SecondDollar, OutStr);
@@ -1317,11 +1330,10 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
       getDiags()->ConvertArgToString(Kind, val,
                                      StringRef(Modifier, ModifierLen),
                                      StringRef(Argument, ArgumentLen),
-                                     FormattedArgs,
-                                     OutStr, QualTypeVals);
+                                     FormattedArgs, OutStr, QualTypeVals);
       if (!TDT.TemplateDiffUsed)
-        FormattedArgs.push_back(std::make_pair(DiagnosticsEngine::ak_qualtype,
-                                               TDT.ToType));
+        FormattedArgs.push_back(
+            std::make_pair(DiagnosticsEngine::ak_qualtype, TDT.ToType));
 
       // Append end text
       FormatDiagnostic(SecondDollar + 1, Pipe, OutStr);
@@ -1337,8 +1349,9 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
     else if (Kind != DiagnosticsEngine::ak_std_string)
       FormattedArgs.push_back(std::make_pair(Kind, getRawArg(ArgNo)));
     else
-      FormattedArgs.push_back(std::make_pair(DiagnosticsEngine::ak_c_string,
-                                        (intptr_t)getArgStdStr(ArgNo).c_str()));
+      FormattedArgs.push_back(
+          std::make_pair(DiagnosticsEngine::ak_c_string,
+                         (intptr_t)getArgStdStr(ArgNo).c_str()));
   }
 
   // Append the type tree to the end of the diagnostics.
@@ -1352,8 +1365,9 @@ StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
 StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level,
                                    const Diagnostic &Info)
     : ID(Info.getID()), Level(Level) {
-  assert((Info.getLocation().isInvalid() || Info.hasSourceManager()) &&
-       "Valid source location without setting a source manager for diagnostic");
+  assert(
+      (Info.getLocation().isInvalid() || Info.hasSourceManager()) &&
+      "Valid source location without setting a source manager for diagnostic");
   if (Info.getLocation().isValid())
     Loc = FullSourceLoc(Info.getLocation(), Info.getSourceManager());
   SmallString<64> Message;
@@ -1368,9 +1382,8 @@ StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
                                    ArrayRef<CharSourceRange> Ranges,
                                    ArrayRef<FixItHint> FixIts)
     : ID(ID), Level(Level), Loc(Loc), Message(Message),
-      Ranges(Ranges.begin(), Ranges.end()), FixIts(FixIts.begin(), FixIts.end())
-{
-}
+      Ranges(Ranges.begin(), Ranges.end()),
+      FixIts(FixIts.begin(), FixIts.end()) {}
 
 llvm::raw_ostream &clang::operator<<(llvm::raw_ostream &OS,
                                      const StoredDiagnostic &SD) {
@@ -1391,8 +1404,7 @@ void IgnoringDiagConsumer::anchor() {}
 ForwardingDiagnosticConsumer::~ForwardingDiagnosticConsumer() = default;
 
 void ForwardingDiagnosticConsumer::HandleDiagnostic(
-       DiagnosticsEngine::Level DiagLevel,
-       const Diagnostic &Info) {
+    DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) {
   Target.HandleDiagnostic(DiagLevel, Info);
 }
 
diff --git a/clang/lib/Basic/ProfileList.cpp b/clang/lib/Basic/ProfileList.cpp
index 01b8d7a073432..f2383c76853ec 100644
--- a/clang/lib/Basic/ProfileList.cpp
+++ b/clang/lib/Basic/ProfileList.cpp
@@ -37,7 +37,7 @@ class ProfileSpecialCaseList : public llvm::SpecialCaseList {
 
   bool hasPrefix(StringRef Prefix) const {
     for (const auto &It : Sections)
-      if (It.second.Entries.count(Prefix) > 0)
+      if (It.Entries.count(Prefix) > 0)
         return true;
     return false;
   }
diff --git a/clang/lib/Basic/SanitizerSpecialCaseList.cpp b/clang/lib/Basic/SanitizerSpecialCaseList.cpp
index b02e868cdaa44..1c1e51632bd8a 100644
--- a/clang/lib/Basic/SanitizerSpecialCaseList.cpp
+++ b/clang/lib/Basic/SanitizerSpecialCaseList.cpp
@@ -38,11 +38,10 @@ SanitizerSpecialCaseList::createOrDie(const std::vector<std::string> &Paths,
 
 void SanitizerSpecialCaseList::createSanitizerSections() {
   for (auto &It : Sections) {
-    auto &S = It.second;
     SanitizerMask Mask;
 
 #define SANITIZER(NAME, ID)                                                    \
-  if (S.SectionMatcher->match(NAME))                                           \
+  if (It.SectionMatcher->match(NAME))                                           \
     Mask |= SanitizerKind::ID;
 #define SANITIZER_GROUP(NAME, ID, ALIAS) SANITIZER(NAME, ID)
 
@@ -50,7 +49,7 @@ void SanitizerSpecialCaseList::createSanitizerSections() {
 #undef SANITIZER
 #undef SANITIZER_GROUP
 
-    SanitizerSections.emplace_back(Mask, S.Entries);
+    SanitizerSections.emplace_back(Mask, It.Entries);
   }
 }
 
diff --git a/llvm/include/llvm/Support/SpecialCaseList.h b/llvm/include/llvm/Support/SpecialCaseList.h
index ca2030abdc1f5..4f4c097c7162a 100644
--- a/llvm/include/llvm/Support/SpecialCaseList.h
+++ b/llvm/include/llvm/Support/SpecialCaseList...
[truncated]

Copy link

github-actions bot commented May 15, 2025

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

You can test this locally with the following command:
git-clang-format --diff HEAD~1 HEAD --extensions ,h,c,cpp,inc -- clang/test/OpenMP/openmp_workshare.c libcxx/test/benchmarks/algorithms/pstl.stable_sort.bench.cpp libcxx/test/benchmarks/algorithms/ranges_sort.bench.cpp libcxx/test/benchmarks/algorithms/ranges_stable_sort.bench.cpp libcxx/test/benchmarks/algorithms/sort.bench.cpp libcxx/test/benchmarks/algorithms/stable_sort.bench.cpp bolt/include/bolt/Profile/Heatmap.h bolt/lib/Profile/DataAggregator.cpp bolt/lib/Profile/Heatmap.cpp bolt/lib/Rewrite/RewriteInstance.cpp clang/include/clang/AST/ASTConcept.h clang/include/clang/AST/ASTDiagnostic.h clang/include/clang/AST/Decl.h clang/include/clang/AST/DeclTemplate.h clang/include/clang/AST/OpenACCClause.h clang/include/clang/AST/OpenMPClause.h clang/include/clang/AST/Type.h clang/include/clang/Basic/Module.h clang/include/clang/Frontend/CommandLineSourceLoc.h clang/include/clang/Sema/Sema.h clang/include/clang/Sema/SemaHLSL.h clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h clang/lib/AST/ASTConcept.cpp clang/lib/AST/ASTDiagnostic.cpp clang/lib/AST/ByteCode/Compiler.cpp clang/lib/AST/ByteCode/Compiler.h clang/lib/AST/ByteCode/Context.cpp clang/lib/AST/ByteCode/Interp.cpp clang/lib/AST/Decl.cpp clang/lib/AST/DeclTemplate.cpp clang/lib/AST/OpenACCClause.cpp clang/lib/AST/Type.cpp clang/lib/Basic/Diagnostic.cpp clang/lib/Basic/ProfileList.cpp clang/lib/Basic/SanitizerSpecialCaseList.cpp clang/lib/Basic/Targets/PPC.cpp clang/lib/CodeGen/CGBuiltin.cpp clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CGExpr.cpp clang/lib/CodeGen/CGExprScalar.cpp clang/lib/CodeGen/CGHLSLBuiltins.cpp clang/lib/CodeGen/CGHLSLRuntime.h clang/lib/CodeGen/CodeGenFunction.h clang/lib/CodeGen/CodeGenModule.cpp clang/lib/CodeGen/CodeGenTypes.cpp clang/lib/CodeGen/ItaniumCXXABI.cpp clang/lib/CodeGen/TargetBuiltins/ARM.cpp clang/lib/Driver/SanitizerArgs.cpp clang/lib/Frontend/CompilerInvocation.cpp clang/lib/Headers/__clang_hip_cmath.h clang/lib/Parse/ParseOpenMP.cpp clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.cpp clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.h clang/lib/Sema/HLSLExternalSemaSource.cpp clang/lib/Sema/SemaChecking.cpp clang/lib/Sema/SemaDeclCXX.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaExprMember.cpp clang/lib/Sema/SemaHLSL.cpp clang/lib/Sema/SemaInit.cpp clang/lib/Sema/SemaOverload.cpp clang/lib/Sema/SemaTemplate.cpp clang/lib/Sema/SemaTemplateDeduction.cpp clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp clang/lib/StaticAnalyzer/Core/BugReporter.cpp clang/lib/StaticAnalyzer/Core/CoreEngine.cpp clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp clang/lib/StaticAnalyzer/Core/ExprEngine.cpp clang/lib/StaticAnalyzer/Core/SymbolManager.cpp clang/test/AST/ByteCode/builtin-bit-cast.cpp clang/test/AST/ByteCode/cxx20.cpp clang/test/CodeGen/AArch64/fp8-init-list.c clang/test/CodeGen/AArch64/fp8-intrinsics/acle_sve2_fp8_fdot.c clang/test/CodeGen/AArch64/fp8-intrinsics/acle_sve2_fp8_fmla.c clang/test/CodeGen/RISCV/attr-riscv-rvv-vector-bits-less-8-call.c clang/test/CodeGen/RISCV/attr-riscv-rvv-vector-bits-less-8-cast.c clang/test/CodeGen/RISCV/attr-rvv-vector-bits-bitcast-less-8.c clang/test/CodeGen/RISCV/attr-rvv-vector-bits-cast.c clang/test/CodeGen/RISCV/attr-rvv-vector-bits-codegen.c clang/test/CodeGen/RISCV/attr-rvv-vector-bits-globals.c clang/test/CodeGen/arm-mfp8.c clang/test/CodeGen/builtins-arm64.c clang/test/CodeGen/builtins-wasm.c clang/test/CodeGen/dllexport.c clang/test/CodeGen/dllimport.c clang/test/CodeGen/dso-local-executable.c clang/test/CodeGenCXX/dllexport-members.cpp clang/test/CodeGenCXX/dllexport-missing-key.cpp clang/test/CodeGenCXX/dllexport.cpp clang/test/CodeGenCXX/dllimport-members.cpp clang/test/CodeGenCXX/dllimport-missing-key.cpp clang/test/CodeGenCXX/dllimport-rtti.cpp clang/test/CodeGenCXX/dllimport.cpp clang/test/CodeGenCXX/dso-local-executable.cpp clang/test/CodeGenCXX/mingw-template-dllexport.cpp clang/test/CodeGenCXX/rtti-mingw64.cpp clang/test/CodeGenCXX/virt-dtor-key.cpp clang/test/CodeGenCXX/vtable-key-function-ios.cpp clang/test/Driver/fsanitize.c clang/test/Driver/ppc-mrop-protection-support-check.c clang/test/Driver/print-supported-extensions-riscv.c clang/test/Driver/riscv-arch.c clang/test/Preprocessor/riscv-target-features.c clang/test/Sema/atomic-expr.c clang/test/SemaCXX/cxx2a-consteval.cpp clang/test/SemaCXX/cxx2b-deducing-this.cpp clang/test/SemaCXX/dllexport.cpp clang/test/SemaCXX/dllimport.cpp clang/tools/clang-refactor/ClangRefactor.cpp clang/utils/TableGen/NeonEmitter.cpp compiler-rt/lib/builtins/clear_cache.c compiler-rt/lib/builtins/cpu_model/aarch64.c compiler-rt/lib/builtins/cpu_model/aarch64.h compiler-rt/lib/builtins/fp_compare_impl.inc compiler-rt/lib/builtins/fp_lib.h compiler-rt/lib/builtins/udivmodti4.c compiler-rt/test/builtins/Unit/enable_execute_stack_test.c compiler-rt/test/builtins/Unit/fixunstfdi_test.c compiler-rt/test/builtins/Unit/multc3_test.c flang-rt/lib/runtime/assign.cpp flang/include/flang/Parser/preprocessor.h flang/include/flang/Semantics/symbol.h flang/lib/Lower/OpenMP/ClauseProcessor.cpp flang/lib/Lower/OpenMP/Utils.cpp flang/lib/Parser/preprocessor.cpp flang/lib/Semantics/expression.cpp libcxx/include/__format/format_functions.h libcxx/include/__fwd/pair.h libcxx/include/__memory/uses_allocator_construction.h libcxx/include/__node_handle libcxx/include/__tree libcxx/include/map libcxx/include/print libcxx/test/benchmarks/format/format.bench.cpp libcxx/test/libcxx/containers/associative/tree_key_value_traits.pass.cpp libcxx/test/std/algorithms/alg.modifying.operations/alg.swap/ranges.swap_ranges.pass.cpp libcxx/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp libcxx/test/std/localization/codecvt_unicode.pass.cpp libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_in.pass.cpp libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_out.pass.cpp libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_in.pass.cpp libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_out.pass.cpp libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/assign2.pass.cpp lld/COFF/COFFLinkerContext.h lld/COFF/Chunks.cpp lld/COFF/DLL.cpp lld/COFF/Driver.cpp lld/COFF/InputFiles.cpp lld/COFF/SymbolTable.cpp lld/COFF/Writer.cpp lld/ELF/Arch/ARM.cpp lld/ELF/Driver.cpp lld/ELF/Writer.cpp lldb/include/lldb/Core/Address.h lldb/source/Core/Address.cpp lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/source/Target/DynamicRegisterInfo.cpp lldb/source/Target/Process.cpp lldb/source/Target/RegisterContextUnwind.cpp lldb/tools/lldb-dap/DAP.cpp lldb/tools/lldb-dap/DAP.h lldb/tools/lldb-dap/Handler/RequestHandler.h lldb/tools/lldb-dap/Handler/ScopesRequestHandler.cpp lldb/tools/lldb-dap/JSONUtils.cpp lldb/tools/lldb-dap/JSONUtils.h lldb/tools/lldb-dap/Protocol/ProtocolRequests.cpp lldb/tools/lldb-dap/Protocol/ProtocolRequests.h lldb/tools/lldb-dap/Protocol/ProtocolTypes.cpp lldb/tools/lldb-dap/Protocol/ProtocolTypes.h lldb/unittests/DAP/ProtocolTypesTest.cpp llvm/include/llvm/ADT/APFixedPoint.h llvm/include/llvm/ADT/APFloat.h llvm/include/llvm/ADT/APInt.h llvm/include/llvm/ADT/BitmaskEnum.h llvm/include/llvm/ADT/DynamicAPInt.h llvm/include/llvm/ADT/SlowDynamicAPInt.h llvm/include/llvm/ADT/TrieRawHashMap.h llvm/include/llvm/ADT/Twine.h llvm/include/llvm/Analysis/AliasAnalysis.h llvm/include/llvm/Analysis/LoopAccessAnalysis.h llvm/include/llvm/Analysis/TargetTransformInfo.h llvm/include/llvm/CodeGen/ISDOpcodes.h llvm/include/llvm/CodeGen/Passes.h llvm/include/llvm/IR/DerivedTypes.h llvm/include/llvm/IR/IRBuilder.h llvm/include/llvm/Support/BranchProbability.h llvm/include/llvm/Support/ConvertUTF.h llvm/include/llvm/Support/DebugCounter.h llvm/include/llvm/Support/FileOutputBuffer.h llvm/include/llvm/Support/KnownBits.h llvm/include/llvm/Support/SMTAPI.h llvm/include/llvm/Support/ScaledNumber.h llvm/include/llvm/Support/SpecialCaseList.h llvm/include/llvm/TableGen/DirectiveEmitter.h llvm/include/llvm/Transforms/Utils/LoopPeel.h llvm/lib/Analysis/AliasAnalysis.cpp llvm/lib/Analysis/LoopAccessAnalysis.cpp llvm/lib/Analysis/ValueTracking.cpp llvm/lib/CodeGen/CodeGenPrepare.cpp llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp llvm/lib/IR/AutoUpgrade.cpp llvm/lib/IR/IRBuilder.cpp llvm/lib/IR/Verifier.cpp llvm/lib/LTO/LTOBackend.cpp llvm/lib/Passes/PassBuilder.cpp llvm/lib/Passes/PassBuilderPipelines.cpp llvm/lib/ProfileData/InstrProfWriter.cpp llvm/lib/Support/APFixedPoint.cpp llvm/lib/Support/ConvertUTFWrapper.cpp llvm/lib/Support/DebugCounter.cpp llvm/lib/Support/DynamicAPInt.cpp llvm/lib/Support/FileOutputBuffer.cpp llvm/lib/Support/KnownBits.cpp llvm/lib/Support/ScaledNumber.cpp llvm/lib/Support/SlowDynamicAPInt.cpp llvm/lib/Support/SpecialCaseList.cpp llvm/lib/Support/Z3Solver.cpp llvm/lib/Target/AArch64/AArch64FrameLowering.cpp llvm/lib/Target/AArch64/AArch64ISelLowering.cpp llvm/lib/Target/AArch64/AArch64ISelLowering.h llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.cpp llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.h llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp llvm/lib/Target/DirectX/DXILShaderFlags.cpp llvm/lib/Target/DirectX/DXILShaderFlags.h llvm/lib/Target/M68k/M68kISelDAGToDAG.cpp llvm/lib/Target/M68k/M68kISelLowering.cpp llvm/lib/Target/M68k/M68kISelLowering.h llvm/lib/Target/M68k/M68kSubtarget.cpp llvm/lib/Target/M68k/M68kSubtarget.h llvm/lib/Target/NVPTX/NVPTXAliasAnalysis.h llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h llvm/lib/Target/RISCV/RISCVISelLowering.cpp llvm/lib/Target/RISCV/RISCVInstrInfo.cpp llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp llvm/lib/Target/RISCV/RISCVTargetMachine.cpp llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp llvm/lib/Target/X86/X86ISelLowering.cpp llvm/lib/TargetParser/RISCVISAInfo.cpp llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp llvm/lib/Transforms/IPO/SampleProfile.cpp llvm/lib/Transforms/InstCombine/InstructionCombining.cpp llvm/lib/Transforms/Scalar/ConstraintElimination.cpp llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp llvm/lib/Transforms/Scalar/LoopFuse.cpp llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp llvm/lib/Transforms/Utils/CloneFunction.cpp llvm/lib/Transforms/Utils/LoopPeel.cpp llvm/lib/Transforms/Utils/MemoryTaggingSupport.cpp llvm/lib/Transforms/Vectorize/LoopVectorize.cpp llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp llvm/lib/Transforms/Vectorize/VPlan.h llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp llvm/tools/llvm-objdump/llvm-objdump.cpp llvm/unittests/ADT/BitmaskEnumTest.cpp llvm/unittests/Support/FileOutputBufferTest.cpp llvm/unittests/Target/AArch64/SMEAttributesTest.cpp llvm/unittests/TargetParser/RISCVISAInfoTest.cpp llvm/unittests/Transforms/Vectorize/VPlanTest.cpp llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp llvm/utils/TableGen/Basic/DirectiveEmitter.cpp llvm/utils/TableGen/FastISelEmitter.cpp llvm/utils/TableGen/X86RecognizableInstr.cpp mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h mlir/include/mlir/IR/OpImplementation.h mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h mlir/lib/AsmParser/AsmParserImpl.h mlir/lib/AsmParser/Lexer.cpp mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp mlir/lib/Dialect/Linalg/Transforms/DataLayoutPropagation.cpp mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp mlir/lib/Dialect/Mesh/IR/MeshOps.cpp mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp mlir/lib/Dialect/Quant/IR/QuantOps.cpp mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp mlir/lib/Dialect/Vector/IR/VectorOps.cpp mlir/lib/Dialect/Vector/Transforms/VectorLinearize.cpp mlir/lib/Dialect/X86Vector/IR/X86VectorDialect.cpp mlir/lib/Dialect/X86Vector/Transforms/LegalizeForLLVMExport.cpp mlir/lib/ExecutionEngine/JitRunner.cpp mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp mlir/lib/Target/LLVMIR/ModuleTranslation.cpp mlir/test/lib/Dialect/Test/TestAttributes.cpp mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp mlir/tools/mlir-tblgen/DialectGen.cpp mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp mlir/tools/mlir-tblgen/OpInterfacesGen.cpp openmp/runtime/test/ompt/callback.h offload/test/offloading/gpupgo/pgo1.c offload/test/offloading/gpupgo/pgo2.c
View the diff from clang-format here.
diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h
index 80c97681d..a99cb1286 100644
--- a/clang/include/clang/AST/DeclTemplate.h
+++ b/clang/include/clang/AST/DeclTemplate.h
@@ -1325,8 +1325,8 @@ public:
   /// Returns the type constraint associated with this template parameter (if
   /// any).
   const TypeConstraint *getTypeConstraint() const {
-    return TypeConstraintInitialized ? getTrailingObjects<TypeConstraint>() :
-         nullptr;
+    return TypeConstraintInitialized ? getTrailingObjects<TypeConstraint>()
+                                     : nullptr;
   }
 
   void setTypeConstraint(ConceptReference *CR,
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
index 3754e2550..bd0c3d00b 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
@@ -508,9 +508,7 @@ namespace llvm {
     using ChildIteratorType = clang::ento::ExplodedNode::succ_iterator;
     using nodes_iterator = llvm::df_iterator<GraphTy>;
 
-    static NodeRef getEntryNode(const GraphTy G) {
-      return *G->roots_begin();
-    }
+    static NodeRef getEntryNode(const GraphTy G) { return *G->roots_begin(); }
 
     static bool predecessorOfTrivial(NodeRef N) {
       return N->succ_size() == 1 && N->getFirstSucc()->isTrivial();
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index 70b53be7e..7c3c3da1b 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -4040,11 +4040,10 @@ static llvm::GlobalVariable::LinkageTypes getTypeInfoLinkage(CodeGenModule &CGM,
             ShouldUseExternalRTTIDescriptor(CGM, Ty))
           return llvm::GlobalValue::ExternalLinkage;
       // MinGW always uses LinkOnceODRLinkage for type info.
-      if (RD->isDynamicClass() &&
-          !CGM.getContext()
-               .getTargetInfo()
-               .getTriple()
-               .isWindowsGNUEnvironment())
+      if (RD->isDynamicClass() && !CGM.getContext()
+                                       .getTargetInfo()
+                                       .getTriple()
+                                       .isWindowsGNUEnvironment())
         return CGM.getVTableLinkage(RD);
     }
 
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 394512978..c1ddd0a04 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -3114,7 +3114,7 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
       ParsedSourceLocation::FromString(A->getValue());
     if (Opts.CodeCompletionAt.FileName.empty())
       Diags.Report(diag::err_drv_invalid_value)
-        << A->getAsString(Args) << A->getValue();
+          << A->getAsString(Args) << A->getValue();
   }
 
   Opts.Plugins = Args.getAllArgValues(OPT_load);
diff --git a/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp b/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
index 8ba304b3a..3064b19ba 100644
--- a/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
@@ -545,8 +545,7 @@ void CoreEngine::HandleVirtualBaseBranch(const CFGBlock *B,
 
 /// generateNode - Utility method to generate nodes, hook up successors,
 ///  and add nodes to the worklist.
-void CoreEngine::generateNode(const ProgramPoint &Loc,
-                              ProgramStateRef State,
+void CoreEngine::generateNode(const ProgramPoint &Loc, ProgramStateRef State,
                               ExplodedNode *Pred) {
   bool IsNew;
   ExplodedNode *Node = G.getNode(Loc, State, false, &IsNew);
diff --git a/compiler-rt/test/builtins/Unit/fixunstfdi_test.c b/compiler-rt/test/builtins/Unit/fixunstfdi_test.c
index d9f02bf47..56fcba15b 100644
--- a/compiler-rt/test/builtins/Unit/fixunstfdi_test.c
+++ b/compiler-rt/test/builtins/Unit/fixunstfdi_test.c
@@ -6,7 +6,7 @@
 
 #if _ARCH_PPC || __aarch64__
 
-#include "int_lib.h"
+#  include "int_lib.h"
 
 // Returns: convert a to a unsigned long long, rounding toward zero.
 //          Negative values all become zero.
@@ -36,77 +36,77 @@ char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0};
 int main()
 {
 #if _ARCH_PPC || __aarch64__
-    if (test__fixunstfdi(0.0, 0))
-        return 1;
-
-    if (test__fixunstfdi(0.5, 0))
-        return 1;
-    if (test__fixunstfdi(0.99, 0))
-        return 1;
-    if (test__fixunstfdi(1.0, 1))
-        return 1;
-    if (test__fixunstfdi(1.5, 1))
-        return 1;
-    if (test__fixunstfdi(1.99, 1))
-        return 1;
-    if (test__fixunstfdi(2.0, 2))
-        return 1;
-    if (test__fixunstfdi(2.01, 2))
-        return 1;
-    if (test__fixunstfdi(-0.5, 0))
-        return 1;
-    if (test__fixunstfdi(-0.99, 0))
-        return 1;
-    if (test__fixunstfdi(-1.0, 0))
-        return 1;
-    if (test__fixunstfdi(-1.5, 0))
-        return 1;
-    if (test__fixunstfdi(-1.99, 0))
-        return 1;
-    if (test__fixunstfdi(-2.0, 0))
-        return 1;
-    if (test__fixunstfdi(-2.01, 0))
-        return 1;
-
-    if (test__fixunstfdi(0x1.FFFFFEp+62, 0x7FFFFF8000000000LL))
-        return 1;
-    if (test__fixunstfdi(0x1.FFFFFCp+62, 0x7FFFFF0000000000LL))
-        return 1;
-
-    if (test__fixunstfdi(-0x1.FFFFFEp+62, 0))
-        return 1;
-    if (test__fixunstfdi(-0x1.FFFFFCp+62, 0))
-        return 1;
-
-    if (test__fixunstfdi(0x1.FFFFFFFFFFFFFp+62, 0x7FFFFFFFFFFFFC00LL))
-        return 1;
-    if (test__fixunstfdi(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL))
-        return 1;
-
-    if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFp+62, 0))
-        return 1;
-    if (test__fixunstfdi(-0x1.FFFFFFFFFFFFEp+62, 0))
-        return 1;
-
-    if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFFEp+63L, 0xFFFFFFFFFFFFFFFFLL))
-        return 1;
-    if (test__fixunstfdi(0x1.0000000000000002p+63L, 0x8000000000000001LL))
-        return 1;
-    if (test__fixunstfdi(0x1.0000000000000000p+63L, 0x8000000000000000LL))
-        return 1;
-    if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFFCp+62L, 0x7FFFFFFFFFFFFFFFLL))
-        return 1;
-    if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFF8p+62L, 0x7FFFFFFFFFFFFFFELL))
-        return 1;
-    if (test__fixunstfdi(0x1.p+64L, 0xFFFFFFFFFFFFFFFFLL))
-        return 1;
-
-    if (test__fixunstfdi(-0x1.0000000000000000p+63L, 0))
-        return 1;
-    if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFFFCp+62L, 0))
-        return 1;
-    if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFFF8p+62L, 0))
-        return 1;
+  if (test__fixunstfdi(0.0, 0))
+    return 1;
+
+  if (test__fixunstfdi(0.5, 0))
+    return 1;
+  if (test__fixunstfdi(0.99, 0))
+    return 1;
+  if (test__fixunstfdi(1.0, 1))
+    return 1;
+  if (test__fixunstfdi(1.5, 1))
+    return 1;
+  if (test__fixunstfdi(1.99, 1))
+    return 1;
+  if (test__fixunstfdi(2.0, 2))
+    return 1;
+  if (test__fixunstfdi(2.01, 2))
+    return 1;
+  if (test__fixunstfdi(-0.5, 0))
+    return 1;
+  if (test__fixunstfdi(-0.99, 0))
+    return 1;
+  if (test__fixunstfdi(-1.0, 0))
+    return 1;
+  if (test__fixunstfdi(-1.5, 0))
+    return 1;
+  if (test__fixunstfdi(-1.99, 0))
+    return 1;
+  if (test__fixunstfdi(-2.0, 0))
+    return 1;
+  if (test__fixunstfdi(-2.01, 0))
+    return 1;
+
+  if (test__fixunstfdi(0x1.FFFFFEp+62, 0x7FFFFF8000000000LL))
+    return 1;
+  if (test__fixunstfdi(0x1.FFFFFCp+62, 0x7FFFFF0000000000LL))
+    return 1;
+
+  if (test__fixunstfdi(-0x1.FFFFFEp+62, 0))
+    return 1;
+  if (test__fixunstfdi(-0x1.FFFFFCp+62, 0))
+    return 1;
+
+  if (test__fixunstfdi(0x1.FFFFFFFFFFFFFp+62, 0x7FFFFFFFFFFFFC00LL))
+    return 1;
+  if (test__fixunstfdi(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL))
+    return 1;
+
+  if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFp+62, 0))
+    return 1;
+  if (test__fixunstfdi(-0x1.FFFFFFFFFFFFEp+62, 0))
+    return 1;
+
+  if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFFEp+63L, 0xFFFFFFFFFFFFFFFFLL))
+    return 1;
+  if (test__fixunstfdi(0x1.0000000000000002p+63L, 0x8000000000000001LL))
+    return 1;
+  if (test__fixunstfdi(0x1.0000000000000000p+63L, 0x8000000000000000LL))
+    return 1;
+  if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFFCp+62L, 0x7FFFFFFFFFFFFFFFLL))
+    return 1;
+  if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFF8p+62L, 0x7FFFFFFFFFFFFFFELL))
+    return 1;
+  if (test__fixunstfdi(0x1.p+64L, 0xFFFFFFFFFFFFFFFFLL))
+    return 1;
+
+  if (test__fixunstfdi(-0x1.0000000000000000p+63L, 0))
+    return 1;
+  if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFFFCp+62L, 0))
+    return 1;
+  if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFFF8p+62L, 0))
+    return 1;
 
 #else
     printf("skipped\n");
diff --git a/compiler-rt/test/builtins/Unit/multc3_test.c b/compiler-rt/test/builtins/Unit/multc3_test.c
index 06f55a68d..dbc7174b3 100644
--- a/compiler-rt/test/builtins/Unit/multc3_test.c
+++ b/compiler-rt/test/builtins/Unit/multc3_test.c
@@ -6,9 +6,9 @@
 
 #if _ARCH_PPC || __aarch64__
 
-#include "int_lib.h"
-#include <math.h>
-#include <complex.h>
+#  include "int_lib.h"
+#  include <math.h>
+#  include <complex.h>
 
 // Returns: the product of a + ib and c + id
 
@@ -349,16 +349,14 @@ long double x[][2] =
 int main()
 {
 #if _ARCH_PPC || __aarch64__
-    const unsigned N = sizeof(x) / sizeof(x[0]);
-    unsigned i, j;
-    for (i = 0; i < N; ++i)
-    {
-        for (j = 0; j < N; ++j)
-        {
-            if (test__multc3(x[i][0], x[i][1], x[j][0], x[j][1]))
-                return 1;
-        }
+  const unsigned N = sizeof(x) / sizeof(x[0]);
+  unsigned i, j;
+  for (i = 0; i < N; ++i) {
+    for (j = 0; j < N; ++j) {
+      if (test__multc3(x[i][0], x[i][1], x[j][0], x[j][1]))
+        return 1;
     }
+  }
 #else
     printf("skipped\n");
 #endif
diff --git a/lldb/include/lldb/Core/Address.h b/lldb/include/lldb/Core/Address.h
index 9b5874f8b..a7822301b 100644
--- a/lldb/include/lldb/Core/Address.h
+++ b/lldb/include/lldb/Core/Address.h
@@ -385,8 +385,9 @@ public:
   ///     Returns \b false if the function/symbol could not be resolved
   ///     or if the address range was requested and could not be resolved;
   ///     returns \b true otherwise.
-  bool ResolveFunctionScope(lldb_private::SymbolContext &sym_ctx,
-                            lldb_private::AddressRange *addr_range_ptr = nullptr);
+  bool
+  ResolveFunctionScope(lldb_private::SymbolContext &sym_ctx,
+                       lldb_private::AddressRange *addr_range_ptr = nullptr);
 
   /// Set the address to represent \a load_addr.
   ///
diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp
index 1dab874a9..9fbc0e929 100644
--- a/lldb/source/Core/Address.cpp
+++ b/lldb/source/Core/Address.cpp
@@ -263,7 +263,8 @@ bool Address::ResolveAddressUsingFileSections(addr_t file_addr,
   return false; // Failed to resolve this address to a section offset value
 }
 
-/// if "addr_range_ptr" is not NULL, then fill in with the address range of the function.
+/// if "addr_range_ptr" is not NULL, then fill in with the address range of the
+/// function.
 bool Address::ResolveFunctionScope(SymbolContext &sym_ctx,
                                    AddressRange *addr_range_ptr) {
   constexpr SymbolContextItem resolve_scope =
@@ -272,7 +273,7 @@ bool Address::ResolveFunctionScope(SymbolContext &sym_ctx,
   if (!(CalculateSymbolContext(&sym_ctx, resolve_scope) & resolve_scope)) {
     if (addr_range_ptr)
       addr_range_ptr->Clear();
-   return false;
+    return false;
   }
 
   if (!addr_range_ptr)
diff --git a/lldb/source/Target/RegisterContextUnwind.cpp b/lldb/source/Target/RegisterContextUnwind.cpp
index cf4b96c6e..c2bc52208 100644
--- a/lldb/source/Target/RegisterContextUnwind.cpp
+++ b/lldb/source/Target/RegisterContextUnwind.cpp
@@ -525,8 +525,10 @@ void RegisterContextUnwind::InitializeNonZerothFrame() {
     // sigtramp.
     decr_pc_and_recompute_addr_range = false;
   } else if (!addr_range.GetBaseAddress().IsValid() ||
-             addr_range.GetBaseAddress().GetSection() != m_current_pc.GetSection() ||
-             addr_range.GetBaseAddress().GetOffset() != m_current_pc.GetOffset()) {
+             addr_range.GetBaseAddress().GetSection() !=
+                 m_current_pc.GetSection() ||
+             addr_range.GetBaseAddress().GetOffset() !=
+                 m_current_pc.GetOffset()) {
     // If our "current" pc isn't the start of a function, decrement the pc
     // if we're up the stack.
     if (m_behaves_like_zeroth_frame)
diff --git a/llvm/include/llvm/CodeGen/Passes.h b/llvm/include/llvm/CodeGen/Passes.h
index d214ab930..428fc35f8 100644
--- a/llvm/include/llvm/CodeGen/Passes.h
+++ b/llvm/include/llvm/CodeGen/Passes.h
@@ -14,9 +14,9 @@
 #ifndef LLVM_CODEGEN_PASSES_H
 #define LLVM_CODEGEN_PASSES_H
 
+#include "llvm/CodeGen/RegAllocCommon.h"
 #include "llvm/Support/CodeGen.h"
 #include "llvm/Support/Discriminator.h"
-#include "llvm/CodeGen/RegAllocCommon.h"
 
 #include <functional>
 #include <string>
@@ -36,587 +36,587 @@ namespace vfs {
 class FileSystem;
 } // namespace vfs
 
-} // End llvm namespace
+} // namespace llvm
 
 // List of target independent CodeGen pass IDs.
 namespace llvm {
 
-  /// AtomicExpandPass - At IR level this pass replace atomic instructions with
-  /// __atomic_* library calls, or target specific instruction which implement the
-  /// same semantics in a way which better fits the target backend.
-  FunctionPass *createAtomicExpandLegacyPass();
-
-  /// createUnreachableBlockEliminationPass - The LLVM code generator does not
-  /// work well with unreachable basic blocks (what live ranges make sense for a
-  /// block that cannot be reached?).  As such, a code generator should either
-  /// not instruction select unreachable blocks, or run this pass as its
-  /// last LLVM modifying pass to clean up blocks that are not reachable from
-  /// the entry block.
-  FunctionPass *createUnreachableBlockEliminationPass();
-
-  /// createGCEmptyBasicblocksPass - Empty basic blocks (basic blocks without
-  /// real code) appear as the result of optimization passes removing
-  /// instructions. These blocks confuscate profile analysis (e.g., basic block
-  /// sections) since they will share the address of their fallthrough blocks.
-  /// This pass garbage-collects such basic blocks.
-  MachineFunctionPass *createGCEmptyBasicBlocksPass();
-
-  /// createBasicBlockSections Pass - This pass assigns sections to machine
-  /// basic blocks and is enabled with -fbasic-block-sections.
-  MachineFunctionPass *createBasicBlockSectionsPass();
-
-  MachineFunctionPass *createBasicBlockPathCloningPass();
+/// AtomicExpandPass - At IR level this pass replace atomic instructions with
+/// __atomic_* library calls, or target specific instruction which implement the
+/// same semantics in a way which better fits the target backend.
+FunctionPass *createAtomicExpandLegacyPass();
+
+/// createUnreachableBlockEliminationPass - The LLVM code generator does not
+/// work well with unreachable basic blocks (what live ranges make sense for a
+/// block that cannot be reached?).  As such, a code generator should either
+/// not instruction select unreachable blocks, or run this pass as its
+/// last LLVM modifying pass to clean up blocks that are not reachable from
+/// the entry block.
+FunctionPass *createUnreachableBlockEliminationPass();
+
+/// createGCEmptyBasicblocksPass - Empty basic blocks (basic blocks without
+/// real code) appear as the result of optimization passes removing
+/// instructions. These blocks confuscate profile analysis (e.g., basic block
+/// sections) since they will share the address of their fallthrough blocks.
+/// This pass garbage-collects such basic blocks.
+MachineFunctionPass *createGCEmptyBasicBlocksPass();
+
+/// createBasicBlockSections Pass - This pass assigns sections to machine
+/// basic blocks and is enabled with -fbasic-block-sections.
+MachineFunctionPass *createBasicBlockSectionsPass();
+
+MachineFunctionPass *createBasicBlockPathCloningPass();
 
-  /// createMachineFunctionSplitterPass - This pass splits machine functions
-  /// using profile information.
-  MachineFunctionPass *createMachineFunctionSplitterPass();
+/// createMachineFunctionSplitterPass - This pass splits machine functions
+/// using profile information.
+MachineFunctionPass *createMachineFunctionSplitterPass();
 
-  /// createStaticDataSplitterPass - This is a machine-function pass that
-  /// categorizes static data hotness using profile information.
-  MachineFunctionPass *createStaticDataSplitterPass();
+/// createStaticDataSplitterPass - This is a machine-function pass that
+/// categorizes static data hotness using profile information.
+MachineFunctionPass *createStaticDataSplitterPass();
 
-  /// createStaticDataAnnotatorPASS - This is a module pass that reads from
-  /// StaticDataProfileInfoWrapperPass and annotates the section prefix of
-  /// global variables.
-  ModulePass *createStaticDataAnnotatorPass();
-
-  /// MachineFunctionPrinter pass - This pass prints out the machine function to
-  /// the given stream as a debugging tool.
-  MachineFunctionPass *
-  createMachineFunctionPrinterPass(raw_ostream &OS,
-                                   const std::string &Banner ="");
+/// createStaticDataAnnotatorPASS - This is a module pass that reads from
+/// StaticDataProfileInfoWrapperPass and annotates the section prefix of
+/// global variables.
+ModulePass *createStaticDataAnnotatorPass();
+
+/// MachineFunctionPrinter pass - This pass prints out the machine function to
+/// the given stream as a debugging tool.
+MachineFunctionPass *
+createMachineFunctionPrinterPass(raw_ostream &OS,
+                                 const std::string &Banner = "");
 
-  /// StackFramePrinter pass - This pass prints out the machine function's
-  /// stack frame to the given stream as a debugging tool.
-  MachineFunctionPass *createStackFrameLayoutAnalysisPass();
+/// StackFramePrinter pass - This pass prints out the machine function's
+/// stack frame to the given stream as a debugging tool.
+MachineFunctionPass *createStackFrameLayoutAnalysisPass();
 
-  /// MIRPrinting pass - this pass prints out the LLVM IR into the given stream
-  /// using the MIR serialization format.
-  MachineFunctionPass *createPrintMIRPass(raw_ostream &OS);
+/// MIRPrinting pass - this pass prints out the LLVM IR into the given stream
+/// using the MIR serialization format.
+MachineFunctionPass *createPrintMIRPass(raw_ostream &OS);
 
-  /// This pass resets a MachineFunction when it has the FailedISel property
-  /// as if it was just created.
-  /// If EmitFallbackDiag is true, the pass will emit a
-  /// DiagnosticInfoISelFallback for every MachineFunction it resets.
-  /// If AbortOnFailedISel is true, abort compilation instead of resetting.
-  MachineFunctionPass *createResetMachineFunctionPass(bool EmitFallbackDiag,
-                                                      bool AbortOnFailedISel);
+/// This pass resets a MachineFunction when it has the FailedISel property
+/// as if it was just created.
+/// If EmitFallbackDiag is true, the pass will emit a
+/// DiagnosticInfoISelFallback for every MachineFunction it resets.
+/// If AbortOnFailedISel is true, abort compilation instead of resetting.
+MachineFunctionPass *createResetMachineFunctionPass(bool EmitFallbackDiag,
+                                                    bool AbortOnFailedISel);
 
-  /// createCodeGenPrepareLegacyPass - Transform the code to expose more pattern
-  /// matching during instruction selection.
-  FunctionPass *createCodeGenPrepareLegacyPass();
+/// createCodeGenPrepareLegacyPass - Transform the code to expose more pattern
+/// matching during instruction selection.
+FunctionPass *createCodeGenPrepareLegacyPass();
 
-  /// This pass implements generation of target-specific intrinsics to support
-  /// handling of complex number arithmetic
-  FunctionPass *createComplexDeinterleavingPass(const TargetMachine *TM);
+/// This pass implements generation of target-specific intrinsics to support
+/// handling of complex number arithmetic
+FunctionPass *createComplexDeinterleavingPass(const TargetMachine *TM);
 
-  /// AtomicExpandID -- Lowers atomic operations in terms of either cmpxchg
-  /// load-linked/store-conditional loops.
-  extern char &AtomicExpandID;
+/// AtomicExpandID -- Lowers atomic operations in terms of either cmpxchg
+/// load-linked/store-conditional loops.
+extern char &AtomicExpandID;
 
-  /// MachineLoopInfo - This pass is a loop analysis pass.
-  extern char &MachineLoopInfoID;
+/// MachineLoopInfo - This pass is a loop analysis pass.
+extern char &MachineLoopInfoID;
 
-  /// MachineDominators - This pass is a machine dominators analysis pass.
-  extern char &MachineDominatorsID;
-
-  /// MachineDominanaceFrontier - This pass is a machine dominators analysis.
-  extern char &MachineDominanceFrontierID;
+/// MachineDominators - This pass is a machine dominators analysis pass.
+extern char &MachineDominatorsID;
+
+/// MachineDominanaceFrontier - This pass is a machine dominators analysis.
+extern char &MachineDominanceFrontierID;
 
-  /// MachineRegionInfo - This pass computes SESE regions for machine functions.
-  extern char &MachineRegionInfoPassID;
-
-  /// EdgeBundles analysis - Bundle machine CFG edges.
-  extern char &EdgeBundlesWrapperLegacyID;
-
-  /// LiveVariables pass - This pass computes the set of blocks in which each
-  /// variable is life and sets machine operand kill flags.
-  extern char &LiveVariablesID;
-
-  /// PHIElimination - This pass eliminates machine instruction PHI nodes
-  /// by inserting copy instructions.  This destroys SSA information, but is the
-  /// desired input for some register allocators.  This pass is "required" by
-  /// these register allocator like this: AU.addRequiredID(PHIEliminationID);
-  extern char &PHIEliminationID;
-
-  /// LiveIntervals - This analysis keeps track of the live ranges of virtual
-  /// and physical registers.
-  extern char &LiveIntervalsID;
-
-  /// LiveStacks pass. An analysis keeping track of the liveness of stack slots.
-  extern char &LiveStacksID;
-
-  /// TwoAddressInstruction - This pass reduces two-address instructions to
-  /// use two operands. This destroys SSA information but it is desired by
-  /// register allocators.
-  extern char &TwoAddressInstructionPassID;
-
-  /// ProcessImpicitDefs pass - This pass removes IMPLICIT_DEFs.
-  extern char &ProcessImplicitDefsID;
-
-  /// RegisterCoalescer - This pass merges live ranges to eliminate copies.
-  extern char &RegisterCoalescerID;
-
-  /// MachineScheduler - This pass schedules machine instructions.
-  extern char &MachineSchedulerID;
-
-  /// PostMachineScheduler - This pass schedules machine instructions postRA.
-  extern char &PostMachineSchedulerID;
-
-  /// SpillPlacement analysis. Suggest optimal placement of spill code between
-  /// basic blocks.
-  extern char &SpillPlacementID;
-
-  /// ShrinkWrap pass. Look for the best place to insert save and restore
-  // instruction and update the MachineFunctionInfo with that information.
-  extern char &ShrinkWrapID;
-
-  /// LiveRangeShrink pass. Move instruction close to its definition to shrink
-  /// the definition's live range.
-  extern char &LiveRangeShrinkID;
-
-  /// Greedy register allocator.
-  extern char &RAGreedyLegacyID;
-
-  /// Basic register allocator.
-  extern char &RABasicID;
-
-  /// VirtRegRewriter pass. Rewrite virtual registers to physical registers as
-  /// assigned in VirtRegMap.
-  extern char &VirtRegRewriterID;
-  FunctionPass *createVirtRegRewriter(bool ClearVirtRegs = true);
+/// MachineRegionInfo - This pass computes SESE regions for machine functions.
+extern char &MachineRegionInfoPassID;
+
+/// EdgeBundles analysis - Bundle machine CFG edges.
+extern char &EdgeBundlesWrapperLegacyID;
+
+/// LiveVariables pass - This pass computes the set of blocks in which each
+/// variable is life and sets machine operand kill flags.
+extern char &LiveVariablesID;
+
+/// PHIElimination - This pass eliminates machine instruction PHI nodes
+/// by inserting copy instructions.  This destroys SSA information, but is the
+/// desired input for some register allocators.  This pass is "required" by
+/// these register allocator like this: AU.addRequiredID(PHIEliminationID);
+extern char &PHIEliminationID;
+
+/// LiveIntervals - This analysis keeps track of the live ranges of virtual
+/// and physical registers.
+extern char &LiveIntervalsID;
+
+/// LiveStacks pass. An analysis keeping track of the liveness of stack slots.
+extern char &LiveStacksID;
+
+/// TwoAddressInstruction - This pass reduces two-address instructions to
+/// use two operands. This destroys SSA information but it is desired by
+/// register allocators.
+extern char &TwoAddressInstructionPassID;
+
+/// ProcessImpicitDefs pass - This pass removes IMPLICIT_DEFs.
+extern char &ProcessImplicitDefsID;
+
+/// RegisterCoalescer - This pass merges live ranges to eliminate copies.
+extern char &RegisterCoalescerID;
+
+/// MachineScheduler - This pass schedules machine instructions.
+extern char &MachineSchedulerID;
+
+/// PostMachineScheduler - This pass schedules machine instructions postRA.
+extern char &PostMachineSchedulerID;
+
+/// SpillPlacement analysis. Suggest optimal placement of spill code between
+/// basic blocks.
+extern char &SpillPlacementID;
+
+/// ShrinkWrap pass. Look for the best place to insert save and restore
+// instruction and update the MachineFunctionInfo with that information.
+extern char &ShrinkWrapID;
+
+/// LiveRangeShrink pass. Move instruction close to its definition to shrink
+/// the definition's live range.
+extern char &LiveRangeShrinkID;
+
+/// Greedy register allocator.
+extern char &RAGreedyLegacyID;
+
+/// Basic register allocator.
+extern char &RABasicID;
+
+/// VirtRegRewriter pass. Rewrite virtual registers to physical registers as
+/// assigned in VirtRegMap.
+extern char &VirtRegRewriterID;
+FunctionPass *createVirtRegRewriter(bool ClearVirtRegs = true);
 
-  /// UnreachableMachineBlockElimination - This pass removes unreachable
-  /// machine basic blocks.
-  extern char &UnreachableMachineBlockElimID;
+/// UnreachableMachineBlockElimination - This pass removes unreachable
+/// machine basic blocks.
+extern char &UnreachableMachineBlockElimID;
 
-  /// DeadMachineInstructionElim - This pass removes dead machine instructions.
-  extern char &DeadMachineInstructionElimID;
+/// DeadMachineInstructionElim - This pass removes dead machine instructions.
+extern char &DeadMachineInstructionElimID;
 
-  /// This pass adds dead/undef flags after analyzing subregister lanes.
-  extern char &DetectDeadLanesID;
+/// This pass adds dead/undef flags after analyzing subregister lanes.
+extern char &DetectDeadLanesID;
 
-  /// This pass perform post-ra machine sink for COPY instructions.
-  extern char &PostRAMachineSinkingID;
+/// This pass perform post-ra machine sink for COPY instructions.
+extern char &PostRAMachineSinkingID;
 
-  /// This pass adds flow sensitive discriminators.
-  extern char &MIRAddFSDiscriminatorsID;
+/// This pass adds flow sensitive discriminators.
+extern char &MIRAddFSDiscriminatorsID;
 
-  /// This pass reads flow sensitive profile.
-  extern char &MIRProfileLoaderPassID;
+/// This pass reads flow sensitive profile.
+extern char &MIRProfileLoaderPassID;
 
-  // This pass gives undef values a Pseudo Instruction definition for
-  // Instructions to ensure early-clobber is followed when using the greedy
-  // register allocator.
-  extern char &InitUndefID;
+// This pass gives undef values a Pseudo Instruction definition for
+// Instructions to ensure early-clobber is followed when using the greedy
+// register allocator.
+extern char &InitUndefID;
 
-  /// FastRegisterAllocation Pass - This pass register allocates as fast as
-  /// possible. It is best suited for debug code where live ranges are short.
-  ///
-  FunctionPass *createFastRegisterAllocator();
-  FunctionPass *createFastRegisterAllocator(RegAllocFilterFunc F,
-                                            bool ClearVirtRegs);
+/// FastRegisterAllocation Pass - This pass register allocates as fast as
+/// possible. It is best suited for debug code where live ranges are short.
+///
+FunctionPass *createFastRegisterAllocator();
+FunctionPass *createFastRegisterAllocator(RegAllocFilterFunc F,
+                                          bool ClearVirtRegs);
 
-  /// BasicRegisterAllocation Pass - This pass implements a degenerate global
-  /// register allocator using the basic regalloc framework.
-  ///
-  FunctionPass *createBasicRegisterAllocator();
-  FunctionPass *createBasicRegisterAllocator(RegAllocFilterFunc F);
+/// BasicRegisterAllocation Pass - This pass implements a degenerate global
+/// register allocator using the basic regalloc framework.
+///
+FunctionPass *createBasicRegisterAllocator();
+FunctionPass *createBasicRegisterAllocator(RegAllocFilterFunc F);
 
-  /// Greedy register allocation pass - This pass implements a global register
-  /// allocator for optimized builds.
-  ///
-  FunctionPass *createGreedyRegisterAllocator();
-  FunctionPass *createGreedyRegisterAllocator(RegAllocFilterFunc F);
+/// Greedy register allocation pass - This pass implements a global register
+/// allocator for optimized builds.
+///
+FunctionPass *createGreedyRegisterAllocator();
+FunctionPass *createGreedyRegisterAllocator(RegAllocFilterFunc F);
 
-  /// PBQPRegisterAllocation Pass - This pass implements the Partitioned Boolean
-  /// Quadratic Prograaming (PBQP) based register allocator.
-  ///
-  FunctionPass *createDefaultPBQPRegisterAllocator();
-
-  /// PrologEpilogCodeInserter - This pass inserts prolog and epilog code,
-  /// and eliminates abstract frame references.
-  extern char &PrologEpilogCodeInserterID;
-  MachineFunctionPass *createPrologEpilogInserterPass();
+/// PBQPRegisterAllocation Pass - This pass implements the Partitioned Boolean
+/// Quadratic Prograaming (PBQP) based register allocator.
+///
+FunctionPass *createDefaultPBQPRegisterAllocator();
+
+/// PrologEpilogCodeInserter - This pass inserts prolog and epilog code,
+/// and eliminates abstract frame references.
+extern char &PrologEpilogCodeInserterID;
+MachineFunctionPass *createPrologEpilogInserterPass();
 
-  /// ExpandPostRAPseudos - This pass expands pseudo instructions after
-  /// register allocation.
-  extern char &ExpandPostRAPseudosID;
+/// ExpandPostRAPseudos - This pass expands pseudo instructions after
+/// register allocation.
+extern char &ExpandPostRAPseudosID;
 
-  /// PostRAHazardRecognizer - This pass runs the post-ra hazard
-  /// recognizer.
-  extern char &PostRAHazardRecognizerID;
-
-  /// PostRAScheduler - This pass performs post register allocation
-  /// scheduling.
-  extern char &PostRASchedulerID;
+/// PostRAHazardRecognizer - This pass runs the post-ra hazard
+/// recognizer.
+extern char &PostRAHazardRecognizerID;
+
+/// PostRAScheduler - This pass performs post register allocation
+/// scheduling.
+extern char &PostRASchedulerID;
 
-  /// BranchFolding - This pass performs machine code CFG based
-  /// optimizations to delete branches to branches, eliminate branches to
-  /// successor blocks (creating fall throughs), and eliminating branches over
-  /// branches.
-  extern char &BranchFolderPassID;
+/// BranchFolding - This pass performs machine code CFG based
+/// optimizations to delete branches to branches, eliminate branches to
+/// successor blocks (creating fall throughs), and eliminating branches over
+/// branches.
+extern char &BranchFolderPassID;
 
-  /// BranchRelaxation - This pass replaces branches that need to jump further
-  /// than is supported by a branch instruction.
-  extern char &BranchRelaxationPassID;
-
-  /// MachineFunctionPrinterPass - This pass prints out MachineInstr's.
-  extern char &MachineFunctionPrinterPassID;
-
-  /// MIRPrintingPass - this pass prints out the LLVM IR using the MIR
-  /// serialization format.
-  extern char &MIRPrintingPassID;
-
-  /// TailDuplicate - Duplicate blocks with unconditional branches
-  /// into tails of their predecessors.
-  extern char &TailDuplicateLegacyID;
-
-  /// Duplicate blocks with unconditional branches into tails of their
-  /// predecessors. Variant that works before register allocation.
-  extern char &EarlyTailDuplicateLegacyID;
-
-  /// MachineTraceMetrics - This pass computes critical path and CPU resource
-  /// usage in an ensemble of traces.
-  extern char &MachineTraceMetricsID;
-
-  /// EarlyIfConverter - This pass performs if-conversion on SSA form by
-  /// inserting cmov instructions.
-  extern char &EarlyIfConverterLegacyID;
+/// BranchRelaxation - This pass replaces branches that need to jump further
+/// than is supported by a branch instruction.
+extern char &BranchRelaxationPassID;
+
+/// MachineFunctionPrinterPass - This pass prints out MachineInstr's.
+extern char &MachineFunctionPrinterPassID;
+
+/// MIRPrintingPass - this pass prints out the LLVM IR using the MIR
+/// serialization format.
+extern char &MIRPrintingPassID;
+
+/// TailDuplicate - Duplicate blocks with unconditional branches
+/// into tails of their predecessors.
+extern char &TailDuplicateLegacyID;
+
+/// Duplicate blocks with unconditional branches into tails of their
+/// predecessors. Variant that works before register allocation.
+extern char &EarlyTailDuplicateLegacyID;
+
+/// MachineTraceMetrics - This pass computes critical path and CPU resource
+/// usage in an ensemble of traces.
+extern char &MachineTraceMetricsID;
+
+/// EarlyIfConverter - This pass performs if-conversion on SSA form by
+/// inserting cmov instructions.
+extern char &EarlyIfConverterLegacyID;
 
-  /// EarlyIfPredicator - This pass performs if-conversion on SSA form by
-  /// predicating if/else block and insert select at the join point.
-  extern char &EarlyIfPredicatorID;
+/// EarlyIfPredicator - This pass performs if-conversion on SSA form by
+/// predicating if/else block and insert select at the join point.
+extern char &EarlyIfPredicatorID;
 
-  /// This pass performs instruction combining using trace metrics to estimate
-  /// critical-path and resource depth.
-  extern char &MachineCombinerID;
+/// This pass performs instruction combining using trace metrics to estimate
+/// critical-path and resource depth.
+extern char &MachineCombinerID;
 
-  /// StackSlotColoring - This pass performs stack coloring and merging.
-  /// It merges disjoint allocas to reduce the stack size.
-  extern char &StackColoringLegacyID;
+/// StackSlotColoring - This pass performs stack coloring and merging.
+/// It merges disjoint allocas to reduce the stack size.
+extern char &StackColoringLegacyID;
 
-  /// StackFramePrinter - This pass prints the stack frame layout and variable
-  /// mappings.
-  extern char &StackFrameLayoutAnalysisPassID;
-
-  /// IfConverter - This pass performs machine code if conversion.
-  extern char &IfConverterID;
-
-  FunctionPass *createIfConverter(
-      std::function<bool(const MachineFunction &)> Ftor);
-
-  /// MachineBlockPlacement - This pass places basic blocks based on branch
-  /// probabilities.
-  extern char &MachineBlockPlacementID;
-
-  /// MachineBlockPlacementStats - This pass collects statistics about the
-  /// basic block placement using branch probabilities and block frequency
-  /// information.
-  extern char &MachineBlockPlacementStatsID;
-
-  /// GCLowering Pass - Used by gc.root to perform its default lowering
-  /// operations.
-  FunctionPass *createGCLoweringPass();
-
-  /// GCLowering Pass - Used by gc.root to perform its default lowering
-  /// operations.
-  extern char &GCLoweringID;
+/// StackFramePrinter - This pass prints the stack frame layout and variable
+/// mappings.
+extern char &StackFrameLayoutAnalysisPassID;
+
+/// IfConverter - This pass performs machine code if conversion.
+extern char &IfConverterID;
+
+FunctionPass *
+createIfConverter(std::function<bool(const MachineFunction &)> Ftor);
+
+/// MachineBlockPlacement - This pass places basic blocks based on branch
+/// probabilities.
+extern char &MachineBlockPlacementID;
+
+/// MachineBlockPlacementStats - This pass collects statistics about the
+/// basic block placement using branch probabilities and block frequency
+/// information.
+extern char &MachineBlockPlacementStatsID;
+
+/// GCLowering Pass - Used by gc.root to perform its default lowering
+/// operations.
+FunctionPass *createGCLoweringPass();
+
+/// GCLowering Pass - Used by gc.root to perform its default lowering
+/// operations.
+extern char &GCLoweringID;
 
-  /// ShadowStackGCLowering - Implements the custom lowering mechanism
-  /// used by the shadow stack GC.  Only runs on functions which opt in to
-  /// the shadow stack collector.
-  FunctionPass *createShadowStackGCLoweringPass();
+/// ShadowStackGCLowering - Implements the custom lowering mechanism
+/// used by the shadow stack GC.  Only runs on functions which opt in to
+/// the shadow stack collector.
+FunctionPass *createShadowStackGCLoweringPass();
 
-  /// ShadowStackGCLowering - Implements the custom lowering mechanism
-  /// used by the shadow stack GC.
-  extern char &ShadowStackGCLoweringID;
+/// ShadowStackGCLowering - Implements the custom lowering mechanism
+/// used by the shadow stack GC.
+extern char &ShadowStackGCLoweringID;
 
-  /// GCMachineCodeAnalysis - Target-independent pass to mark safe points
-  /// in machine code. Must be added very late during code generation, just
-  /// prior to output, and importantly after all CFG transformations (such as
-  /// branch folding).
-  extern char &GCMachineCodeAnalysisID;
+/// GCMachineCodeAnalysis - Target-independent pass to mark safe points
+/// in machine code. Must be added very late during code generation, just
+/// prior to output, and importantly after all CFG transformations (such as
+/// branch folding).
+extern char &GCMachineCodeAnalysisID;
 
-  /// MachineCSE - This pass performs global CSE on machine instructions.
-  extern char &MachineCSELegacyID;
+/// MachineCSE - This pass performs global CSE on machine instructions.
+extern char &MachineCSELegacyID;
 
-  /// MIRCanonicalizer - This pass canonicalizes MIR by renaming vregs
-  /// according to the semantics of the instruction as well as hoists
-  /// code.
-  extern char &MIRCanonicalizerID;
+/// MIRCanonicalizer - This pass canonicalizes MIR by renaming vregs
+/// according to the semantics of the instruction as well as hoists
+/// code.
+extern char &MIRCanonicalizerID;
 
-  /// ImplicitNullChecks - This pass folds null pointer checks into nearby
-  /// memory operations.
-  extern char &ImplicitNullChecksID;
+/// ImplicitNullChecks - This pass folds null pointer checks into nearby
+/// memory operations.
+extern char &ImplicitNullChecksID;
 
-  /// This pass performs loop invariant code motion on machine instructions.
-  extern char &MachineLICMID;
+/// This pass performs loop invariant code motion on machine instructions.
+extern char &MachineLICMID;
 
-  /// This pass performs loop invariant code motion on machine instructions.
-  /// This variant works before register allocation. \see MachineLICMID.
-  extern char &EarlyMachineLICMID;
+/// This pass performs loop invariant code motion on machine instructions.
+/// This variant works before register allocation. \see MachineLICMID.
+extern char &EarlyMachineLICMID;
 
-  /// MachineSinking - This pass performs sinking on machine instructions.
-  extern char &MachineSinkingLegacyID;
+/// MachineSinking - This pass performs sinking on machine instructions.
+extern char &MachineSinkingLegacyID;
 
-  /// MachineCopyPropagation - This pass performs copy propagation on
-  /// machine instructions.
-  extern char &MachineCopyPropagationID;
+/// MachineCopyPropagation - This pass performs copy propagation on
+/// machine instructions.
+extern char &MachineCopyPropagationID;
 
-  MachineFunctionPass *createMachineCopyPropagationPass(bool UseCopyInstr);
+MachineFunctionPass *createMachineCopyPropagationPass(bool UseCopyInstr);
 
-  /// MachineLateInstrsCleanup - This pass removes redundant identical
-  /// instructions after register allocation and rematerialization.
-  extern char &MachineLateInstrsCleanupID;
+/// MachineLateInstrsCleanup - This pass removes redundant identical
+/// instructions after register allocation and rematerialization.
+extern char &MachineLateInstrsCleanupID;
 
-  /// PeepholeOptimizer - This pass performs peephole optimizations -
-  /// like extension and comparison eliminations.
-  extern char &PeepholeOptimizerLegacyID;
+/// PeepholeOptimizer - This pass performs peephole optimizations -
+/// like extension and comparison eliminations.
+extern char &PeepholeOptimizerLegacyID;
 
-  /// OptimizePHIs - This pass optimizes machine instruction PHIs
-  /// to take advantage of opportunities created during DAG legalization.
-  extern char &OptimizePHIsLegacyID;
+/// OptimizePHIs - This pass optimizes machine instruction PHIs
+/// to take advantage of opportunities created during DAG legalization.
+extern char &OptimizePHIsLegacyID;
 
-  /// StackSlotColoring - This pass performs stack slot coloring.
-  extern char &StackSlotColoringID;
+/// StackSlotColoring - This pass performs stack slot coloring.
+extern char &StackSlotColoringID;
 
-  /// This pass lays out funclets contiguously.
-  extern char &FuncletLayoutID;
+/// This pass lays out funclets contiguously.
+extern char &FuncletLayoutID;
 
-  /// This pass inserts the XRay instrumentation sleds if they are supported by
-  /// the target platform.
-  extern char &XRayInstrumentationID;
+/// This pass inserts the XRay instrumentation sleds if they are supported by
+/// the target platform.
+extern char &XRayInstrumentationID;
 
-  /// This pass inserts FEntry calls
-  extern char &FEntryInserterID;
-
-  /// This pass implements the "patchable-function" attribute.
-  extern char &PatchableFunctionID;
-
-  /// createStackProtectorPass - This pass adds stack protectors to functions.
-  ///
-  FunctionPass *createStackProtectorPass();
-
-  /// createMachineVerifierPass - This pass verifies cenerated machine code
-  /// instructions for correctness.
-  ///
-  FunctionPass *createMachineVerifierPass(const std::string& Banner);
-
-  /// createDwarfEHPass - This pass mulches exception handling code into a form
-  /// adapted to code generation.  Required if using dwarf exception handling.
-  FunctionPass *createDwarfEHPass(CodeGenOptLevel OptLevel);
-
-  /// createWinEHPass - Prepares personality functions used by MSVC on Windows,
-  /// in addition to the Itanium LSDA based personalities.
-  FunctionPass *createWinEHPass(bool DemoteCatchSwitchPHIOnly = false);
-
-  /// createSjLjEHPreparePass - This pass adapts exception handling code to use
-  /// the GCC-style builtin setjmp/longjmp (sjlj) to handling EH control flow.
-  ///
-  FunctionPass *createSjLjEHPreparePass(const TargetMachine *TM);
-
-  /// createWasmEHPass - This pass adapts exception handling code to use
-  /// WebAssembly's exception handling scheme.
-  FunctionPass *createWasmEHPass();
-
-  /// LocalStackSlotAllocation - This pass assigns local frame indices to stack
-  /// slots relative to one another and allocates base registers to access them
-  /// when it is estimated by the target to be out of range of normal frame
-  /// pointer or stack pointer index addressing.
-  extern char &LocalStackSlotAllocationID;
+/// This pass inserts FEntry calls
+extern char &FEntryInserterID;
+
+/// This pass implements the "patchable-function" attribute.
+extern char &PatchableFunctionID;
+
+/// createStackProtectorPass - This pass adds stack protectors to functions.
+///
+FunctionPass *createStackProtectorPass();
+
+/// createMachineVerifierPass - This pass verifies cenerated machine code
+/// instructions for correctness.
+///
+FunctionPass *createMachineVerifierPass(const std::string &Banner);
+
+/// createDwarfEHPass - This pass mulches exception handling code into a form
+/// adapted to code generation.  Required if using dwarf exception handling.
+FunctionPass *createDwarfEHPass(CodeGenOptLevel OptLevel);
+
+/// createWinEHPass - Prepares personality functions used by MSVC on Windows,
+/// in addition to the Itanium LSDA based personalities.
+FunctionPass *createWinEHPass(bool DemoteCatchSwitchPHIOnly = false);
+
+/// createSjLjEHPreparePass - This pass adapts exception handling code to use
+/// the GCC-style builtin setjmp/longjmp (sjlj) to handling EH control flow.
+///
+FunctionPass *createSjLjEHPreparePass(const TargetMachine *TM);
+
+/// createWasmEHPass - This pass adapts exception handling code to use
+/// WebAssembly's exception handling scheme.
+FunctionPass *createWasmEHPass();
+
+/// LocalStackSlotAllocation - This pass assigns local frame indices to stack
+/// slots relative to one another and allocates base registers to access them
+/// when it is estimated by the target to be out of range of normal frame
+/// pointer or stack pointer index addressing.
+extern char &LocalStackSlotAllocationID;
 
-  /// This pass expands pseudo-instructions, reserves registers and adjusts
-  /// machine frame information.
-  extern char &FinalizeISelID;
+/// This pass expands pseudo-instructions, reserves registers and adjusts
+/// machine frame information.
+extern char &FinalizeISelID;
 
-  /// UnpackMachineBundles - This pass unpack machine instruction bundles.
-  extern char &UnpackMachineBundlesID;
+/// UnpackMachineBundles - This pass unpack machine instruction bundles.
+extern char &UnpackMachineBundlesID;
 
-  FunctionPass *
-  createUnpackMachineBundles(std::function<bool(const MachineFunction &)> Ftor);
+FunctionPass *
+createUnpackMachineBundles(std::function<bool(const MachineFunction &)> Ftor);
 
-  /// FinalizeMachineBundles - This pass finalize machine instruction
-  /// bundles (created earlier, e.g. during pre-RA scheduling).
-  extern char &FinalizeMachineBundlesID;
+/// FinalizeMachineBundles - This pass finalize machine instruction
+/// bundles (created earlier, e.g. during pre-RA scheduling).
+extern char &FinalizeMachineBundlesID;
 
-  /// StackMapLiveness - This pass analyses the register live-out set of
-  /// stackmap/patchpoint intrinsics and attaches the calculated information to
-  /// the intrinsic for later emission to the StackMap.
-  extern char &StackMapLivenessID;
+/// StackMapLiveness - This pass analyses the register live-out set of
+/// stackmap/patchpoint intrinsics and attaches the calculated information to
+/// the intrinsic for later emission to the StackMap.
+extern char &StackMapLivenessID;
 
-  // MachineSanitizerBinaryMetadata - appends/finalizes sanitizer binary
-  // metadata after llvm SanitizerBinaryMetadata pass.
-  extern char &MachineSanitizerBinaryMetadataID;
+// MachineSanitizerBinaryMetadata - appends/finalizes sanitizer binary
+// metadata after llvm SanitizerBinaryMetadata pass.
+extern char &MachineSanitizerBinaryMetadataID;
 
-  /// RemoveLoadsIntoFakeUses pass.
-  extern char &RemoveLoadsIntoFakeUsesID;
+/// RemoveLoadsIntoFakeUses pass.
+extern char &RemoveLoadsIntoFakeUsesID;
 
-  /// RemoveRedundantDebugValues pass.
-  extern char &RemoveRedundantDebugValuesID;
+/// RemoveRedundantDebugValues pass.
+extern char &RemoveRedundantDebugValuesID;
 
-  /// MachineCFGPrinter pass.
-  extern char &MachineCFGPrinterID;
+/// MachineCFGPrinter pass.
+extern char &MachineCFGPrinterID;
 
-  /// LiveDebugValues pass
-  extern char &LiveDebugValuesID;
+/// LiveDebugValues pass
+extern char &LiveDebugValuesID;
 
-  /// InterleavedAccess Pass - This pass identifies and matches interleaved
-  /// memory accesses to target specific intrinsics.
-  ///
-  FunctionPass *createInterleavedAccessPass();
+/// InterleavedAccess Pass - This pass identifies and matches interleaved
+/// memory accesses to target specific intrinsics.
+///
+FunctionPass *createInterleavedAccessPass();
 
-  /// InterleavedLoadCombines Pass - This pass identifies interleaved loads and
-  /// combines them into wide loads detectable by InterleavedAccessPass
-  ///
-  FunctionPass *createInterleavedLoadCombinePass();
+/// InterleavedLoadCombines Pass - This pass identifies interleaved loads and
+/// combines them into wide loads detectable by InterleavedAccessPass
+///
+FunctionPass *createInterleavedLoadCombinePass();
 
-  /// LowerEmuTLS - This pass generates __emutls_[vt].xyz variables for all
-  /// TLS variables for the emulated TLS model.
-  ///
-  ModulePass *createLowerEmuTLSPass();
+/// LowerEmuTLS - This pass generates __emutls_[vt].xyz variables for all
+/// TLS variables for the emulated TLS model.
+///
+ModulePass *createLowerEmuTLSPass();
 
-  /// This pass lowers the \@llvm.load.relative and \@llvm.objc.* intrinsics to
-  /// instructions.  This is unsafe to do earlier because a pass may combine the
-  /// constant initializer into the load, which may result in an overflowing
-  /// evaluation.
-  ModulePass *createPreISelIntrinsicLoweringPass();
+/// This pass lowers the \@llvm.load.relative and \@llvm.objc.* intrinsics to
+/// instructions.  This is unsafe to do earlier because a pass may combine the
+/// constant initializer into the load, which may result in an overflowing
+/// evaluation.
+ModulePass *createPreISelIntrinsicLoweringPass();
 
-  /// GlobalMerge - This pass merges internal (by default) globals into structs
-  /// to enable reuse of a base pointer by indexed addressing modes.
-  /// It can also be configured to focus on size optimizations only.
-  ///
-  Pass *createGlobalMergePass(const TargetMachine *TM, unsigned MaximalOffset,
-                              bool OnlyOptimizeForSize = false,
-                              bool MergeExternalByDefault = false,
-                              bool MergeConstantByDefault = false,
-                              bool MergeConstAggressiveByDefault = false);
+/// GlobalMerge - This pass merges internal (by default) globals into structs
+/// to enable reuse of a base pointer by indexed addressing modes.
+/// It can also be configured to focus on size optimizations only.
+///
+Pass *createGlobalMergePass(const TargetMachine *TM, unsigned MaximalOffset,
+                            bool OnlyOptimizeForSize = false,
+                            bool MergeExternalByDefault = false,
+                            bool MergeConstantByDefault = false,
+                            bool MergeConstAggressiveByDefault = false);
 
-  /// This pass splits the stack into a safe stack and an unsafe stack to
-  /// protect against stack-based overflow vulnerabilities.
-  FunctionPass *createSafeStackPass();
+/// This pass splits the stack into a safe stack and an unsafe stack to
+/// protect against stack-based overflow vulnerabilities.
+FunctionPass *createSafeStackPass();
 
-  /// This pass detects subregister lanes in a virtual register that are used
-  /// independently of other lanes and splits them into separate virtual
-  /// registers.
-  extern char &RenameIndependentSubregsID;
+/// This pass detects subregister lanes in a virtual register that are used
+/// independently of other lanes and splits them into separate virtual
+/// registers.
+extern char &RenameIndependentSubregsID;
 
-  /// This pass is executed POST-RA to collect which physical registers are
-  /// preserved by given machine function.
-  FunctionPass *createRegUsageInfoCollector();
+/// This pass is executed POST-RA to collect which physical registers are
+/// preserved by given machine function.
+FunctionPass *createRegUsageInfoCollector();
 
-  /// Return a MachineFunction pass that identifies call sites
-  /// and propagates register usage information of callee to caller
-  /// if available with PysicalRegisterUsageInfo pass.
-  FunctionPass *createRegUsageInfoPropPass();
+/// Return a MachineFunction pass that identifies call sites
+/// and propagates register usage information of callee to caller
+/// if available with PysicalRegisterUsageInfo pass.
+FunctionPass *createRegUsageInfoPropPass();
 
-  /// This pass performs software pipelining on machine instructions.
-  extern char &MachinePipelinerID;
+/// This pass performs software pipelining on machine instructions.
+extern char &MachinePipelinerID;
 
-  /// This pass frees the memory occupied by the MachineFunction.
-  FunctionPass *createFreeMachineFunctionPass();
+/// This pass frees the memory occupied by the MachineFunction.
+FunctionPass *createFreeMachineFunctionPass();
 
-  /// This pass performs merging similar functions globally.
-  ModulePass *createGlobalMergeFuncPass();
+/// This pass performs merging similar functions globally.
+ModulePass *createGlobalMergeFuncPass();
 
-  /// This pass performs outlining on machine instructions directly before
-  /// printing assembly.
-  ModulePass *createMachineOutlinerPass(bool RunOnAllFunctions = true);
+/// This pass performs outlining on machine instructions directly before
+/// printing assembly.
+ModulePass *createMachineOutlinerPass(bool RunOnAllFunctions = true);
 
-  /// This pass expands the reduction intrinsics into sequences of shuffles.
-  FunctionPass *createExpandReductionsPass();
+/// This pass expands the reduction intrinsics into sequences of shuffles.
+FunctionPass *createExpandReductionsPass();
 
-  // This pass replaces intrinsics operating on vector operands with calls to
-  // the corresponding function in a vector library (e.g., SVML, libmvec).
-  FunctionPass *createReplaceWithVeclibLegacyPass();
+// This pass replaces intrinsics operating on vector operands with calls to
+// the corresponding function in a vector library (e.g., SVML, libmvec).
+FunctionPass *createReplaceWithVeclibLegacyPass();
 
-  // Expands large div/rem instructions.
-  FunctionPass *createExpandLargeDivRemPass();
+// Expands large div/rem instructions.
+FunctionPass *createExpandLargeDivRemPass();
 
-  // Expands large div/rem instructions.
-  FunctionPass *createExpandFpPass();
+// Expands large div/rem instructions.
+FunctionPass *createExpandFpPass();
 
-  // This pass expands memcmp() to load/stores.
-  FunctionPass *createExpandMemCmpLegacyPass();
+// This pass expands memcmp() to load/stores.
+FunctionPass *createExpandMemCmpLegacyPass();
 
-  /// Creates Break False Dependencies pass. \see BreakFalseDeps.cpp
-  FunctionPass *createBreakFalseDeps();
+/// Creates Break False Dependencies pass. \see BreakFalseDeps.cpp
+FunctionPass *createBreakFalseDeps();
 
-  // This pass expands indirectbr instructions.
-  FunctionPass *createIndirectBrExpandPass();
+// This pass expands indirectbr instructions.
+FunctionPass *createIndirectBrExpandPass();
 
-  /// Creates CFI Fixup pass. \see CFIFixup.cpp
-  FunctionPass *createCFIFixup();
+/// Creates CFI Fixup pass. \see CFIFixup.cpp
+FunctionPass *createCFIFixup();
 
-  /// Creates CFI Instruction Inserter pass. \see CFIInstrInserter.cpp
-  FunctionPass *createCFIInstrInserter();
+/// Creates CFI Instruction Inserter pass. \see CFIInstrInserter.cpp
+FunctionPass *createCFIInstrInserter();
 
-  /// Creates CFGuard longjmp target identification pass.
-  /// \see CFGuardLongjmp.cpp
-  FunctionPass *createCFGuardLongjmpPass();
+/// Creates CFGuard longjmp target identification pass.
+/// \see CFGuardLongjmp.cpp
+FunctionPass *createCFGuardLongjmpPass();
 
-  /// Creates Windows EH Continuation Guard target identification pass.
-  /// \see EHContGuardTargets.cpp
-  FunctionPass *createEHContGuardTargetsPass();
+/// Creates Windows EH Continuation Guard target identification pass.
+/// \see EHContGuardTargets.cpp
+FunctionPass *createEHContGuardTargetsPass();
 
-  /// Create Hardware Loop pass. \see HardwareLoops.cpp
-  FunctionPass *createHardwareLoopsLegacyPass();
+/// Create Hardware Loop pass. \see HardwareLoops.cpp
+FunctionPass *createHardwareLoopsLegacyPass();
 
-  /// This pass inserts pseudo probe annotation for callsite profiling.
-  FunctionPass *createPseudoProbeInserter();
+/// This pass inserts pseudo probe annotation for callsite profiling.
+FunctionPass *createPseudoProbeInserter();
 
-  /// Create IR Type Promotion pass. \see TypePromotion.cpp
-  FunctionPass *createTypePromotionLegacyPass();
+/// Create IR Type Promotion pass. \see TypePromotion.cpp
+FunctionPass *createTypePromotionLegacyPass();
 
-  /// Add Flow Sensitive Discriminators. PassNum specifies the
-  /// sequence number of this pass (starting from 1).
-  FunctionPass *
-  createMIRAddFSDiscriminatorsPass(sampleprof::FSDiscriminatorPass P);
+/// Add Flow Sensitive Discriminators. PassNum specifies the
+/// sequence number of this pass (starting from 1).
+FunctionPass *
+createMIRAddFSDiscriminatorsPass(sampleprof::FSDiscriminatorPass P);
 
-  /// Read Flow Sensitive Profile.
-  FunctionPass *
-  createMIRProfileLoaderPass(std::string File, std::string RemappingFile,
-                             sampleprof::FSDiscriminatorPass P,
-                             IntrusiveRefCntPtr<vfs::FileSystem> FS);
+/// Read Flow Sensitive Profile.
+FunctionPass *
+createMIRProfileLoaderPass(std::string File, std::string RemappingFile,
+                           sampleprof::FSDiscriminatorPass P,
+                           IntrusiveRefCntPtr<vfs::FileSystem> FS);
 
-  /// Creates MIR Debugify pass. \see MachineDebugify.cpp
-  ModulePass *createDebugifyMachineModulePass();
+/// Creates MIR Debugify pass. \see MachineDebugify.cpp
+ModulePass *createDebugifyMachineModulePass();
 
-  /// Creates MIR Strip Debug pass. \see MachineStripDebug.cpp
-  /// If OnlyDebugified is true then it will only strip debug info if it was
-  /// added by a Debugify pass. The module will be left unchanged if the debug
-  /// info was generated by another source such as clang.
-  ModulePass *createStripDebugMachineModulePass(bool OnlyDebugified);
+/// Creates MIR Strip Debug pass. \see MachineStripDebug.cpp
+/// If OnlyDebugified is true then it will only strip debug info if it was
+/// added by a Debugify pass. The module will be left unchanged if the debug
+/// info was generated by another source such as clang.
+ModulePass *createStripDebugMachineModulePass(bool OnlyDebugified);
 
-  /// Creates MIR Check Debug pass. \see MachineCheckDebugify.cpp
-  ModulePass *createCheckDebugMachineModulePass();
+/// Creates MIR Check Debug pass. \see MachineCheckDebugify.cpp
+ModulePass *createCheckDebugMachineModulePass();
 
-  /// The pass fixups statepoint machine instruction to replace usage of
-  /// caller saved registers with stack slots.
-  extern char &FixupStatepointCallerSavedID;
+/// The pass fixups statepoint machine instruction to replace usage of
+/// caller saved registers with stack slots.
+extern char &FixupStatepointCallerSavedID;
 
-  /// The pass transforms load/store <256 x i32> to AMX load/store intrinsics
-  /// or split the data to two <128 x i32>.
-  FunctionPass *createX86LowerAMXTypePass();
+/// The pass transforms load/store <256 x i32> to AMX load/store intrinsics
+/// or split the data to two <128 x i32>.
+FunctionPass *createX86LowerAMXTypePass();
 
-  /// The pass transforms amx intrinsics to scalar operation if the function has
-  /// optnone attribute or it is O0.
-  FunctionPass *createX86LowerAMXIntrinsicsPass();
+/// The pass transforms amx intrinsics to scalar operation if the function has
+/// optnone attribute or it is O0.
+FunctionPass *createX86LowerAMXIntrinsicsPass();
 
-  /// When learning an eviction policy, extract score(reward) information,
-  /// otherwise this does nothing
-  FunctionPass *createRegAllocScoringPass();
+/// When learning an eviction policy, extract score(reward) information,
+/// otherwise this does nothing
+FunctionPass *createRegAllocScoringPass();
 
-  /// JMC instrument pass.
-  ModulePass *createJMCInstrumenterPass();
+/// JMC instrument pass.
+ModulePass *createJMCInstrumenterPass();
 
-  /// This pass converts conditional moves to conditional jumps when profitable.
-  FunctionPass *createSelectOptimizePass();
+/// This pass converts conditional moves to conditional jumps when profitable.
+FunctionPass *createSelectOptimizePass();
 
-  FunctionPass *createCallBrPass();
+FunctionPass *createCallBrPass();
 
-  /// Lowers KCFI operand bundles for indirect calls.
-  FunctionPass *createKCFIPass();
-} // End llvm namespace
+/// Lowers KCFI operand bundles for indirect calls.
+FunctionPass *createKCFIPass();
+} // namespace llvm
 
 #endif
diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index f650c0659..5d8f1c622 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -615,8 +615,8 @@ public:
                          MaybeAlign Align, bool isVolatile = false,
                          MDNode *TBAATag = nullptr, MDNode *ScopeTag = nullptr,
                          MDNode *NoAliasTag = nullptr) {
-    return CreateMemSet(Ptr, Val, getInt64(Size), Align, isVolatile,
-                        TBAATag, ScopeTag, NoAliasTag);
+    return CreateMemSet(Ptr, Val, getInt64(Size), Align, isVolatile, TBAATag,
+                        ScopeTag, NoAliasTag);
   }
 
   CallInst *CreateMemSet(Value *Ptr, Value *Val, Value *Size, MaybeAlign Align,
@@ -715,7 +715,8 @@ public:
   /// Create and insert an element unordered-atomic memcpy between the
   /// specified pointers.
   ///
-  /// DstAlign/SrcAlign are the alignments of the Dst/Src pointers, respectively.
+  /// DstAlign/SrcAlign are the alignments of the Dst/Src pointers,
+  /// respectively.
   ///
   /// If the pointers aren't i8*, they will be converted.  If a TBAA tag is
   /// specified, it will be added to the instruction. Likewise with alias.scope
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
index 432209e8e..c9a2c1298 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -2803,7 +2803,9 @@ void DAGTypeLegalizer::PromoteFloatResult(SDNode *N, unsigned ResNo) {
     case ISD::FTRUNC:
     case ISD::FTAN:
     case ISD::FTANH:
-    case ISD::FCANONICALIZE: R = PromoteFloatRes_UnaryOp(N); break;
+    case ISD::FCANONICALIZE:
+      R = PromoteFloatRes_UnaryOp(N);
+      break;
 
     // Binary FP Operations
     case ISD::FADD:
@@ -3280,7 +3282,9 @@ void DAGTypeLegalizer::SoftPromoteHalfResult(SDNode *N, unsigned ResNo) {
   case ISD::FTRUNC:
   case ISD::FTAN:
   case ISD::FTANH:
-  case ISD::FCANONICALIZE: R = SoftPromoteHalfRes_UnaryOp(N); break;
+  case ISD::FCANONICALIZE:
+    R = SoftPromoteHalfRes_UnaryOp(N);
+    break;
 
   // Binary FP Operations
   case ISD::FADD:
diff --git a/llvm/lib/ProfileData/InstrProfWriter.cpp b/llvm/lib/ProfileData/InstrProfWriter.cpp
index 275934693..9dc1a0d0b 100644
--- a/llvm/lib/ProfileData/InstrProfWriter.cpp
+++ b/llvm/lib/ProfileData/InstrProfWriter.cpp
@@ -152,9 +152,7 @@ void InstrProfWriter::setValueProfDataEndianness(llvm::endianness Endianness) {
   InfoObj->ValueProfDataEndianness = Endianness;
 }
 
-void InstrProfWriter::setOutputSparse(bool Sparse) {
-  this->Sparse = Sparse;
-}
+void InstrProfWriter::setOutputSparse(bool Sparse) { this->Sparse = Sparse; }
 
 void InstrProfWriter::addRecord(NamedInstrProfRecord &&I, uint64_t Weight,
                                 function_ref<void(Error)> Warn) {
diff --git a/llvm/lib/Support/DebugCounter.cpp b/llvm/lib/Support/DebugCounter.cpp
index a6de07a55..97973d638 100644
--- a/llvm/lib/Support/DebugCounter.cpp
+++ b/llvm/lib/Support/DebugCounter.cpp
@@ -248,6 +248,4 @@ bool DebugCounter::shouldExecuteImpl(unsigned CounterName) {
   return true;
 }
 
-LLVM_DUMP_METHOD void DebugCounter::dump() const {
-  print(dbgs());
-}
+LLVM_DUMP_METHOD void DebugCounter::dump() const { print(dbgs()); }
diff --git a/llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.h b/llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.h
index 1691d4fec..3cfb27984 100644
--- a/llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.h
+++ b/llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.h
@@ -43,7 +43,7 @@ public:
     SM_Body = 1 << 2,         // aarch64_pstate_sm_body
     SME_ABI_Routine = 1 << 3, // Used for SME ABI routines to avoid lazy saves
     ZA_State_Agnostic = 1 << 4,
-    ZT0_Undef = 1 << 5,       // Use to mark ZT0 as undef to avoid spills
+    ZT0_Undef = 1 << 5, // Use to mark ZT0 as undef to avoid spills
     ZA_Shift = 6,
     ZA_Mask = 0b111 << ZA_Shift,
     ZT0_Shift = 9,
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index 8f5d1ecba..98fb25538 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -1112,7 +1112,7 @@ bool LoopIdiomRecognize::processLoopStridedStore(
         BasePtr, SplatValue, NumBytes, MaybeAlign(StoreAlignment),
         /*isVolatile=*/false, AATags.TBAA, AATags.Scope, AATags.NoAlias);
   } else {
-    assert (isLibFuncEmittable(M, TLI, LibFunc_memset_pattern16));
+    assert(isLibFuncEmittable(M, TLI, LibFunc_memset_pattern16));
     // Everything is emitted in default address space
     Type *Int8PtrTy = DestInt8PtrTy;
 
diff --git a/llvm/lib/Transforms/Utils/LoopPeel.cpp b/llvm/lib/Transforms/Utils/LoopPeel.cpp
index f6ace9c4e..3a7bcf44a 100644
--- a/llvm/lib/Transforms/Utils/LoopPeel.cpp
+++ b/llvm/lib/Transforms/Utils/LoopPeel.cpp
@@ -1029,7 +1029,7 @@ bool llvm::peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI,
     if (Iter == 0)
       for (auto BBIDom : NonLoopBlocksIDom)
         DT.changeImmediateDominator(BBIDom.first,
-                                     cast<BasicBlock>(LVMap[BBIDom.second]));
+                                    cast<BasicBlock>(LVMap[BBIDom.second]));
 #ifdef EXPENSIVE_CHECKS
     assert(DT.verify(DominatorTree::VerificationLevel::Fast));
 #endif
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 45cf4e1ea..ef66f6401 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -6428,7 +6428,8 @@ static bool clusterSortPtrAccesses(ArrayRef<Value *> VL,
   // Ptr into, sort and return the sorted indices with values next to one
   // another.
   SmallMapVector<std::pair<BasicBlock *, Value *>,
-                 SmallVector<SmallVector<std::tuple<Value *, int, unsigned>>>, 8>
+                 SmallVector<SmallVector<std::tuple<Value *, int, unsigned>>>,
+                 8>
       Bases;
   Bases
       .try_emplace(std::make_pair(
@@ -6441,10 +6442,10 @@ static bool clusterSortPtrAccesses(ArrayRef<Value *> VL,
                               getUnderlyingObject(Ptr, RecursionMaxDepth));
     bool Found = any_of(Bases.try_emplace(Key).first->second,
                         [&, &Cnt = Cnt, &Ptr = Ptr](auto &Base) {
-                          std::optional<int> Diff = getPointersDiff(
-                              ElemTy, std::get<0>(Base.front()), ElemTy,
-                              Ptr, DL, SE,
-                              /*StrictCheck=*/true);
+                          std::optional<int> Diff =
+                              getPointersDiff(ElemTy, std::get<0>(Base.front()),
+                                              ElemTy, Ptr, DL, SE,
+                                              /*StrictCheck=*/true);
                           if (!Diff)
                             return false;
 
diff --git a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
index dcd68e6c2..c734b9cdd 100644
--- a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
@@ -589,7 +589,8 @@ void InterfaceGenerator::emitInterfaceDecl(const Interface &interface) {
        << "    auto* interface = getInterfaceFor(base);\n"
        << "    if (!interface)\n"
           "      return false;\n"
-          "    " << interfaceName << " odsInterfaceInstance(base, interface);\n"
+          "    "
+       << interfaceName << " odsInterfaceInstance(base, interface);\n"
        << "    " << tblgen::tgfmt(extraClassOf->trim(), &extraClassOfFmt)
        << "\n  }\n";
   }

qinkunbao added a commit that referenced this pull request May 15, 2025
In this way, SpecialCaseList::Sections can keep the order of Sections
when parsing the case list.

Reviewers: 

Pull Request: #140115
@qinkunbao qinkunbao requested a review from vitalybuka May 15, 2025 18:49
@llvmbot llvmbot added llvm:instcombine Covers the InstCombine, InstSimplify and AggressiveInstCombine passes backend:DirectX HLSL HLSL Language Support backend:SPIR-V LTO Link time optimization (regular/full LTO or ThinLTO) backend:NVPTX mlir:scf bazel "Peripheral" support tier build system: utils/bazel llvm:SelectionDAG SelectionDAGISel as well mlir:openmp mlir:quant mlir:vector mlir:execution-engine flang:fir-hlfir flang:openmp llvm:ir llvm:analysis Includes value tracking, cost tables and constant folding llvm:transforms llvm:binary-utilities llvm:adt flang:semantics flang:parser clang:openmp OpenMP related changes to Clang openmp:libomp OpenMP host runtime offload ClangIR Anything related to the ClangIR project lldb-dap clang:bytecode Issues for the clang bytecode constexpr interpreter labels May 15, 2025
Copy link

⚠️ undef deprecator found issues in your code. ⚠️

You can test this locally with the following command:
git diff -U0 --pickaxe-regex -S '([^a-zA-Z0-9#_-]undef[^a-zA-Z0-9_-]|UndefValue::get)' 'HEAD~1' HEAD clang/test/OpenMP/openmp_workshare.c libcxx/test/benchmarks/algorithms/pstl.stable_sort.bench.cpp libcxx/test/benchmarks/algorithms/ranges_sort.bench.cpp libcxx/test/benchmarks/algorithms/ranges_stable_sort.bench.cpp libcxx/test/benchmarks/algorithms/sort.bench.cpp libcxx/test/benchmarks/algorithms/stable_sort.bench.cpp bolt/include/bolt/Profile/Heatmap.h bolt/lib/Profile/DataAggregator.cpp bolt/lib/Profile/Heatmap.cpp bolt/lib/Rewrite/RewriteInstance.cpp clang/include/clang/AST/ASTConcept.h clang/include/clang/AST/ASTDiagnostic.h clang/include/clang/AST/Decl.h clang/include/clang/AST/DeclTemplate.h clang/include/clang/AST/OpenACCClause.h clang/include/clang/AST/OpenMPClause.h clang/include/clang/AST/Type.h clang/include/clang/Basic/Module.h clang/include/clang/Frontend/CommandLineSourceLoc.h clang/include/clang/Sema/Sema.h clang/include/clang/Sema/SemaHLSL.h clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h clang/lib/AST/ASTConcept.cpp clang/lib/AST/ASTDiagnostic.cpp clang/lib/AST/ByteCode/Compiler.cpp clang/lib/AST/ByteCode/Compiler.h clang/lib/AST/ByteCode/Context.cpp clang/lib/AST/ByteCode/Interp.cpp clang/lib/AST/Decl.cpp clang/lib/AST/DeclTemplate.cpp clang/lib/AST/OpenACCClause.cpp clang/lib/AST/Type.cpp clang/lib/Basic/Diagnostic.cpp clang/lib/Basic/ProfileList.cpp clang/lib/Basic/SanitizerSpecialCaseList.cpp clang/lib/Basic/Targets/PPC.cpp clang/lib/CodeGen/CGBuiltin.cpp clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CGExpr.cpp clang/lib/CodeGen/CGExprScalar.cpp clang/lib/CodeGen/CGHLSLBuiltins.cpp clang/lib/CodeGen/CGHLSLRuntime.h clang/lib/CodeGen/CodeGenFunction.h clang/lib/CodeGen/CodeGenModule.cpp clang/lib/CodeGen/CodeGenTypes.cpp clang/lib/CodeGen/ItaniumCXXABI.cpp clang/lib/CodeGen/TargetBuiltins/ARM.cpp clang/lib/Driver/SanitizerArgs.cpp clang/lib/Frontend/CompilerInvocation.cpp clang/lib/Headers/__clang_hip_cmath.h clang/lib/Parse/ParseOpenMP.cpp clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.cpp clang/lib/Sema/HLSLBuiltinTypeDeclBuilder.h clang/lib/Sema/HLSLExternalSemaSource.cpp clang/lib/Sema/SemaChecking.cpp clang/lib/Sema/SemaDeclCXX.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaExprMember.cpp clang/lib/Sema/SemaHLSL.cpp clang/lib/Sema/SemaInit.cpp clang/lib/Sema/SemaOverload.cpp clang/lib/Sema/SemaTemplate.cpp clang/lib/Sema/SemaTemplateDeduction.cpp clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp clang/lib/StaticAnalyzer/Core/BugReporter.cpp clang/lib/StaticAnalyzer/Core/CoreEngine.cpp clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp clang/lib/StaticAnalyzer/Core/ExprEngine.cpp clang/lib/StaticAnalyzer/Core/SymbolManager.cpp clang/test/AST/ByteCode/builtin-bit-cast.cpp clang/test/AST/ByteCode/cxx20.cpp clang/test/CodeGen/AArch64/fp8-init-list.c clang/test/CodeGen/AArch64/fp8-intrinsics/acle_sve2_fp8_fdot.c clang/test/CodeGen/AArch64/fp8-intrinsics/acle_sve2_fp8_fmla.c clang/test/CodeGen/RISCV/attr-riscv-rvv-vector-bits-less-8-call.c clang/test/CodeGen/RISCV/attr-riscv-rvv-vector-bits-less-8-cast.c clang/test/CodeGen/RISCV/attr-rvv-vector-bits-bitcast-less-8.c clang/test/CodeGen/RISCV/attr-rvv-vector-bits-cast.c clang/test/CodeGen/RISCV/attr-rvv-vector-bits-codegen.c clang/test/CodeGen/RISCV/attr-rvv-vector-bits-globals.c clang/test/CodeGen/arm-mfp8.c clang/test/CodeGen/builtins-arm64.c clang/test/CodeGen/builtins-wasm.c clang/test/CodeGen/dllexport.c clang/test/CodeGen/dllimport.c clang/test/CodeGen/dso-local-executable.c clang/test/CodeGenCXX/dllexport-members.cpp clang/test/CodeGenCXX/dllexport-missing-key.cpp clang/test/CodeGenCXX/dllexport.cpp clang/test/CodeGenCXX/dllimport-members.cpp clang/test/CodeGenCXX/dllimport-missing-key.cpp clang/test/CodeGenCXX/dllimport-rtti.cpp clang/test/CodeGenCXX/dllimport.cpp clang/test/CodeGenCXX/dso-local-executable.cpp clang/test/CodeGenCXX/mingw-template-dllexport.cpp clang/test/CodeGenCXX/rtti-mingw64.cpp clang/test/CodeGenCXX/virt-dtor-key.cpp clang/test/CodeGenCXX/vtable-key-function-ios.cpp clang/test/Driver/fsanitize.c clang/test/Driver/ppc-mrop-protection-support-check.c clang/test/Driver/print-supported-extensions-riscv.c clang/test/Driver/riscv-arch.c clang/test/Preprocessor/riscv-target-features.c clang/test/Sema/atomic-expr.c clang/test/SemaCXX/cxx2a-consteval.cpp clang/test/SemaCXX/cxx2b-deducing-this.cpp clang/test/SemaCXX/dllexport.cpp clang/test/SemaCXX/dllimport.cpp clang/tools/clang-refactor/ClangRefactor.cpp clang/utils/TableGen/NeonEmitter.cpp compiler-rt/lib/builtins/clear_cache.c compiler-rt/lib/builtins/cpu_model/aarch64.c compiler-rt/lib/builtins/cpu_model/aarch64.h compiler-rt/lib/builtins/fp_compare_impl.inc compiler-rt/lib/builtins/fp_lib.h compiler-rt/lib/builtins/udivmodti4.c compiler-rt/test/builtins/Unit/enable_execute_stack_test.c compiler-rt/test/builtins/Unit/fixunstfdi_test.c compiler-rt/test/builtins/Unit/multc3_test.c flang-rt/lib/runtime/assign.cpp flang/include/flang/Parser/preprocessor.h flang/include/flang/Semantics/symbol.h flang/lib/Lower/OpenMP/ClauseProcessor.cpp flang/lib/Lower/OpenMP/Utils.cpp flang/lib/Parser/preprocessor.cpp flang/lib/Semantics/expression.cpp libcxx/include/__format/format_functions.h libcxx/include/__fwd/pair.h libcxx/include/__memory/uses_allocator_construction.h libcxx/test/benchmarks/format/format.bench.cpp libcxx/test/libcxx/containers/associative/tree_key_value_traits.pass.cpp libcxx/test/std/algorithms/alg.modifying.operations/alg.swap/ranges.swap_ranges.pass.cpp libcxx/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp libcxx/test/std/localization/codecvt_unicode.pass.cpp libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_in.pass.cpp libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_char8_t_out.pass.cpp libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_in.pass.cpp libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_char8_t_out.pass.cpp libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/assign2.pass.cpp lld/COFF/COFFLinkerContext.h lld/COFF/Chunks.cpp lld/COFF/DLL.cpp lld/COFF/Driver.cpp lld/COFF/InputFiles.cpp lld/COFF/SymbolTable.cpp lld/COFF/Writer.cpp lld/ELF/Arch/ARM.cpp lld/ELF/Driver.cpp lld/ELF/Writer.cpp lldb/include/lldb/Core/Address.h lldb/source/Core/Address.cpp lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/source/Target/DynamicRegisterInfo.cpp lldb/source/Target/Process.cpp lldb/source/Target/RegisterContextUnwind.cpp lldb/tools/lldb-dap/DAP.cpp lldb/tools/lldb-dap/DAP.h lldb/tools/lldb-dap/Handler/RequestHandler.h lldb/tools/lldb-dap/Handler/ScopesRequestHandler.cpp lldb/tools/lldb-dap/JSONUtils.cpp lldb/tools/lldb-dap/JSONUtils.h lldb/tools/lldb-dap/Protocol/ProtocolRequests.cpp lldb/tools/lldb-dap/Protocol/ProtocolRequests.h lldb/tools/lldb-dap/Protocol/ProtocolTypes.cpp lldb/tools/lldb-dap/Protocol/ProtocolTypes.h lldb/unittests/DAP/ProtocolTypesTest.cpp llvm/include/llvm/ADT/APFixedPoint.h llvm/include/llvm/ADT/APFloat.h llvm/include/llvm/ADT/APInt.h llvm/include/llvm/ADT/BitmaskEnum.h llvm/include/llvm/ADT/DynamicAPInt.h llvm/include/llvm/ADT/SlowDynamicAPInt.h llvm/include/llvm/ADT/TrieRawHashMap.h llvm/include/llvm/ADT/Twine.h llvm/include/llvm/Analysis/AliasAnalysis.h llvm/include/llvm/Analysis/LoopAccessAnalysis.h llvm/include/llvm/Analysis/TargetTransformInfo.h llvm/include/llvm/CodeGen/ISDOpcodes.h llvm/include/llvm/CodeGen/Passes.h llvm/include/llvm/IR/DerivedTypes.h llvm/include/llvm/IR/IRBuilder.h llvm/include/llvm/Support/BranchProbability.h llvm/include/llvm/Support/ConvertUTF.h llvm/include/llvm/Support/DebugCounter.h llvm/include/llvm/Support/FileOutputBuffer.h llvm/include/llvm/Support/KnownBits.h llvm/include/llvm/Support/SMTAPI.h llvm/include/llvm/Support/ScaledNumber.h llvm/include/llvm/Support/SpecialCaseList.h llvm/include/llvm/TableGen/DirectiveEmitter.h llvm/include/llvm/Transforms/Utils/LoopPeel.h llvm/lib/Analysis/AliasAnalysis.cpp llvm/lib/Analysis/LoopAccessAnalysis.cpp llvm/lib/Analysis/ValueTracking.cpp llvm/lib/CodeGen/CodeGenPrepare.cpp llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp llvm/lib/IR/AutoUpgrade.cpp llvm/lib/IR/IRBuilder.cpp llvm/lib/IR/Verifier.cpp llvm/lib/LTO/LTOBackend.cpp llvm/lib/Passes/PassBuilder.cpp llvm/lib/Passes/PassBuilderPipelines.cpp llvm/lib/ProfileData/InstrProfWriter.cpp llvm/lib/Support/APFixedPoint.cpp llvm/lib/Support/ConvertUTFWrapper.cpp llvm/lib/Support/DebugCounter.cpp llvm/lib/Support/DynamicAPInt.cpp llvm/lib/Support/FileOutputBuffer.cpp llvm/lib/Support/KnownBits.cpp llvm/lib/Support/ScaledNumber.cpp llvm/lib/Support/SlowDynamicAPInt.cpp llvm/lib/Support/SpecialCaseList.cpp llvm/lib/Support/Z3Solver.cpp llvm/lib/Target/AArch64/AArch64FrameLowering.cpp llvm/lib/Target/AArch64/AArch64ISelLowering.cpp llvm/lib/Target/AArch64/AArch64ISelLowering.h llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.cpp llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.h llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp llvm/lib/Target/DirectX/DXILShaderFlags.cpp llvm/lib/Target/DirectX/DXILShaderFlags.h llvm/lib/Target/M68k/M68kISelDAGToDAG.cpp llvm/lib/Target/M68k/M68kISelLowering.cpp llvm/lib/Target/M68k/M68kISelLowering.h llvm/lib/Target/M68k/M68kSubtarget.cpp llvm/lib/Target/M68k/M68kSubtarget.h llvm/lib/Target/NVPTX/NVPTXAliasAnalysis.h llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h llvm/lib/Target/RISCV/RISCVISelLowering.cpp llvm/lib/Target/RISCV/RISCVInstrInfo.cpp llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp llvm/lib/Target/RISCV/RISCVTargetMachine.cpp llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp llvm/lib/Target/X86/X86ISelLowering.cpp llvm/lib/TargetParser/RISCVISAInfo.cpp llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp llvm/lib/Transforms/IPO/SampleProfile.cpp llvm/lib/Transforms/InstCombine/InstructionCombining.cpp llvm/lib/Transforms/Scalar/ConstraintElimination.cpp llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp llvm/lib/Transforms/Scalar/LoopFuse.cpp llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp llvm/lib/Transforms/Utils/CloneFunction.cpp llvm/lib/Transforms/Utils/LoopPeel.cpp llvm/lib/Transforms/Utils/MemoryTaggingSupport.cpp llvm/lib/Transforms/Vectorize/LoopVectorize.cpp llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp llvm/lib/Transforms/Vectorize/VPlan.h llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp llvm/test/Assembler/autoupgrade-thread-pointer.ll llvm/test/CodeGen/AArch64/arm64-arith-saturating.ll llvm/test/CodeGen/AArch64/arm64-vshift.ll llvm/test/CodeGen/AArch64/bitcast-extend.ll llvm/test/CodeGen/AArch64/fix-shuffle-vector-be-rev.ll llvm/test/CodeGen/AArch64/fp16-vector-shuffle.ll llvm/test/CodeGen/AArch64/itofp.ll llvm/test/CodeGen/AArch64/neon-bitcast.ll llvm/test/CodeGen/AArch64/neon-insert-sve-elt.ll llvm/test/CodeGen/AArch64/neon-insextbitcast.ll llvm/test/CodeGen/AArch64/reserveXreg.ll llvm/test/CodeGen/AArch64/shuffle-extend.ll llvm/test/CodeGen/AArch64/sme-peephole-opts.ll llvm/test/CodeGen/AArch64/sme-vg-to-stack.ll llvm/test/CodeGen/AArch64/sme-zt0-state.ll llvm/test/CodeGen/AArch64/stack-tagging-prologue.ll llvm/test/CodeGen/AArch64/vector-fcvt.ll llvm/test/CodeGen/AMDGPU/GlobalISel/dropped_debug_info_assert.ll llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-inline-asm.ll llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-metadata.ll llvm/test/CodeGen/AMDGPU/GlobalISel/load-legalize-range-metadata.ll llvm/test/CodeGen/AMDGPU/GlobalISel/mmra.ll llvm/test/CodeGen/AMDGPU/lower-kernel-and-module-lds.ll llvm/test/CodeGen/AMDGPU/lower-kernel-lds.ll llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa-memcpy.ll llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa-merge.ll llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa.ll llvm/test/CodeGen/AMDGPU/lower-module-lds-all-indirect-accesses.ll llvm/test/CodeGen/AMDGPU/lower-module-lds-indirect-extern-uses-max-reachable-alignment.ll llvm/test/CodeGen/AMDGPU/lower-module-lds-via-hybrid.ll llvm/test/CodeGen/AMDGPU/mmra.ll llvm/test/CodeGen/DirectX/ShaderFlags/low-precision.ll llvm/test/CodeGen/DirectX/ShaderFlags/res-may-not-alias-sm6.7.ll llvm/test/CodeGen/DirectX/ShaderFlags/use-native-low-precision-0.ll llvm/test/CodeGen/DirectX/ShaderFlags/use-native-low-precision-1.ll llvm/test/CodeGen/NVPTX/cp-async-bulk.ll llvm/test/CodeGen/NVPTX/shift-opt.ll llvm/test/CodeGen/RISCV/attributes.ll llvm/test/CodeGen/RISCV/double-calling-conv.ll llvm/test/CodeGen/RISCV/double-convert.ll llvm/test/CodeGen/RISCV/double-imm.ll llvm/test/CodeGen/RISCV/double-mem.ll llvm/test/CodeGen/RISCV/double-previous-failure.ll llvm/test/CodeGen/RISCV/double-round-conv-sat.ll llvm/test/CodeGen/RISCV/features-info.ll llvm/test/CodeGen/RISCV/zdinx-boundary-check.ll llvm/test/CodeGen/RISCV/zdinx-memoperand.ll llvm/test/CodeGen/SPIRV/pointers/resource-addrspacecast-2.ll llvm/test/CodeGen/SPIRV/pointers/resource-addrspacecast.ll llvm/test/CodeGen/X86/avg-mask.ll llvm/test/CodeGen/X86/avgfloors.ll llvm/test/CodeGen/X86/machine-combiner-int-vec.ll llvm/test/CodeGen/X86/pr63108.ll llvm/test/Instrumentation/HWAddressSanitizer/alloca-array.ll llvm/test/Instrumentation/HWAddressSanitizer/alloca-compat.ll llvm/test/Instrumentation/HWAddressSanitizer/alloca-with-calls.ll llvm/test/Instrumentation/HWAddressSanitizer/exception-lifetime.ll llvm/test/Instrumentation/HWAddressSanitizer/prologue.ll llvm/test/Instrumentation/HWAddressSanitizer/use-after-scope-setjmp.ll llvm/test/Instrumentation/HWAddressSanitizer/use-after-scope.ll llvm/test/Transforms/ConstraintElimination/and-implied-by-operands.ll llvm/test/Transforms/ConstraintElimination/eq.ll llvm/test/Transforms/ConstraintElimination/gep-arithmetic-signed-predicates.ll llvm/test/Transforms/ConstraintElimination/geps-precondition-overflow-check.ll llvm/test/Transforms/ConstraintElimination/loops-bottom-tested-pointer-cmps.ll llvm/test/Transforms/ConstraintElimination/loops-header-tested-pointer-cmps.ll llvm/test/Transforms/ConstraintElimination/or-implied-by-operands.ll llvm/test/Transforms/ConstraintElimination/or.ll llvm/test/Transforms/GVN/phi.ll llvm/test/Transforms/GVN/pre-compare.ll llvm/test/Transforms/GVN/readattrs.ll llvm/test/Transforms/GVN/setjmp.ll llvm/test/Transforms/GVN/tbaa.ll llvm/test/Transforms/GVN/vscale.ll llvm/test/Transforms/LoopUnroll/peel-last-iteration.ll llvm/test/Transforms/SLPVectorizer/X86/long-pointer-distance.ll llvm/test/Transforms/SafeStack/AArch64/abi.ll llvm/test/Transforms/SafeStack/AArch64/abi_ssp.ll llvm/test/Transforms/SafeStack/AArch64/unreachable.ll llvm/tools/llvm-objdump/llvm-objdump.cpp llvm/unittests/ADT/BitmaskEnumTest.cpp llvm/unittests/Support/FileOutputBufferTest.cpp llvm/unittests/Target/AArch64/SMEAttributesTest.cpp llvm/unittests/TargetParser/RISCVISAInfoTest.cpp llvm/unittests/Transforms/Vectorize/VPlanTest.cpp llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp llvm/utils/TableGen/Basic/DirectiveEmitter.cpp llvm/utils/TableGen/FastISelEmitter.cpp llvm/utils/TableGen/X86RecognizableInstr.cpp mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h mlir/include/mlir/IR/OpImplementation.h mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h mlir/lib/AsmParser/AsmParserImpl.h mlir/lib/AsmParser/Lexer.cpp mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp mlir/lib/Dialect/Linalg/Transforms/DataLayoutPropagation.cpp mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp mlir/lib/Dialect/Mesh/IR/MeshOps.cpp mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp mlir/lib/Dialect/Quant/IR/QuantOps.cpp mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp mlir/lib/Dialect/Vector/IR/VectorOps.cpp mlir/lib/Dialect/Vector/Transforms/VectorLinearize.cpp mlir/lib/Dialect/X86Vector/IR/X86VectorDialect.cpp mlir/lib/Dialect/X86Vector/Transforms/LegalizeForLLVMExport.cpp mlir/lib/ExecutionEngine/JitRunner.cpp mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp mlir/lib/Target/LLVMIR/ModuleTranslation.cpp mlir/test/lib/Dialect/Test/TestAttributes.cpp mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp mlir/tools/mlir-tblgen/DialectGen.cpp mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp mlir/tools/mlir-tblgen/OpInterfacesGen.cpp openmp/runtime/test/ompt/callback.h offload/test/offloading/gpupgo/pgo1.c offload/test/offloading/gpupgo/pgo2.c

The following files introduce new uses of undef:

  • llvm/test/Transforms/GVN/vscale.ll

Undef is now deprecated and should only be used in the rare cases where no replacement is possible. For example, a load of uninitialized memory yields undef. You should use poison values for placeholders instead.

In tests, avoid using undef and having tests that trigger undefined behavior. If you need an operand with some unimportant value, you can add a new argument to the function and use that instead.

For example, this is considered a bad practice:

define void @fn() {
  ...
  br i1 undef, ...
}

Please use the following instead:

define void @fn(i1 %cond) {
  ...
  br i1 %cond, ...
}

Please refer to the Undefined Behavior Manual for more information.

@qinkunbao qinkunbao deleted the users/qinkunbao/spr/convert-specialcaselistsections-from-stringmap-to-vector branch May 19, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AArch64 backend:AMDGPU backend:ARM backend:DirectX backend:m68k backend:NVPTX backend:PowerPC backend:RISC-V backend:SPIR-V backend:X86 bazel "Peripheral" support tier build system: utils/bazel BOLT clang:bytecode Issues for the clang bytecode constexpr interpreter clang:codegen IR generation bugs: mangling, exceptions, etc. clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:headers Headers provided by Clang, e.g. for intrinsics clang:modules C++20 modules and Clang Header Modules clang:openmp OpenMP related changes to Clang clang:static analyzer clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project cmake Build system in general and CMake in particular compiler-rt:builtins compiler-rt debuginfo flang:fir-hlfir flang:openmp flang:parser flang:semantics flang Flang issues not falling into any other category HLSL HLSL Language Support libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. lld:COFF lld:ELF lld lldb lldb-dap llvm:adt llvm:analysis Includes value tracking, cost tables and constant folding llvm:binary-utilities llvm:globalisel llvm:instcombine Covers the InstCombine, InstSimplify and AggressiveInstCombine passes llvm:ir llvm:SelectionDAG SelectionDAGISel as well llvm:support llvm:transforms LTO Link time optimization (regular/full LTO or ThinLTO) mc Machine (object) code mlir:affine mlir:core MLIR Core Infrastructure mlir:execution-engine mlir:linalg mlir:llvm mlir:openmp mlir:quant mlir:scf mlir:sparse Sparse compiler in MLIR mlir:vector mlir:vectorops mlir offload openmp:libomp OpenMP host runtime PGO Profile Guided Optimizations platform:windows tablegen tools:llvm-exegesis vectorizers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants