aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2003-05-31 07:41:24 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2003-05-31 07:41:24 +0000
commitf3d3ca18b5a36f3a331367aa9ff0c3bcbd86ca82 (patch)
tree9e66723c3f2a70ddd884ac0abcba0c196793e3d1 /include
parent3497782f3843007de3be0c43e3ff206a01e2ccac (diff)
downloadexternal_llvm-f3d3ca18b5a36f3a331367aa9ff0c3bcbd86ca82.zip
external_llvm-f3d3ca18b5a36f3a331367aa9ff0c3bcbd86ca82.tar.gz
external_llvm-f3d3ca18b5a36f3a331367aa9ff0c3bcbd86ca82.tar.bz2
Added MachineCodeForInstruction object as an argument to
TmpInstruction constructors because every TmpInstruction object has to be registered with a MachineCodeForInstruction to prevent leaks. This simplifies the user's code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/InstrSelection.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/InstrSelection.h b/include/llvm/CodeGen/InstrSelection.h
index 256a180..c1ed86e 100644
--- a/include/llvm/CodeGen/InstrSelection.h
+++ b/include/llvm/CodeGen/InstrSelection.h
@@ -13,6 +13,7 @@ class InstrForest;
class MachineInstr;
class InstructionNode;
class TargetMachine;
+class MachineCodeForInstruction;
class Pass;
//===--------------------- Required Functions ---------------------------------
@@ -68,14 +69,19 @@ class TmpInstruction : public Instruction {
public:
// Constructor that uses the type of S1 as the type of the temporary.
// s1 must be a valid value. s2 may be NULL.
- TmpInstruction(Value *s1, Value *s2 = 0, const std::string &name = "");
+ TmpInstruction(MachineCodeForInstruction& mcfi,
+ Value *s1, Value *s2 = 0, const std::string &name = "");
// Constructor that requires the type of the temporary to be specified.
// Both S1 and S2 may be NULL.
- TmpInstruction(const Type *Ty, Value *s1 = 0, Value* s2 = 0,
+ TmpInstruction(MachineCodeForInstruction& mcfi,
+ const Type *Ty, Value *s1 = 0, Value* s2 = 0,
const std::string &name = "");
- virtual Instruction *clone() const { return new TmpInstruction(*this); }
+ virtual Instruction *clone() const {
+ assert(0 && "Cannot clone TmpInstructions!");
+ return 0;
+ }
virtual const char *getOpcodeName() const {
return "TempValueForMachineInstr";
}