Ignore:
Timestamp:
Feb 11, 2019, 6:46:56 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
cdcddfe1
Parents:
0e66857
Message:

update constant parsing add _FloatNN

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypeData.cc

    r0e66857 rba01b14  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Nov  2 07:54:26 2018
    13 // Update Count     : 624
     12// Last Modified On : Fri Feb  8 09:36:26 2019
     13// Update Count     : 645
    1414//
    1515
     
    629629                } // if
    630630
    631                 ret = BasicType::Bool;
     631                ret = BasicType::_Bool;
    632632                break;
    633633
     
    666666
    667667          case DeclarationNode::Float:
     668          case DeclarationNode::Double:
     669          case DeclarationNode::LongDouble:                                     // not set until below
    668670          case DeclarationNode::Float80:
    669671          case DeclarationNode::Float128:
    670           case DeclarationNode::Double:
    671           case DeclarationNode::LongDouble:                                     // not set until below
    672                 static BasicType::Kind floattype[3][3] = {
    673                         { BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex },
    674                         { BasicType::FloatImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary },
    675                         { BasicType::Float, BasicType::Double, BasicType::LongDouble },
     672          case DeclarationNode::_Float16:
     673          case DeclarationNode::_Float32:
     674          case DeclarationNode::_Float32x:
     675          case DeclarationNode::_Float64:
     676          case DeclarationNode::_Float64x:
     677          case DeclarationNode::_Float128:
     678          case DeclarationNode::_Float128x:
     679                static BasicType::Kind floattype[2][12] = {
     680                        { BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, (BasicType::Kind)-1, (BasicType::Kind)-1, BasicType::_Float16Complex, BasicType::_Float32Complex, BasicType::_Float32xComplex, BasicType::_Float64Complex, BasicType::_Float64xComplex, BasicType::_Float128Complex, BasicType::_Float128xComplex, },
     681                        { BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::__float80, BasicType::__float128, BasicType::_Float16, BasicType::_Float32, BasicType::_Float32x, BasicType::_Float64, BasicType::_Float64x, BasicType::_Float128, BasicType::_Float128x, },
    676682                };
    677683
     
    686692                        genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );
    687693                } // if
     694                if ( td->complextype == DeclarationNode::Imaginary ) {
     695                        genTSError( DeclarationNode::complexTypeNames[ td->complextype ], td->basictype );
     696                } // if
     697                if ( (td->basictype == DeclarationNode::Float80 || td->basictype == DeclarationNode::Float128) && td->complextype == DeclarationNode::Complex ) { // gcc unsupported
     698                        genTSError( DeclarationNode::complexTypeNames[ td->complextype ], td->basictype );
     699                } // if
    688700                if ( td->length == DeclarationNode::Long ) {
    689701                        const_cast<TypeData *>(td)->basictype = DeclarationNode::LongDouble;
    690702                } // if
    691703
    692                 if ( td->basictype == DeclarationNode::Float80 || td->basictype == DeclarationNode::Float128 ) {
    693                         // if ( td->complextype != DeclarationNode::NoComplexType ) {
    694                         //      genTSError( DeclarationNode::complexTypeNames[ td->complextype ], td->basictype );
    695                         // }
    696                         if ( td->basictype == DeclarationNode::Float80 ) ret = BasicType::Float80;
    697                         else ret = BasicType::Float128;
    698                         break;
    699                 }
    700 
    701704                ret = floattype[ td->complextype ][ td->basictype - DeclarationNode::Float ];
     705                //printf( "XXXX %d %d %d %d\n", td->complextype, td->basictype, DeclarationNode::Float, ret );
    702706                break;
    703707
Note: See TracChangeset for help on using the changeset viewer.