Debian Codegraph @

gcc/sym-exec/sym-exec-condition.h

raw
1 /* Everything defined here is used for representing conditions for bits
2 and their status.
3 Copyright (C) 2022-2025 Free Software Foundation, Inc.
4 Contributed by Matevos Mehrabyan <[email protected]>
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
11 version.
12
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
21
22
23 #ifndef SYM_EXEC_CONDITION_H
24 #define SYM_EXEC_CONDITION_H
25
26 #include "sym-exec-expression.h"
27
28 /* Enum representing condition status. */
29
30 enum condition_status {
31 CS_NO_COND,
32 CS_TRUE,
33 CS_FALSE,
34 CS_SYM
35 };
36
37 /* Class used for describing and storing condition for a single bit. */
38
39 class bit_condition : public bit_expression {
40 private:
41 /* Condition's code. */
42 tree_code m_code;
43
44 /* Prints the condition's sign. */
45 void print_expr_sign ();
46
47 public:
48 /* Constructor where the first argument is the bit left to the condition sign,
49 the second argument is the bit right to the condition sign and the third
50 argument is the code of the condition. */
51 bit_condition (value_bit *left, value_bit *right, tree_code type);
52
53 /* Copy constructor. */
54 bit_condition (const bit_condition &expr);
55
56 /* Returns the condition's code. */
57 tree_code get_code () const;
58
59 /* Returns a copy of the condition. */
60 value_bit *copy () const;
61 };
62
63 #endif /* SYM_EXEC_CONDITION_H. */