llir-opt  0.0.1
Low-Level Post-Link Optimiser for OCaml and C
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
Item Class Referencefinal

#include <core/item.h>

Inheritance diagram for Item:
Inheritance graph
[legend]
Collaboration diagram for Item:
Collaboration graph
[legend]

Public Types

enum  Kind : uint8_t {
  Kind::INT8, Kind::INT16, Kind::INT32, Kind::INT64,
  Kind::FLOAT64, Kind::EXPR32, Kind::EXPR64, Kind::SPACE,
  Kind::STRING
}
 Enumeration of item kinds. More...
 

Public Member Functions

 Item (Item &that)
 Copy constructor.
 
 ~Item ()
 Cleanup.
 
void removeFromParent ()
 Removes an item from the parent.
 
void eraseFromParent ()
 Removes an atom from the data section.
 
AtomgetParent () const
 Returns a pointer to the parent section.
 
Kind GetKind () const
 Returns the item kind.
 
bool IsExpr () const
 Checks whether the item is an expression.
 
bool IsSpace () const
 Checks whether the item is space.
 
size_t GetSize () const
 Returns the size of the item in bytes.
 
int8_t GetInt8 () const
 
int16_t GetInt16 () const
 
int32_t GetInt32 () const
 
int64_t GetInt64 () const
 
unsigned GetSpace () const
 Returns the spacing.
 
double GetFloat64 () const
 
llvm::StringRef getString () const
 Returns the string value.
 
std::string_view GetString () const
 Returns the string value.
 
ExprGetExpr ()
 Returns the symbol value.
 
const ExprGetExpr () const
 Returns the symbol value.
 
ExprAsExpr ()
 Returns the item as an expression, nullptr if not one.
 
const ExprAsExpr () const
 Returns the item as an expression, nullptr if not one.
 

Static Public Member Functions

static ItemCreateInt8 (int8_t val)
 
static ItemCreateInt16 (int16_t val)
 
static ItemCreateInt32 (int32_t val)
 
static ItemCreateInt64 (int64_t val)
 
static ItemCreateFloat64 (double val)
 
static ItemCreateSpace (unsigned val)
 
static ItemCreateExpr32 (Expr *val)
 
static ItemCreateExpr64 (Expr *val)
 
static ItemCreateString (const std::string_view str)
 

Friends

struct llvm::ilist_traits< Item >
 

Detailed Description

Class representing a value in the data section.

Member Enumeration Documentation

◆ Kind

enum Item::Kind : uint8_t
strong

Enumeration of item kinds.

Enumerator
INT8 

8-bit integer.

INT16 

16-bit integer.

INT32 

32-bit integer.

INT64 

64-bit integer.

FLOAT64 

IEEE double.

EXPR32 

32-bit pointer.

EXPR64 

64-bit pointer.

SPACE 

Unallocated space.

STRING 

Raw string.


The documentation for this class was generated from the following files: