aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Instruction.h
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2001-07-20 21:05:02 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2001-07-20 21:05:02 +0000
commit3344615555d57b2c16f36a3108b78ac89c7b4e7f (patch)
tree708530a1750aa91e2089dd960c4ca3b995c25686 /include/llvm/Instruction.h
parent369bbeb62cef986b6eb5213c9edab1a4c4f157af (diff)
downloadexternal_llvm-3344615555d57b2c16f36a3108b78ac89c7b4e7f.zip
external_llvm-3344615555d57b2c16f36a3108b78ac89c7b4e7f.tar.gz
external_llvm-3344615555d57b2c16f36a3108b78ac89c7b4e7f.tar.bz2
Added a representation of the machine instructions generated
for a VM instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Instruction.h')
-rw-r--r--include/llvm/Instruction.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h
index 6b6d31a..fefc1a4 100644
--- a/include/llvm/Instruction.h
+++ b/include/llvm/Instruction.h
@@ -8,16 +8,20 @@
#ifndef LLVM_INSTRUCTION_H
#define LLVM_INSTRUCTION_H
+#include <vector>
#include "llvm/User.h"
class Type;
class BasicBlock;
class Method;
+class MachineInstr; // do not include header file MachineInstr.h
+class MachineCodeForVMInstr;
class Instruction : public User {
BasicBlock *Parent;
unsigned iType; // InstructionType
+ MachineCodeForVMInstr* machineInstrVec;
friend class ValueHolder<Instruction,BasicBlock,Method>;
inline void setParent(BasicBlock *P) { Parent = P; }
@@ -27,20 +31,28 @@ public:
// Specialize setName to handle symbol table majik...
virtual void setName(const string &name);
-
+
// clone() - Create a copy of 'this' instruction that is identical in all ways
// except the following:
// * The instruction has no parent
// * The instruction has no name
//
virtual Instruction *clone() const = 0;
-
+
+ // Add a machine instruction used to implement this instruction
+ //
+ void addMachineInstruction(MachineInstr* minstr);
+
// Accessor methods...
//
inline const BasicBlock *getParent() const { return Parent; }
inline BasicBlock *getParent() { return Parent; }
virtual bool hasSideEffects() const { return false; } // Memory & Call insts
-
+ inline MachineCodeForVMInstr&
+ getMachineInstrVec() { return *machineInstrVec; }
+ const vector<Value*>&
+ getTempValuesForMachineCode() const;
+
// ---------------------------------------------------------------------------
// Subclass classification... getInstType() returns a member of
// one of the enums that is coming soon (down below)...
@@ -65,7 +77,13 @@ public:
// isPHINode() - This is used frequently enough to allow it to exist
inline bool isPHINode() const { return iType == PHINode; }
-
+ // dropAllReferences() - This function is in charge of "letting go" of all
+ // objects that this Instruction refers to. This first lets go of all
+ // references to hidden values generated code for this instruction,
+ // and then drops all references to its operands.
+ //
+ void dropAllReferences();
+
//----------------------------------------------------------------------
// Exported enumerations...
//