summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp17
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp2
-rw-r--r--llvm/lib/MC/MCFragment.cpp4
-rw-r--r--llvm/lib/Support/YAMLParser.cpp11
4 files changed, 14 insertions, 20 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 8d34360b331..1788d7ca952 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -74,7 +74,8 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const MachineBasicBlock &MBB) {
/// MBBs start out as #-1. When a MBB is added to a MachineFunction, it
/// gets the next available unique MBB number. If it is removed from a
/// MachineFunction, it goes back to being #-1.
-void ilist_traits<MachineBasicBlock>::addNodeToList(MachineBasicBlock *N) {
+void ilist_callback_traits<MachineBasicBlock>::addNodeToList(
+ MachineBasicBlock *N) {
MachineFunction &MF = *N->getParent();
N->Number = MF.addToMBBNumbering(N);
@@ -85,7 +86,8 @@ void ilist_traits<MachineBasicBlock>::addNodeToList(MachineBasicBlock *N) {
I->AddRegOperandsToUseLists(RegInfo);
}
-void ilist_traits<MachineBasicBlock>::removeNodeFromList(MachineBasicBlock *N) {
+void ilist_callback_traits<MachineBasicBlock>::removeNodeFromList(
+ MachineBasicBlock *N) {
N->getParent()->removeFromMBBNumbering(N->Number);
N->Number = -1;
}
@@ -116,10 +118,11 @@ void ilist_traits<MachineInstr>::removeNodeFromList(MachineInstr *N) {
/// When moving a range of instructions from one MBB list to another, we need to
/// update the parent pointers and the use/def lists.
-void ilist_traits<MachineInstr>::
-transferNodesFromList(ilist_traits<MachineInstr> &FromList,
- ilist_iterator<MachineInstr> First,
- ilist_iterator<MachineInstr> Last) {
+template <>
+void ilist_traits<MachineInstr>::transferNodesFromList<
+ ilist<MachineInstr>::iterator>(ilist_traits<MachineInstr> &FromList,
+ ilist<MachineInstr>::iterator First,
+ ilist<MachineInstr>::iterator Last) {
assert(Parent->getParent() == FromList.Parent->getParent() &&
"MachineInstr parent mismatch!");
assert(this != &FromList && "Called without a real transfer...");
@@ -131,7 +134,7 @@ transferNodesFromList(ilist_traits<MachineInstr> &FromList,
First->setParent(Parent);
}
-void ilist_traits<MachineInstr>::deleteNode(MachineInstr* MI) {
+void ilist_traits<MachineInstr>::deleteNode(MachineInstr *MI) {
assert(!MI->getParent() && "MI is still in a block!");
Parent->getParent()->DeleteMachineInstr(MI);
}
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index c8039f5e876..7f1bb9294ad 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -86,7 +86,7 @@ void MachineFunctionProperties::print(raw_ostream &OS) const {
// Out-of-line virtual method.
MachineFunctionInfo::~MachineFunctionInfo() {}
-void ilist_traits<MachineBasicBlock>::deleteNode(MachineBasicBlock *MBB) {
+void ilist_alloc_traits<MachineBasicBlock>::deleteNode(MachineBasicBlock *MBB) {
MBB->getParent()->DeleteMachineBasicBlock(MBB);
}
diff --git a/llvm/lib/MC/MCFragment.cpp b/llvm/lib/MC/MCFragment.cpp
index e2c4b22688d..8ff8f8aba1c 100644
--- a/llvm/lib/MC/MCFragment.cpp
+++ b/llvm/lib/MC/MCFragment.cpp
@@ -232,9 +232,7 @@ uint64_t llvm::computeBundlePadding(const MCAssembler &Assembler,
/* *** */
-void ilist_node_traits<MCFragment>::deleteNode(MCFragment *V) {
- V->destroy();
-}
+void ilist_alloc_traits<MCFragment>::deleteNode(MCFragment *V) { V->destroy(); }
MCFragment::~MCFragment() { }
diff --git a/llvm/lib/Support/YAMLParser.cpp b/llvm/lib/Support/YAMLParser.cpp
index 7490f1a9708..c083e1f1ebd 100644
--- a/llvm/lib/Support/YAMLParser.cpp
+++ b/llvm/lib/Support/YAMLParser.cpp
@@ -149,22 +149,15 @@ struct Token : ilist_node<Token> {
}
namespace llvm {
-template<>
-struct ilist_node_traits<Token> {
+template <> struct ilist_alloc_traits<Token> {
Token *createNode(const Token &V) {
return new (Alloc.Allocate<Token>()) Token(V);
}
static void deleteNode(Token *V) { V->~Token(); }
- void addNodeToList(Token *) {}
- void removeNodeFromList(Token *) {}
- void transferNodesFromList(ilist_node_traits & /*SrcTraits*/,
- ilist_iterator<Token> /*first*/,
- ilist_iterator<Token> /*last*/) {}
-
BumpPtrAllocator Alloc;
};
-}
+} // end namespace llvm
typedef ilist<Token> TokenQueueT;
OpenPOWER on IntegriCloud