FLANG
Fortran::evaluate::value::LogicalValue Class Reference

#include <flang/Evaluate/logical-value.h>

Public Types

using Word = IntegerValue

Public Member Functions

 LogicalValue (const LogicalValue &)=default
 LogicalValue (LogicalValue &&)=default
LogicalValue & operator= (const LogicalValue &)=default
LogicalValue & operator= (LogicalValue &&)=default
 LogicalValue (int kind, const LogicalValue &v)
 LogicalValue (int kind, LogicalValue &&v)
 LogicalValue (int kind, bool truth)
 LogicalValue (int kind, const Word &w)
void print (llvm::raw_ostream &os) const
LLVM_DUMP_METHOD void dump () const
bool IsNull () const
int kind () const
 The kind of the value currently stored.
int bits () const
std::size_t bytesStored () const
 Number of bytes accessed by FromRawBytes/StoreRawBytes.
Word word () const
bool IsCanonical () const
bool operator< (const LogicalValue &that) const
bool operator<= (const LogicalValue &that) const
bool operator== (const LogicalValue &that) const
bool operator!= (const LogicalValue &that) const
bool operator>= (const LogicalValue &that) const
bool operator> (const LogicalValue &that) const
bool IsTrue () const
LogicalValue NOT () const
LogicalValue AND (const LogicalValue &that) const
LogicalValue OR (const LogicalValue &that) const
LogicalValue EQV (const LogicalValue &that) const
LogicalValue NEQV (const LogicalValue &that) const
void StoreRawBytes (void *dst, size_t size, bool *changed=nullptr) const

Static Public Member Functions

static LogicalValue Zero (int kind)
static constexpr int bits (int kind)
static constexpr std::size_t bytesStored (int kind)
static LogicalValue FromRawBytes (int kind, const void *raw, std::size_t expectedSize)

Detailed Description

A Fortran LOGICAL value.

The kind is dynamic, but only a predefined set of Fortran kinds are allowed. It is also kind-aware, i.e. knows which LOGICAL kind it currently represents.

It is implemented as a wrapper around IntegerValue.

Member Function Documentation

◆ IsNull()

bool Fortran::evaluate::value::LogicalValue::IsNull ( ) const
inline

Whether this object represents a default-initialized value ('false') of unknown kind.

◆ operator<()

bool Fortran::evaluate::value::LogicalValue::operator< ( const LogicalValue & that) const
inline

Fortran actually has only .EQV. & .NEQV. relational operations for LOGICAL, but this class supports more so that it can be used with the STL for sorting and as a key type for std::set<> & std::map<>.

◆ Zero()

LogicalValue Fortran::evaluate::value::LogicalValue::Zero ( int kind)
inlinestatic

Creates a logical with value 'false' of a given kind. This is in contrast to the default-ctor which creates a null state that represents 'false' of a not-yet-known kind.


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