Changeset ef46abb
- Timestamp:
- Aug 12, 2019, 12:34:27 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 1ee048fd
- Parents:
- 14347ac (diff), 4f5a8a2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 2 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
automake/cfa.m4
r14347ac ref46abb 66 66 "x86-64" ) cannon_arch_name="x64";; 67 67 "x86_64" ) cannon_arch_name="x64";; 68 "aarch64" ) cannon_arch_name=" x64";;68 "aarch64" ) cannon_arch_name="arm";; 69 69 "x86" ) cannon_arch_name="x86";; 70 70 "i386" ) cannon_arch_name="x86";; -
configure
r14347ac ref46abb 3478 3478 "x86-64" ) cannon_arch_name="x64";; 3479 3479 "x86_64" ) cannon_arch_name="x64";; 3480 "aarch64" ) cannon_arch_name=" x64";;3480 "aarch64" ) cannon_arch_name="arm";; 3481 3481 "x86" ) cannon_arch_name="x86";; 3482 3482 "i386" ) cannon_arch_name="x86";; … … 3520 3520 "x86-64" ) cannon_arch_name="x64";; 3521 3521 "x86_64" ) cannon_arch_name="x64";; 3522 "aarch64" ) cannon_arch_name=" x64";;3522 "aarch64" ) cannon_arch_name="arm";; 3523 3523 "x86" ) cannon_arch_name="x86";; 3524 3524 "i386" ) cannon_arch_name="x86";; -
driver/cfa.cc
r14347ac ref46abb 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Feb 10 08:28:09201913 // Update Count : 28112 // Last Modified On : Sat Aug 10 08:44:15 2019 13 // Update Count : 311 14 14 // 15 15 … … 20 20 #include <string> // STL version 21 21 #include <string.h> // strcmp 22 #include <algorithm> // find 22 23 23 24 #include <sys/types.h> … … 26 27 #include "Common/SemanticError.h" 27 28 #include "config.h" // configure info 29 28 30 29 31 using std::cerr; … … 40 42 } // prefix 41 43 42 enum { NumSuffixes = 2 }; 43 const string suffixes[NumSuffixes] = { "cfa", "hfa", }; 44 45 bool suffix( string arg, const char * args[], int & nargs ) { 44 bool suffix( string arg ) { 45 enum { NumSuffixes = 3 }; 46 static const string suffixes[NumSuffixes] = { "cfa", "hfa", "ifa" }; 46 47 //std::cerr << arg << std::endl; 47 48 size_t dot = arg.find_last_of( "." ); 48 49 //std::cerr << dot << " " << (dot != string::npos ? arg.substr( dot + 1 ) : "fred" ) << std::endl; 49 50 if ( dot == string::npos ) return false; 50 string sx = arg.substr( dot + 1 ); 51 for ( int i = 0; i < NumSuffixes; i += 1 ) { 52 if ( sx == suffixes[i] ) { 53 args[nargs] = "-x"; 54 nargs += 1; 55 args[nargs] = "c"; 56 nargs += 1; 57 return true; 58 } // if 59 } // for 60 return false; 51 const string * end = suffixes + NumSuffixes; 52 return std::find( suffixes, end, arg.substr( dot + 1 ) ) != end; 61 53 } // suffix 62 54 63 55 64 void shuffle( const char * args[], int S, int E, int N ) {56 void shuffle( const char * args[], int S, int E, int N ) { 65 57 // S & E index 1 passed the end so adjust with -1 66 58 #ifdef __DEBUG_H__ … … 75 67 } // shuffle 76 68 77 static inline bool dirExists( const string & path) {69 static inline bool dirExists( const string & path ) { 78 70 struct stat info; 79 71 if(stat( path.c_str(), &info ) != 0) … … 92 84 #define str(s) #s 93 85 94 int main( int argc, char * argv[] ) {86 int main( int argc, char * argv[] ) { 95 87 string Version( CFA_VERSION_LONG ); // current version number from CONFIG 96 88 string Major( str( CFA_VERSION_MAJOR ) ), Minor( str( CFA_VERSION_MINOR ) ), Patch( str( CFA_VERSION_PATCH ) ); … … 108 100 string compiler_name; // name of C compiler 109 101 102 bool x_flag = false; // -x flag 110 103 bool nonoptarg = false; // indicates non-option argument specified 111 104 bool link = true; // linking as well as compiling 112 105 bool verbose = false; // -v flag 113 bool quiet = false; // -quiet flag114 bool debug = true; // -debug flag115 bool nolib = false; // -nolib flag116 bool help = false; // -help flag106 bool quiet = false; // -quiet flag 107 bool debug = true; // -debug flag 108 bool nolib = false; // -nolib flag 109 bool help = false; // -help flag 117 110 bool CFA_flag = false; // -CFA flag 118 111 bool cpp_flag = false; // -E or -M flag, preprocessor only … … 120 113 bool noincstd_flag = false; // -no-include-stdhdr= flag 121 114 bool debugging __attribute(( unused )) = false; // -g flag 122 bool m32 = false; 123 bool m64 = false; 115 bool m32 = false; // -m32 flag 116 bool m64 = false; // -m64 flag 124 117 bool intree = false; 125 118 bool disttree = false; … … 210 203 args[nargs] = argv[i]; // pass the argument along 211 204 nargs += 1; 205 } else if ( prefix( arg, "-x" ) ) { // file suffix ? 206 string lang; 207 args[nargs] = argv[i]; // pass the argument along 208 nargs += 1; 209 if ( arg.length() == 2 ) { // separate argument ? 210 i += 1; 211 if ( i == argc ) continue; // next argument available ? 212 lang = argv[i]; 213 args[nargs] = argv[i]; // pass the argument along 214 nargs += 1; 215 } else { 216 lang = arg.substr( 2 ); 217 } // if 218 x_flag = lang != "none"; 212 219 } else if ( prefix( arg, "-std=" ) || prefix( arg, "--std=" ) ) { 213 220 std_flag = true; // -std=XX provided … … 295 302 } // if 296 303 } else { 297 bool cfa = suffix( arg, args, nargs ); // check suffix 304 bool cfa = suffix( arg ); // check suffix 305 if ( ! x_flag && cfa ) { // no explicit suffix and cfa suffix ? 306 args[nargs] = "-x"; 307 nargs += 1; 308 args[nargs] = "c"; 309 nargs += 1; 310 } // if 298 311 args[nargs] = argv[i]; // concatenate file 299 312 nargs += 1; 300 if ( cfa ) {313 if ( ! x_flag && cfa ) { // no explicit suffix and cfa suffix ? 301 314 args[nargs] = "-x"; 302 315 nargs += 1; -
src/BasicTypes-gen.cc
r14347ac ref46abb 295 295 // cout << code.str(); 296 296 297 297 298 // TEMPORARY DURING CHANGE OVER 299 #define TypeAST TOP_SRCDIR "src/AST/Type.hpp" 300 resetInput( file, TypeAST, buffer, code, str ); 301 302 if ( (start = str.find( STARTMK )) == string::npos ) Abort( "start", TypeAST ); 303 start += sizeof( STARTMK ); // includes newline 304 code << str.substr( 0, start ); 305 306 code << "\t" << BYMK << endl; 307 code << "\tenum Kind {" << endl; 308 for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { 309 code << "\t\t" << graph[r].name << "," << endl; 310 } // for 311 code << "\t\tNUMBER_OF_BASIC_TYPES" << endl; 312 code << "\t} kind;" << endl; 313 code << "\t"; // indentation for end marker 314 315 if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", TypeAST ); 316 code << str.substr( start ); 317 318 output( file, TypeAST, code ); 319 // cout << code.str(); 320 321 298 322 #define ConversionCost TOP_SRCDIR "src/ResolvExpr/ConversionCost.cc" 299 323 resetInput( file, ConversionCost, buffer, code, str ); … … 310 334 code << right << setw(30) << graph[c].type << left; 311 335 } else if ( graph[c].rank != graph[c + 2].rank ) { 312 code << string( 10, ' ' ) << setw(25) << graph[c].type << setw(25) <<graph[c + 1].type;336 code << string( 10, ' ' ) << setw(25) << graph[c].type << graph[c + 1].type; 313 337 c += 1; 314 338 } else { 315 code << setw(20) << graph[c].type << setw(20) << graph[c + 1].type << setw(20) <<graph[c + 2].type;339 code << setw(20) << graph[c].type << setw(20) << graph[c + 1].type << graph[c + 2].type; 316 340 c += 2; 317 341 } // if … … 328 352 code << "\t" << BYMK << endl; 329 353 code << "\tstatic const int costMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node" << endl 330 << "\t\t/* ";354 << "\t\t/* "; 331 355 for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // titles 332 356 code << setw(5) << graph[r].abbrev; … … 334 358 code << " */" << endl; 335 359 for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // costs 336 code << "\t\t/* " << setw(6) << graph[r].abbrev << "*/ {";360 code << "\t\t/* " << setw(6) << graph[r].abbrev << " */ {"; 337 361 for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) { 338 362 code << setw(4) << costMatrix[r][c] << ","; … … 353 377 code << "\t" << BYMK << endl; 354 378 code << "\tstatic const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion" << endl 355 << "\t\t/* ";379 << "\t\t/* "; 356 380 for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // titles 357 381 code << setw(5) << graph[r].abbrev; … … 359 383 code << " */" << endl; 360 384 for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // costs 361 code << "\t\t/* " << setw(6) << graph[r].abbrev << "*/ {";385 code << "\t\t/* " << setw(6) << graph[r].abbrev << " */ {"; 362 386 for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) { 363 387 code << setw(4) << signMatrix[r][c] << ","; … … 395 419 code << "*/" << endl; 396 420 for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { // costs 397 code << "\t\t\t\t {\n\t\t/* " << setw(6) << graph[r].abbrev << "*/";421 code << "\t\t\t\t {\n\t\t/* " << setw(6) << graph[r].abbrev << " */"; 398 422 for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) { 399 423 string s = string{"BT "} + graph[commonTypeMatrix[r][c]].name; -
src/GenPoly/Box.cc
r14347ac ref46abb 725 725 if ( ! needsBoxing( param, arg->result, exprTyVars, env ) ) return; 726 726 727 if ( arg-> result->get_lvalue() ) {727 if ( arg->get_lvalue() ) { 728 728 // argument expression may be CFA lvalue, but not C lvalue -- apply generalizedLvalue transformations. 729 729 // if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( arg ) ) { -
src/GenPoly/Lvalue.cc
r14347ac ref46abb 363 363 int diff = depth1 - depth2; 364 364 365 if ( diff > 0 && ! srcType->get_lvalue() ) {365 if ( diff > 0 && ! castExpr->arg->get_lvalue() ) { 366 366 // rvalue to reference conversion -- introduce temporary 367 367 // know that reference depth of cast argument is 0, need to introduce n temporaries for reference depth of n, e.g. … … 407 407 ret = new AddressExpr( ret ); 408 408 } 409 if ( srcType->get_lvalue() && ! ResolvExpr::typesCompatible( srcType, strict_dynamic_cast<ReferenceType *>( destType )->base, SymTab::Indexer() ) ) {409 if ( castExpr->arg->get_lvalue() && ! ResolvExpr::typesCompatible( srcType, strict_dynamic_cast<ReferenceType *>( destType )->base, SymTab::Indexer() ) ) { 410 410 // must keep cast if cast-to type is different from the actual type 411 411 castExpr->arg = ret; -
src/Makefile.am
r14347ac ref46abb 11 11 ## Created On : Sun May 31 08:51:46 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Fri Feb 15 09:44:09201914 ## Update Count : 9 713 ## Last Modified On : Mon Aug 5 12:57:46 2019 14 ## Update Count : 98 15 15 ############################################################################### 16 16 … … 55 55 $(addprefix $(srcdir)/, ResolvExpr/ConversionCost.cc ResolvExpr/CommonType.cc SymTab/ManglerCommon.cc) : $(srcdir)/SynTree/Type.h 56 56 57 $(srcdir)/ SynTree/Type.h: BasicTypes-gen.cc57 $(srcdir)/AST/Type.hpp : BasicTypes-gen.cc 58 58 ${AM_V_GEN}${CXXCOMPILE} $< -o BasicTypes-gen -Wall -Wextra 59 59 @./BasicTypes-gen -
src/Makefile.in
r14347ac ref46abb 231 231 SynTree/Initializer.$(OBJEXT) \ 232 232 SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \ 233 SynTree/DeclReplacer.$(OBJEXT) 233 SynTree/DeclReplacer.$(OBJEXT) SynTree/TopLvalue.$(OBJEXT) 234 234 am__objects_8 = CompilationState.$(OBJEXT) $(am__objects_1) \ 235 235 $(am__objects_2) Concurrency/Keywords.$(OBJEXT) \ … … 694 694 SynTree/TypeSubstitution.cc \ 695 695 SynTree/Attribute.cc \ 696 SynTree/DeclReplacer.cc 696 SynTree/DeclReplacer.cc \ 697 SynTree/TopLvalue.cc 697 698 698 699 … … 1023 1024 SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \ 1024 1025 SynTree/$(DEPDIR)/$(am__dirstamp) 1026 SynTree/TopLvalue.$(OBJEXT): SynTree/$(am__dirstamp) \ 1027 SynTree/$(DEPDIR)/$(am__dirstamp) 1025 1028 Tuples/$(am__dirstamp): 1026 1029 @$(MKDIR_P) Tuples … … 1333 1336 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ReferenceType.Po@am__quote@ 1334 1337 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Statement.Po@am__quote@ 1338 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TopLvalue.Po@am__quote@ 1335 1339 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TupleExpr.Po@am__quote@ 1336 1340 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TupleType.Po@am__quote@ … … 1666 1670 $(addprefix $(srcdir)/, ResolvExpr/ConversionCost.cc ResolvExpr/CommonType.cc SymTab/ManglerCommon.cc) : $(srcdir)/SynTree/Type.h 1667 1671 1668 $(srcdir)/ SynTree/Type.h: BasicTypes-gen.cc1672 $(srcdir)/AST/Type.hpp : BasicTypes-gen.cc 1669 1673 ${AM_V_GEN}${CXXCOMPILE} $< -o BasicTypes-gen -Wall -Wextra 1670 1674 @./BasicTypes-gen -
src/Parser/ExpressionNode.cc
r14347ac ref46abb 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Mar 10 16:10:32201913 // Update Count : 97 612 // Last Modified On : Sun Aug 4 20:57:55 2019 13 // Update Count : 978 14 14 // 15 15 … … 109 109 110 110 Expression * build_constantInteger( string & str ) { 111 static const BasicType::Kind kind[2][ 7] = {111 static const BasicType::Kind kind[2][6] = { 112 112 // short (h) must be before char (hh) because shorter type has the longer suffix 113 113 { BasicType::ShortSignedInt, BasicType::SignedChar, BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt, BasicType::SignedInt128, }, -
src/Parser/lex.ll
r14347ac ref46abb 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Thu Jul 25 22:08:32201913 * Update Count : 71 612 * Last Modified On : Sun Aug 4 20:53:47 2019 13 * Update Count : 719 14 14 */ 15 15 … … 273 273 __inline__ { KEYWORD_RETURN(INLINE); } // GCC 274 274 int { KEYWORD_RETURN(INT); } 275 int128 { KEYWORD_RETURN(INT128); } // CFA 275 276 __int128 { KEYWORD_RETURN(INT128); } // GCC 276 int128{ KEYWORD_RETURN(INT128); } // GCC277 __int128_t { KEYWORD_RETURN(INT128); } // GCC 277 278 __label__ { KEYWORD_RETURN(LABEL); } // GCC 278 279 long { KEYWORD_RETURN(LONG); } … … 313 314 __typeof__ { KEYWORD_RETURN(TYPEOF); } // GCC 314 315 union { KEYWORD_RETURN(UNION); } 316 __uint128_t { KEYWORD_RETURN(UINT128); } // GCC 315 317 unsigned { KEYWORD_RETURN(UNSIGNED); } 316 318 __builtin_va_list { KEYWORD_RETURN(VALIST); } // GCC -
src/Parser/parser.yy
r14347ac ref46abb 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 25 22:31:38201913 // Update Count : 43 5912 // Last Modified On : Sun Aug 4 21:48:23 2019 13 // Update Count : 4364 14 14 // 15 15 … … 268 268 %token VOID CHAR SHORT INT LONG FLOAT DOUBLE SIGNED UNSIGNED 269 269 %token BOOL COMPLEX IMAGINARY // C99 270 %token INT128 uuFLOAT80 uuFLOAT128// GCC270 %token INT128 UINT128 uuFLOAT80 uuFLOAT128 // GCC 271 271 %token uFLOAT16 uFLOAT32 uFLOAT32X uFLOAT64 uFLOAT64X uFLOAT128 // GCC 272 272 %token ZERO_T ONE_T // CFA … … 1826 1826 | INT128 1827 1827 { $$ = DeclarationNode::newBasicType( DeclarationNode::Int128 ); } 1828 | UINT128 1829 { $$ = DeclarationNode::newBasicType( DeclarationNode::Int128 )->addType( DeclarationNode::newSignedNess( DeclarationNode::Unsigned ) ); } 1828 1830 | FLOAT 1829 1831 { $$ = DeclarationNode::newBasicType( DeclarationNode::Float ); } -
src/ResolvExpr/AlternativeFinder.cc
r14347ac ref46abb 1135 1135 bool isLvalue( Expression *expr ) { 1136 1136 // xxx - recurse into tuples? 1137 return expr->result && ( expr-> result->get_lvalue() || dynamic_cast< ReferenceType * >( expr->result ) );1137 return expr->result && ( expr->get_lvalue() || dynamic_cast< ReferenceType * >( expr->result ) ); 1138 1138 } 1139 1139 -
src/ResolvExpr/CommonType.cc
r14347ac ref46abb 190 190 */ 191 191 { 192 /* B */ BT Bool, BT Char, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt,192 /* B */ BT Bool, BT Char, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, 193 193 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 194 194 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 198 198 }, 199 199 { 200 /* C */ BT Char, BT Char, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt,200 /* C */ BT Char, BT Char, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, 201 201 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 202 202 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 206 206 }, 207 207 { 208 /* SC */ BT SignedChar, BT SignedChar, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt,208 /* SC */ BT SignedChar, BT SignedChar, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, 209 209 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 210 210 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 214 214 }, 215 215 { 216 /* UC */ BT UnsignedChar, BT UnsignedChar, BT UnsignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt,216 /* UC */ BT UnsignedChar, BT UnsignedChar, BT UnsignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, 217 217 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 218 218 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 222 222 }, 223 223 { 224 /* SI */ BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortUnsignedInt,224 /* SI */ BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortUnsignedInt, 225 225 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 226 226 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 230 230 }, 231 231 { 232 /* SUI */ BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt,232 /* SUI */ BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, 233 233 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 234 234 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 238 238 }, 239 239 { 240 /* I */ BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt,240 /* I */ BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, 241 241 BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 242 242 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 246 246 }, 247 247 { 248 /* UI */ BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt,248 /* UI */ BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, 249 249 BT UnsignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 250 250 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 254 254 }, 255 255 { 256 /* LI */ BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt,256 /* LI */ BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, 257 257 BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 258 258 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 262 262 }, 263 263 { 264 /* LUI */ BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt,264 /* LUI */ BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, 265 265 BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 266 266 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 270 270 }, 271 271 { 272 /* LLI */ BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt,272 /* LLI */ BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, 273 273 BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, 274 274 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 278 278 }, 279 279 { 280 /* LLUI */ BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt,280 /* LLUI */ BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, 281 281 BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, 282 282 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 286 286 }, 287 287 { 288 /* IB */ BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128,288 /* IB */ BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, 289 289 BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, 290 290 BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 294 294 }, 295 295 { 296 /* UIB */ BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128,296 /* UIB */ BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, 297 297 BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, 298 298 BT UnsignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 302 302 }, 303 303 { 304 /* _FH */ BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16,304 /* _FH */ BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, 305 305 BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, 306 306 BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, … … 310 310 }, 311 311 { 312 /* _FH */ BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex,312 /* _FH */ BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, 313 313 BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, 314 314 BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat32Complex, BT uFloat32Complex, … … 318 318 }, 319 319 { 320 /* _F */ BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32,320 /* _F */ BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, 321 321 BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, 322 322 BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32Complex, BT uFloat32, BT uFloat32Complex, … … 326 326 }, 327 327 { 328 /* _FC */ BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex,328 /* _FC */ BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, 329 329 BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, 330 330 BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, … … 334 334 }, 335 335 { 336 /* F */ BT Float, BT Float, BT Float, BT Float, BT Float, BT Float,336 /* F */ BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, 337 337 BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, 338 338 BT Float, BT Float, BT Float, BT FloatComplex, BT Float, BT FloatComplex, … … 342 342 }, 343 343 { 344 /* FC */ BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex,344 /* FC */ BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, 345 345 BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, 346 346 BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, … … 350 350 }, 351 351 { 352 /* _FX */ BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x,352 /* _FX */ BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, 353 353 BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, 354 354 BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32xComplex, BT uFloat32x, BT uFloat32xComplex, … … 358 358 }, 359 359 { 360 /* _FXC */ BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex,360 /* _FXC */ BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, 361 361 BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, 362 362 BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, … … 366 366 }, 367 367 { 368 /* FD */ BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64,368 /* FD */ BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, 369 369 BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, 370 370 BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64Complex, BT uFloat64, BT uFloat64Complex, … … 374 374 }, 375 375 { 376 /* _FDC */ BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex,376 /* _FDC */ BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, 377 377 BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, 378 378 BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, … … 382 382 }, 383 383 { 384 /* D */ BT Double, BT Double, BT Double, BT Double, BT Double, BT Double,384 /* D */ BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, 385 385 BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, 386 386 BT Double, BT Double, BT Double, BT DoubleComplex, BT Double, BT DoubleComplex, … … 390 390 }, 391 391 { 392 /* DC */ BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex,392 /* DC */ BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, 393 393 BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, 394 394 BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, … … 398 398 }, 399 399 { 400 /* F80X */ BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x,400 /* F80X */ BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, 401 401 BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, 402 402 BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64xComplex, BT uFloat64x, BT uFloat64xComplex, … … 406 406 }, 407 407 { 408 /* _FDXC */ BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex,408 /* _FDXC */ BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, 409 409 BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, 410 410 BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, … … 414 414 }, 415 415 { 416 /* F80*/ BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80,416 /* F80 */ BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, 417 417 BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, 418 418 BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat64xComplex, … … 422 422 }, 423 423 { 424 /* _FB */ BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128,424 /* _FB */ BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, 425 425 BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, 426 426 BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128Complex, … … 430 430 }, 431 431 { 432 /* _FLDC */ BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex,432 /* _FLDC */ BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, 433 433 BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, 434 434 BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, … … 438 438 }, 439 439 { 440 /* FB */ BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128,440 /* FB */ BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, 441 441 BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, 442 442 BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uFloat128Complex, … … 446 446 }, 447 447 { 448 /* LD */ BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble,448 /* LD */ BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, 449 449 BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, 450 450 BT LongDouble, BT LongDouble, BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDoubleComplex, … … 454 454 }, 455 455 { 456 /* LDC */ BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex,456 /* LDC */ BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, 457 457 BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, 458 458 BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, … … 462 462 }, 463 463 { 464 /* _FBX */ BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x,464 /* _FBX */ BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, 465 465 BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, 466 466 BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, -
src/ResolvExpr/ConversionCost.cc
r14347ac ref46abb 98 98 } 99 99 100 Cost convertToReferenceCost( const Type * src, const Type * dest, int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) {100 static Cost convertToReferenceCost( const Type * src, const Type * dest, int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) { 101 101 PRINT( std::cerr << "convert to reference cost... diff " << diff << " " << src << " / " << dest << std::endl; ) 102 102 if ( diff > 0 ) { … … 217 217 // GENERATED BY BasicTypes-gen.cc 218 218 static const int costMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node 219 /* B C SC UC SI SUI I UI LI LUI LLI LLUI IB UIB _FH _FH _F _FC F FC _FX _FXC FD _FDC D DC F80X_FDXC F80 _FB_FLDC FB LD LDC _FBX_FLDXC */220 /* B */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 17, 16, 18, 17, },221 /* C */ { -1, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 15, 17, 16, },222 /* SC */ { -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 15, 17, 16, },223 /* UC */ { -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 15, 17, 16, },224 /* SI */ { -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 14, 16, 15, },225 /* SUI */ { -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 14, 16, 15, },226 /* I */ { -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 13, 15, 14, },227 /* UI */ { -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 13, 15, 14, },228 /* LI */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 12, 14, 13, },229 /* LUI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 12, 14, 13, },230 /* LLI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 11, 13, 12, },231 /* LLUI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 11, 13, 12, },232 /* IB */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 10, 12, 11, },233 /* UIB */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 10, 12, 11, },234 /* _FH */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 10, 9, 11, 10, },235 /* _FH */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, 5, -1, 6, -1, -1, 7, -1, -1, 8, -1, 9, },236 /* _F */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 9, 8, 10, 9, },237 /* _FC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, 5, -1, -1, 6, -1, -1, 7, -1, 8, },238 /* F */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8, 7, 9, 8, },239 /* FC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, -1, 5, -1, -1, 6, -1, 7, },240 /* _FX */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 6, 8, 7, },241 /* _FXC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, -1, 4, -1, -1, 5, -1, 6, },242 /* FD */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 5, 7, 6, },243 /* _FDC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, -1, 3, -1, -1, 4, -1, 5, },244 /* D */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 5, 4, 6, 5, },245 /* DC */ { -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, 0, -1, 1, -1, -1, 2, -1, -1, 3, -1, 4, },246 /* F80X */ { -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, 0, 1, 1, 2, 2, 3, 4, 3, 5, 4, },247 /* _FDXC */ { -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, 0, -1, -1, 1, -1, -1, 2, -1, 3, },248 /* F80*/ { -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, 0, 1, 2, 2, 3, 3, 4, 4, },249 /* _FB */ { -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, 0, 1, 1, 2, 2, 3, 3, },250 /* _FLDC */ { -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, 0, -1, -1, 1, -1, 2, },251 /* FB */ { -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, 0, 1, 2, 2, 3, },252 /* LD */ { -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, 0, 1, 1, 2, },253 /* LDC */ { -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, 0, -1, 1, },254 /* _FBX */ { -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, 0, 1, },219 /* B C SC UC SI SUI I UI LI LUI LLI LLUI IB UIB _FH _FH _F _FC F FC _FX _FXC FD _FDC D DC F80X_FDXC F80 _FB_FLDC FB LD LDC _FBX_FLDXC */ 220 /* B */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 17, 16, 18, 17, }, 221 /* C */ { -1, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 15, 17, 16, }, 222 /* SC */ { -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 15, 17, 16, }, 223 /* UC */ { -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 15, 17, 16, }, 224 /* SI */ { -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 14, 16, 15, }, 225 /* SUI */ { -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 14, 16, 15, }, 226 /* I */ { -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 13, 15, 14, }, 227 /* UI */ { -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 13, 15, 14, }, 228 /* LI */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 12, 14, 13, }, 229 /* LUI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 12, 14, 13, }, 230 /* LLI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 11, 13, 12, }, 231 /* LLUI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 11, 13, 12, }, 232 /* IB */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 10, 12, 11, }, 233 /* UIB */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 10, 12, 11, }, 234 /* _FH */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 10, 9, 11, 10, }, 235 /* _FH */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, 5, -1, 6, -1, -1, 7, -1, -1, 8, -1, 9, }, 236 /* _F */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 9, 8, 10, 9, }, 237 /* _FC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, 5, -1, -1, 6, -1, -1, 7, -1, 8, }, 238 /* F */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8, 7, 9, 8, }, 239 /* FC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, -1, 5, -1, -1, 6, -1, 7, }, 240 /* _FX */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 6, 8, 7, }, 241 /* _FXC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, -1, 4, -1, -1, 5, -1, 6, }, 242 /* FD */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 5, 7, 6, }, 243 /* _FDC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, -1, 3, -1, -1, 4, -1, 5, }, 244 /* D */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 5, 4, 6, 5, }, 245 /* DC */ { -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, 0, -1, 1, -1, -1, 2, -1, -1, 3, -1, 4, }, 246 /* F80X */ { -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, 0, 1, 1, 2, 2, 3, 4, 3, 5, 4, }, 247 /* _FDXC */ { -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, 0, -1, -1, 1, -1, -1, 2, -1, 3, }, 248 /* F80 */ { -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, 0, 1, 2, 2, 3, 3, 4, 4, }, 249 /* _FB */ { -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, 0, 1, 1, 2, 2, 3, 3, }, 250 /* _FLDC */ { -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, 0, -1, -1, 1, -1, 2, }, 251 /* FB */ { -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, 0, 1, 2, 2, 3, }, 252 /* LD */ { -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, 0, 1, 1, 2, }, 253 /* LDC */ { -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, 0, -1, 1, }, 254 /* _FBX */ { -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, 0, 1, }, 255 255 /* _FLDXC */ { -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, 0, }, 256 256 }; // costMatrix … … 265 265 // GENERATED BY BasicTypes-gen.cc 266 266 static const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion 267 /* B C SC UC SI SUI I UI LI LUI LLI LLUI IB UIB _FH _FH _F _FC F FC _FX _FXC FD _FDC D DC F80X_FDXC F80 _FB_FLDC FB LD LDC _FBX_FLDXC */268 /* B */ { 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },269 /* C */ { -1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },270 /* SC */ { -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },271 /* UC */ { -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },272 /* SI */ { -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },273 /* SUI */ { -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },274 /* I */ { -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },275 /* UI */ { -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },276 /* LI */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },277 /* LUI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },278 /* LLI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },279 /* LLUI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },280 /* IB */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },281 /* UIB */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },282 /* _FH */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },283 /* _FH */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, },284 /* _F */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },285 /* _FC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, },286 /* F */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },287 /* FC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, },288 /* _FX */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },289 /* _FXC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, },290 /* FD */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },291 /* _FDC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, },292 /* D */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },293 /* DC */ { -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, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, },294 /* F80X */ { -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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },295 /* _FDXC */ { -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, 0, -1, -1, 0, -1, -1, 0, -1, 0, },296 /* F80*/ { -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, 0, 0, 0, 0, 0, 0, 0, 0, 0, },297 /* _FB */ { -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, 0, 0, 0, 0, 0, 0, 0, },298 /* _FLDC */ { -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, 0, -1, -1, 0, -1, 0, },299 /* FB */ { -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, 0, 0, 0, 0, 0, 0, },300 /* LD */ { -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, 0, 0, 0, 0, },301 /* LDC */ { -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, 0, -1, 0, },302 /* _FBX */ { -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, 0, 0, },267 /* B C SC UC SI SUI I UI LI LUI LLI LLUI IB UIB _FH _FH _F _FC F FC _FX _FXC FD _FDC D DC F80X_FDXC F80 _FB_FLDC FB LD LDC _FBX_FLDXC */ 268 /* B */ { 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 269 /* C */ { -1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 270 /* SC */ { -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 271 /* UC */ { -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 272 /* SI */ { -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 273 /* SUI */ { -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 274 /* I */ { -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 275 /* UI */ { -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 276 /* LI */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 277 /* LUI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 278 /* LLI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 279 /* LLUI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 280 /* IB */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 281 /* UIB */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 282 /* _FH */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 283 /* _FH */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, }, 284 /* _F */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 285 /* _FC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, }, 286 /* F */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 287 /* FC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, }, 288 /* _FX */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 289 /* _FXC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, }, 290 /* FD */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 291 /* _FDC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, }, 292 /* D */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 293 /* DC */ { -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, 0, -1, 0, -1, -1, 0, -1, -1, 0, -1, 0, }, 294 /* F80X */ { -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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 295 /* _FDXC */ { -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, 0, -1, -1, 0, -1, -1, 0, -1, 0, }, 296 /* F80 */ { -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, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 297 /* _FB */ { -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, 0, 0, 0, 0, 0, 0, 0, }, 298 /* _FLDC */ { -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, 0, -1, -1, 0, -1, 0, }, 299 /* FB */ { -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, 0, 0, 0, 0, 0, 0, }, 300 /* LD */ { -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, 0, 0, 0, 0, }, 301 /* LDC */ { -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, 0, -1, 0, }, 302 /* _FBX */ { -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, 0, 0, }, 303 303 /* _FLDXC */ { -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, 0, }, 304 304 }; // signMatrix … … 534 534 } 535 535 536 Cost convertToReferenceCost( const ast::Type * src, const ast::Type * dst, int diff,537 const ast::SymbolTable & symtab, const ast::TypeEnvironment & env,536 static Cost convertToReferenceCost( const ast::Type * src, const ast::Type * dst, 537 int diff, const ast::SymbolTable & symtab, const ast::TypeEnvironment & env, 538 538 NumCostCalculation func ) { 539 539 if ( 0 < diff ) { -
src/SymTab/Validate.cc
r14347ac ref46abb 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 21:50:04 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon Aug 28 13:47:23 201713 // Update Count : 3 5911 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Aug 7 6:42:00 2019 13 // Update Count : 360 14 14 // 15 15 … … 81 81 #include "SynTree/Label.h" // for operator==, Label 82 82 #include "SynTree/Mutator.h" // for Mutator 83 #include "SynTree/TopLvalue.h" // for assertTopLvalue, clearInnerLvalue 83 84 #include "SynTree/Type.h" // for Type, TypeInstType, EnumInstType 84 85 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution … … 308 309 PassVisitor<FixQualifiedTypes> fixQual; 309 310 311 assertTopLvalue( translationUnit ); 310 312 { 311 313 Stats::Heap::newPass("validate-A"); … … 316 318 acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes_old because it is an indexer and needs correct types for mangling 317 319 } 320 assertTopLvalue( translationUnit ); 318 321 { 319 322 Stats::Heap::newPass("validate-B"); 320 323 Stats::Time::BlockGuard guard("validate-B"); 324 assertTopLvalue( translationUnit ); 321 325 Stats::Time::TimeBlock("Link Reference To Types", [&]() { 322 326 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions 323 327 }); 328 clearInnerLvalue( translationUnit ); 329 assertTopLvalue( translationUnit ); 324 330 Stats::Time::TimeBlock("Fix Qualified Types", [&]() { 325 331 mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes_old, because aggregate members are accessed 326 332 }); 333 assertTopLvalue( translationUnit ); 327 334 Stats::Time::TimeBlock("Hoist Structs", [&]() { 328 335 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order 329 336 }); 337 assertTopLvalue( translationUnit ); 330 338 Stats::Time::TimeBlock("Eliminate Typedefs", [&]() { 331 339 EliminateTypedef::eliminateTypedef( translationUnit ); // 332 340 }); 333 341 } 342 assertTopLvalue( translationUnit ); 334 343 { 335 344 Stats::Heap::newPass("validate-C"); … … 340 349 InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen 341 350 } 351 assertTopLvalue( translationUnit ); 342 352 { 343 353 Stats::Heap::newPass("validate-D"); 344 354 Stats::Time::BlockGuard guard("validate-D"); 355 assertTopLvalue( translationUnit ); 345 356 Stats::Time::TimeBlock("Apply Concurrent Keywords", [&]() { 346 357 Concurrency::applyKeywords( translationUnit ); 347 358 }); 359 clearInnerLvalue( translationUnit ); 360 assertTopLvalue( translationUnit ); 348 361 Stats::Time::TimeBlock("Forall Pointer Decay", [&]() { 349 362 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution 350 363 }); 364 assertTopLvalue( translationUnit ); 351 365 Stats::Time::TimeBlock("Hoist Control Declarations", [&]() { 352 366 ControlStruct::hoistControlDecls( translationUnit ); // hoist initialization out of for statements; must happen before autogenerateRoutines 353 367 }); 368 assertTopLvalue( translationUnit ); 354 369 Stats::Time::TimeBlock("Generate Autogen routines", [&]() { 355 370 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay_old 356 371 }); 357 } 372 clearInnerLvalue( translationUnit ); 373 } 374 assertTopLvalue( translationUnit ); 358 375 { 359 376 Stats::Heap::newPass("validate-E"); 360 377 Stats::Time::BlockGuard guard("validate-E"); 378 assertTopLvalue( translationUnit ); 361 379 Stats::Time::TimeBlock("Implement Mutex Func", [&]() { 362 380 Concurrency::implementMutexFuncs( translationUnit ); 363 381 }); 382 clearInnerLvalue( translationUnit ); 383 assertTopLvalue( translationUnit ); 364 384 Stats::Time::TimeBlock("Implement Thread Start", [&]() { 365 385 Concurrency::implementThreadStarter( translationUnit ); 366 386 }); 387 assertTopLvalue( translationUnit ); 367 388 Stats::Time::TimeBlock("Compound Literal", [&]() { 368 389 mutateAll( translationUnit, compoundliteral ); 369 390 }); 391 assertTopLvalue( translationUnit ); 370 392 Stats::Time::TimeBlock("Resolve With Expressions", [&]() { 371 393 ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables 372 394 }); 373 } 395 clearInnerLvalue( translationUnit ); 396 } 397 assertTopLvalue( translationUnit ); 374 398 { 375 399 Stats::Heap::newPass("validate-F"); 376 400 Stats::Time::BlockGuard guard("validate-F"); 401 assertTopLvalue( translationUnit ); 377 402 Stats::Time::TimeBlock("Fix Object Type", [&]() { 378 403 FixObjectType::fix( translationUnit ); 379 404 }); 405 assertTopLvalue( translationUnit ); 380 406 Stats::Time::TimeBlock("Array Length", [&]() { 381 407 ArrayLength::computeLength( translationUnit ); 382 408 }); 409 clearInnerLvalue( translationUnit ); 410 assertTopLvalue( translationUnit ); 383 411 Stats::Time::TimeBlock("Find Special Declarations", [&]() { 384 412 Validate::findSpecialDecls( translationUnit ); 385 413 }); 414 assertTopLvalue( translationUnit ); 386 415 Stats::Time::TimeBlock("Fix Label Address", [&]() { 387 416 mutateAll( translationUnit, labelAddrFixer ); 388 417 }); 418 assertTopLvalue( translationUnit ); 389 419 Stats::Time::TimeBlock("Handle Attributes", [&]() { 390 420 Validate::handleAttributes( translationUnit ); 391 421 }); 392 422 } 423 assertTopLvalue( translationUnit ); 393 424 } 394 425 -
src/SynTree/AddressExpr.cc
r14347ac ref46abb 42 42 AddressExpr::AddressExpr( Expression *arg ) : Expression(), arg( arg ) { 43 43 if ( arg->result ) { 44 if ( arg-> result->get_lvalue() ) {44 if ( arg->get_lvalue() ) { 45 45 // lvalue, retains all layers of reference and gains a pointer inside the references 46 46 set_result( addrType( arg->result ) ); -
src/SynTree/BasicType.cc
r14347ac ref46abb 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jan 31 21:37:36201913 // Update Count : 1 212 // Last Modified On : Sun Aug 4 21:07:44 2019 13 // Update Count : 13 14 14 // 15 15 … … 31 31 bool BasicType::isInteger() const { 32 32 return kind <= UnsignedInt128; 33 #if 034 switch ( kind ) {35 case Bool:36 case Char:37 case SignedChar:38 case UnsignedChar:39 case ShortSignedInt:40 case ShortUnsignedInt:41 case SignedInt:42 case UnsignedInt:43 case LongSignedInt:44 case LongUnsignedInt:45 case LongLongSignedInt:46 case LongLongUnsignedInt:47 case SignedInt128:48 case UnsignedInt128:49 return true;50 case Float:51 case Double:52 case LongDouble:53 case FloatComplex:54 case DoubleComplex:55 case LongDoubleComplex:56 case FloatImaginary:57 case DoubleImaginary:58 case LongDoubleImaginary:59 case Float80:60 case Float128:61 return false;62 case NUMBER_OF_BASIC_TYPES:63 assert( false );64 } // switch65 assert( false );66 return false;67 #endif68 33 } 69 34 -
src/SynTree/Expression.cc
r14347ac ref46abb 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Jul 25 22:21:48201913 // Update Count : 6 111 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Aug 7 17:03:00 2019 13 // Update Count : 62 14 14 // 15 15 … … 61 61 delete env; 62 62 delete result; 63 } 64 65 bool Expression::get_lvalue() const { 66 return result->get_lvalue(); 63 67 } 64 68 -
src/SynTree/Expression.h
r14347ac ref46abb 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Jul 25 22:21:44201913 // Update Count : 5 011 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Aug 7 16:56:00 2019 13 // Update Count : 51 14 14 // 15 15 … … 71 71 const Type * get_result() const { return result; } 72 72 void set_result( Type * newValue ) { result = newValue; } 73 bool get_lvalue() const; 73 74 74 75 TypeSubstitution * get_env() const { return env; } -
src/SynTree/Type.cc
r14347ac ref46abb 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Jul 12 15:48:00201913 // Update Count : 4 411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Aug 4 21:05:07 2019 13 // Update Count : 45 14 14 // 15 15 #include "Type.h" … … 24 24 using namespace std; 25 25 26 const char *BasicType::typeNames[] = { 27 #if 0 28 "_Bool", 29 "char", 30 "signed char", 31 "unsigned char", 32 "signed short int", 33 "unsigned short int", 34 "signed int", 35 "unsigned int", 36 "signed long int", 37 "unsigned long int", 38 "signed long long int", 39 "unsigned long long int", 40 "float", 41 "double", 42 "long double", 43 "float _Complex", 44 "double _Complex", 45 "long double _Complex", 46 "float _Imaginary", 47 "double _Imaginary", 48 "long double _Imaginary", 49 "__int128", 50 "unsigned __int128", 51 "__float80", 52 "__float128", 53 "_Float16", 54 "_Float32", 55 "_Float32x", 56 "_Float64", 57 "_Float64x", 58 "_Float128", 59 "_Float128x", 60 "_Float16 _Complex", 61 "_Float32 _Complex", 62 "_Float32x _Complex", 63 "_Float64 _Complex", 64 "_Float64x _Complex", 65 "_Float128 _Complex", 66 "_Float128x _Complex", 67 #endif 26 const char * BasicType::typeNames[] = { 68 27 "_Bool", 69 28 "char", … … 107 66 }; 108 67 static_assert( 109 sizeof(BasicType::typeNames) /sizeof(BasicType::typeNames[0]) == BasicType::NUMBER_OF_BASIC_TYPES,68 sizeof(BasicType::typeNames) / sizeof(BasicType::typeNames[0]) == BasicType::NUMBER_OF_BASIC_TYPES, 110 69 "Each basic type name should have a corresponding kind enum value" 111 70 ); … … 152 111 TypeSubstitution Type::genericSubstitution() const { assertf( false, "Non-aggregate type: %s", toCString( this ) ); } 153 112 154 void Type::print( std::ostream & os, Indenter indent ) const {113 void Type::print( std::ostream & os, Indenter indent ) const { 155 114 if ( ! forall.empty() ) { 156 115 os << "forall" << std::endl; -
src/SynTree/module.mk
r14347ac ref46abb 49 49 SynTree/TypeSubstitution.cc \ 50 50 SynTree/Attribute.cc \ 51 SynTree/DeclReplacer.cc 51 SynTree/DeclReplacer.cc \ 52 SynTree/TopLvalue.cc 52 53 53 54 SRC += $(SRC_SYNTREE) -
src/main.cc
r14347ac ref46abb 59 59 #include "ResolvExpr/Resolver.h" // for resolve 60 60 #include "SymTab/Validate.h" // for validate 61 #include "SynTree/TopLvalue.h" // for assertTopLvalue, clearInn... 61 62 #include "SynTree/Declaration.h" // for Declaration 62 63 #include "SynTree/Visitor.h" // for acceptAll 63 64 #include "Tuples/Tuples.h" // for expandMemberTuples, expan... 64 65 #include "Virtual/ExpandCasts.h" // for expandCasts 66 65 67 66 68 using namespace std; … … 257 259 Stats::Time::StopBlock(); 258 260 261 //std::cerr << "Post-Parse Check" << std::endl; 262 clearInnerLvalue( translationUnit ); 263 assertTopLvalue( translationUnit ); 264 259 265 // add the assignment statement after the initialization of a type parameter 260 266 PASS( "Validate", SymTab::validate( translationUnit, symtabp ) ); … … 275 281 } // if 276 282 283 assertTopLvalue( translationUnit ); 277 284 PASS( "Fix Labels", ControlStruct::fixLabels( translationUnit ) ); 285 assertTopLvalue( translationUnit ); 278 286 PASS( "Fix Names", CodeGen::fixNames( translationUnit ) ); 287 assertTopLvalue( translationUnit ); 279 288 PASS( "Gen Init", InitTweak::genInit( translationUnit ) ); 289 assertTopLvalue( translationUnit ); 280 290 PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( translationUnit ) ); 291 assertTopLvalue( translationUnit ); 281 292 if ( libcfap ) { 282 293 // generate the bodies of cfa library functions … … 302 313 } // if 303 314 315 assertTopLvalue( translationUnit ); 316 304 317 PASS( "Resolve", ResolvExpr::resolve( translationUnit ) ); 305 318 if ( exprp ) { … … 308 321 } // if 309 322 323 clearInnerLvalue( translationUnit ); 324 assertTopLvalue( translationUnit ); 325 310 326 // fix ObjectDecl - replaces ConstructorInit nodes 311 327 PASS( "Fix Init", InitTweak::fix( translationUnit, buildingLibrary() ) ); 328 clearInnerLvalue( translationUnit ); 329 assertTopLvalue( translationUnit ); 312 330 if ( ctorinitp ) { 313 331 dump ( translationUnit ); … … 316 334 317 335 PASS( "Expand Unique Expr", Tuples::expandUniqueExpr( translationUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused 336 assertTopLvalue( translationUnit ); 318 337 319 338 PASS( "Translate EHM" , ControlStruct::translateEHM( translationUnit ) ); 339 assertTopLvalue( translationUnit ); 320 340 321 341 PASS( "Gen Waitfor" , Concurrency::generateWaitFor( translationUnit ) ); 342 clearInnerLvalue( translationUnit ); 343 assertTopLvalue( translationUnit ); 322 344 323 345 PASS( "Convert Specializations", GenPoly::convertSpecializations( translationUnit ) ); // needs to happen before tuple types are expanded 346 clearInnerLvalue( translationUnit ); 347 assertTopLvalue( translationUnit ); 324 348 325 349 PASS( "Expand Tuples", Tuples::expandTuples( translationUnit ) ); // xxx - is this the right place for this? 350 assertTopLvalue( translationUnit ); 326 351 327 352 if ( tuplep ) { … … 331 356 332 357 PASS( "Virtual Expand Casts", Virtual::expandCasts( translationUnit ) ); // Must come after translateEHM 358 assertTopLvalue( translationUnit ); 333 359 334 360 PASS( "Instantiate Generics", GenPoly::instantiateGeneric( translationUnit ) ); … … 337 363 return EXIT_SUCCESS; 338 364 } // if 365 clearInnerLvalue( translationUnit ); 366 assertTopLvalue( translationUnit ); 339 367 PASS( "Convert L-Value", GenPoly::convertLvalue( translationUnit ) ); 340 368 clearInnerLvalue( translationUnit ); 369 assertTopLvalue( translationUnit ); 341 370 342 371 if ( bboxp ) { … … 345 374 } // if 346 375 PASS( "Box", GenPoly::box( translationUnit ) ); 376 clearInnerLvalue( translationUnit ); 377 assertTopLvalue( translationUnit ); 347 378 348 379 if ( bcodegenp ) { … … 356 387 357 388 CodeTools::fillLocations( translationUnit ); 389 assertTopLvalue( translationUnit ); 358 390 PASS( "Code Gen", CodeGen::generate( translationUnit, *output, ! genproto, prettycodegenp, true, linemarks ) ); 359 391 -
tests/.expect/gccExtensions.x64.txt
r14347ac ref46abb 291 291 signed int _X2m2A0A0i_2[((unsigned long int )10)][((unsigned long int )10)]; 292 292 signed int _X2m3A0A0i_2[((unsigned long int )10)][((unsigned long int )10)]; 293 { 294 ((void)(_X12_retval_maini_1=0) /* ?{} */); 295 } 296 297 return _X12_retval_maini_1; 293 void _X4f128Fv_n__2(__int128 _X1in_2); 294 void _X4f128Fv_o__2(unsigned __int128 __anonymous_object0); 295 __int128 _X6i128_0n_2; 296 { 297 ((void)_X4f128Fv_n__2(_X6i128_0n_2)); 298 } 299 300 unsigned __int128 _X6i128_1o_2; 301 { 302 ((void)_X4f128Fv_o__2(_X6i128_1o_2)); 303 } 304 305 __int128 _X6i128_2n_2; 306 { 307 ((void)_X4f128Fv_n__2(_X6i128_2n_2)); 308 } 309 310 unsigned __int128 _X6i128_3o_2; 311 { 312 ((void)_X4f128Fv_o__2(_X6i128_3o_2)); 313 } 314 298 315 { 299 316 ((void)(_X12_retval_maini_1=0) /* ?{} */); -
tests/.expect/gccExtensions.x86.txt
r14347ac ref46abb 296 296 297 297 return _X12_retval_maini_1; 298 {299 ((void)(_X12_retval_maini_1=0) /* ?{} */);300 }301 302 return _X12_retval_maini_1;303 298 } 304 299 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return _X4mainFi_iPPKc__1((signed int )argc, (const char **)argv); } -
tests/gccExtensions.cfa
r14347ac ref46abb 10 10 // Created On : Sun Aug 14 17:28:17 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Nov 6 17:54:20 201813 // Update Count : 1112 // Last Modified On : Mon Aug 5 18:04:37 2019 13 // Update Count : 28 14 14 // 15 15 … … 50 50 51 51 L1: L2: 52 asm goto ( "frob %%r5, %1; jc %l[L1]; mov (%2), %%r5"53 : /* No outputs. */54 : "r"(src), "r"(&dst)55 : "r5", "memory"56 : L1, L2 );52 asm goto ( "frob %%r5, %1; jc %l[L1]; mov (%2), %%r5" 53 : /* No outputs. */ 54 : "r"(src), "r"(&dst) 55 : "r5", "memory" 56 : L1, L2 ); 57 57 58 58 // alternative type/qualifer names … … 110 110 struct __attribute(()) s4 { int i; } x2, y2 __attribute(()); 111 111 112 int m1 113 int m2 112 int m1[10] __attribute(()); 113 int m2[10][10] __attribute(()); 114 114 int __attribute(()) m3 [10][10]; 115 115 // int ( __attribute(()) m4 [10] )[10]; 116 116 117 return 0; 117 // int128 118 119 #if defined( __SIZEOF_INT128__ ) 120 void f128( __int128 i ); 121 void f128( __uint128_t ); 122 123 __int128 i128_0; 124 f128( i128_0 ); 125 unsigned __int128 i128_1; 126 f128( i128_1 ); 127 __int128_t i128_2; 128 f128( i128_2 ); 129 __uint128_t i128_3; 130 f128( i128_3 ); 131 #endif 118 132 } 119 133 -
tests/pybin/settings.py
r14347ac ref46abb 19 19 class Architecture: 20 20 KnownArchitectures = { 21 'x64' 22 'x86-64' 23 'x86_64' 24 ' aarch64' : 'x64',25 ' x86' : 'x86',21 'x64' : 'x64', 22 'x86-64' : 'x64', 23 'x86_64' : 'x64', 24 'x86' : 'x86', 25 'aarch64' : 'arm', 26 26 'i386' : 'x86', 27 27 'i486' : 'x86', 28 28 'i686' : 'x86', 29 29 'Intel 80386' : 'x86', 30 'arm' 31 'ARM' 30 'arm' : 'arm', 31 'ARM' : 'arm', 32 32 } 33 33
Note: See TracChangeset
for help on using the changeset viewer.