C-Breeze
C Compiler Infrastructure

[ Project home page]
Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

constant Class Reference

#include <constant.h>

List of all members.

Public Member Functions

const basic_typebasic () const
 constant (signed char SChar)
signed char SChar () const
void SChar (signed char val)
 constant (unsigned char UChar)
unsigned char UChar () const
void UChar (unsigned char val)
 constant (signed short int SShort)
signed short int SShort () const
void SShort (signed short int val)
 constant (unsigned short int UShort)
unsigned short int UShort () const
void UShort (unsigned short int val)
 constant (signed int SInt)
signed int SInt () const
void SInt (signed int val)
 constant (unsigned int UInt)
unsigned int UInt () const
void UInt (unsigned int val)
 constant (signed long int SLong)
signed long int SLong () const
void SLong (signed long int val)
 constant (unsigned long int ULong)
unsigned long int ULong () const
void ULong (unsigned long int val)
 constant (float Float)
float Float () const
void Float (float val)
 constant (double Double)
double Double () const
void Double (double val)
 constant (const char *Str)
char * Str () const
bool is_str () const
 constant (void *Ptr)
void * Ptr () const
bool is_ptr () const
 constant ()
bool no_val () const
void set_no_val ()
 constant (const constant &other)
 ~constant ()
constant & operator= (const constant &rhs)
unsigned long Integer () const
bool Boolean () const
bool is_zero () const
void make_zero ()
bool is_equal_to (const constant &other) const
bool operator< (const constant &other) const
string to_string (bool wantQuoteChar=true) const

Static Public Member Functions

constant eval (const Operator *op, const constant &operand1, const constant &operand2)
constant eval (const Operator *op, const constant &operand)
constant cast (const basic_type &new_bt, const constant &con)

Static Private Member Functions

void print_char (int value, ostringstream &ost)

Private Attributes

union {
   signed char   SChar
   unsigned char   UChar
   signed short int   SShort
   unsigned short int   UShort
   signed int   SInt
   unsigned int   UInt
   signed long int   SLong
   unsigned long int   ULong
   float   Float
   double   Double
   char *   Str
   void *   Ptr
_v
basic_type _bt
bool _is_ptr
bool _is_str
bool _no_val


Constructor & Destructor Documentation

constant::constant signed char    SChar [inline]
 

Definition at line 73 of file constant.h.

References _v, and SChar.

constant::constant unsigned char    UChar [inline]
 

Definition at line 80 of file constant.h.

References _v, and UChar.

constant::constant signed short int    SShort [inline]
 

Definition at line 87 of file constant.h.

References _v, and SShort.

constant::constant unsigned short int    UShort [inline]
 

Definition at line 94 of file constant.h.

References _v, and UShort.

constant::constant signed int    SInt [inline]
 

Definition at line 101 of file constant.h.

References _v, and SInt.

constant::constant unsigned int    UInt [inline]
 

Definition at line 108 of file constant.h.

References _v, and UInt.

constant::constant signed long int    SLong [inline]
 

Definition at line 115 of file constant.h.

References _v, and SLong.

constant::constant unsigned long int    ULong [inline]
 

Definition at line 122 of file constant.h.

References _v, and ULong.

constant::constant float    Float [inline]
 

Definition at line 129 of file constant.h.

References _v, and Float.

constant::constant double    Double [inline]
 

Definition at line 136 of file constant.h.

References _v, and Double.

constant::constant const char *    Str [inline]
 

Definition at line 143 of file constant.h.

References _v.

constant::constant void *    Ptr [inline]
 

Definition at line 150 of file constant.h.

References _v, and Ptr.

constant::constant   [inline]
 

Definition at line 157 of file constant.h.

Referenced by cast(), Double(), eval(), Float(), lir_gen_walker::gen_binary_assignment(), lir_gen_walker::index_offset(), lir_gen_walker::load_const(), lir_gen_walker::load_global_addr(), lir_gen_walker::load_global_value(), lir_gen_walker::load_global_var(), lir_gen_walker::load_stack_value(), reg_or_const::operator=(), SChar(), SInt(), SLong(), SShort(), lir_gen_walker::store_global(), lir_gen_walker::store_stack(), UChar(), UInt(), ULong(), and UShort().

constant::constant const constant &    other
 

Definition at line 44 of file constant.cc.

References _v.

constant::~constant  
 

Definition at line 83 of file constant.cc.

References _v.


Member Function Documentation

const basic_type& constant::basic   const [inline]
 

Definition at line 71 of file constant.h.

Referenced by enum_value_walker::at_enum(), semcheck_walker::at_suespec(), constantFoldingChanger::at_threeAddr(), cast(), constNode::constNode(), eval(), Symbol::getLirVt(), is_equal_to(), constantAnalyzer::lookup(), and operator<().

bool constant::Boolean   const
 

Definition at line 118 of file constant.cc.

References _bt, _v, basic_type::Double, basic_type::Float, is_ptr(), is_str(), basic_type::SInt, basic_type::SLong, basic_type::SShort, basic_type::UInt, basic_type::ULong, and basic_type::UShort.

Referenced by constantFoldingChanger::at_conditiongoto(), constantsChanger::at_conditiongoto(), CFS_Changer::at_if(), ternaryNode::eval(), constantAnalyzer::has_truth_value(), is_zero(), and operator<().

constant constant::cast const basic_type   new_bt,
const constant &    con
[static]
 

Definition at line 780 of file constant.cc.

References basic(), constant(), Double, basic_type::Double, Float, basic_type::Float, no_val(), SChar, basic_type::SChar, SInt, basic_type::SInt, SLong, basic_type::SLong, SShort, basic_type::SShort, UChar, basic_type::UChar, UInt, basic_type::UInt, ULong, basic_type::ULong, UShort, and basic_type::UShort.

Referenced by constantAnalyzer::at_cast(), constantPropChanger::at_expr(), ipConstant::cast_operator(), InitializerDismantle::init_array(), and InitializerDismantle::init_struct().

void constant::Double double    val [inline]
 

Definition at line 141 of file constant.h.

References constant().

double constant::Double   const [inline]
 

Definition at line 140 of file constant.h.

References _v.

Referenced by is_equal_to().

constant constant::eval const Operator   op,
const constant &    operand
[static]
 

Definition at line 680 of file constant.cc.

References basic(), constant(), Double, basic_type::Double, Float, basic_type::Float, Operator::id(), no_val(), SInt, basic_type::SInt, SLong, basic_type::SLong, UInt, basic_type::UInt, ULong, basic_type::ULong, Operator::UMINUS, and Operator::UPLUS.

constant constant::eval const Operator   op,
const constant &    operand1,
const constant &    operand2
[static]
 

Definition at line 287 of file constant.cc.

References Operator::ANDAND, basic(), constant(), Double, basic_type::Double, Operator::EQ, Float, basic_type::Float, Operator::GE, Operator::id(), Operator::LE, Operator::LS, Operator::NE, no_val(), Operator::OROR, Operator::RS, SInt, basic_type::SInt, SLong, basic_type::SLong, UInt, basic_type::UInt, ULong, and basic_type::ULong.

Referenced by constantAnalyzer::at_binary(), constantFoldingChanger::at_conditiongoto(), constantPropChanger::at_expr(), constantFoldingChanger::at_threeAddr(), constantAnalyzer::at_unary(), ipConstant::binary_operator(), operator<(), and ipConstant::unary_operator().

void constant::Float float    val [inline]
 

Definition at line 134 of file constant.h.

References constant().

float constant::Float   const [inline]
 

Definition at line 133 of file constant.h.

References _v.

Referenced by is_equal_to().

unsigned long constant::Integer   const
 

Definition at line 93 of file constant.cc.

References _bt, _v, basic_type::SInt, basic_type::SLong, basic_type::SShort, basic_type::UInt, basic_type::ULong, and basic_type::UShort.

Referenced by AllocSizeChanger::at_array(), enum_value_walker::at_enum(), semcheck_walker::at_suespec(), constantFoldingChanger::at_threeAddr(), lir_gen_walker::index_offset(), InitializerDismantle::init_array(), is_equal_to(), and arrayNode::qualified_equal_to().

bool constant::is_equal_to const constant &    other const
 

Definition at line 211 of file constant.cc.

References basic(), Double(), basic_type::Double, Float(), basic_type::Float, Integer(), basic_type::is_integer(), is_ptr(), is_str(), Ptr(), and Str().

Referenced by constantPropChanger::at_expr(), ipConstant::diff(), ipConstant::meet_with(), and Symbol::operator==().

bool constant::is_ptr   const [inline]
 

Definition at line 155 of file constant.h.

Referenced by Boolean(), constNode::constNode(), is_equal_to(), make_zero(), operator<(), and to_string().

bool constant::is_str   const [inline]
 

Definition at line 148 of file constant.h.

Referenced by UnificationBasedPtr::alpha(), constantAnalyzer::at_const(), Boolean(), constNode::constNode(), Pointers::eval(), arch_info::instruction_supports_immediate(), is_equal_to(), InitializerDismantle::isStringLiteral(), lir_gen_walker::load_const(), make_zero(), vcgASTWalker::node_name(), operator<(), operator=(), reg_or_const::to_string(), and to_string().

bool constant::is_zero   const
 

Definition at line 159 of file constant.cc.

References Boolean().

Referenced by constantAnalyzer::at_binary(), constantPropChanger::at_expr(), constantFoldingChanger::at_threeAddr(), and constantAnalyzer::meet().

void constant::make_zero  
 

Definition at line 164 of file constant.cc.

References _bt, _v, basic_type::Double, basic_type::Float, is_ptr(), is_str(), SInt(), basic_type::SInt, basic_type::SLong, basic_type::SShort, basic_type::UInt, basic_type::ULong, and basic_type::UShort.

bool constant::no_val   const [inline]
 

Definition at line 161 of file constant.h.

Referenced by AllocSizeChanger::at_array(), constantFoldingChanger::at_conditiongoto(), constantsChanger::at_conditiongoto(), ipConstantsChanger::at_expr(), constantsChanger::at_id(), constantFoldingChanger::at_threeAddr(), constantsChanger::at_threeAddr(), cast(), TreeChecker::checkConstant(), ternaryNode::eval(), eval(), InitializerDismantle::eval_or_cast(), InitializerDismantle::init_array(), ipConstant::is_bottom(), ipConstant::is_top(), lir_gen_walker::load_const(), operator<(), and arrayNode::qualified_equal_to().

bool constant::operator< const constant &    other const
 

Definition at line 236 of file constant.cc.

References basic(), Boolean(), eval(), is_ptr(), is_str(), no_val(), Ptr(), and Str().

constant & constant::operator= const constant &    rhs
 

Definition at line 59 of file constant.cc.

References _bt, _is_ptr, _is_str, _no_val, _v, and is_str().

void constant::print_char int    value,
ostringstream &    ost
[static, private]
 

Definition at line 1192 of file constant.cc.

Referenced by to_string().

void* constant::Ptr   const [inline]
 

Definition at line 154 of file constant.h.

References _v.

Referenced by is_equal_to(), operator<(), and to_string().

void constant::SChar signed char    val [inline]
 

Definition at line 78 of file constant.h.

References constant().

signed char constant::SChar   const [inline]
 

Definition at line 77 of file constant.h.

References _v.

void constant::set_no_val   [inline]
 

Definition at line 162 of file constant.h.

Referenced by const_phase::run(), and ipConstant::to_bottom().

void constant::SInt signed int    val [inline]
 

Definition at line 106 of file constant.h.

References constant().

signed int constant::SInt   const [inline]
 

Definition at line 105 of file constant.h.

References _v.

Referenced by make_zero().

void constant::SLong signed long int    val [inline]
 

Definition at line 120 of file constant.h.

References constant().

signed long int constant::SLong   const [inline]
 

Definition at line 119 of file constant.h.

References _v.

void constant::SShort signed short int    val [inline]
 

Definition at line 92 of file constant.h.

References constant().

signed short int constant::SShort   const [inline]
 

Definition at line 91 of file constant.h.

References _v.

char* constant::Str   const [inline]
 

Definition at line 147 of file constant.h.

References _v.

Referenced by is_equal_to(), operator<(), and to_string().

string constant::to_string bool    wantQuoteChar = true const
 

Definition at line 1119 of file constant.cc.

References _bt, _v, basic_type::Double, basic_type::Float, basic_type::is_char(), is_ptr(), is_str(), print_char(), Ptr(), basic_type::SChar, basic_type::SInt, basic_type::SLong, basic_type::SShort, Str(), basic_type::UChar, basic_type::UInt, basic_type::ULong, and basic_type::UShort.

Referenced by constantsChanger::at_id(), constantsChanger::at_threeAddr(), TreeChecker::checkConstant(), arch_info::make_template_replacements(), vcgASTWalker::node_name(), constNode::output_expr(), ipConstant::print(), constantAnalyzer::print(), reg_or_const::to_string(), and constantAnalyzer::to_string().

void constant::UChar unsigned char    val [inline]
 

Definition at line 85 of file constant.h.

References constant().

unsigned char constant::UChar   const [inline]
 

Definition at line 84 of file constant.h.

References _v.

void constant::UInt unsigned int    val [inline]
 

Definition at line 113 of file constant.h.

References constant().

unsigned int constant::UInt   const [inline]
 

Definition at line 112 of file constant.h.

References _v.

void constant::ULong unsigned long int    val [inline]
 

Definition at line 127 of file constant.h.

References constant().

unsigned long int constant::ULong   const [inline]
 

Definition at line 126 of file constant.h.

References _v.

void constant::UShort unsigned short int    val [inline]
 

Definition at line 99 of file constant.h.

References constant().

unsigned short int constant::UShort   const [inline]
 

Definition at line 98 of file constant.h.

References _v.


Member Data Documentation

basic_type constant::_bt [private]
 

Definition at line 64 of file constant.h.

Referenced by Boolean(), Integer(), make_zero(), operator=(), and to_string().

bool constant::_is_ptr [private]
 

Definition at line 65 of file constant.h.

Referenced by operator=().

bool constant::_is_str [private]
 

Definition at line 66 of file constant.h.

Referenced by operator=().

bool constant::_no_val [private]
 

Definition at line 67 of file constant.h.

Referenced by operator=().

union { ... } constant::_v [private]
 

Referenced by Boolean(), constant(), Double(), Float(), Integer(), make_zero(), operator=(), Ptr(), SChar(), SInt(), SLong(), SShort(), Str(), to_string(), UChar(), UInt(), ULong(), UShort(), and ~constant().

double constant::Double [private]
 

Definition at line 58 of file constant.h.

Referenced by cast(), constant(), eval(), and is_equal_to().

float constant::Float [private]
 

Definition at line 57 of file constant.h.

Referenced by cast(), constant(), eval(), and is_equal_to().

void* constant::Ptr [private]
 

Definition at line 61 of file constant.h.

Referenced by constant(), is_equal_to(), and operator<().

signed char constant::SChar [private]
 

Definition at line 49 of file constant.h.

Referenced by cast(), and constant().

signed int constant::SInt [private]
 

Definition at line 53 of file constant.h.

Referenced by cast(), constant(), and eval().

signed long int constant::SLong [private]
 

Definition at line 55 of file constant.h.

Referenced by cast(), constant(), and eval().

signed short int constant::SShort [private]
 

Definition at line 51 of file constant.h.

Referenced by cast(), and constant().

char* constant::Str [private]
 

Definition at line 60 of file constant.h.

Referenced by UnificationBasedPtr::alpha(), UnificationBasedPtr::at_initializer(), constNode::constNode(), is_equal_to(), operator<(), and reg_or_const::to_string().

unsigned char constant::UChar [private]
 

Definition at line 50 of file constant.h.

Referenced by cast(), and constant().

unsigned int constant::UInt [private]
 

Definition at line 54 of file constant.h.

Referenced by cast(), constant(), and eval().

unsigned long int constant::ULong [private]
 

Definition at line 56 of file constant.h.

Referenced by cast(), constant(), and eval().

unsigned short int constant::UShort [private]
 

Definition at line 52 of file constant.h.

Referenced by cast(), and constant().


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

Generated on August 27, 2003
Back to the C-Breeze home page