aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/iMemory.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/llvm/iMemory.h b/include/llvm/iMemory.h
index e2a1e1b..c198aeb 100644
--- a/include/llvm/iMemory.h
+++ b/include/llvm/iMemory.h
@@ -63,13 +63,15 @@ public:
// MallocInst Class
//===----------------------------------------------------------------------===//
-struct MallocInst : public AllocationInst {
+class MallocInst : public AllocationInst {
+ MallocInst(const MallocInst &MI);
+public:
MallocInst(const Type *Ty, Value *ArraySize = 0, const std::string &Name = "",
Instruction *InsertBefore = 0)
: AllocationInst(Ty, ArraySize, Malloc, Name, InsertBefore) {}
virtual Instruction *clone() const {
- return new MallocInst((Type*)getType(), (Value*)Operands[0].get());
+ return new MallocInst(*this);
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -87,13 +89,15 @@ struct MallocInst : public AllocationInst {
// AllocaInst Class
//===----------------------------------------------------------------------===//
-struct AllocaInst : public AllocationInst {
+class AllocaInst : public AllocationInst {
+ AllocaInst(const AllocaInst &);
+public:
AllocaInst(const Type *Ty, Value *ArraySize = 0, const std::string &Name = "",
Instruction *InsertBefore = 0)
: AllocationInst(Ty, ArraySize, Alloca, Name, InsertBefore) {}
virtual Instruction *clone() const {
- return new AllocaInst((Type*)getType(), (Value*)Operands[0].get());
+ return new AllocaInst(*this);
}
// Methods for support type inquiry through isa, cast, and dyn_cast: