diff options
| author | Nate Begeman <natebegeman@mac.com> | 2005-11-05 09:21:28 +0000 |
|---|---|---|
| committer | Nate Begeman <natebegeman@mac.com> | 2005-11-05 09:21:28 +0000 |
| commit | 848622f87f00b81bdfef2aed8c26f80e38217713 (patch) | |
| tree | cef0c6b2b461e20d131912b80cd6b21e5f895520 /llvm/lib/VMCore/Instructions.cpp | |
| parent | 75fe59c4ead311d292bec997ff6a08c00e644b6d (diff) | |
| download | bcm5719-llvm-848622f87f00b81bdfef2aed8c26f80e38217713.tar.gz bcm5719-llvm-848622f87f00b81bdfef2aed8c26f80e38217713.zip | |
Add support alignment of allocation instructions.
Add support for specifying alignment and size of setjmp jmpbufs.
No targets currently do anything with this information, nor is it presrved
in the bytecode representation. That's coming up next.
llvm-svn: 24196
Diffstat (limited to 'llvm/lib/VMCore/Instructions.cpp')
| -rw-r--r-- | llvm/lib/VMCore/Instructions.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index 7de5602f087..96a010b2f77 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/lib/VMCore/Instructions.cpp @@ -494,18 +494,18 @@ static Value *getAISize(Value *Amt) { } AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy, - const std::string &Name, + unsigned Align, const std::string &Name, Instruction *InsertBefore) : UnaryInstruction(PointerType::get(Ty), iTy, getAISize(ArraySize), - Name, InsertBefore) { + Name, InsertBefore), Alignment(Align) { assert(Ty != Type::VoidTy && "Cannot allocate void!"); } AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy, - const std::string &Name, + unsigned Align, const std::string &Name, BasicBlock *InsertAtEnd) : UnaryInstruction(PointerType::get(Ty), iTy, getAISize(ArraySize), - Name, InsertAtEnd) { + Name, InsertAtEnd), Alignment(Align) { assert(Ty != Type::VoidTy && "Cannot allocate void!"); } @@ -521,12 +521,12 @@ const Type *AllocationInst::getAllocatedType() const { AllocaInst::AllocaInst(const AllocaInst &AI) : AllocationInst(AI.getType()->getElementType(), (Value*)AI.getOperand(0), - Instruction::Alloca) { + Instruction::Alloca, AI.getAlignment()) { } MallocInst::MallocInst(const MallocInst &MI) : AllocationInst(MI.getType()->getElementType(), (Value*)MI.getOperand(0), - Instruction::Malloc) { + Instruction::Malloc, MI.getAlignment()) { } //===----------------------------------------------------------------------===// |

