mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SIL] NFC: Migrate BuiltinInst to InstructionBaseWithTrailingOperands
This commit is contained in:
@@ -383,15 +383,10 @@ BuiltinInst *BuiltinInst::create(SILDebugLocation Loc, Identifier Name,
|
||||
BuiltinInst::BuiltinInst(SILDebugLocation Loc, Identifier Name,
|
||||
SILType ReturnType, SubstitutionList Subs,
|
||||
ArrayRef<SILValue> Args)
|
||||
: InstructionBase(Loc, ReturnType), Name(Name) {
|
||||
: InstructionBaseWithTrailingOperands(Args, Loc, ReturnType), Name(Name) {
|
||||
SILInstruction::Bits.BuiltinInst.NumSubstitutions = Subs.size();
|
||||
assert(SILInstruction::Bits.BuiltinInst.NumSubstitutions == Subs.size() &&
|
||||
"Truncation");
|
||||
SILInstruction::Bits.BuiltinInst.NumOperands = Args.size();
|
||||
Operand *dynamicSlot = getTrailingObjects<Operand>();
|
||||
for (auto value : Args) {
|
||||
new (dynamicSlot++) Operand(this, value);
|
||||
}
|
||||
std::uninitialized_copy(Subs.begin(), Subs.end(),
|
||||
getTrailingObjects<Substitution>());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user