示例#1
0
Fix Fix::getRelabelTuple(ConstraintSystem &cs, FixKind kind,
                         ArrayRef<Identifier> names) {
  assert(isRelabelTupleKind(kind) && "Not a tuple-relabel fix");
  Fix result(kind, cs.RelabelTupleNames.size());
  auto &allocator = cs.getAllocator();

  // Copy the names and indices.
  Identifier *namesCopy = allocator.Allocate<Identifier>(names.size());
  memcpy(namesCopy, names.data(), names.size() * sizeof(Identifier));
  cs.RelabelTupleNames.push_back({namesCopy, names.size()});

  return result;
}