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( |
| 10 | AnnotationManager::getID("CodeGen::MachineCodeForBasicBlock")); |
| 11 | |
| 12 | static Annotation *CreateMCFBB(AnnotationID AID, const Annotable *, void *) { |
| 13 | assert(AID == MCFBB_AID); |
| 14 | return new MachineCodeForBasicBlock(); // Invoke constructor! |
| 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 | |
| 25 | MachineCodeForBasicBlock::MachineCodeForBasicBlock() |
| 26 | : Annotation(MCFBB_AID) |
| 27 | {} |
| 28 | |