mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Add more IR support for the new extractvalue and insertvalue
instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51461 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1689,8 +1689,42 @@ template <>
|
||||
struct OperandTraits<ExtractValueInst> : VariadicOperandTraits<1> {
|
||||
};
|
||||
|
||||
template<typename InputIterator>
|
||||
ExtractValueInst::ExtractValueInst(Value *Agg,
|
||||
InputIterator IdxBegin,
|
||||
InputIterator IdxEnd,
|
||||
unsigned Values,
|
||||
const std::string &Name,
|
||||
Instruction *InsertBefore)
|
||||
: Instruction(checkType(getIndexedType(Agg->getType(), IdxBegin, IdxEnd)),
|
||||
ExtractValue,
|
||||
OperandTraits<ExtractValueInst>::op_end(this) - Values,
|
||||
Values, InsertBefore) {
|
||||
init(Agg, IdxBegin, IdxEnd, Name,
|
||||
typename std::iterator_traits<InputIterator>::iterator_category());
|
||||
}
|
||||
template<typename InputIterator>
|
||||
ExtractValueInst::ExtractValueInst(Value *Agg,
|
||||
InputIterator IdxBegin,
|
||||
InputIterator IdxEnd,
|
||||
unsigned Values,
|
||||
const std::string &Name,
|
||||
BasicBlock *InsertAtEnd)
|
||||
: Instruction(PointerType::get(checkType(
|
||||
getIndexedType(Agg->getType(),
|
||||
IdxBegin, IdxEnd)),
|
||||
cast<PointerType>(Agg->getType())
|
||||
->getAddressSpace()),
|
||||
ExtractValue,
|
||||
OperandTraits<ExtractValueInst>::op_end(this) - Values,
|
||||
Values, InsertAtEnd) {
|
||||
init(Agg, IdxBegin, IdxEnd, Name,
|
||||
typename std::iterator_traits<InputIterator>::iterator_category());
|
||||
}
|
||||
|
||||
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractValueInst, Value)
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// InsertValueInst Class
|
||||
//===----------------------------------------------------------------------===//
|
||||
@ -1840,6 +1874,44 @@ template <>
|
||||
struct OperandTraits<InsertValueInst> : VariadicOperandTraits<2> {
|
||||
};
|
||||
|
||||
template<typename InputIterator>
|
||||
InsertValueInst::InsertValueInst(Value *Agg,
|
||||
Value *Val,
|
||||
InputIterator IdxBegin,
|
||||
InputIterator IdxEnd,
|
||||
unsigned Values,
|
||||
const std::string &Name,
|
||||
Instruction *InsertBefore)
|
||||
: Instruction(checkType(ExtractValueInst::getIndexedType(
|
||||
Agg->getType(),
|
||||
IdxBegin, IdxEnd)),
|
||||
InsertValue,
|
||||
OperandTraits<InsertValueInst>::op_end(this) - Values,
|
||||
Values, InsertBefore) {
|
||||
init(Agg, Val, IdxBegin, IdxEnd, Name,
|
||||
typename std::iterator_traits<InputIterator>::iterator_category());
|
||||
}
|
||||
template<typename InputIterator>
|
||||
InsertValueInst::InsertValueInst(Value *Agg,
|
||||
Value *Val,
|
||||
InputIterator IdxBegin,
|
||||
InputIterator IdxEnd,
|
||||
unsigned Values,
|
||||
const std::string &Name,
|
||||
BasicBlock *InsertAtEnd)
|
||||
: Instruction(PointerType::get(checkType(
|
||||
ExtractValueInst::getIndexedType(
|
||||
Val->getType(),
|
||||
IdxBegin, IdxEnd)),
|
||||
cast<PointerType>(Val->getType())
|
||||
->getAddressSpace()),
|
||||
InsertValue,
|
||||
OperandTraits<InsertValueInst>::op_end(this) - Values,
|
||||
Values, InsertAtEnd) {
|
||||
init(Agg, Val, IdxBegin, IdxEnd, Name,
|
||||
typename std::iterator_traits<InputIterator>::iterator_category());
|
||||
}
|
||||
|
||||
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertValueInst, Value)
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Reference in New Issue
Block a user