[llvm] [llvm] Migrate to FoldingSet's typed lookup/insert/erase. NFC (PR #219764)

via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 29 22:18:29 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- bolt/lib/Core/DIEBuilder.cpp bolt/lib/Core/DebugNames.cpp llvm/include/llvm/ADT/ImmutableList.h llvm/lib/Analysis/ScalarEvolution.cpp llvm/lib/DWARFLinker/Classic/DWARFLinker.cpp llvm/lib/DWARFLinker/Parallel/DWARFLinkerUnit.cpp llvm/lib/IR/Attributes.cpp llvm/lib/IR/LegacyPassManager.cpp llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/bolt/lib/Core/DebugNames.cpp b/bolt/lib/Core/DebugNames.cpp
index dc2494bec..fa6a207ee 100644
--- a/bolt/lib/Core/DebugNames.cpp
+++ b/bolt/lib/Core/DebugNames.cpp
@@ -627,8 +627,7 @@ void DWARF5AcceleratorTable::populateAbbrevsMap() {
         FoldingSetNodeID ID;
         Abbrev.Profile(ID);
         FoldingSetInsertToken Token;
-        if (DebugNamesAbbrev *Existing =
-                AbbreviationsSet.lookup(ID, Token)) {
+        if (DebugNamesAbbrev *Existing = AbbreviationsSet.lookup(ID, Token)) {
           Value->setAbbrevNumber(Existing->getNumber());
           continue;
         }
diff --git a/llvm/include/llvm/ADT/ImmutableList.h b/llvm/include/llvm/ADT/ImmutableList.h
index 96b526bad..2698c829a 100644
--- a/llvm/include/llvm/ADT/ImmutableList.h
+++ b/llvm/include/llvm/ADT/ImmutableList.h
@@ -192,7 +192,7 @@ public:
 
     const ListTy* TailImpl = Tail.getInternalPointer();
     ListTy::Profile(ID, Head, TailImpl);
-    ListTy* L = Cache.lookup(ID, Token);
+    ListTy *L = Cache.lookup(ID, Token);
 
     if (!L) {
       // The list does not exist in our cache.  Create it.
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 01c35e997..b66cdf159 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -1337,8 +1337,7 @@ AttributeSetNode *AttributeSetNode::getSorted(LLVMContext &C,
     Attr.Profile(ID);
 
   FoldingSetInsertToken Token;
-  AttributeSetNode *PA =
-    pImpl->AttrsSetNodes.lookup(ID, Token);
+  AttributeSetNode *PA = pImpl->AttrsSetNodes.lookup(ID, Token);
 
   // If we didn't find any existing attributes of the same shape then create a
   // new one and insert it.
@@ -1559,8 +1558,7 @@ AttributeList AttributeList::getImpl(LLVMContext &C,
   AttributeListImpl::Profile(ID, AttrSets);
 
   FoldingSetInsertToken Token;
-  AttributeListImpl *PA =
-      pImpl->AttrsLists.lookup(ID, Token);
+  AttributeListImpl *PA = pImpl->AttrsLists.lookup(ID, Token);
 
   // If we didn't find any existing attributes of the same shape then
   // create a new one and insert it.

``````````

</details>


https://github.com/llvm/llvm-project/pull/219764


More information about the llvm-commits mailing list