aboutsummaryrefslogtreecommitdiff
path: root/gcc/sym-exec/condition.cc
blob: 5b558d1e3158b5b42c04d41eb01e9b8be27e5c81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "condition.h"

bit_condition::bit_condition (value_bit *left, value_bit *right, tree_code code)
{
  this->m_left = left;
  this->m_right = right;
  this->m_code = code;
  m_type = BIT_CONDITION;
}


bit_condition::bit_condition (const bit_condition &expr)
{
  bit_expression::copy (&expr);
  m_code = expr.get_code ();
}


tree_code
bit_condition::get_code () const
{
  return m_code;
}


value_bit *
bit_condition::copy () const
{
  return new bit_condition (*this);
}


void
bit_condition::print_expr_sign ()
{
  switch (m_code)
    {
      case GT_EXPR:
	fprintf (dump_file, " > ");
	break;
      case LT_EXPR:
	fprintf (dump_file, " < ");
	break;
      case EQ_EXPR:
	fprintf (dump_file, " == ");
	break;
      case NE_EXPR:
	fprintf (dump_file, " != ");
	break;
      default:
	fprintf (dump_file, " ? ");
    }
}