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
|
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
|
-
+
-
+
|
#include "builtins/builtins.h"
using namespace empathy::builtins;
namespace empathy::builtins
{
bool IsTExpr( const Value& te )
{
if( te.isConstant() )
{
const auto* ppVec = get_if< pvec >( &te.val().content() );
const auto* ppVec = get_if< pvec >( &te.val() );
if( ppVec && !( *ppVec )->empty()
&&( **ppVec )[0] == TSID( texpr ) )
{
return true;
}
}
auto typeVal = ValueFromIRExpr( te.type() );
if( !typeVal )
return false;
const auto* ppVec = get_if< pvec >( &typeVal->val().content() );
const auto* ppVec = get_if< pvec >( &typeVal->val() );
if( !ppVec )
return false;
if( ( *ppVec )->empty() )
return false;
return ( **ppVec )[0] == TSID( texpr );
|