GCC Middle and Back End API Reference
tristate Class Reference

#include <tristate.h>

Public Types

enum  value { TS_UNKNOWN , TS_TRUE , TS_FALSE }

Public Member Functions

 tristate (enum value val)
 tristate (bool val)
const char * as_string () const
bool is_known () const
bool is_unknown () const
bool is_true () const
bool is_false () const
tristate not_ () const
tristate or_ (tristate other) const
tristate and_ (tristate other) const
bool operator== (const tristate &other) const
bool operator!= (const tristate &other) const
enum value get_value () const

Static Public Member Functions

static tristate unknown ()

Private Attributes

enum value m_value

Detailed Description

"True" vs "False" vs "Unknown".
   Copyright (C) 2019-2025 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
"True" vs "False" vs "Unknown".   

Member Enumeration Documentation

◆ value

Enumerator
TS_UNKNOWN 
TS_TRUE 
TS_FALSE 

Constructor & Destructor Documentation

◆ tristate() [1/2]

tristate::tristate ( enum value val)
inline

References m_value.

Referenced by and_(), not_(), operator!=(), operator==(), or_(), and unknown().

◆ tristate() [2/2]

tristate::tristate ( bool val)
inline

References m_value, TS_FALSE, and TS_TRUE.

Member Function Documentation

◆ and_()

tristate tristate::and_ ( tristate other) const

◆ as_string()

const char * tristate::as_string ( ) const
"True" vs "False" vs "Unknown".
   Copyright (C) 2019-2025 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   

References gcc_unreachable, m_value, TS_FALSE, TS_TRUE, and TS_UNKNOWN.

◆ get_value()

enum value tristate::get_value ( ) const
inline

References m_value.

◆ is_false()

bool tristate::is_false ( ) const
inline

References m_value, and TS_FALSE.

◆ is_known()

bool tristate::is_known ( ) const
inline

References m_value, and TS_UNKNOWN.

◆ is_true()

bool tristate::is_true ( ) const
inline

References m_value, and TS_TRUE.

◆ is_unknown()

bool tristate::is_unknown ( ) const
inline

References m_value, and TS_UNKNOWN.

◆ not_()

tristate tristate::not_ ( ) const

◆ operator!=()

bool tristate::operator!= ( const tristate & other) const
inline

References m_value, and tristate().

◆ operator==()

bool tristate::operator== ( const tristate & other) const
inline

References m_value, and tristate().

◆ or_()

tristate tristate::or_ ( tristate other) const

◆ unknown()

tristate tristate::unknown ( )
inlinestatic

References tristate(), and TS_UNKNOWN.

Field Documentation

◆ m_value


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