<commit_before>//===-- DWARFDebugLine.h ----------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef SymbolFileDWARF_DWARFDebugLine_h_
#define SymbolFileDWARF_DWARFDebugLine_h_

#include <map>
#include <vector>
#include <string>

#include "lldb/lldb-private.h"

#include "DWARFDataExtractor.h"
#include "DWARFDefines.h"

class SymbolFileDWARF;
class DWARFDebugInfoEntry;

//----------------------------------------------------------------------
// DWARFDebugLine
//----------------------------------------------------------------------
class DWARFDebugLine
{
public:
    //------------------------------------------------------------------
    // FileNameEntry
    //------------------------------------------------------------------
    struct FileNameEntry
    {
        FileNameEntry() :
            name(),
            dir_idx(0),
            mod_time(0),
            length(0)
        {
        }

        std::string     name;
        dw_sleb128_t    dir_idx;
        dw_sleb128_t    mod_time;
        dw_sleb128_t    length;

    };

    //------------------------------------------------------------------
    // Prologue
    //------------------------------------------------------------------
    struct Prologue
    {

        Prologue() :
            total_length(0),
            version(0),
            prologue_length(0),
            min_inst_length(0),
            default_is_stmt(0),
            line_base(0),
            line_range(0),
            opcode_base(0),
            standard_opcode_lengths(),
            include_directories(),
            file_names(),
            is_64_bit(false)
        {
        }

        typedef std::shared_ptr<Prologue> shared_ptr;

        uint32_t    total_length;   // The size in bytes of the statement information for this compilation unit (not including the total_length field itself).
        uint16_t    version;        // Version identifier for the statement information format.
        uint32_t    prologue_length;// The number of bytes following the prologue_length field to the beginning of the first byte of the statement program itself.
        uint8_t     min_inst_length;// The size in bytes of the smallest target machine instruction. Statement program opcodes that alter the address register first multiply their operands by this value.
        uint8_t     default_is_stmt;// The initial value of theis_stmtregister.
        int8_t      line_base;      // This parameter affects the meaning of the special opcodes. See below.
        uint8_t     line_range;     // This parameter affects the meaning of the special opcodes. See below.
        uint8_t     opcode_base;    // The number assigned to the first special opcode.
        std::vector<uint8_t>            standard_opcode_lengths;
        std::vector<std::string>        include_directories;
        std::vector<FileNameEntry>      file_names;

        bool        is_64_bit;      // 64-bit dwarf
        uint32_t SizeofTotalLength() const { return is_64_bit ? 12 : 4; }
        uint32_t SizeofPrologueLength() const { return is_64_bit ? 8 : 4; }
        // Length of the prologue in bytes
        uint32_t Length() const { return prologue_length + SizeofTotalLength() + sizeof(version) + SizeofPrologueLength(); }
        // Length of the line table data in bytes (not including the prologue)
        uint32_t StatementTableLength() const { return total_length + SizeofPrologueLength() - Length(); }
        int32_t MaxLineIncrementForSpecialOpcode() const { return line_base + (int8_t)line_range - 1; }
        bool IsValid() const;
//      void Append(BinaryStreamBuf& buff) const;
        void Dump (lldb_private::Log *log);
        void Clear()
        {
            total_length = version = prologue_length = min_inst_length = line_base = line_range = opcode_base = 0;
            line_base = 0;
            standard_opcode_lengths.clear();
            include_directories.clear();
            file_names.clear();
            is_64_bit = false;
        }<commit_msg>Remove unused DWARFDebugLine length functions<commit_after>//===-- DWARFDebugLine.h ----------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef SymbolFileDWARF_DWARFDebugLine_h_
#define SymbolFileDWARF_DWARFDebugLine_h_

#include <map>
#include <vector>
#include <string>

#include "lldb/lldb-private.h"

#include "DWARFDataExtractor.h"
#include "DWARFDefines.h"

class SymbolFileDWARF;
class DWARFDebugInfoEntry;

//----------------------------------------------------------------------
// DWARFDebugLine
//----------------------------------------------------------------------
class DWARFDebugLine
{
public:
    //------------------------------------------------------------------
    // FileNameEntry
    //------------------------------------------------------------------
    struct FileNameEntry
    {
        FileNameEntry() :
            name(),
            dir_idx(0),
            mod_time(0),
            length(0)
        {
        }

        std::string     name;
        dw_sleb128_t    dir_idx;
        dw_sleb128_t    mod_time;
        dw_sleb128_t    length;

    };

    //------------------------------------------------------------------
    // Prologue
    //------------------------------------------------------------------
    struct Prologue
    {

        Prologue() :
            total_length(0),
            version(0),
            prologue_length(0),
            min_inst_length(0),
            default_is_stmt(0),
            line_base(0),
            line_range(0),
            opcode_base(0),
            standard_opcode_lengths(),
            include_directories(),
            file_names(),
            is_64_bit(false)
        {
        }

        typedef std::shared_ptr<Prologue> shared_ptr;

        uint32_t    total_length;   // The size in bytes of the statement information for this compilation unit (not including the total_length field itself).
        uint16_t    version;        // Version identifier for the statement information format.
        uint32_t    prologue_length;// The number of bytes following the prologue_length field to the beginning of the first byte of the statement program itself.
        uint8_t     min_inst_length;// The size in bytes of the smallest target machine instruction. Statement program opcodes that alter the address register first multiply their operands by this value.
        uint8_t     default_is_stmt;// The initial value of theis_stmtregister.
        int8_t      line_base;      // This parameter affects the meaning of the special opcodes. See below.
        uint8_t     line_range;     // This parameter affects the meaning of the special opcodes. See below.
        uint8_t     opcode_base;    // The number assigned to the first special opcode.
        std::vector<uint8_t>            standard_opcode_lengths;
        std::vector<std::string>        include_directories;
        std::vector<FileNameEntry>      file_names;

        bool        is_64_bit;      // 64-bit dwarf
        uint32_t SizeofTotalLength() const { return is_64_bit ? 12 : 4; }
        uint32_t SizeofPrologueLength() const { return is_64_bit ? 8 : 4; }
        int32_t MaxLineIncrementForSpecialOpcode() const { return line_base + (int8_t)line_range - 1; }
        bool IsValid() const;
//      void Append(BinaryStreamBuf& buff) const;
        void Dump (lldb_private::Log *log);
        void Clear()
        {
            total_length = version = prologue_length = min_inst_length = line_base = line_range = opcode_base = 0;
            line_base = 0;
            standard_opcode_lengths.clear();
            include_directories.clear();
            file_names.clear();
            is_64_bit = false;
        }
{'fraction_non_alphanumeric': 0.19973190348525469, 'fraction_numerical': 0.014867170363148916, 'mean_word_length': 1.4764634882317442, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6264371', 'n_tokens_mistral': 2181, 'n_tokens_neox': 2122, 'n_words': 561}