#define GCC_GIMPLE_MATCH_H
-/* Helper to transparently allow tree codes and builtin function codes
- exist in one storage entity. */
-class code_helper
-{
-public:
- code_helper () {}
- code_helper (tree_code code) : rep ((int) code) {}
- code_helper (combined_fn fn) : rep (-(int) fn) {}
- code_helper (internal_fn fn) : rep (-(int) as_combined_fn (fn)) {}
- explicit operator tree_code () const { return (tree_code) rep; }
- explicit operator combined_fn () const { return (combined_fn) -rep; }
- explicit operator internal_fn () const;
- explicit operator built_in_function () const;
- bool is_tree_code () const { return rep > 0; }
- bool is_fn_code () const { return rep < 0; }
- bool is_internal_fn () const;
- bool is_builtin_fn () const;
- int get_rep () const { return rep; }
- bool operator== (const code_helper &other) { return rep == other.rep; }
- bool operator!= (const code_helper &other) { return rep != other.rep; }
- bool operator== (tree_code c) { return rep == code_helper (c).rep; }
- bool operator!= (tree_code c) { return rep != code_helper (c).rep; }
-
-private:
- int rep;
-};
-
-inline code_helper::operator internal_fn () const
-{
- return as_internal_fn (combined_fn (*this));
-}
-
-inline code_helper::operator built_in_function () const
-{
- return as_builtin_fn (combined_fn (*this));
-}
-
-inline bool
-code_helper::is_internal_fn () const
-{
- return is_fn_code () && internal_fn_p (combined_fn (*this));
-}
-
-inline bool
-code_helper::is_builtin_fn () const
-{
- return is_fn_code () && builtin_fn_p (combined_fn (*this));
-}
-
/* Represents the condition under which an operation should happen,
and the value to use otherwise. The condition applies elementwise
(as for VEC_COND_EXPR) if the values are vectors. */
return internal_fn (int (code) - int (END_BUILTINS));
}
+/* Helper to transparently allow tree codes and builtin function codes
+ exist in one storage entity. */
+class code_helper
+{
+public:
+ code_helper () {}
+ code_helper (tree_code code) : rep ((int) code) {}
+ code_helper (combined_fn fn) : rep (-(int) fn) {}
+ code_helper (internal_fn fn) : rep (-(int) as_combined_fn (fn)) {}
+ explicit operator tree_code () const { return (tree_code) rep; }
+ explicit operator combined_fn () const { return (combined_fn) -rep; }
+ explicit operator internal_fn () const;
+ explicit operator built_in_function () const;
+ bool is_tree_code () const { return rep > 0; }
+ bool is_fn_code () const { return rep < 0; }
+ bool is_internal_fn () const;
+ bool is_builtin_fn () const;
+ int get_rep () const { return rep; }
+ bool operator== (const code_helper &other) { return rep == other.rep; }
+ bool operator!= (const code_helper &other) { return rep != other.rep; }
+ bool operator== (tree_code c) { return rep == code_helper (c).rep; }
+ bool operator!= (tree_code c) { return rep != code_helper (c).rep; }
+
+private:
+ int rep;
+};
+
+inline code_helper::operator internal_fn () const
+{
+ return as_internal_fn (combined_fn (*this));
+}
+
+inline code_helper::operator built_in_function () const
+{
+ return as_builtin_fn (combined_fn (*this));
+}
+
+inline bool
+code_helper::is_internal_fn () const
+{
+ return is_fn_code () && internal_fn_p (combined_fn (*this));
+}
+
+inline bool
+code_helper::is_builtin_fn () const
+{
+ return is_fn_code () && builtin_fn_p (combined_fn (*this));
+}
+
/* Macros for initializing `tree_contains_struct'. */
#define MARK_TS_BASE(C) \
(tree_contains_struct[C][TS_BASE] = true)