GCC Middle and Back End API Reference
ana::integer Class Reference

#include <integer.h>

Public Member Functions

 integer ()
 integer (int i)
 ~integer ()
 integer (const integer &other)
 integer (integer &&other)
const integer & get_integer () const
bool is_zero_p () const
bool is_one_p () const
integer & operator= (const integer &other)
integer & operator= (integer &&other)
void dump_to_pp (pretty_printer *pp) const
void dump () const
std::unique_ptr< json::value > to_json () const
std::unique_ptr< diagnostics::markup::node > make_markup_node () const
bool operator== (const integer &other) const
bool operator== (int i) const
bool operator!= (const integer &other) const
bool operator!= (int i) const
bool operator< (const integer &other) const
bool operator< (int i) const
bool operator<= (const integer &other) const
bool operator> (const integer &other) const
bool operator>= (const integer &other) const
integer operator+ (const integer &other) const
integer & operator+= (const integer &other)
integer operator- (const integer &other) const
integer operator- () const
integer & operator-= (const integer &other)
integer operator* (const integer &other) const
integer floor_div (const integer &other) const
integer floor_mod (const integer &other) const
long as_long () const
unsigned long as_unsigned_long () const
mpz_t & access_mpz ()

Static Public Member Functions

static int cmp (const integer &lhs, const integer &rhs)

Static Public Attributes

static constexpr const char * dump_type_name = "integer"

Private Attributes

mpz_t m_mpz

Detailed Description

A class for arbitrary precision integers.

This is a C++ wrapper around gmp's mpz_t, with integration with
pretty_printer.

We don't use gmp's gmpxx.h: it uses exceptions, which we can't use.   

Constructor & Destructor Documentation

◆ integer() [1/4]

◆ integer() [2/4]

ana::integer::integer ( int i)
inline

References i, and m_mpz.

◆ ~integer()

ana::integer::~integer ( )
inline

References m_mpz.

◆ integer() [3/4]

ana::integer::integer ( const integer & other)
inline

References integer(), m_mpz, and ana::other.

◆ integer() [4/4]

ana::integer::integer ( integer && other)
inline

References integer(), m_mpz, and ana::other.

Member Function Documentation

◆ access_mpz()

mpz_t & ana::integer::access_mpz ( )
inline

References m_mpz.

◆ as_long()

long ana::integer::as_long ( ) const
inline

◆ as_unsigned_long()

unsigned long ana::integer::as_unsigned_long ( ) const
inline

◆ cmp()

int ana::integer::cmp ( const integer & lhs,
const integer & rhs )
inlinestatic

◆ dump()

void ana::integer::dump ( ) const

◆ dump_to_pp()

void ana::integer::dump_to_pp ( pretty_printer * pp) const

◆ floor_div()

integer ana::integer::floor_div ( const integer & other) const
inline

◆ floor_mod()

integer ana::integer::floor_mod ( const integer & other) const
inline

References gcc_assert, integer(), m_mpz, and ana::other.

Referenced by ana::bit_within_byte().

◆ get_integer()

const integer & ana::integer::get_integer ( ) const
inline

◆ is_one_p()

bool ana::integer::is_one_p ( ) const
inline

◆ is_zero_p()

bool ana::integer::is_zero_p ( ) const
inline

◆ make_markup_node()

std::unique_ptr< diagnostics::markup::node > ana::integer::make_markup_node ( ) const

◆ operator!=() [1/2]

bool ana::integer::operator!= ( const integer & other) const
inline

References integer(), m_mpz, and ana::other.

◆ operator!=() [2/2]

bool ana::integer::operator!= ( int i) const
inline

References i, and m_mpz.

◆ operator*()

integer ana::integer::operator* ( const integer & other) const
inline

References integer(), m_mpz, and ana::other.

◆ operator+()

integer ana::integer::operator+ ( const integer & other) const
inline

References integer(), m_mpz, and ana::other.

◆ operator+=()

integer & ana::integer::operator+= ( const integer & other)
inline

References integer(), and ana::other.

◆ operator-() [1/2]

integer ana::integer::operator- ( ) const
inline

References integer(), and m_mpz.

◆ operator-() [2/2]

integer ana::integer::operator- ( const integer & other) const
inline

References integer(), m_mpz, and ana::other.

◆ operator-=()

integer & ana::integer::operator-= ( const integer & other)
inline

References integer(), and ana::other.

◆ operator<() [1/2]

bool ana::integer::operator< ( const integer & other) const
inline

References integer(), m_mpz, and ana::other.

◆ operator<() [2/2]

bool ana::integer::operator< ( int i) const
inline

References i, and m_mpz.

◆ operator<=()

bool ana::integer::operator<= ( const integer & other) const
inline

References integer(), m_mpz, and ana::other.

◆ operator=() [1/2]

integer & ana::integer::operator= ( const integer & other)
inline

References integer(), m_mpz, and ana::other.

◆ operator=() [2/2]

integer & ana::integer::operator= ( integer && other)
inline

References integer(), m_mpz, and ana::other.

◆ operator==() [1/2]

bool ana::integer::operator== ( const integer & other) const
inline

References integer(), m_mpz, and ana::other.

◆ operator==() [2/2]

bool ana::integer::operator== ( int i) const
inline

References i, and m_mpz.

◆ operator>()

bool ana::integer::operator> ( const integer & other) const
inline

References integer(), m_mpz, and ana::other.

◆ operator>=()

bool ana::integer::operator>= ( const integer & other) const
inline

References integer(), m_mpz, and ana::other.

◆ to_json()

std::unique_ptr< json::value > ana::integer::to_json ( ) const

Field Documentation

◆ dump_type_name

const char* ana::integer::dump_type_name = "integer"
staticconstexpr

◆ m_mpz


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