<commit_before>//===-- llvm/Target/TargetAsmInfo.h - Asm info ------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains a class to be used as the basis for target specific
// asm writers.  This class primarily takes care of global printing constants,
// which are used in very similar ways across all targets.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_TARGET_ASM_INFO_H
#define LLVM_TARGET_ASM_INFO_H

#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/DataTypes.h"
#include <string>

namespace llvm {
  // DWARF encoding query type
  namespace DwarfEncoding {
    enum Target {
      Data       = 0,
      CodeLabels = 1,
      Functions  = 2
    };
  }

  /// SectionKind - This is a simple POD value that classifies the properties of
  /// a section.
  struct SectionKind {
    enum Kind {
      Text,             ///< Text section.
      BSS,              ///< BSS section.

      Data,             ///< Data section.
      DataRel,          ///< Data that has relocations.
      DataRelLocal,     ///< Data that only has local relocations.

      // Readonly data.
      ROData,           ///< Readonly data section.
      DataRelRO,        ///< Readonly data with non-local relocations.
      DataRelROLocal,   ///< Readonly data with local relocations only.
      
      /// Mergable sections.
      RODataMergeStr,   ///< Readonly data section: nul-terminated strings.
      RODataMergeConst, ///< Readonly data section: fixed-length constants.
      
      /// Thread local data.
      ThreadData,       ///< Initialized TLS data objects
      ThreadBSS         ///< Uninitialized TLS data objects
    } K : 8; // This is private.
    
    // FIXME: Eliminate.
    Kind getKind() const { return K; }

    bool isReadOnly() const {
      return K == ROData ||
             K == DataRelRO        || K == DataRelROLocal ||
             K == RODataMergeConst || K == RODataMergeStr;
    }
    
    /// isReadOnlyWithDynamicInit - Return true if this data is readonly, but
    /// the dynamic linker has to write to it to apply relocations.
    bool isReadOnlyWithDynamicInit() const {
      return K == DataRelRO || K == DataRelROLocal;
    }

    bool isBSS() const {
      return K == BSS || K == ThreadBSS;
    }
    
    bool isTLS() const {
      return K == ThreadData || K == ThreadBSS;
    }
    
    bool isCode() const {
      return K == Text;
    }
    
    bool isWritable() const {
      return isTLS() ||<commit_msg>fix isReadOnly predicate to not include data that has to be writable because of teh dynamic linker.<commit_after>//===-- llvm/Target/TargetAsmInfo.h - Asm info ------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains a class to be used as the basis for target specific
// asm writers.  This class primarily takes care of global printing constants,
// which are used in very similar ways across all targets.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_TARGET_ASM_INFO_H
#define LLVM_TARGET_ASM_INFO_H

#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/DataTypes.h"
#include <string>

namespace llvm {
  // DWARF encoding query type
  namespace DwarfEncoding {
    enum Target {
      Data       = 0,
      CodeLabels = 1,
      Functions  = 2
    };
  }

  /// SectionKind - This is a simple POD value that classifies the properties of
  /// a section.
  struct SectionKind {
    enum Kind {
      Text,             ///< Text section.
      BSS,              ///< BSS section.

      Data,             ///< Data section.
      DataRel,          ///< Data that has relocations.
      DataRelLocal,     ///< Data that only has local relocations.

      // Readonly data.
      ROData,           ///< Readonly data section.
      DataRelRO,        ///< Readonly data with non-local relocations.
      DataRelROLocal,   ///< Readonly data with local relocations only.
      
      /// Mergable sections.
      RODataMergeStr,   ///< Readonly data section: nul-terminated strings.
      RODataMergeConst, ///< Readonly data section: fixed-length constants.
      
      /// Thread local data.
      ThreadData,       ///< Initialized TLS data objects
      ThreadBSS         ///< Uninitialized TLS data objects
    } K : 8; // This is private.
    
    // FIXME: Eliminate.
    Kind getKind() const { return K; }

    bool isReadOnly() const {
      return K == ROData || K == RODataMergeConst || K == RODataMergeStr;
    }
    
    /// isReadOnlyWithDynamicInit - Return true if this data is readonly, but
    /// the dynamic linker has to write to it to apply relocations.
    bool isReadOnlyWithDynamicInit() const {
      return K == DataRelRO || K == DataRelROLocal;
    }

    bool isBSS() const {
      return K == BSS || K == ThreadBSS;
    }
    
    bool isTLS() const {
      return K == ThreadData || K == ThreadBSS;
    }
    
    bool isCode() const {
      return K == Text;
    }
    
    bool isWritable() const {
      return isTLS() ||
{'fraction_non_alphanumeric': 0.16231209735146743, 'fraction_numerical': 0.0014316392269148174, 'mean_word_length': 1.6601618277010948, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2745890', 'n_tokens_mistral': 1540, 'n_tokens_neox': 1513, 'n_words': 520}