summaryrefslogtreecommitdiff
path: root/include/llvm/iMemory.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-13 22:28:50 +0000
committerChris Lattner <sabre@nondot.org>2002-09-13 22:28:50 +0000
commite87e1c9aa947e6558412b6517308410cd0f5aea4 (patch)
treee64b7d79741476bd0070c8284ac6757ee0be1a83 /include/llvm/iMemory.h
parent05804b74590ab8714bd7695d8cd0d98819c092f9 (diff)
downloadllvm-e87e1c9aa947e6558412b6517308410cd0f5aea4.tar.gz
llvm-e87e1c9aa947e6558412b6517308410cd0f5aea4.tar.bz2
llvm-e87e1c9aa947e6558412b6517308410cd0f5aea4.tar.xz
Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3711 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/iMemory.h')
-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 e2a1e1bd64..c198aebd70 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: