mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
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
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user