Class: Rubycc::IR::Generator::AddressConstant
- Inherits:
-
Data
- Object
- Data
- Rubycc::IR::Generator::AddressConstant
- Defined in:
- lib/rubycc/ir/generator.rb
Overview
A folded address constant (ISO C 6.6): a base object plus a constant byte
displacement, the form a pointer global's initializer must reduce to.
base_kind is :symbol (a file-scope object named by symbol), :string
(an interned string literal indexed by string_id), or :absolute (no
object at all — symbol and string_id are nil and offset is the raw
bit pattern, from a pointer cast of an integer constant such as
"(dfree_t)-1"); offset is the byte displacement past that base for
:symbol/:string (accumulated from subscripts, member accesses and
pointer arithmetic), or the absolute value itself for :absolute;
pointee is the type of the object presently at base+offset, so a
further subscript or "+ n" knows how many bytes one step spans (and a
cast overrides it without moving the address).
Instance Attribute Summary collapse
-
#base_kind ⇒ Object
readonly
Returns the value of attribute base_kind.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#pointee ⇒ Object
readonly
Returns the value of attribute pointee.
-
#string_id ⇒ Object
readonly
Returns the value of attribute string_id.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Attribute Details
#base_kind ⇒ Object (readonly)
Returns the value of attribute base_kind
70 71 72 |
# File 'lib/rubycc/ir/generator.rb', line 70 def base_kind @base_kind end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset
70 71 72 |
# File 'lib/rubycc/ir/generator.rb', line 70 def offset @offset end |
#pointee ⇒ Object (readonly)
Returns the value of attribute pointee
70 71 72 |
# File 'lib/rubycc/ir/generator.rb', line 70 def pointee @pointee end |
#string_id ⇒ Object (readonly)
Returns the value of attribute string_id
70 71 72 |
# File 'lib/rubycc/ir/generator.rb', line 70 def string_id @string_id end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol
70 71 72 |
# File 'lib/rubycc/ir/generator.rb', line 70 def symbol @symbol end |