<commit_before>//===- Core/Resolver.h - Resolves Atom References -------------------------===//
//
//                             The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLD_CORE_RESOLVER_H
#define LLD_CORE_RESOLVER_H

#include "lld/Core/File.h"
#include "lld/Core/SharedLibraryFile.h"
#include "lld/Core/SymbolTable.h"

#include "llvm/ADT/DenseSet.h"

#include <set>
#include <vector>

namespace lld {

class Atom;
class LinkingContext;

/// \brief The Resolver is responsible for merging all input object files
/// and producing a merged graph.
class Resolver {
public:
  enum ResolverState {
    StateNoChange = 0,              // The default resolver state
    StateNewDefinedAtoms = 1,       // New defined atoms were added
    StateNewUndefinedAtoms = 2,     // New undefined atoms were added
    StateNewSharedLibraryAtoms = 4, // New shared library atoms were added
    StateNewAbsoluteAtoms = 8       // New absolute atoms were added
  };

  Resolver(LinkingContext &context)
      : _context(context), _symbolTable(context), _result(new MergedFile()),
        _haveLLVMObjs(false), _addToFinalSection(false) {}

  virtual ~Resolver() {}

  // InputFiles::Handler methods
  virtual void doDefinedAtom(const DefinedAtom&);
  virtual void doUndefinedAtom(const UndefinedAtom&);
  virtual void doSharedLibraryAtom(const SharedLibraryAtom &);
  virtual void doAbsoluteAtom(const AbsoluteAtom &);

  // Handle files, this adds atoms from the current file thats
  // being processed by the resolver
  virtual void handleFile(const File &);

  // Handle an archive library file.
  virtual void handleArchiveFile(const File &);

  // Handle a shared library file.
  virtual void handleSharedLibrary(const File &);

  /// @brief do work of merging and resolving and return list
  bool resolve();<commit_msg>Devirtualize Resolver.<commit_after>//===- Core/Resolver.h - Resolves Atom References -------------------------===//
//
//                             The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLD_CORE_RESOLVER_H
#define LLD_CORE_RESOLVER_H

#include "lld/Core/File.h"
#include "lld/Core/SharedLibraryFile.h"
#include "lld/Core/SymbolTable.h"

#include "llvm/ADT/DenseSet.h"

#include <set>
#include <vector>

namespace lld {

class Atom;
class LinkingContext;

/// \brief The Resolver is responsible for merging all input object files
/// and producing a merged graph.
class Resolver {
public:
  enum ResolverState {
    StateNoChange = 0,              // The default resolver state
    StateNewDefinedAtoms = 1,       // New defined atoms were added
    StateNewUndefinedAtoms = 2,     // New undefined atoms were added
    StateNewSharedLibraryAtoms = 4, // New shared library atoms were added
    StateNewAbsoluteAtoms = 8       // New absolute atoms were added
  };

  Resolver(LinkingContext &context)
      : _context(context), _symbolTable(context), _result(new MergedFile()),
        _haveLLVMObjs(false), _addToFinalSection(false) {}

  // InputFiles::Handler methods
  void doDefinedAtom(const DefinedAtom&);
  void doUndefinedAtom(const UndefinedAtom&);
  void doSharedLibraryAtom(const SharedLibraryAtom &);
  void doAbsoluteAtom(const AbsoluteAtom &);

  // Handle files, this adds atoms from the current file thats
  // being processed by the resolver
  void handleFile(const File &);

  // Handle an archive library file.
  void handleArchiveFile(const File &);

  // Handle a shared library file.
  void handleSharedLibrary(const File &);

  /// @brief do work of merging and resolving and return list
  bool resolve();
{'fraction_non_alphanumeric': 0.14260158446204957, 'fraction_numerical': 0.002555583950932788, 'mean_word_length': 2.7634615384615384, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6408861', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1080, 'n_words': 349}