Ejemplo n.º 1
0
int    	import(t_root *root)
{
  if (!(root->History = getHistory(root->Env)) ||
      !(root->Aliases = getAliases(root->Env)))
    return (1);
  return (0);
}
Ejemplo n.º 2
0
std::unique_ptr<File> LinkingContext::createAliasSymbolFile() const {
  if (getAliases().empty())
    return nullptr;
  std::unique_ptr<SimpleFile> file(new SimpleFile("<alias>"));
  for (const auto &i : getAliases()) {
    StringRef from = i.first;
    StringRef to = i.second;
    SimpleDefinedAtom *fromAtom = new (_allocator) AliasAtom(*file, from);
    UndefinedAtom *toAtom = new (_allocator) SimpleUndefinedAtom(*file, to);
    fromAtom->addReference(Reference::KindNamespace::all,
                           Reference::KindArch::all, Reference::kindLayoutAfter,
                           0, toAtom, 0);
    file->addAtom(*fromAtom);
    file->addAtom(*toAtom);
  }
  return std::move(file);
}