<commit_before>//===- llvm/unittest/DebugInfo/PDB/PDBApiTest.cpp -------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include <unordered_map>

#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
#include "llvm/DebugInfo/PDB/IPDBSession.h"
#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"

#include "llvm/DebugInfo/PDB/PDBSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbolAnnotation.h"
#include "llvm/DebugInfo/PDB/PDBSymbolBlock.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCustom.h"
#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
#include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
#include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h"
#include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h"
#include "llvm/DebugInfo/PDB/PDBSymbolLabel.h"
#include "llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbolThunk.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeArray.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h"
#include "llvm/DebugInfo/PDB/PDBSymbolUnknown.h"
#include "llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h"
#include "llvm/DebugInfo/PDB/PDBTypes.h"
#include "gtest/gtest.h"
using namespace llvm;

namespace {

#define MOCK_SYMBOL_ACCESSOR(Func)                                             \
  decltype(std::declval<IPDBRawSymbol>().Func()) Func() const override {       \
    typedef decltype(IPDBRawSymbol::Func()) ReturnType;                        \
    return ReturnType();                                                       \
  }

class MockSession : public IPDBSession {
  uint64_t getLoadAddress() const override { return 0; }
  void setLoadAddress(uint64_t Address) override {}
  std::unique_ptr<PDBSymbolExe> getGlobalScope() const override {
    return nullptr;
  }
  std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const override {
    return nullptr;
  }
  std::unique_ptr<IPDBSourceFile>
  getSourceFileById(uint32_t SymbolId) const override {
    return nullptr;
  }
  std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const override {
    return nullptr;
  }
  std::unique_ptr<IPDBEnumSourceFiles> getSourceFilesForCompiland(
      const PDBSymbolCompiland &Compiland) const override {
    return nullptr;
  }
};

class MockRawSymbol : public IPDBRawSymbol {
public:
  MockRawSymbol(const IPDBSession &PDBSession, PDB_SymType SymType)
      : Session(PDBSession), Type(SymType) {}

  void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override {}

  std::unique_ptr<IPDBEnumSymbols>
  findChildren(PDB_SymType Type) const override {
    return nullptr;
  }<commit_msg>Add missing function and header include.<commit_after>//===- llvm/unittest/DebugInfo/PDB/PDBApiTest.cpp -------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include <memory>
#include <unordered_map>

#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
#include "llvm/DebugInfo/PDB/IPDBSession.h"
#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"

#include "llvm/DebugInfo/PDB/PDBSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbolAnnotation.h"
#include "llvm/DebugInfo/PDB/PDBSymbolBlock.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCustom.h"
#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
#include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
#include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h"
#include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h"
#include "llvm/DebugInfo/PDB/PDBSymbolLabel.h"
#include "llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbolThunk.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeArray.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h"
#include "llvm/DebugInfo/PDB/PDBSymbolUnknown.h"
#include "llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h"
#include "llvm/DebugInfo/PDB/PDBTypes.h"
#include "gtest/gtest.h"
using namespace llvm;

namespace {

#define MOCK_SYMBOL_ACCESSOR(Func)                                             \
  decltype(std::declval<IPDBRawSymbol>().Func()) Func() const override {       \
    typedef decltype(IPDBRawSymbol::Func()) ReturnType;                        \
    return ReturnType();                                                       \
  }

class MockSession : public IPDBSession {
  uint64_t getLoadAddress() const override { return 0; }
  void setLoadAddress(uint64_t Address) override {}
  std::unique_ptr<PDBSymbolExe> getGlobalScope() const override {
    return nullptr;
  }
  std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const override {
    return nullptr;
  }
  std::unique_ptr<IPDBSourceFile>
  getSourceFileById(uint32_t SymbolId) const override {
    return nullptr;
  }
  std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const override {
    return nullptr;
  }
  std::unique_ptr<IPDBEnumSourceFiles> getSourceFilesForCompiland(
      const PDBSymbolCompiland &Compiland) const override {
    return nullptr;
  }

  std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const override {
    return nullptr;
  }
};

class MockRawSymbol : public IPDBRawSymbol {
public:
  MockRawSymbol(const IPDBSession &PDBSession, PDB_SymType SymType)
      : Session(PDBSession), Type(SymType) {}

  void dump(raw_ostream &OS, int Indent, PDB_DumpLevel Level) const override {}

  std::unique_ptr<IPDBEnumSymbols>
  findChildren(PDB_SymType Type) const override {
    return nullptr;
  }
{'fraction_non_alphanumeric': 0.14099868593955323, 'fraction_numerical': 0.0023653088042049934, 'mean_word_length': 4.00065703022339, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7234640', 'n_tokens_mistral': 2582, 'n_tokens_neox': 2585, 'n_words': 397}