[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineCodeForBasicBlock.h MachineCodeForInstruction.h

Chris Lattner lattner at cs.uiuc.edu
Sun Oct 27 19:23:00 PST 2002


Changes in directory llvm/include/llvm/CodeGen:

MachineCodeForBasicBlock.h updated: 1.4 -> 1.5
MachineCodeForInstruction.h updated: 1.3 -> 1.4

---
Log message:

Inline some methods from .cpp files into .h files, minor cleanups


---
Diffs of the changes:

Index: llvm/include/llvm/CodeGen/MachineCodeForBasicBlock.h
diff -u llvm/include/llvm/CodeGen/MachineCodeForBasicBlock.h:1.4 llvm/include/llvm/CodeGen/MachineCodeForBasicBlock.h:1.5
--- llvm/include/llvm/CodeGen/MachineCodeForBasicBlock.h:1.4	Sun Oct 27 18:25:36 2002
+++ llvm/include/llvm/CodeGen/MachineCodeForBasicBlock.h	Sun Oct 27 19:21:54 2002
@@ -1,8 +1,8 @@
-//===-- llvm/CodeGen/MachineBasicBlock.h ------------------------*- C++ -*--=//
+//===-- llvm/CodeGen/MachineBasicBlock.h ------------------------*- C++ -*-===//
 // 
 // Collect the sequence of machine instructions for a basic block.
 //
-//===---------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
 
 #ifndef LLVM_CODEGEN_MACHINEBASICBLOCK_H
 #define LLVM_CODEGEN_MACHINEBASICBLOCK_H
@@ -19,7 +19,7 @@
 class MachineBasicBlock: public Annotation {
   std::vector<MachineInstr*> Insts;
 public:
-  MachineBasicBlock();
+  MachineBasicBlock() : Annotation(MCFBB_AID) {}
   ~MachineBasicBlock() {}
   
   // Static methods to retrieve or destroy the MachineBasicBlock


Index: llvm/include/llvm/CodeGen/MachineCodeForInstruction.h
diff -u llvm/include/llvm/CodeGen/MachineCodeForInstruction.h:1.3 llvm/include/llvm/CodeGen/MachineCodeForInstruction.h:1.4
--- llvm/include/llvm/CodeGen/MachineCodeForInstruction.h:1.3	Fri Aug  9 15:04:28 2002
+++ llvm/include/llvm/CodeGen/MachineCodeForInstruction.h	Sun Oct 27 19:21:54 2002
@@ -24,15 +24,22 @@
 class Instruction;
 class Value;
 
+extern AnnotationID MCFI_AID;
+
 class MachineCodeForInstruction : public Annotation {
   std::vector<Value*> tempVec;         // used by m/c instr but not VM instr
   std::vector<MachineInstr*> Contents;
 public:
-  MachineCodeForInstruction();
+  MachineCodeForInstruction() : Annotation(MCFI_AID) {}
   ~MachineCodeForInstruction();
   
-  static MachineCodeForInstruction &get(const Instruction *I);
-  static void destroy(const Instruction *I);
+  static MachineCodeForInstruction &get(const Instruction *I) {
+    assert(I != NULL);
+    return *(MachineCodeForInstruction*)I->getOrCreateAnnotation(MCFI_AID);
+  }
+  static void destroy(const Instruction *I) {
+    I->deleteAnnotation(MCFI_AID);
+  }
 
   // Access to underlying machine instructions...
   typedef std::vector<MachineInstr*>::iterator iterator;





More information about the llvm-commits mailing list