Vikram S. Adve | 11991ac | 2002-07-08 23:01:11 +0000 | [diff] [blame] | 1 | //===-- llvm/CodeGen/MachineCodeForBasicBlock.cpp ---------------*- C++ -*--=// |
| 2 | // |
| 3 | // Purpose: |
| 4 | // Collect the sequence of machine instructions for a basic block. |
| 5 | //===---------------------------------------------------------------------===// |
| 6 | |
| 7 | #include "llvm/CodeGen/MachineCodeForBasicBlock.h" |
| 8 | |
| 9 | AnnotationID MCFBB_AID( |
Chris Lattner | 0c68e8c | 2002-10-28 00:37:53 +0000 | [diff] [blame] | 10 | AnnotationManager::getID("CodeGen::MachineBasicBlock")); |
Vikram S. Adve | 11991ac | 2002-07-08 23:01:11 +0000 | [diff] [blame] | 11 | |
| 12 | static Annotation *CreateMCFBB(AnnotationID AID, const Annotable *, void *) { |
| 13 | assert(AID == MCFBB_AID); |
Chris Lattner | 0c68e8c | 2002-10-28 00:37:53 +0000 | [diff] [blame] | 14 | return new MachineBasicBlock(); // Invoke constructor! |
Vikram S. Adve | 11991ac | 2002-07-08 23:01:11 +0000 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | // Register the annotation with the annotation factory |
| 18 | static struct MCFBBInitializer { |
| 19 | MCFBBInitializer() { |
| 20 | AnnotationManager::registerAnnotationFactory(MCFBB_AID, &CreateMCFBB); |
| 21 | } |
| 22 | } RegisterCreateMCFBB; |
| 23 | |
| 24 | |
Chris Lattner | 0c68e8c | 2002-10-28 00:37:53 +0000 | [diff] [blame] | 25 | MachineBasicBlock::MachineBasicBlock() |
Vikram S. Adve | 11991ac | 2002-07-08 23:01:11 +0000 | [diff] [blame] | 26 | : Annotation(MCFBB_AID) |
| 27 | {} |
| 28 | |