<commit_before>//===- lib/MC/MCSymbol.cpp - MCSymbol implementation ----------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;

// Sentinel value for the absolute pseudo section.
const MCSection *MCSymbol::AbsolutePseudoSection =
  reinterpret_cast<const MCSection *>(1);

/// ShouldQuoteIdentifier - Return true if the identifier \arg Str needs quotes
/// for this assembler.
static bool ShouldQuoteIdentifier(const StringRef &Str, const MCAsmInfo &MAI) {
  // If the assembler doesn't support quotes, never use them.
  if (!MAI.doesAllowQuotesInName())
    return false;
  
  // If empty, we need quotes.
  if (Str.empty())
    return true;
  
  // If the first character is a number, we need quotes.
  if (Str[0] >= '0' && Str[0] <= '9')
    return true;

  // If any of the characters in the string is an unacceptable character, force
  // quotes.
  for (unsigned i = 0, e = Str.size(); i != e; ++i) {
    char C = Str[i];
  
    if ((C < 'a' || C > 'z') &&
        (C < 'A' || C > 'Z') &&
        (C < '0' || C > '9') &&
        C != '_' && C != '$' && C != '.')
      return true;
  }
  return false;
}

void MCSymbol::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
  if (!MAI || ShouldQuoteIdentifier(getName(), *MAI))
    OS << '"' << getName() << '"';
  else
    OS << getName();
}

void MCSymbol::dump() const {
  print(errs(), 0);
}<commit_msg>allow @ in symbol names without quoting the identifier.  This  allows things like @PLT without quotes.<commit_after>//===- lib/MC/MCSymbol.cpp - MCSymbol implementation ----------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;

// Sentinel value for the absolute pseudo section.
const MCSection *MCSymbol::AbsolutePseudoSection =
  reinterpret_cast<const MCSection *>(1);

/// ShouldQuoteIdentifier - Return true if the identifier \arg Str needs quotes
/// for this assembler.
static bool ShouldQuoteIdentifier(const StringRef &Str, const MCAsmInfo &MAI) {
  // If the assembler doesn't support quotes, never use them.
  if (!MAI.doesAllowQuotesInName())
    return false;
  
  // If empty, we need quotes.
  if (Str.empty())
    return true;
  
  // If the first character is a number, we need quotes.
  if (Str[0] >= '0' && Str[0] <= '9')
    return true;

  // If any of the characters in the string is an unacceptable character, force
  // quotes.
  for (unsigned i = 0, e = Str.size(); i != e; ++i) {
    char C = Str[i];
  
    if ((C < 'a' || C > 'z') &&
        (C < 'A' || C > 'Z') &&
        (C < '0' || C > '9') &&
        C != '_' && C != '$' && C != '.' && C != '@')
      return true;
  }
  return false;
}

void MCSymbol::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
  if (!MAI || ShouldQuoteIdentifier(getName(), *MAI))
    OS << '"' << getName() << '"';
  else
    OS << getName();
}

void MCSymbol::dump() const {
  print(errs(), 0);
}
{'fraction_non_alphanumeric': 0.20851063829787234, 'fraction_numerical': 0.005106382978723404, 'mean_word_length': 2.3453510436432636, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 13, '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': '4379119', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1103, 'n_words': 361}