aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-15 23:53:25 +0000
committerOwen Anderson <resistor@mac.com>2009-07-15 23:53:25 +0000
commit50dead06ffc107edb7e84857baaeeb09039c631c (patch)
tree2e30bfd47153b472b2e2ff73a2fb3b594ca56f46 /include/llvm
parent6d823cd39d8d16571682cd1bb4cbf2ecb4815d8e (diff)
downloadexternal_llvm-50dead06ffc107edb7e84857baaeeb09039c631c.tar.gz
external_llvm-50dead06ffc107edb7e84857baaeeb09039c631c.tar.bz2
external_llvm-50dead06ffc107edb7e84857baaeeb09039c631c.zip
Revert yesterday's change by removing the LLVMContext parameter to AllocaInst and MallocInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75863 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Instructions.h55
-rw-r--r--include/llvm/Support/IRBuilder.h4
-rw-r--r--include/llvm/Transforms/Utils/Local.h5
3 files changed, 30 insertions, 34 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index b20ac18f41..6fa434cccf 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -40,12 +40,10 @@ class LLVMContext;
///
class AllocationInst : public UnaryInstruction {
protected:
- LLVMContext &Context;
-
- AllocationInst(LLVMContext &Context, const Type *Ty, Value *ArraySize,
+ AllocationInst(const Type *Ty, Value *ArraySize,
unsigned iTy, unsigned Align, const std::string &Name = "",
Instruction *InsertBefore = 0);
- AllocationInst(LLVMContext &Context, const Type *Ty, Value *ArraySize,
+ AllocationInst(const Type *Ty, Value *ArraySize,
unsigned iTy, unsigned Align, const std::string &Name,
BasicBlock *InsertAtEnd);
public:
@@ -103,32 +101,31 @@ public:
class MallocInst : public AllocationInst {
MallocInst(const MallocInst &MI);
public:
- explicit MallocInst(LLVMContext &Context,
- const Type *Ty, Value *ArraySize = 0,
+ explicit MallocInst(const Type *Ty, Value *ArraySize = 0,
const std::string &NameStr = "",
Instruction *InsertBefore = 0)
- : AllocationInst(Context, Ty, ArraySize, Malloc,
+ : AllocationInst(Ty, ArraySize, Malloc,
0, NameStr, InsertBefore) {}
- MallocInst(LLVMContext &Context, const Type *Ty, Value *ArraySize,
+ MallocInst(const Type *Ty, Value *ArraySize,
const std::string &NameStr, BasicBlock *InsertAtEnd)
- : AllocationInst(Context, Ty, ArraySize, Malloc, 0, NameStr, InsertAtEnd) {}
+ : AllocationInst(Ty, ArraySize, Malloc, 0, NameStr, InsertAtEnd) {}
- MallocInst(LLVMContext &Context, const Type *Ty, const std::string &NameStr,
+ MallocInst(const Type *Ty, const std::string &NameStr,
Instruction *InsertBefore = 0)
- : AllocationInst(Context, Ty, 0, Malloc, 0, NameStr, InsertBefore) {}
- MallocInst(LLVMContext &Context, const Type *Ty, const std::string &NameStr,
+ : AllocationInst(Ty, 0, Malloc, 0, NameStr, InsertBefore) {}
+ MallocInst(const Type *Ty, const std::string &NameStr,
BasicBlock *InsertAtEnd)
- : AllocationInst(Context, Ty, 0, Malloc, 0, NameStr, InsertAtEnd) {}
+ : AllocationInst(Ty, 0, Malloc, 0, NameStr, InsertAtEnd) {}
- MallocInst(LLVMContext &Context, const Type *Ty, Value *ArraySize,
+ MallocInst(const Type *Ty, Value *ArraySize,
unsigned Align, const std::string &NameStr,
BasicBlock *InsertAtEnd)
- : AllocationInst(Context, Ty, ArraySize, Malloc,
+ : AllocationInst(Ty, ArraySize, Malloc,
Align, NameStr, InsertAtEnd) {}
- MallocInst(LLVMContext &Context, const Type *Ty, Value *ArraySize,
+ MallocInst(const Type *Ty, Value *ArraySize,
unsigned Align, const std::string &NameStr = "",
Instruction *InsertBefore = 0)
- : AllocationInst(Context, Ty, ArraySize,
+ : AllocationInst(Ty, ArraySize,
Malloc, Align, NameStr, InsertBefore) {}
virtual MallocInst *clone(LLVMContext &Context) const;
@@ -153,33 +150,33 @@ public:
class AllocaInst : public AllocationInst {
AllocaInst(const AllocaInst &);
public:
- explicit AllocaInst(LLVMContext &Context, const Type *Ty,
+ explicit AllocaInst(const Type *Ty,
Value *ArraySize = 0,
const std::string &NameStr = "",
Instruction *InsertBefore = 0)
- : AllocationInst(Context, Ty, ArraySize, Alloca,
+ : AllocationInst(Ty, ArraySize, Alloca,
0, NameStr, InsertBefore) {}
- AllocaInst(LLVMContext &Context, const Type *Ty,
+ AllocaInst(const Type *Ty,
Value *ArraySize, const std::string &NameStr,
BasicBlock *InsertAtEnd)
- : AllocationInst(Context, Ty, ArraySize, Alloca, 0, NameStr, InsertAtEnd) {}
+ : AllocationInst(Ty, ArraySize, Alloca, 0, NameStr, InsertAtEnd) {}
- AllocaInst(LLVMContext &Context, const Type *Ty, const std::string &NameStr,
+ AllocaInst(const Type *Ty, const std::string &NameStr,
Instruction *InsertBefore = 0)
- : AllocationInst(Context, Ty, 0, Alloca, 0, NameStr, InsertBefore) {}
- AllocaInst(LLVMContext &Context, const Type *Ty, const std::string &NameStr,
+ : AllocationInst(Ty, 0, Alloca, 0, NameStr, InsertBefore) {}
+ AllocaInst(const Type *Ty, const std::string &NameStr,
BasicBlock *InsertAtEnd)
- : AllocationInst(Context, Ty, 0, Alloca, 0, NameStr, InsertAtEnd) {}
+ : AllocationInst(Ty, 0, Alloca, 0, NameStr, InsertAtEnd) {}
- AllocaInst(LLVMContext &Context, const Type *Ty, Value *ArraySize,
+ AllocaInst(const Type *Ty, Value *ArraySize,
unsigned Align, const std::string &NameStr = "",
Instruction *InsertBefore = 0)
- : AllocationInst(Context, Ty, ArraySize, Alloca,
+ : AllocationInst(Ty, ArraySize, Alloca,
Align, NameStr, InsertBefore) {}
- AllocaInst(LLVMContext &Context, const Type *Ty, Value *ArraySize,
+ AllocaInst(const Type *Ty, Value *ArraySize,
unsigned Align, const std::string &NameStr,
BasicBlock *InsertAtEnd)
- : AllocationInst(Context, Ty, ArraySize, Alloca,
+ : AllocationInst(Ty, ArraySize, Alloca,
Align, NameStr, InsertAtEnd) {}
virtual AllocaInst *clone(LLVMContext &Context) const;
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h
index cd0e1826b0..2ef13a789f 100644
--- a/include/llvm/Support/IRBuilder.h
+++ b/include/llvm/Support/IRBuilder.h
@@ -330,11 +330,11 @@ public:
MallocInst *CreateMalloc(const Type *Ty, Value *ArraySize = 0,
const char *Name = "") {
- return Insert(new MallocInst(Context, Ty, ArraySize), Name);
+ return Insert(new MallocInst(Ty, ArraySize), Name);
}
AllocaInst *CreateAlloca(const Type *Ty, Value *ArraySize = 0,
const char *Name = "") {
- return Insert(new AllocaInst(Context, Ty, ArraySize), Name);
+ return Insert(new AllocaInst(Ty, ArraySize), Name);
}
FreeInst *CreateFree(Value *Ptr) {
return Insert(new FreeInst(Ptr));
diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h
index 35f2a69f47..32e7ae81b1 100644
--- a/include/llvm/Transforms/Utils/Local.h
+++ b/include/llvm/Transforms/Utils/Local.h
@@ -108,15 +108,14 @@ bool FoldBranchToCommonDest(BranchInst *BI);
/// invalidating the SSA information for the value. It returns the pointer to
/// the alloca inserted to create a stack slot for X.
///
-AllocaInst *DemoteRegToStack(LLVMContext &Context, Instruction &X,
+AllocaInst *DemoteRegToStack(Instruction &X,
bool VolatileLoads = false,
Instruction *AllocaPoint = 0);
/// DemotePHIToStack - This function takes a virtual register computed by a phi
/// node and replaces it with a slot in the stack frame, allocated via alloca.
/// The phi node is deleted and it returns the pointer to the alloca inserted.
-AllocaInst *DemotePHIToStack(LLVMContext &Context, PHINode *P,
- Instruction *AllocaPoint = 0);
+AllocaInst *DemotePHIToStack(PHINode *P, Instruction *AllocaPoint = 0);
/// OnlyUsedByDbgIntrinsics - Return true if the instruction I is only used
/// by DbgIntrinsics. If DbgInUses is specified then the vector is filled