- Timestamp:
- Feb 15, 2019, 2:37:56 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- ee06e41b
- Parents:
- fba51ab
- Location:
- src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/BasicTypes-gen.cc
rfba51ab rada4575 249 249 } // for 250 250 251 #define startMK "// GENERATED START, DO NOT EDIT" 252 #define endMK "// GENERATED END" 251 #define STARTMK "// GENERATED START, DO NOT EDIT" 252 #define BYMK "// GENERATED BY " __FILE__ 253 #define ENDMK "// GENERATED END" 253 254 fstream file; 254 255 stringstream buffer, code; … … 260 261 resetInput( file, Type, buffer, code, str ); 261 262 262 if ( (start = str.find( startMK )) == string::npos ) Abort( "start", Type );263 start += sizeof( startMK ); // includes newline263 if ( (start = str.find( STARTMK )) == string::npos ) Abort( "start", Type ); 264 start += sizeof( STARTMK ); // includes newline 264 265 code << str.substr( 0, start ); 265 266 266 code << "\t // GENERATED BY " __FILE__<< endl;267 code << "\t" << BYMK << endl; 267 268 code << "\tenum Kind {" << endl; 268 269 for ( int r = 0; r < NUMBER_OF_BASIC_TYPES; r += 1 ) { … … 273 274 code << "\t"; // indentation for end marker 274 275 275 if ( (start = str.find( endMK, start + 1 )) == string::npos ) Abort( "end", Type );276 if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", Type ); 276 277 code << str.substr( start ); 277 278 … … 283 284 resetInput( file, ConversionCost, buffer, code, str ); 284 285 285 if ( (start = str.find( startMK )) == string::npos ) Abort( "start", ConversionCost );286 start += sizeof( startMK ); // includes newline286 if ( (start = str.find( STARTMK )) == string::npos ) Abort( "start", ConversionCost ); 287 start += sizeof( STARTMK ); // includes newline 287 288 code << str.substr( 0, start ); 288 289 289 code << "\t // GENERATED BY " __FILE__<< endl;290 code << "\t" << BYMK << endl; 290 291 code << "\t/* EXTENDED INTEGRAL RANK HIERARCHY (root to leaves)" << endl; 291 292 for ( int c = 0; c < NUMBER_OF_BASIC_TYPES; c += 1 ) { … … 305 306 code << "\t"; // indentation for end marker 306 307 307 if ( (start = str.find( endMK, start + 1 )) == string::npos ) Abort( "end", ConversionCost );308 if ( (end = str.find( startMK, start + 1 )) == string::npos ) Abort( "start", ConversionCost );309 end += sizeof( startMK );308 if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", ConversionCost ); 309 if ( (end = str.find( STARTMK, start + 1 )) == string::npos ) Abort( "start", ConversionCost ); 310 end += sizeof( STARTMK ); 310 311 code << str.substr( start, end - start ); 311 312 312 code << "\t // GENERATED BY " __FILE__<< endl;313 code << "\t" << BYMK << endl; 313 314 code << "\tstatic const int costMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node" << endl 314 315 << "\t\t/* "; … … 327 328 code << "\t"; // indentation for end marker 328 329 329 if ( (start = str.find( endMK, start + 1 )) == string::npos ) Abort( "end", ConversionCost );330 if ( (end = str.find( startMK, start + 1 )) == string::npos ) Abort( "start", ConversionCost );331 end += sizeof( startMK );330 if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", ConversionCost ); 331 if ( (end = str.find( STARTMK, start + 1 )) == string::npos ) Abort( "start", ConversionCost ); 332 end += sizeof( STARTMK ); 332 333 code << str.substr( start, end - start ); 333 334 334 code << "\t // GENERATED BY " __FILE__<< endl;335 code << "\t" << BYMK << endl; 335 336 code << "\tstatic const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion" << endl 336 337 << "\t\t/* "; … … 349 350 code << "\t"; // indentation for end marker 350 351 351 if ( (start = str.find( endMK, start + 1 )) == string::npos ) Abort( "end", ConversionCost );352 if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", ConversionCost ); 352 353 code << str.substr( start ); 353 354 … … 359 360 resetInput( file, CommonType, buffer, code, str ); 360 361 361 if ( (start = str.find( startMK )) == string::npos ) Abort( "start", CommonType );362 start += sizeof( startMK ); // includes newline362 if ( (start = str.find( STARTMK )) == string::npos ) Abort( "start", CommonType ); 363 start += sizeof( STARTMK ); // includes newline 363 364 code << str.substr( 0, start ); 364 365 365 366 enum { PER_ROW = 6 }; 366 code << "\t // GENERATED BY " __FILE__<< endl;367 code << "\t" << BYMK << endl; 367 368 code << "\t#define BT BasicType::" << endl; 368 369 code << "\tstatic const BasicType::Kind commonTypes[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor" << endl … … 394 395 code << "\t"; // indentation for end marker 395 396 396 if ( (start = str.find( endMK, start + 1 )) == string::npos ) Abort( "end", CommonType );397 if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", CommonType ); 397 398 code << str.substr( start ); 398 399 … … 404 405 resetInput( file, ManglerCommon, buffer, code, str ); 405 406 406 if ( (start = str.find( startMK )) == string::npos ) Abort( "start", ManglerCommon );407 start += sizeof( startMK ); // includes newline407 if ( (start = str.find( STARTMK )) == string::npos ) Abort( "start", ManglerCommon ); 408 start += sizeof( STARTMK ); // includes newline 408 409 code << str.substr( 0, start ); 409 410 … … 432 433 code << "\t\t\t"; // indentation for end marker 433 434 434 if ( (start = str.find( endMK, start + 1 )) == string::npos ) Abort( "end", ManglerCommon );435 if ( (start = str.find( ENDMK, start + 1 )) == string::npos ) Abort( "end", ManglerCommon ); 435 436 code << str.substr( start ); 436 437 -
src/Makefile.am
rfba51ab rada4575 11 11 ## Created On : Sun May 31 08:51:46 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Sat Feb 9 19:07:14201914 ## Update Count : 8113 ## Last Modified On : Fri Feb 15 09:44:09 2019 14 ## Update Count : 97 15 15 ############################################################################### 16 16 … … 40 40 include Validate/module.mk 41 41 include Virtual/module.mk 42 43 $(addprefix $(srcdir)/, ResolvExpr/ConversionCost.cc ResolvExpr/CommonType.cc SymTab/ManglerCommon.cc) : $(srcdir)/SynTree/Type.h 44 45 $(srcdir)/SynTree/Type.h : BasicTypes-gen.cc 46 ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${AM_CFLAGS} ${<} -o BasicTypes-gen -Wall -Wextra -O2 -g -std=c++14 47 @./BasicTypes-gen 48 @rm BasicTypes-gen 42 49 43 50 # put into lib for now -
src/Makefile.in
rfba51ab rada4575 1557 1557 1558 1558 1559 $(addprefix $(srcdir)/, ResolvExpr/ConversionCost.cc ResolvExpr/CommonType.cc SymTab/ManglerCommon.cc) : $(srcdir)/SynTree/Type.h 1560 1561 $(srcdir)/SynTree/Type.h : BasicTypes-gen.cc 1562 ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${AM_CFLAGS} ${<} -o BasicTypes-gen -Wall -Wextra -O2 -g -std=c++14 1563 @./BasicTypes-gen 1564 @rm BasicTypes-gen 1565 1559 1566 # Tell versions [3.59,3.63) of GNU make to not export all variables. 1560 1567 # Otherwise a system limit (for SysV at least) may be exceeded. -
src/ResolvExpr/CommonType.cc
rfba51ab rada4575 10 10 // Created On : Sun May 17 06:59:27 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 13 22:30:32201913 // Update Count : 2 212 // Last Modified On : Thu Feb 14 17:10:10 2019 13 // Update Count : 24 14 14 // 15 15 … … 175 175 return result; 176 176 } 177 #if 0178 #define BT BasicType::179 static const BasicType::Kind combinedType[][ BasicType::NUMBER_OF_BASIC_TYPES ] =180 {181 /* Bool Char SignedChar UnsignedChar ShortSignedInt ShortUnsignedInt SignedInt UnsignedInt LongSignedInt LongUnsignedInt LongLongSignedInt LongLongUnsignedInt Float Double LongDouble FloatComplex DoubleComplex LongDoubleComplex FloatImaginary DoubleImaginary LongDoubleImaginary SignedInt128 UnsignedInt128 Float80 Float128 */182 /* Bool */ { BT Bool, BT Char, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT SignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },183 /* Char */ { BT Char, BT Char, BT UnsignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT SignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },184 /* SignedChar */ { BT SignedChar, BT UnsignedChar, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT SignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },185 /* UnsignedChar */ { BT UnsignedChar, BT UnsignedChar, BT UnsignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT SignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },186 /* ShortSignedInt */ { BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortUnsignedInt, BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT SignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },187 /* ShortUnsignedInt */ { BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT SignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },188 /* SignedInt */ { BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT SignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },189 /* UnsignedInt */ { BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT SignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },190 /* LongSignedInt */ { BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT SignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },191 /* LongUnsignedInt */ { BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT SignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },192 /* LongLongSignedInt */ { BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT SignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },193 /* LongLongUnsignedInt */ { BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT SignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },194 195 /* Float */ { BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT Float, BT Float, BT Float80, BT Float128, BT Float, BT Float, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT FloatComplex, BT FloatComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },196 /* Double */ { BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, BT LongDouble, BT DoubleComplex, BT DoubleComplex, BT LongDoubleComplex, BT DoubleComplex, BT DoubleComplex, BT LongDoubleComplex, BT Double, BT Double, BT Float80, BT Float128, BT Double, BT Double, BT Double, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },197 /* LongDouble */ { BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDouble, BT LongDouble, BT BT LongDouble, BT Float128, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT _Float128x, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT _Float128xComplex },198 /* FloatComplex */ { BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT FloatComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT FloatComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT FloatComplex, BT FloatComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },199 /* DoubleComplex */ { BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT LongDoubleComplex, BT DoubleComplex, BT DoubleComplex, BT LongDoubleComplex, BT DoubleComplex, BT DoubleComplex, BT LongDoubleComplex, BT DoubleComplex, BT DoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },200 /* LongDoubleComplex */ { BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT _Float128xComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT _Float128xComplex },201 /* FloatImaginary */ { BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatImaginary, BT DoubleImaginary, BT LongDoubleImaginary, BT FloatImaginary, BT FloatImaginary, BT LongDoubleImaginary, BT LongDoubleImaginary, BT FloatComplex, BT FloatComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT FloatComplex, BT FloatComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },202 /* DoubleImaginary */ { BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT LongDoubleComplex, BT DoubleComplex, BT DoubleComplex, BT LongDoubleComplex, BT DoubleImaginary, BT DoubleImaginary, BT LongDoubleImaginary, BT DoubleImaginary, BT DoubleImaginary, BT LongDoubleImaginary, BT LongDoubleImaginary, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },203 /* LongDoubleImaginary */ { BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleImaginary, BT LongDoubleImaginary, BT LongDoubleImaginary, BT LongDoubleImaginary, BT LongDoubleImaginary, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT _Float128xComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT _Float128xComplex },204 205 /* SignedInt128 */ { BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT SignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },206 /* UnsignedInt128 */ { BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT UnsignedInt128, BT UnsignedInt128, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },207 /* Float80 */ { BT Float80, BT Float80, BT Float80, BT Float80, BT Float80, BT Float80, BT Float80, BT Float80, BT Float80, BT Float80, BT Float80, BT Float80, BT Float80, BT Float80, BT LongDouble, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT Float80, BT Float80, BT Float80, BT Float128, BT Float80, BT Float80, BT Float80, BT Float80, BT Float80, BT _Float128, BT _Float128x, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },208 /* Float128 */ { BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT Float128, BT _Float128x, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128xComplex },209 210 /* _Float16 */ { BT _Float16, BT _Float16, BT _Float16, BT _Float16, BT _Float16, BT _Float16, BT _Float16, BT _Float16, BT _Float16, BT _Float16, BT _Float16, BT _Float16, BT Float, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT _Float16, BT _Float16, BT Float80, BT Float128, BT _Float16, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },211 /* _Float32 */ { BT _Float32, BT _Float32, BT _Float32, BT _Float32, BT _Float32, BT _Float32, BT _Float32, BT _Float32, BT _Float32, BT _Float32, BT _Float32, BT _Float32, BT _Float32, BT Double, BT LongDouble, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT _Float32, BT _Float32, BT Float80, BT Float128, BT _Float32, BT _Float32, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float32Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },212 /* _Float32x */ { BT _Float32x, BT _Float32x, BT _Float32x, BT _Float32x, BT _Float32x, BT _Float32x, BT _Float32x, BT _Float32x, BT _Float32x, BT _Float32x, BT _Float32x, BT _Float32x, BT _Float32x, BT Double, BT LongDouble, BT _Float32xComplex, BT DoubleComplex, BT LongDoubleComplex, BT _Float32xComplex, BT DoubleComplex, BT LongDoubleComplex, BT _Float32x, BT _Float32x, BT Float80, BT Float128, BT _Float32x, BT _Float32x, BT _Float32x, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },213 /* _Float64 */ { BT _Float64, BT _Float64, BT _Float64, BT _Float64, BT _Float64, BT _Float64, BT _Float64, BT _Float64, BT _Float64, BT _Float64, BT _Float64, BT _Float64, BT _Float64, BT Double, BT LongDouble, BT _Float64Complex, BT DoubleComplex, BT LongDoubleComplex, BT _Float64Complex, BT DoubleComplex, BT LongDoubleComplex, BT _Float64, BT _Float64, BT Float80, BT Float128, BT _Float64, BT _Float64, BT _Float64, BT _Float64, BT _Float64x, BT _Float128, BT _Float128x, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },214 /* _Float64x */ { BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT LongDouble, BT _Float64xComplex, BT _Float64xComplex, BT LongDoubleComplex, BT _Float64xComplex, BT _Float64xComplex, BT LongDoubleComplex, BT _Float64x, BT _Float64x, BT Float80, BT Float128, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float64x, BT _Float128, BT _Float128x, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },215 /* _Float128 */ { BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT LongDouble, BT _Float128Complex, BT _Float128Complex, BT LongDoubleComplex, BT _Float128Complex, BT _Float128Complex, BT LongDoubleComplex, BT _Float128, BT _Float128, BT _Float128, BT Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128, BT _Float128x, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128xComplex },216 /* _Float128x */ { BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128x, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex },217 218 /* _Float16Complex */ { BT _Float16Complex, BT _Float16Complex, BT _Float16Complex, BT _Float16Complex, BT _Float16Complex, BT _Float16Complex, BT _Float16Complex, BT _Float16Complex, BT _Float16Complex, BT _Float16Complex, BT _Float16Complex, BT _Float16Complex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT _Float16Complex, BT _Float16Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT _Float16Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },219 /* _Float32Complex */ { BT _Float32Complex, BT _Float32Complex, BT _Float32Complex, BT _Float32Complex, BT _Float32Complex, BT _Float32Complex, BT _Float32Complex, BT _Float32Complex, BT _Float32Complex, BT _Float32Complex, BT _Float32Complex, BT _Float32Complex, BT _Float32Complex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT FloatComplex, BT DoubleComplex, BT LongDoubleComplex, BT _Float32Complex, BT _Float32Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float32Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT _Float32Complex, BT _Float32Complex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },220 /* _Float32xComplex */ { BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT DoubleComplex, BT LongDoubleComplex, BT _Float32xComplex, BT DoubleComplex, BT LongDoubleComplex, BT _Float32xComplex, BT DoubleComplex, BT LongDoubleComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float32xComplex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },221 /* _Float64Complex */ { BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT DoubleComplex, BT LongDoubleComplex, BT _Float64Complex, BT DoubleComplex, BT LongDoubleComplex, BT _Float64Complex, BT DoubleComplex, BT LongDoubleComplex, BT _Float64Complex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64Complex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },222 /* _Float64xComplex */ { BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT LongDoubleComplex, BT _Float64xComplex, BT _Float64xComplex, BT LongDoubleComplex, BT _Float64xComplex, BT _Float64xComplex, BT LongDoubleComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float64xComplex, BT _Float128Complex, BT _Float128xComplex },223 /* _Float128Complex */ { BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT LongDoubleComplex, BT _Float128Complex, BT _Float128Complex, BT LongDoubleComplex, BT _Float128Complex, BT _Float128Complex, BT LongDoubleComplex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128xComplex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128Complex, BT _Float128xComplex },224 /* _Float128xComplex */ { BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex, BT _Float128xComplex },225 };226 #undef BT227 #endif228 177 229 178 // GENERATED START, DO NOT EDIT 179 // GENERATED BY BasicTypes-gen.cc 230 180 #define BT BasicType:: 231 181 static const BasicType::Kind commonTypes[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor … … 492 442 #undef BT 493 443 // GENERATED END 494 495 444 static_assert( 496 445 sizeof(commonTypes)/sizeof(commonTypes[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES, -
src/ResolvExpr/ConversionCost.cc
rfba51ab rada4575 10 10 // Created On : Sun May 17 07:06:19 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 13 23:04:51 201913 // Update Count : 2 212 // Last Modified On : Thu Feb 14 17:04:31 2019 13 // Update Count : 23 14 14 // 15 15 … … 43 43 #define PRINT(x) 44 44 #endif 45 45 46 Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 46 47 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { … … 179 180 : dest( dest ), indexer( indexer ), cost( Cost::infinity ), env( env ), costFunc( costFunc ) { 180 181 } 181 #if 0182 /*183 Old184 ===185 Double186 |187 Float188 |189 ULong190 / \191 UInt Long192 \ /193 Int194 |195 Ushort196 |197 Short198 |199 Uchar200 / \201 Schar Char202 203 New204 ===205 +-----LongDoubleComplex--+206 LongDouble--+ | +-LongDoubleImag207 | +---DoubleComplex---+ |208 Double------+ | +----DoubleImag209 | +-FloatComplex-+ |210 Float---------+ +-------FloatImag211 |212 ULongLong213 |214 LongLong215 |216 ULong217 / \218 UInt Long219 \ /220 Int221 |222 Ushort223 |224 Short225 |226 Uchar227 / \228 Schar Char229 \ /230 Bool231 */232 233 static const int costMatrix[][ BasicType::NUMBER_OF_BASIC_TYPES ] = {234 /* Src \ Dest: Bool Char SChar UChar Short UShort Int UInt Long ULong LLong ULLong Float Double LDbl FCplex DCplex LDCplex FImag DImag LDImag I128, U128, F80, F128 */235 /* Bool */ { 0, 1, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 12, 13, 14, 12, 13, 14, -1, -1, -1, 10, 11, 14, 15},236 /* Char */ { -1, 0, -1, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, 13, 14},237 /* SChar */ { -1, -1, 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, 13, 14},238 /* UChar */ { -1, -1, -1, 0, 1, 2, 3, 4, 4, 5, 6, 7, 10, 11, 12, 10, 11, 12, -1, -1, -1, 8, 9, 12, 13},239 /* Short */ { -1, -1, -1, -1, 0, 1, 2, 3, 3, 4, 5, 6, 9, 10, 11, 9, 10, 11, -1, -1, -1, 7, 8, 11, 12},240 /* UShort */{ -1, -1, -1, -1, -1, 0, 1, 2, 2, 3, 4, 5, 8, 9, 10, 8, 9, 10, -1, -1, -1, 6, 7, 10, 11},241 /* Int */ { -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 4, 7, 8, 9, 7, 8, 9, -1, -1, -1, 5, 6, 9, 10},242 /* UInt */ { -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, 8, 9},243 /* Long */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, 8, 9},244 /* ULong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 5, 6, 7, 5, 6, 7, -1, -1, -1, 3, 4, 7, 8},245 /* LLong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 4, 5, 6, 4, 5, 6, -1, -1, -1, 2, 3, 6, 7},246 /* ULLong */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 3, 4, 5, 3, 4, 5, -1, -1, -1, 1, 2, 5, 6},247 248 /* Float */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 1, 2, 3, -1, -1, -1, -1, -1, 2, 3},249 /* Double */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 1, 2, -1, -1, -1, -1, -1, 1, 2},250 /* LDbl */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1},251 /* FCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, -1, -1, -1, -1, -1, -1, -1},252 /* DCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1, -1},253 /* LDCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1},254 /* FImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 0, 1, 2, -1, -1, -1, -1},255 /* DImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, -1, 0, 1, -1, -1, -1, -1},256 /* LDImag */{ -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},257 258 /* I128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 3, 4, 5, -1, -1, -1, 0, 1, 4, 4},259 /* U128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 2, 3, 4, -1, -1, -1, -1, 0, 3, 3},260 261 /* F80 */ { -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},262 /* F128 */ { -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},263 };264 static_assert(265 sizeof(costMatrix)/sizeof(costMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,266 "Each basic type kind should have a corresponding row in the cost matrix"267 );268 #endif269 182 270 183 // GENERATED START, DO NOT EDIT 184 // GENERATED BY BasicTypes-gen.cc 271 185 /* EXTENDED INTEGRAL RANK HIERARCHY (root to leaves) 272 186 _Bool … … 293 207 294 208 // GENERATED START, DO NOT EDIT 209 // GENERATED BY BasicTypes-gen.cc 295 210 static const int costMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node 296 211 /* 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 */ … … 339 254 340 255 // GENERATED START, DO NOT EDIT 256 // GENERATED BY BasicTypes-gen.cc 341 257 static const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion 342 258 /* 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 */ -
src/SymTab/ManglerCommon.cc
rfba51ab rada4575 10 10 // Created On : Sun May 17 21:44:03 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 14 08:12:17 201913 // Update Count : 2 512 // Last Modified On : Thu Feb 14 17:06:37 2019 13 // Update Count : 26 14 14 // 15 15 … … 22 22 namespace Encoding { 23 23 const std::string manglePrefix = "_X"; 24 #if 0 25 const std::string basicTypes[] = { 26 "b", // Bool 27 "c", // Char 28 "a", // SignedChar 29 "h", // UnsignedChar 30 "s", // ShortSignedInt 31 "t", // ShortUnsignedInt 32 "i", // SignedInt 33 "j", // UnsignedInt 34 "l", // LongSignedInt 35 "m", // LongUnsignedInt 36 "x", // LongLongSignedInt 37 "y", // LongLongUnsignedInt 38 "f", // Float 39 "d", // Double 40 "e", // LongDouble 41 "Cf", // FloatComplex 42 "Cd", // DoubleComplex 43 "Ce", // LongDoubleComplex 44 // Note: imaginary is not an overloadable type in C++ 45 // "If", // FloatImaginary 46 // "Id", // DoubleImaginary 47 // "Ie", // LongDoubleImaginary 48 "n", // SignedInt128 49 "o", // UnsignedInt128 50 "Dq", // Float80 -- TODO: itanium says Float80 and LongDouble both encode to "e", but doing this causes problems with constructing long double, because the cost tables are incorrect 51 "g", // Float128 52 // "z", // ellipsis 53 // "Dd" // # IEEE 754r decimal floating point (64 bits) 54 // "De" // # IEEE 754r decimal floating point (128 bits) 55 // "Df" // # IEEE 754r decimal floating point (32 bits) 56 // "Dh" // # IEEE 754r half-precision floating point (16 bits) 57 // "DF"N_ // # ISO/IEC TS 18661 binary floating point type _FloatN (N bits) 58 // "Di" // char32_t 59 // "Ds" // char16_t 60 }; 61 static_assert( 62 sizeof(basicTypes)/sizeof(basicTypes[0]) == BasicType::NUMBER_OF_BASIC_TYPES, 63 "Each basic type kind should have a corresponding mangler letter" 64 ); 65 #endif 24 66 25 // GENERATED START, DO NOT EDIT 26 // GENERATED BY BasicTypes-gen.cc 67 27 // NOTES ON MANGLING: 68 28 // * Itanium spec says that Float80 encodes to "e" (like LongDouble), but the distinct lengths cause resolution problems. … … 118 78 }; // basicTypes 119 79 // GENERATED END 80 static_assert( 81 sizeof(basicTypes)/sizeof(basicTypes[0]) == BasicType::NUMBER_OF_BASIC_TYPES, 82 "Each basic type kind should have a corresponding mangler letter" 83 ); 120 84 121 85 const std::map<int, std::string> qualifiers = { -
src/SynTree/Type.h
rfba51ab rada4575 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 13 18:10:45201913 // Update Count : 16 712 // Last Modified On : Thu Feb 14 17:11:24 2019 13 // Update Count : 169 14 14 // 15 15 … … 207 207 class BasicType : public Type { 208 208 public: 209 #if 0 210 enum Kind { 211 Bool, 212 Char, 213 SignedChar, 214 UnsignedChar, 215 ShortSignedInt, 216 ShortUnsignedInt, 217 SignedInt, 218 UnsignedInt, 219 LongSignedInt, 220 LongUnsignedInt, 221 LongLongSignedInt, 222 LongLongUnsignedInt, 223 Float, 224 Double, 225 LongDouble, 226 FloatComplex, 227 DoubleComplex, 228 LongDoubleComplex, 229 FloatImaginary, 230 DoubleImaginary, 231 LongDoubleImaginary, 232 SignedInt128, 233 UnsignedInt128, 234 Float80, 235 Float128, 236 _Float16, 237 _Float32, 238 _Float32x, 239 _Float64, 240 _Float64x, 241 _Float128, 242 _Float128x, 243 _Float16Complex, 244 _Float32Complex, 245 _Float32xComplex, 246 _Float64Complex, 247 _Float64xComplex, 248 _Float128Complex, 249 _Float128xComplex, 250 NUMBER_OF_BASIC_TYPES 251 } kind; 252 #endif 209 // GENERATED START, DO NOT EDIT 210 // GENERATED BY BasicTypes-gen.cc 253 211 enum Kind { 254 212 Bool, … … 272 230 Float, 273 231 FloatComplex, 274 // FloatImaginary,275 232 uFloat32x, 276 233 uFloat32xComplex, … … 279 236 Double, 280 237 DoubleComplex, 281 // DoubleImaginary,282 238 uFloat64x, 283 239 uFloat64xComplex, … … 288 244 LongDouble, 289 245 LongDoubleComplex, 290 // LongDoubleImaginary,291 246 uFloat128x, 292 247 uFloat128xComplex, 293 248 NUMBER_OF_BASIC_TYPES 294 249 } kind; 250 // GENERATED END 295 251 296 252 static const char *typeNames[]; // string names for basic types, MUST MATCH with Kind
Note: See TracChangeset
for help on using the changeset viewer.