1 //===-- llvm/CodeGen/MachineCodeForInstruction.h -----------------*- C++ -*--=//
3 // Representation of the sequence of machine instructions created
4 // for a single VM instruction. Additionally records information
5 // about hidden and implicit values used by the machine instructions:
6 // about hidden values used by the machine instructions:
8 // "Temporary values" are intermediate values used in the machine
9 // instruction sequence, but not in the VM instruction
10 // Note that such values should be treated as pure SSA values with
11 // no interpretation of their operands (i.e., as a TmpInstruction
12 // object which actually represents such a value).
14 // (2) "Implicit uses" are values used in the VM instruction but not in
15 // the machine instruction sequence
17 //===----------------------------------------------------------------------===//
19 #ifndef LLVM_CODEGEN_MACHINECODE_FOR_INSTRUCTION_H
20 #define LLVM_CODEGEN_MACHINECODE_FOR_INSTRUCTION_H
22 #include "llvm/Annotation.h"
28 class MachineCodeForInstruction
29 : public Annotation, public std::vector<MachineInstr*> {
30 std::vector<Value*> tempVec; // used by m/c instr but not VM instr
33 MachineCodeForInstruction();
34 ~MachineCodeForInstruction();
36 static MachineCodeForInstruction &get(const Instruction *I);
37 static void destroy(const Instruction *I);
39 // dropAllReferences() - This function drops all references within
40 // temporary (hidden) instructions created in implementing the original
41 // VM intruction. This ensures there are no remaining "uses" within
42 // these hidden instructions, before the values of a method are freed.
44 void dropAllReferences();
46 const std::vector<Value*> &getTempValues() const { return tempVec; }
47 std::vector<Value*> &getTempValues() { return tempVec; }
49 inline MachineCodeForInstruction &addTemp(Value *tmp) {
50 tempVec.push_back(tmp);