Sha256: c2ea3abe416efb46819c9c7b6139f4002d1e1f9160850ac99d87a8de8a049319

Contents?: true

Size: 1002 Bytes

Versions: 2

Compression:

Stored size: 1002 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true

module Carbon
  module Tacky
    # A "value."  A value can be a parameter, a reference, or a number.
    class Value
      # The name of the value.  This can be set in order to make the resulting
      # LLVM IR pretty.
      #
      # @return [::String]
      attr_accessor :name

      # The type of the value.  This is used in order to determine typing
      # information for LLVM.
      #
      # @return [Concrete::Type] If it is set.
      # @return [nil] If it is not set or determinable.
      attr_accessor :type

      # The actual value.
      #
      # @return [::Object]
      attr_accessor :value

      # Initialize the value.
      #
      # @param name [::String] The name of the value.
      # @param type [Concrete::Type, nil] The type of the value.
      # @param value [::Object] The actual value.
      def initialize(name, type, value)
        @name = name
        @type = type
        @value = value
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
carbon-core-0.2.1 lib/carbon/tacky/value.rb
carbon-core-0.2.0 lib/carbon/tacky/value.rb