-//===-- 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
class MachineBasicBlock: public Annotation {
std::vector<MachineInstr*> Insts;
public:
- MachineBasicBlock();
+ MachineBasicBlock() : Annotation(MCFBB_AID) {}
~MachineBasicBlock() {}
// Static methods to retrieve or destroy the MachineBasicBlock
-//===-- 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
class MachineBasicBlock: public Annotation {
std::vector<MachineInstr*> Insts;
public:
- MachineBasicBlock();
+ MachineBasicBlock() : Annotation(MCFBB_AID) {}
~MachineBasicBlock() {}
// Static methods to retrieve or destroy the MachineBasicBlock
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;
-//===-- llvm/CodeGen/MachineCodeForBasicBlock.cpp ---------------*- C++ -*--=//
+//===-- MachineCodeForBasicBlock.cpp --------------------------------------===//
//
-// Purpose:
-// Collect the sequence of machine instructions for a basic block.
-//===---------------------------------------------------------------------===//
+// Collect the sequence of machine instructions for a basic block.
+//
+//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
}
} RegisterCreateMCFBB;
-
-MachineBasicBlock::MachineBasicBlock()
- : Annotation(MCFBB_AID)
-{}
-
//===-- MachineCodeForInstruction.cpp -------------------------------------===//
//
-// Representation of the sequence of machine instructions created
-// for a single VM instruction. Additionally records information
-// about hidden and implicit values used by the machine instructions:
-// about hidden values used by the machine instructions:
+// Representation of the sequence of machine instructions created for a single
+// VM instruction. Additionally records information about hidden and implicit
+// values used by the machine instructions: about hidden values used by the
+// machine instructions:
//
-// "Temporary values" are intermediate values used in the machine
-// instruction sequence, but not in the VM instruction
-// Note that such values should be treated as pure SSA values with
-// no interpretation of their operands (i.e., as a TmpInstruction
-// object which actually represents such a value).
+// "Temporary values" are intermediate values used in the machine instruction
+// sequence, but not in the VM instruction Note that such values should be
+// treated as pure SSA values with no interpretation of their operands (i.e., as
+// a TmpInstruction object which actually represents such a value).
//
-// (2) "Implicit uses" are values used in the VM instruction but not in
-// the machine instruction sequence
+// (2) "Implicit uses" are values used in the VM instruction but not in the
+// machine instruction sequence
//
//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/InstrSelection.h"
-static AnnotationID MCFI_AID(
+AnnotationID MCFI_AID(
AnnotationManager::getID("CodeGen::MachineCodeForInstruction"));
static Annotation *CreateMCFI(AnnotationID AID, const Annotable *, void *) {
} RegisterCreateMCFI;
-MachineCodeForInstruction&
-MachineCodeForInstruction::get(const Instruction *I){
- assert(I != NULL);
- return *(MachineCodeForInstruction*)I->getOrCreateAnnotation(MCFI_AID);
-}
-
-
-void
-MachineCodeForInstruction::destroy(const Instruction *I) {
- I->deleteAnnotation(MCFI_AID);
-}
-
-
void
MachineCodeForInstruction::dropAllReferences()
{
}
-MachineCodeForInstruction::MachineCodeForInstruction()
- : Annotation(MCFI_AID)
-{}
-
-
MachineCodeForInstruction::~MachineCodeForInstruction()
{
// Let go of all uses in temp. instructions
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;