diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-28 05:30:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-28 05:30:46 +0000 |
commit | d0aa0cdbc6fee00f2b2019633a9b9d00d301ac68 (patch) | |
tree | f8540335fb213761b69aa8cd7f5a06b9f04954e8 /include/llvm/CodeGen/MachineBasicBlock.h | |
parent | 07541a271152687dd8d443de48b563dc08a65cbd (diff) |
Change MachineBasicBlock's to not be Annotations, instead they are kept as
part of a linked list tracked by MachineFunction. MachineBasicBlock::get
is now linear time instead of constant time, and thus is deprecated!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4337 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineBasicBlock.h')
-rw-r--r-- | include/llvm/CodeGen/MachineBasicBlock.h | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index aa32a81109..dfa8e0d183 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -7,31 +7,28 @@ #ifndef LLVM_CODEGEN_MACHINEBASICBLOCK_H #define LLVM_CODEGEN_MACHINEBASICBLOCK_H -#include "llvm/Annotation.h" #include <vector> class BasicBlock; class MachineInstr; template <typename T> struct ilist_traits; -extern AnnotationID MCFBB_AID; - -class MachineBasicBlock : public Annotation { +class MachineBasicBlock { std::vector<MachineInstr*> Insts; MachineBasicBlock *Prev, *Next; + BasicBlock *BB; public: - MachineBasicBlock() : Annotation(MCFBB_AID) {} + MachineBasicBlock(BasicBlock *bb = 0) : Prev(0), Next(0), BB(bb) {} ~MachineBasicBlock() {} - // Static methods to retrieve or destroy the MachineBasicBlock - // object for a given basic block. - static MachineBasicBlock& get(const BasicBlock *BB) { - return *(MachineBasicBlock*) - ((Annotable*)BB)->getOrCreateAnnotation(MCFBB_AID); - } - - static void destroy(const BasicBlock *BB) { - ((Annotable*)BB)->deleteAnnotation(MCFBB_AID); - } + // get - This deprecated static method returns the MachineBasicBlock object + // for the specified BasicBlock. + // + static MachineBasicBlock& get(const BasicBlock *BB); + + /// getBasicBlock - Return the LLVM basic block that this instance + /// corresponded to originally. + /// + BasicBlock *getBasicBlock() const { return BB; } typedef std::vector<MachineInstr*>::iterator iterator; typedef std::vector<MachineInstr*>::const_iterator const_iterator; |