<commit_before>//===--- GlobalVariable.swift - Defines the GlobalVariable class ----------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

import Basic
import SILBridging

final public class GlobalVariable : CustomStringConvertible, HasShortDescription {
  public var name: StringRef {
    return StringRef(bridged: SILGlobalVariable_getName(bridged))
  }

  public var description: String {
    let stdString = SILGlobalVariable_debugDescription(bridged)
    return String(_cxxString: stdString)
  }

  public var shortDescription: String { name.string }

  public var isLet: Bool { SILGlobalVariable_isLet(bridged) != 0 }

  // TODO: initializer instructions

  var bridged: BridgedGlobalVar { BridgedGlobalVar(obj: SwiftObject(self)) }
}

// Bridging utilities

extension BridgedGlobalVar {<commit_msg>Swift SIL: add `GlobalVariable` equality<commit_after>//===--- GlobalVariable.swift - Defines the GlobalVariable class ----------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

import Basic
import SILBridging

final public class GlobalVariable : CustomStringConvertible, HasShortDescription {
  public var name: StringRef {
    return StringRef(bridged: SILGlobalVariable_getName(bridged))
  }

  public var description: String {
    let stdString = SILGlobalVariable_debugDescription(bridged)
    return String(_cxxString: stdString)
  }

  public var shortDescription: String { name.string }

  public var isLet: Bool { SILGlobalVariable_isLet(bridged) != 0 }

  // TODO: initializer instructions

  var bridged: BridgedGlobalVar { BridgedGlobalVar(obj: SwiftObject(self)) }
}

public func ==(_ lhs: GlobalVariable, _ rhs: GlobalVariable) -> Bool {
  return lhs === rhs
}

public func !=(_ lhs: GlobalVariable, _ rhs: GlobalVariable) -> Bool {
  return (lhs !== rhs)
}

// Bridging utilities

extension BridgedGlobalVar {
{'fraction_non_alphanumeric': 0.1575734452499046, 'fraction_numerical': 0.008393742846241892, 'mean_word_length': 3.090483619344774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '5102814', 'n_tokens_mistral': 741, 'n_tokens_neox': 679, 'n_words': 226}