16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
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
|
+
+
+
+
+
+
+
+
+
+
+
+
|
{
return BuildComputedValue( GetValueType< bool >(),
Xor( operand, ToValue( true ) ) );
} )
);
CreateLeftAssInfixOp( e, "^"_sid, "operator_xor"_sid, precedence::OrOp,
// Logical xor
ForType< bool >( []( auto&& lhs, auto&& rhs ) -> Value
{
return BuildComputedValue( GetValueType< bool >(),
Xor( lhs, rhs ) );
} ),
// ct_int xor
ForType< APSInt >( []( auto&& lhs, auto&& rhs ) -> Value
{
return BuildComputedValue( GetValueType< APSInt >(),
Xor( lhs, rhs ) );
} ),
// runtime integer xor, defined to work for any two integers of same
// bit size but ignoring signedness difference.
ForType< CustomPattern< RTInteger, RTInteger::SizeIntegerPat > >(
[]( auto&& lhs, auto&& rhs ) -> Value
{
return BuildComputedValue( lhs.type(),
Xor( lhs, rhs ) );
} )
);
CreateLeftAssInfixOp( e, "|"_sid, "operator_or"_sid, precedence::OrOp,
ForType< bool >( []( auto&& lhs, auto&& rhs ) -> Value
{
// Build a CFG that implements the control flow for
|