Skip to content

[LLVM] Include simple_ilist.h in preference to ilist.h. NFC. #96644

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

Closed
wants to merge 1 commit into from

Conversation

jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Jun 25, 2024

Files that do not use iplist or ilist_traits do not need to include the
full ilist.h.

Files that do not use iplist or ilist_traits do not need to include the
full ilist.h.
@llvmbot llvmbot added llvm:regalloc debuginfo llvm:support llvm:ir llvm:analysis Includes value tracking, cost tables and constant folding labels Jun 25, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 25, 2024

@llvm/pr-subscribers-llvm-support
@llvm/pr-subscribers-llvm-regalloc
@llvm/pr-subscribers-llvm-ir
@llvm/pr-subscribers-llvm-analysis

@llvm/pr-subscribers-debuginfo

Author: Jay Foad (jayfoad)

Changes

Files that do not use iplist or ilist_traits do not need to include the
full ilist.h.


Full diff: https://github.com/llvm/llvm-project/pull/96644.diff

6 Files Affected:

  • (modified) llvm/include/llvm/Analysis/AliasSetTracker.h (+1-1)
  • (modified) llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h (-1)
  • (modified) llvm/include/llvm/CodeGen/SlotIndexes.h (+1-1)
  • (modified) llvm/include/llvm/IR/BasicBlock.h (+1-1)
  • (modified) llvm/include/llvm/IR/DebugProgramInstruction.h (+1-1)
  • (modified) llvm/include/llvm/Support/Recycler.h (+1-1)
diff --git a/llvm/include/llvm/Analysis/AliasSetTracker.h b/llvm/include/llvm/Analysis/AliasSetTracker.h
index b8e8e7ef047f9..25a7a051085a3 100644
--- a/llvm/include/llvm/Analysis/AliasSetTracker.h
+++ b/llvm/include/llvm/Analysis/AliasSetTracker.h
@@ -20,8 +20,8 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/ilist.h"
 #include "llvm/ADT/ilist_node.h"
+#include "llvm/ADT/simple_ilist.h"
 #include "llvm/Analysis/MemoryLocation.h"
 #include "llvm/IR/Instruction.h"
 #include "llvm/IR/PassManager.h"
diff --git a/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h b/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h
index 250cb0d78a68f..a0cefb53039dc 100644
--- a/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h
+++ b/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h
@@ -13,7 +13,6 @@
 #ifndef LLVM_CODEGEN_MACHINEINSTRBUNDLEITERATOR_H
 #define LLVM_CODEGEN_MACHINEINSTRBUNDLEITERATOR_H
 
-#include "llvm/ADT/ilist.h"
 #include "llvm/ADT/simple_ilist.h"
 #include <cassert>
 #include <iterator>
diff --git a/llvm/include/llvm/CodeGen/SlotIndexes.h b/llvm/include/llvm/CodeGen/SlotIndexes.h
index 72f4a6876b6cb..e02a34fd3e6cf 100644
--- a/llvm/include/llvm/CodeGen/SlotIndexes.h
+++ b/llvm/include/llvm/CodeGen/SlotIndexes.h
@@ -22,7 +22,7 @@
 #include "llvm/ADT/IntervalMap.h"
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/ilist.h"
+#include "llvm/ADT/simple_ilist.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
diff --git a/llvm/include/llvm/IR/BasicBlock.h b/llvm/include/llvm/IR/BasicBlock.h
index 80067f2652a2b..218e0cbeea4bb 100644
--- a/llvm/include/llvm/IR/BasicBlock.h
+++ b/llvm/include/llvm/IR/BasicBlock.h
@@ -16,10 +16,10 @@
 #include "llvm-c/Types.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/Twine.h"
-#include "llvm/ADT/ilist.h"
 #include "llvm/ADT/ilist_node.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/ADT/iterator_range.h"
+#include "llvm/ADT/simple_ilist.h"
 #include "llvm/IR/DebugProgramInstruction.h"
 #include "llvm/IR/Instruction.h"
 #include "llvm/IR/SymbolTableListTraits.h"
diff --git a/llvm/include/llvm/IR/DebugProgramInstruction.h b/llvm/include/llvm/IR/DebugProgramInstruction.h
index ed8081a3cad19..1cbe3d32402e5 100644
--- a/llvm/include/llvm/IR/DebugProgramInstruction.h
+++ b/llvm/include/llvm/IR/DebugProgramInstruction.h
@@ -47,9 +47,9 @@
 #ifndef LLVM_IR_DEBUGPROGRAMINSTRUCTION_H
 #define LLVM_IR_DEBUGPROGRAMINSTRUCTION_H
 
-#include "llvm/ADT/ilist.h"
 #include "llvm/ADT/ilist_node.h"
 #include "llvm/ADT/iterator.h"
+#include "llvm/ADT/simple_ilist.h"
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/IR/Instruction.h"
 #include "llvm/IR/SymbolTableListTraits.h"
diff --git a/llvm/include/llvm/Support/Recycler.h b/llvm/include/llvm/Support/Recycler.h
index bbd9ae321ae30..e2e5c7a3ff605 100644
--- a/llvm/include/llvm/Support/Recycler.h
+++ b/llvm/include/llvm/Support/Recycler.h
@@ -14,7 +14,7 @@
 #ifndef LLVM_SUPPORT_RECYCLER_H
 #define LLVM_SUPPORT_RECYCLER_H
 
-#include "llvm/ADT/ilist.h"
+#include "llvm/ADT/simple_ilist.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>

@jayfoad jayfoad requested a review from kazutakahirata June 25, 2024 14:49
Copy link
Contributor

@fhahn fhahn left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@@ -14,7 +14,7 @@
#ifndef LLVM_SUPPORT_RECYCLER_H
#define LLVM_SUPPORT_RECYCLER_H

#include "llvm/ADT/ilist.h"
#include "llvm/ADT/simple_ilist.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see any ilist uses in this file at all.

#include "llvm/ADT/ilist_node.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/ADT/simple_ilist.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see any simple_ilist mentions in this file either. Though it's kind of moot since SymbolTableListTraits will pull in ilist.h anyway.

@@ -22,7 +22,7 @@
#include "llvm/ADT/IntervalMap.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/ilist.h"
#include "llvm/ADT/simple_ilist.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

This file uses ilist<> (which is a typedef for iplist<>).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry. I was trying to do IWYU by hand but it is more complicated than I realized. I will abandon this patch.

#include "llvm/ADT/ilist_node.h"
#include "llvm/ADT/simple_ilist.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

This uses ilist<>, so I think it needs the header.

@jayfoad
Copy link
Contributor Author

jayfoad commented Jun 26, 2024

Abandoning.

@jayfoad jayfoad closed this Jun 26, 2024
@jayfoad
Copy link
Contributor Author

jayfoad commented Jun 26, 2024

I decided to focus on simplifying SlotIndexes instead: #96747

@jayfoad jayfoad deleted the simple-ilist-only branch June 26, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debuginfo llvm:analysis Includes value tracking, cost tables and constant folding llvm:ir llvm:regalloc llvm:support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants