aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/InstructionDescriptor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backend/lib/CodeGen/InstructionDescriptor.cpp')
-rw-r--r--backend/lib/CodeGen/InstructionDescriptor.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/backend/lib/CodeGen/InstructionDescriptor.cpp b/backend/lib/CodeGen/InstructionDescriptor.cpp
index d164cde..027f738 100644
--- a/backend/lib/CodeGen/InstructionDescriptor.cpp
+++ b/backend/lib/CodeGen/InstructionDescriptor.cpp
@@ -302,6 +302,19 @@ struct OperandShape final {
} // namespace
+Expected<std::vector<const OperandDescriptor *>>
+resolveExplicitOperandDescriptors(const InstructionDescriptor &Descriptor,
+ std::size_t OperandCount) {
+ auto Shape = resolveOperandShape(Descriptor, OperandCount);
+ if (!Shape)
+ return std::unexpected(Shape.error());
+ std::vector<const OperandDescriptor *> Result;
+ Result.reserve(OperandCount);
+ for (std::size_t Index = 0; Index < OperandCount; ++Index)
+ Result.push_back(&descriptorForOperand(Descriptor, *Shape, Index));
+ return Result;
+}
+
OperandKindSet::OperandKindSet(std::initializer_list<MachineOperand::Kind> Kinds) noexcept {
for (const MachineOperand::Kind Kind : Kinds)
add(Kind);