1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

regenerate

llvm-svn: 30029
This commit is contained in:
Chris Lattner 2006-09-01 21:14:42 +00:00
parent 1e5cf5e60f
commit 67e2187a04
5 changed files with 878 additions and 479 deletions

View File

@ -306,40 +306,43 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
*yy_cp = '\0'; \ *yy_cp = '\0'; \
yy_c_buf_p = yy_cp; yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 32 #define YY_NUM_RULES 34
#define YY_END_OF_BUFFER 33 #define YY_END_OF_BUFFER 35
static yyconst short int yy_acclist[130] = static yyconst short int yy_acclist[145] =
{ 0, { 0,
26, 26, 33, 31, 32, 24, 31, 32, 24, 32, 28, 28, 35, 33, 34, 26, 33, 34, 26, 34,
31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 33, 34, 33, 34, 33, 34, 33, 34, 33, 34,
23, 31, 32, 23, 31, 32, 20, 31, 32, 31, 25, 33, 34, 25, 33, 34, 22, 33, 34, 33,
32, 20, 31, 32, 20, 31, 32, 20, 31, 32, 34, 22, 33, 34, 22, 33, 34, 22, 33, 34,
20, 31, 32, 20, 31, 32, 20, 31, 32, 20, 22, 33, 34, 22, 33, 34, 22, 33, 34, 22,
31, 32, 26, 32, 27, 32, 29, 32, 24, 22, 33, 34, 22, 33, 34, 28, 34, 29, 34, 31,
21, 23, 25, 1, 20, 20, 20, 20, 20, 20, 34, 26, 24, 23, 25, 27, 1, 22, 22, 22,
20, 15, 20, 20, 20, 20, 26, 27, 27, 30, 22, 22, 22, 22, 17, 22, 22, 22, 22, 22,
29, 28, 29, 21, 1, 23, 23, 5, 20, 20, 28, 29, 29, 32, 31, 30, 31, 23, 1, 25,
20, 10, 20, 12, 20, 20, 20, 4, 20, 14, 25, 5, 22, 22, 22, 10, 22, 12, 22, 22,
20, 20, 20, 18, 16, 17, 3, 6, 20, 20, 22, 4, 22, 16, 22, 22, 22, 22, 20, 18,
9, 20, 20, 20, 8, 20, 20, 11, 20, 13, 19, 3, 6, 22, 22, 9, 22, 13, 22, 22,
20, 20, 20, 20, 7, 20, 20, 19, 2 22, 8, 22, 22, 22, 11, 22, 15, 22, 22,
22, 22, 22, 22, 7, 22, 22, 22, 22, 22,
21, 2, 14, 22
} ; } ;
static yyconst short int yy_accept[109] = static yyconst short int yy_accept[120] =
{ 0, { 0,
1, 1, 1, 2, 3, 4, 6, 9, 11, 13, 1, 1, 1, 2, 3, 4, 6, 9, 11, 13,
15, 17, 19, 21, 24, 27, 30, 32, 35, 38, 15, 17, 19, 21, 24, 27, 30, 32, 35, 38,
41, 44, 47, 50, 53, 55, 57, 59, 60, 60, 41, 44, 47, 50, 53, 56, 58, 60, 62, 63,
60, 61, 62, 63, 64, 65, 65, 65, 66, 66, 63, 63, 64, 65, 66, 67, 68, 68, 68, 69,
67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 69, 70, 71, 72, 73, 74, 75, 77, 78, 79,
78, 79, 80, 81, 82, 83, 84, 84, 84, 84, 80, 81, 82, 83, 84, 85, 86, 87, 88, 88,
85, 86, 87, 88, 88, 88, 90, 91, 92, 94, 88, 88, 89, 90, 91, 92, 92, 92, 94, 95,
96, 97, 98, 100, 102, 103, 104, 105, 106, 107, 96, 98, 100, 101, 102, 104, 106, 107, 108, 109,
107, 107, 108, 110, 111, 113, 114, 115, 117, 118, 110, 111, 112, 112, 112, 113, 115, 116, 118, 120,
118, 120, 122, 123, 124, 124, 125, 127, 127, 128, 121, 122, 124, 125, 126, 126, 128, 130, 131, 132,
128, 128, 128, 128, 129, 129, 130, 130 133, 133, 134, 135, 137, 137, 138, 139, 139, 139,
140, 140, 140, 141, 142, 142, 143, 145, 145
} ; } ;
static yyconst int yy_ec[256] = static yyconst int yy_ec[256] =
@ -355,9 +358,9 @@ static yyconst int yy_ec[256] =
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
16, 1, 17, 1, 15, 1, 18, 19, 20, 21, 16, 1, 17, 1, 15, 1, 18, 19, 20, 21,
22, 23, 24, 25, 26, 15, 15, 27, 15, 28, 22, 23, 24, 25, 26, 15, 15, 27, 28, 29,
29, 15, 15, 30, 31, 32, 33, 15, 15, 34, 30, 15, 15, 31, 32, 33, 34, 15, 15, 35,
15, 15, 35, 1, 36, 1, 1, 1, 1, 1, 15, 15, 36, 1, 37, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -374,108 +377,114 @@ static yyconst int yy_ec[256] =
1, 1, 1, 1, 1 1, 1, 1, 1, 1
} ; } ;
static yyconst int yy_meta[37] = static yyconst int yy_meta[38] =
{ 0, { 0,
1, 1, 2, 1, 1, 1, 1, 3, 1, 3, 1, 1, 2, 1, 1, 1, 1, 3, 1, 3,
4, 4, 4, 5, 6, 1, 1, 5, 5, 5, 4, 4, 4, 5, 6, 1, 1, 5, 5, 5,
5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 1, 1 6, 6, 6, 6, 6, 1, 1
} ; } ;
static yyconst short int yy_base[121] = static yyconst short int yy_base[132] =
{ 0, { 0,
0, 0, 29, 30, 207, 208, 39, 42, 175, 199, 0, 0, 30, 31, 218, 219, 40, 43, 185, 210,
0, 36, 42, 42, 45, 0, 169, 177, 33, 41, 0, 37, 43, 43, 46, 0, 179, 188, 33, 43,
176, 173, 42, 168, 0, 57, 61, 70, 45, 193, 187, 183, 42, 177, 177, 0, 59, 62, 71, 46,
208, 0, 67, 208, 0, 70, 0, 0, 162, 165, 203, 219, 0, 69, 219, 0, 72, 0, 0, 171,
178, 174, 170, 170, 170, 63, 159, 159, 159, 0, 174, 188, 184, 180, 180, 180, 56, 168, 168, 172,
76, 77, 208, 80, 208, 81, 161, 74, 157, 0, 167, 0, 77, 78, 219, 82, 219, 83, 170, 76,
0, 82, 0, 150, 168, 153, 152, 160, 0, 0, 165, 0, 0, 84, 0, 158, 177, 161, 160, 169,
154, 153, 0, 0, 147, 152, 208, 208, 208, 157, 0, 162, 162, 161, 0, 0, 154, 153, 159, 219,
140, 208, 0, 144, 0, 153, 140, 0, 144, 142, 219, 219, 164, 146, 219, 0, 150, 0, 0, 160,
0, 0, 149, 145, 140, 145, 0, 122, 94, 104, 146, 0, 153, 149, 147, 0, 0, 155, 155, 150,
96, 68, 60, 208, 45, 208, 208, 102, 108, 110, 144, 150, 144, 0, 150, 95, 151, 126, 98, 92,
113, 119, 125, 131, 134, 140, 143, 148, 154, 160 69, 93, 34, 219, 46, 219, 0, 219, 104, 110,
112, 115, 121, 127, 133, 136, 142, 145, 150, 156,
162
} ; } ;
static yyconst short int yy_def[121] = static yyconst short int yy_def[132] =
{ 0, { 0,
107, 1, 108, 108, 107, 107, 107, 107, 107, 109, 118, 1, 119, 119, 118, 118, 118, 118, 118, 120,
110, 107, 107, 107, 107, 111, 107, 111, 111, 111, 121, 118, 118, 118, 118, 122, 118, 122, 122, 122,
111, 111, 111, 111, 112, 113, 114, 107, 107, 109, 122, 122, 122, 122, 122, 123, 124, 125, 118, 118,
107, 115, 107, 107, 116, 107, 117, 111, 118, 111, 120, 118, 126, 118, 118, 127, 118, 128, 122, 129,
111, 111, 111, 111, 111, 111, 111, 111, 111, 112, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
113, 113, 107, 114, 107, 114, 107, 107, 107, 115, 122, 123, 124, 124, 118, 125, 118, 125, 118, 118,
116, 107, 117, 118, 119, 111, 111, 111, 111, 111, 118, 126, 127, 118, 128, 129, 130, 122, 122, 122,
111, 111, 111, 111, 111, 111, 107, 107, 107, 107, 122, 122, 122, 122, 122, 122, 122, 122, 122, 118,
118, 107, 111, 111, 111, 111, 111, 111, 111, 107, 118, 118, 118, 129, 118, 122, 122, 122, 122, 122,
111, 111, 111, 111, 107, 111, 111, 107, 111, 107, 122, 122, 122, 122, 118, 122, 122, 122, 122, 122,
107, 107, 120, 107, 120, 107, 0, 107, 107, 107, 118, 122, 122, 122, 118, 122, 122, 118, 118, 122,
107, 107, 107, 107, 107, 107, 107, 107, 107, 107 118, 131, 122, 118, 131, 118, 122, 0, 118, 118,
118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
118
} ; } ;
static yyconst short int yy_nxt[245] = static yyconst short int yy_nxt[257] =
{ 0, { 0,
6, 7, 8, 7, 9, 10, 11, 6, 12, 13, 6, 7, 8, 7, 9, 10, 11, 6, 12, 13,
14, 15, 15, 16, 16, 17, 6, 16, 18, 19, 14, 15, 15, 16, 16, 17, 6, 16, 18, 19,
20, 16, 21, 16, 16, 22, 23, 16, 16, 16, 20, 16, 21, 16, 16, 22, 23, 24, 16, 16,
24, 16, 16, 16, 6, 6, 26, 26, 27, 27, 16, 25, 16, 16, 16, 6, 6, 27, 27, 28,
28, 28, 28, 28, 28, 28, 33, 33, 33, 34, 28, 29, 29, 29, 29, 29, 29, 34, 34, 34,
106, 35, 33, 33, 33, 33, 33, 33, 43, 41, 35, 116, 36, 34, 34, 34, 34, 34, 34, 42,
36, 42, 44, 47, 52, 106, 53, 48, 55, 57, 44, 37, 43, 48, 45, 117, 54, 49, 55, 57,
56, 28, 28, 28, 58, 37, 59, 33, 33, 33, 59, 58, 29, 29, 29, 74, 60, 38, 61, 34,
62, 62, 72, 107, 52, 107, 53, 107, 107, 107, 34, 34, 64, 64, 118, 54, 118, 55, 75, 118,
56, 78, 62, 62, 73, 101, 101, 101, 101, 104, 118, 118, 58, 81, 64, 64, 109, 109, 116, 109,
79, 103, 25, 25, 25, 25, 25, 25, 30, 30, 109, 114, 82, 112, 26, 26, 26, 26, 26, 26,
30, 30, 30, 30, 32, 32, 38, 38, 38, 50, 31, 31, 31, 31, 31, 31, 33, 33, 39, 39,
50, 102, 50, 50, 50, 51, 51, 51, 51, 51, 39, 52, 52, 113, 52, 52, 52, 53, 53, 53,
51, 54, 54, 54, 54, 54, 54, 60, 60, 60, 53, 53, 53, 56, 56, 56, 56, 56, 56, 62,
61, 100, 61, 61, 61, 61, 63, 63, 64, 64, 62, 62, 63, 111, 63, 63, 63, 63, 65, 65,
64, 64, 64, 64, 81, 81, 81, 81, 81, 81, 66, 66, 66, 66, 66, 66, 84, 84, 84, 84,
105, 105, 105, 105, 105, 105, 99, 98, 97, 96, 84, 84, 115, 115, 115, 115, 115, 115, 110, 108,
95, 94, 93, 92, 91, 65, 90, 89, 88, 87, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98,
86, 85, 84, 83, 82, 65, 80, 77, 76, 75, 97, 96, 67, 95, 94, 93, 92, 91, 90, 89,
74, 71, 70, 69, 68, 67, 66, 65, 31, 49, 88, 87, 86, 85, 67, 83, 80, 79, 78, 77,
46, 45, 40, 39, 31, 29, 107, 5, 107, 107, 76, 73, 72, 71, 70, 69, 68, 67, 32, 51,
107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 50, 47, 46, 41, 40, 32, 30, 118, 5, 118,
107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
107, 107, 107, 107 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
118, 118, 118, 118, 118, 118
} ; } ;
static yyconst short int yy_chk[245] = static yyconst short int yy_chk[257] =
{ 0, { 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 3, 4, 3, 4, 1, 1, 1, 1, 1, 1, 1, 3, 4, 3,
7, 7, 7, 8, 8, 8, 12, 12, 12, 13, 4, 7, 7, 7, 8, 8, 8, 12, 12, 12,
105, 13, 14, 14, 14, 15, 15, 15, 20, 19, 13, 115, 13, 14, 14, 14, 15, 15, 15, 19,
14, 19, 20, 23, 26, 103, 26, 23, 27, 29, 20, 14, 19, 23, 20, 113, 27, 23, 27, 28,
27, 28, 28, 28, 29, 14, 29, 33, 33, 33, 30, 28, 29, 29, 29, 47, 30, 14, 30, 34,
36, 36, 46, 51, 52, 51, 52, 54, 56, 54, 34, 34, 37, 37, 53, 54, 53, 54, 47, 56,
56, 58, 62, 62, 46, 99, 99, 101, 101, 102, 58, 56, 58, 60, 64, 64, 106, 106, 112, 109,
58, 101, 108, 108, 108, 108, 108, 108, 109, 109, 109, 111, 60, 109, 119, 119, 119, 119, 119, 119,
109, 109, 109, 109, 110, 110, 111, 111, 111, 112, 120, 120, 120, 120, 120, 120, 121, 121, 122, 122,
112, 100, 112, 112, 112, 113, 113, 113, 113, 113, 122, 123, 123, 110, 123, 123, 123, 124, 124, 124,
113, 114, 114, 114, 114, 114, 114, 115, 115, 115, 124, 124, 124, 125, 125, 125, 125, 125, 125, 126,
116, 98, 116, 116, 116, 116, 117, 117, 118, 118, 126, 126, 127, 108, 127, 127, 127, 127, 128, 128,
118, 118, 118, 118, 119, 119, 119, 119, 119, 119, 129, 129, 129, 129, 129, 129, 130, 130, 130, 130,
120, 120, 120, 120, 120, 120, 96, 95, 94, 93, 130, 130, 131, 131, 131, 131, 131, 131, 107, 105,
90, 89, 87, 86, 84, 81, 80, 76, 75, 72, 103, 102, 101, 100, 99, 98, 95, 94, 93, 91,
71, 68, 67, 66, 65, 64, 59, 57, 49, 48, 90, 87, 84, 83, 79, 78, 77, 74, 73, 72,
47, 45, 44, 43, 42, 41, 40, 39, 30, 24, 70, 69, 68, 67, 66, 61, 59, 51, 50, 49,
22, 21, 18, 17, 10, 9, 5, 107, 107, 107, 48, 46, 45, 44, 43, 42, 41, 40, 31, 25,
107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 24, 22, 21, 18, 17, 10, 9, 5, 118, 118,
107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
107, 107, 107, 107 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
118, 118, 118, 118, 118, 118
} ; } ;
static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
@ -651,7 +660,7 @@ int yywrap(void) {
using namespace llvm; using namespace llvm;
#line 655 "Lexer.cpp" #line 664 "Lexer.cpp"
/* Macros after this point can all be overridden by user definitions in /* Macros after this point can all be overridden by user definitions in
* section 1. * section 1.
@ -805,7 +814,7 @@ YY_DECL
#line 180 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 180 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
#line 809 "Lexer.cpp" #line 818 "Lexer.cpp"
if ( yy_init ) if ( yy_init )
{ {
@ -853,14 +862,14 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 108 ) if ( yy_current_state >= 119 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
*yy_state_ptr++ = yy_current_state; *yy_state_ptr++ = yy_current_state;
++yy_cp; ++yy_cp;
} }
while ( yy_current_state != 107 ); while ( yy_current_state != 118 );
yy_find_action: yy_find_action:
yy_current_state = *--yy_state_ptr; yy_current_state = *--yy_state_ptr;
@ -960,111 +969,121 @@ YY_RULE_SETUP
case 13: case 13:
YY_RULE_SETUP YY_RULE_SETUP
#line 198 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 198 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return FIELD; } { return DEFM; }
YY_BREAK YY_BREAK
case 14: case 14:
YY_RULE_SETUP YY_RULE_SETUP
#line 199 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 199 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return LET; } { return MULTICLASS; }
YY_BREAK YY_BREAK
case 15: case 15:
YY_RULE_SETUP YY_RULE_SETUP
#line 200 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 200 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return IN; } { return FIELD; }
YY_BREAK YY_BREAK
case 16: case 16:
YY_RULE_SETUP YY_RULE_SETUP
#line 202 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 201 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return SRATOK; } { return LET; }
YY_BREAK YY_BREAK
case 17: case 17:
YY_RULE_SETUP YY_RULE_SETUP
#line 203 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 202 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return SRLTOK; } { return IN; }
YY_BREAK YY_BREAK
case 18: case 18:
YY_RULE_SETUP YY_RULE_SETUP
#line 204 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 204 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return SHLTOK; } { return SRATOK; }
YY_BREAK YY_BREAK
case 19: case 19:
YY_RULE_SETUP YY_RULE_SETUP
#line 205 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 205 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return STRCONCATTOK; } { return SRLTOK; }
YY_BREAK YY_BREAK
case 20: case 20:
YY_RULE_SETUP YY_RULE_SETUP
#line 208 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 206 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.StrVal = new std::string(yytext, yytext+yyleng); { return SHLTOK; }
return ID; }
YY_BREAK YY_BREAK
case 21: case 21:
YY_RULE_SETUP YY_RULE_SETUP
#line 210 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 207 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng); { return STRCONCATTOK; }
return VARNAME; }
YY_BREAK YY_BREAK
case 22: case 22:
YY_RULE_SETUP YY_RULE_SETUP
#line 213 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 210 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1); { Filelval.StrVal = new std::string(yytext, yytext+yyleng);
return STRVAL; } return ID; }
YY_BREAK YY_BREAK
case 23: case 23:
YY_RULE_SETUP YY_RULE_SETUP
#line 216 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 212 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ Filelval.IntVal = ParseInt(Filetext); return INTVAL; } { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
return VARNAME; }
YY_BREAK YY_BREAK
case 24: case 24:
YY_RULE_SETUP YY_RULE_SETUP
#line 218 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 215 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ /* Ignore whitespace */ } { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
return STRVAL; }
YY_BREAK YY_BREAK
case 25: case 25:
YY_RULE_SETUP YY_RULE_SETUP
#line 221 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 218 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ BEGIN(comment); CommentDepth++; } { Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
YY_BREAK YY_BREAK
case 26: case 26:
YY_RULE_SETUP YY_RULE_SETUP
#line 222 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 220 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{} /* eat anything that's not a '*' or '/' */ { /* Ignore whitespace */ }
YY_BREAK YY_BREAK
case 27: case 27:
YY_RULE_SETUP YY_RULE_SETUP
#line 223 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 223 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{} /* eat up '*'s not followed by '/'s */ { BEGIN(comment); CommentDepth++; }
YY_BREAK YY_BREAK
case 28: case 28:
YY_RULE_SETUP YY_RULE_SETUP
#line 224 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 224 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ ++CommentDepth; } {} /* eat anything that's not a '*' or '/' */
YY_BREAK YY_BREAK
case 29: case 29:
YY_RULE_SETUP YY_RULE_SETUP
#line 225 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 225 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{} /* eat up /'s not followed by *'s */ {} /* eat up '*'s not followed by '/'s */
YY_BREAK YY_BREAK
case 30: case 30:
YY_RULE_SETUP YY_RULE_SETUP
#line 226 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 226 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ if (!--CommentDepth) { BEGIN(INITIAL); } } { ++CommentDepth; }
YY_BREAK
case YY_STATE_EOF(comment):
#line 227 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ err() << "Unterminated comment!\n"; exit(1); }
YY_BREAK YY_BREAK
case 31: case 31:
YY_RULE_SETUP YY_RULE_SETUP
#line 229 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 227 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return Filetext[0]; } {} /* eat up /'s not followed by *'s */
YY_BREAK YY_BREAK
case 32: case 32:
YY_RULE_SETUP YY_RULE_SETUP
#line 228 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ if (!--CommentDepth) { BEGIN(INITIAL); } }
YY_BREAK
case YY_STATE_EOF(comment):
#line 229 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ err() << "Unterminated comment!\n"; exit(1); }
YY_BREAK
case 33:
YY_RULE_SETUP
#line 231 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 231 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
{ return Filetext[0]; }
YY_BREAK
case 34:
YY_RULE_SETUP
#line 233 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
YY_FATAL_ERROR( "flex scanner jammed" ); YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK YY_BREAK
#line 1068 "Lexer.cpp" #line 1087 "Lexer.cpp"
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
yyterminate(); yyterminate();
@ -1353,7 +1372,7 @@ static yy_state_type yy_get_previous_state()
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 108 ) if ( yy_current_state >= 119 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@ -1383,11 +1402,11 @@ yy_state_type yy_current_state;
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{ {
yy_current_state = (int) yy_def[yy_current_state]; yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 108 ) if ( yy_current_state >= 119 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 107); yy_is_jam = (yy_current_state == 118);
if ( ! yy_is_jam ) if ( ! yy_is_jam )
*yy_state_ptr++ = yy_current_state; *yy_state_ptr++ = yy_current_state;
@ -1948,6 +1967,6 @@ int main()
return 0; return 0;
} }
#endif #endif
#line 231 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l" #line 233 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"

View File

@ -195,6 +195,8 @@ dag { return DAG; }
class { return CLASS; } class { return CLASS; }
def { return DEF; } def { return DEF; }
defm { return DEFM; }
multiclass { return MULTICLASS; }
field { return FIELD; } field { return FIELD; }
let { return LET; } let { return LET; }
in { return IN; } in { return IN; }

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,7 @@ typedef union {
std::vector<llvm::Init*>* FieldList; std::vector<llvm::Init*>* FieldList;
std::vector<unsigned>* BitList; std::vector<unsigned>* BitList;
llvm::Record* Rec; llvm::Record* Rec;
std::vector<llvm::Record*>* RecList;
SubClassRefTy* SubClassRef; SubClassRefTy* SubClassRef;
std::vector<SubClassRefTy>* SubClassList; std::vector<SubClassRefTy>* SubClassList;
std::vector<std::pair<llvm::Init*, std::string> >* DagValueList; std::vector<std::pair<llvm::Init*, std::string> >* DagValueList;
@ -19,18 +20,20 @@ typedef union {
#define DAG 263 #define DAG 263
#define CLASS 264 #define CLASS 264
#define DEF 265 #define DEF 265
#define FIELD 266 #define MULTICLASS 266
#define LET 267 #define DEFM 267
#define IN 268 #define FIELD 268
#define SHLTOK 269 #define LET 269
#define SRATOK 270 #define IN 270
#define SRLTOK 271 #define SHLTOK 271
#define STRCONCATTOK 272 #define SRATOK 272
#define INTVAL 273 #define SRLTOK 273
#define ID 274 #define STRCONCATTOK 274
#define VARNAME 275 #define INTVAL 275
#define STRVAL 276 #define ID 276
#define CODEFRAGMENT 277 #define VARNAME 277
#define STRVAL 278
#define CODEFRAGMENT 279
extern YYSTYPE Filelval; extern YYSTYPE Filelval;

View File

@ -22,8 +22,19 @@ int yyerror(const char *ErrorMsg);
int yylex(); int yylex();
namespace llvm { namespace llvm {
struct MultiClass {
Record Rec; // Placeholder for template args and Name.
std::vector<Record*> DefPrototypes;
MultiClass(const std::string &Name) : Rec(Name) {}
};
static std::map<std::string, MultiClass*> MultiClasses;
extern int Filelineno; extern int Filelineno;
static MultiClass *CurMultiClass = 0; // Set while parsing a multiclass.
static std::string *CurDefmPrefix = 0; // Set while parsing defm.
static Record *CurRec = 0; static Record *CurRec = 0;
static bool ParsingTemplateArgs = false; static bool ParsingTemplateArgs = false;
@ -45,8 +56,16 @@ static std::vector<std::vector<LetRecord> > LetStack;
extern std::ostream &err(); extern std::ostream &err();
/// getActiveRec - If inside a def/class definition, return the def/class.
/// Otherwise, if within a multidef, return it.
static Record *getActiveRec() {
return CurRec ? CurRec : &CurMultiClass->Rec;
}
static void addValue(const RecordVal &RV) { static void addValue(const RecordVal &RV) {
if (RecordVal *ERV = CurRec->getValue(RV.getName())) { Record *TheRec = getActiveRec();
if (RecordVal *ERV = TheRec->getValue(RV.getName())) {
// The value already exists in the class, treat this as a set... // The value already exists in the class, treat this as a set...
if (ERV->setValue(RV.getValue())) { if (ERV->setValue(RV.getValue())) {
err() << "New definition of '" << RV.getName() << "' of type '" err() << "New definition of '" << RV.getName() << "' of type '"
@ -55,7 +74,7 @@ static void addValue(const RecordVal &RV) {
exit(1); exit(1);
} }
} else { } else {
CurRec->addValue(RV); TheRec->addValue(RV);
} }
} }
@ -148,33 +167,33 @@ static void addSubClass(Record *SC, const std::vector<Init*> &TemplateArgs) {
if (TArgs.size() < TemplateArgs.size()) { if (TArgs.size() < TemplateArgs.size()) {
err() << "ERROR: More template args specified than expected!\n"; err() << "ERROR: More template args specified than expected!\n";
exit(1); exit(1);
} else { // This class expects template arguments... }
// Loop over all of the template arguments, setting them to the specified
// value or leaving them as the default if necessary. // Loop over all of the template arguments, setting them to the specified
for (unsigned i = 0, e = TArgs.size(); i != e; ++i) { // value or leaving them as the default if necessary.
if (i < TemplateArgs.size()) { // A value is specified for this temp-arg? for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
// Set it now. if (i < TemplateArgs.size()) { // A value is specified for this temp-arg?
setValue(TArgs[i], 0, TemplateArgs[i]); // Set it now.
setValue(TArgs[i], 0, TemplateArgs[i]);
// Resolve it next. // Resolve it next.
CurRec->resolveReferencesTo(CurRec->getValue(TArgs[i])); CurRec->resolveReferencesTo(CurRec->getValue(TArgs[i]));
// Now remove it. // Now remove it.
CurRec->removeValue(TArgs[i]); CurRec->removeValue(TArgs[i]);
} else if (!CurRec->getValue(TArgs[i])->getValue()->isComplete()) { } else if (!CurRec->getValue(TArgs[i])->getValue()->isComplete()) {
err() << "ERROR: Value not specified for template argument #" err() << "ERROR: Value not specified for template argument #"
<< i << " (" << TArgs[i] << ") of subclass '" << SC->getName() << i << " (" << TArgs[i] << ") of subclass '" << SC->getName()
<< "'!\n"; << "'!\n";
exit(1); exit(1);
}
} }
} }
// Since everything went well, we can now set the "superclass" list for the // Since everything went well, we can now set the "superclass" list for the
// current record. // current record.
const std::vector<Record*> &SCs = SC->getSuperClasses(); const std::vector<Record*> &SCs = SC->getSuperClasses();
for (unsigned i = 0, e = SCs.size(); i != e; ++i) for (unsigned i = 0, e = SCs.size(); i != e; ++i)
addSuperClass(SCs[i]); addSuperClass(SCs[i]);
addSuperClass(SC); addSuperClass(SC);
@ -194,18 +213,20 @@ using namespace llvm;
std::vector<llvm::Init*>* FieldList; std::vector<llvm::Init*>* FieldList;
std::vector<unsigned>* BitList; std::vector<unsigned>* BitList;
llvm::Record* Rec; llvm::Record* Rec;
std::vector<llvm::Record*>* RecList;
SubClassRefTy* SubClassRef; SubClassRefTy* SubClassRef;
std::vector<SubClassRefTy>* SubClassList; std::vector<SubClassRefTy>* SubClassList;
std::vector<std::pair<llvm::Init*, std::string> >* DagValueList; std::vector<std::pair<llvm::Init*, std::string> >* DagValueList;
}; };
%token INT BIT STRING BITS LIST CODE DAG CLASS DEF FIELD LET IN %token INT BIT STRING BITS LIST CODE DAG CLASS DEF MULTICLASS DEFM FIELD LET IN
%token SHLTOK SRATOK SRLTOK STRCONCATTOK %token SHLTOK SRATOK SRLTOK STRCONCATTOK
%token <IntVal> INTVAL %token <IntVal> INTVAL
%token <StrVal> ID VARNAME STRVAL CODEFRAGMENT %token <StrVal> ID VARNAME STRVAL CODEFRAGMENT
%type <Ty> Type %type <Ty> Type
%type <Rec> ClassInst DefInst Object ObjectBody ClassID %type <Rec> ClassInst DefInst MultiClassDef ObjectBody ClassID
%type <RecList> MultiClassBody
%type <SubClassRef> SubClassRef %type <SubClassRef> SubClassRef
%type <SubClassList> ClassList ClassListNE %type <SubClassList> ClassList ClassListNE
@ -221,7 +242,18 @@ using namespace llvm;
%% %%
ClassID : ID { ClassID : ID {
$$ = Records.getClass(*$1); if (CurDefmPrefix) {
// If CurDefmPrefix is set, we're parsing a defm, which means that this is
// actually the name of a multiclass.
MultiClass *MC = MultiClasses[*$1];
if (MC == 0) {
err() << "Couldn't find class '" << *$1 << "'!\n";
exit(1);
}
$$ = &MC->Rec;
} else {
$$ = Records.getClass(*$1);
}
if ($$ == 0) { if ($$ == 0) {
err() << "Couldn't find class '" << *$1 << "'!\n"; err() << "Couldn't find class '" << *$1 << "'!\n";
exit(1); exit(1);
@ -260,6 +292,12 @@ IDValue : ID {
const RecordVal *RV = CurRec->getValue(CurRec->getName()+":"+*$1); const RecordVal *RV = CurRec->getValue(CurRec->getName()+":"+*$1);
assert(RV && "Template arg doesn't exist??"); assert(RV && "Template arg doesn't exist??");
$$ = new VarInit(CurRec->getName()+":"+*$1, RV->getType()); $$ = new VarInit(CurRec->getName()+":"+*$1, RV->getType());
} else if (CurMultiClass &&
CurMultiClass->Rec.isTemplateArg(CurMultiClass->Rec.getName()+"::"+*$1)) {
std::string Name = CurMultiClass->Rec.getName()+"::"+*$1;
const RecordVal *RV = CurMultiClass->Rec.getValue(Name);
assert(RV && "Template arg doesn't exist??");
$$ = new VarInit(Name, RV->getType());
} else if (Record *D = Records.getDef(*$1)) { } else if (Record *D = Records.getDef(*$1)) {
$$ = new DefInit(D); $$ = new DefInit(D);
} else { } else {
@ -467,8 +505,15 @@ ValueListNE : Value {
Declaration : OptPrefix Type ID OptValue { Declaration : OptPrefix Type ID OptValue {
std::string DecName = *$3; std::string DecName = *$3;
if (ParsingTemplateArgs) if (ParsingTemplateArgs) {
DecName = CurRec->getName() + ":" + DecName; if (CurRec) {
DecName = CurRec->getName() + ":" + DecName;
} else {
assert(CurMultiClass);
}
if (CurMultiClass)
DecName = CurMultiClass->Rec.getName() + "::" + DecName;
}
addValue(RecordVal(DecName, $2, $1)); addValue(RecordVal(DecName, $2, $1));
setValue(DecName, 0, $4); setValue(DecName, 0, $4);
@ -510,10 +555,10 @@ ClassList : /*empty */ {
}; };
DeclListNE : Declaration { DeclListNE : Declaration {
CurRec->addTemplateArg(*$1); getActiveRec()->addTemplateArg(*$1);
delete $1; delete $1;
} | DeclListNE ',' Declaration { } | DeclListNE ',' Declaration {
CurRec->addTemplateArg(*$3); getActiveRec()->addTemplateArg(*$3);
delete $3; delete $3;
}; };
@ -551,12 +596,25 @@ DefName : ObjectName {
CurRec = new Record(*$1); CurRec = new Record(*$1);
delete $1; delete $1;
// Ensure redefinition doesn't happen. if (!CurMultiClass) {
if (Records.getDef(CurRec->getName())) { // Top-level def definition.
err() << "Def '" << CurRec->getName() << "' already defined!\n";
exit(1); // Ensure redefinition doesn't happen.
if (Records.getDef(CurRec->getName())) {
err() << "def '" << CurRec->getName() << "' already defined!\n";
exit(1);
}
Records.addDef(CurRec);
} else {
// Otherwise, a def inside a multiclass, add it to the multiclass.
for (unsigned i = 0, e = CurMultiClass->DefPrototypes.size(); i != e; ++i)
if (CurMultiClass->DefPrototypes[i]->getName() == CurRec->getName()) {
err() << "def '" << CurRec->getName()
<< "' already defined in this multiclass!\n";
exit(1);
}
CurMultiClass->DefPrototypes.push_back(CurRec);
} }
Records.addDef(CurRec);
}; };
ObjectBody : ClassList { ObjectBody : ClassList {
@ -594,8 +652,112 @@ DefInst : DEF DefName ObjectBody {
$$ = $3; $$ = $3;
}; };
// MultiClassDef - A def instance specified inside a multiclass.
MultiClassDef : DefInst {
$$ = $1;
// Copy the template arguments for the multiclass into the def.
const std::vector<std::string> &TArgs = CurMultiClass->Rec.getTemplateArgs();
for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
const RecordVal *RV = CurMultiClass->Rec.getValue(TArgs[i]);
assert(RV && "Template arg doesn't exist?");
$$->addValue(*RV);
}
};
Object : ClassInst | DefInst; // MultiClassBody - Sequence of def's that are instantiated when a multiclass is
// used.
MultiClassBody : MultiClassDef {
$$ = new std::vector<Record*>();
$$->push_back($1);
} | MultiClassBody MultiClassDef {
$$->push_back($2);
};
MultiClassName : ID {
MultiClass *&MCE = MultiClasses[*$1];
if (MCE) {
err() << "multiclass '" << *$1 << "' already defined!\n";
exit(1);
}
MCE = CurMultiClass = new MultiClass(*$1);
delete $1;
};
// MultiClass - Multiple definitions.
MultiClassInst : MULTICLASS MultiClassName {
ParsingTemplateArgs = true;
} OptTemplateArgList {
ParsingTemplateArgs = false;
}'{' MultiClassBody '}' {
CurMultiClass = 0;
};
// DefMInst - Instantiate a multiclass.
DefMInst : DEFM ID { CurDefmPrefix = $2; } ':' SubClassRef ';' {
// To instantiate a multiclass, we need to first get the multiclass, then
// instantiate each def contained in the multiclass with the SubClassRef
// template parameters.
MultiClass *MC = MultiClasses[$5->first->getName()];
assert(MC && "Didn't lookup multiclass correctly?");
std::vector<Init*> &TemplateVals = *$5->second;
delete $5;
// Verify that the correct number of template arguments were specified.
const std::vector<std::string> &TArgs = MC->Rec.getTemplateArgs();
if (TArgs.size() < TemplateVals.size()) {
err() << "ERROR: More template args specified than multiclass expects!\n";
exit(1);
}
// Loop over all the def's in the multiclass, instantiating each one.
for (unsigned i = 0, e = MC->DefPrototypes.size(); i != e; ++i) {
Record *DefProto = MC->DefPrototypes[i];
// Add the suffix to the defm name to get the new name.
assert(CurRec == 0 && "A def is current?");
CurRec = new Record(*$2 + DefProto->getName());
addSubClass(DefProto, std::vector<Init*>());
// Loop over all of the template arguments, setting them to the specified
// value or leaving them as the default if necessary.
for (unsigned i = 0, e = TArgs.size(); i != e; ++i) {
if (i < TemplateVals.size()) { // A value is specified for this temp-arg?
// Set it now.
setValue(TArgs[i], 0, TemplateVals[i]);
// Resolve it next.
CurRec->resolveReferencesTo(CurRec->getValue(TArgs[i]));
// Now remove it.
CurRec->removeValue(TArgs[i]);
} else if (!CurRec->getValue(TArgs[i])->getValue()->isComplete()) {
err() << "ERROR: Value not specified for template argument #"
<< i << " (" << TArgs[i] << ") of multiclassclass '"
<< MC->Rec.getName() << "'!\n";
exit(1);
}
}
// Ensure redefinition doesn't happen.
if (Records.getDef(CurRec->getName())) {
err() << "def '" << CurRec->getName() << "' already defined, "
<< "instantiating defm '" << *$2 << "' with subdef '"
<< DefProto->getName() << "'!\n";
exit(1);
}
Records.addDef(CurRec);
CurRec = 0;
}
delete &TemplateVals;
delete $2;
};
Object : ClassInst {} | DefInst {};
Object : MultiClassInst | DefMInst;
LETItem : ID OptBitList '=' Value { LETItem : ID OptBitList '=' Value {
LetStack.back().push_back(LetRecord(*$1, $2, $4)); LetStack.back().push_back(LetRecord(*$1, $2, $4));
@ -617,7 +779,7 @@ Object : LETCommand '{' ObjectList '}' {
ObjectList : Object {} | ObjectList Object {}; ObjectList : Object {} | ObjectList Object {};
File : ObjectList {}; File : ObjectList;
%% %%