Changeset ac10576 for src/Parser
- Timestamp:
- Jul 18, 2017, 10:22:23 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- a57cb58, d49bfa8
- Parents:
- b15f6cf
- Location:
- src/Parser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
rb15f6cf rac10576 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:17:07 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Jul 15 16:09:04201713 // Update Count : 5 4911 // Last Modified By : Andrew Beach 12 // Last Modified On : Tus Jul 18 10:08:00 2017 13 // Update Count : 550 14 14 // 15 15 … … 46 46 // type. 47 47 48 Type::Qualifiers emptyQualifiers; // no qualifiers on constants48 Type::Qualifiers noQualifiers; // no qualifiers on constants 49 49 50 50 static inline bool checkU( char c ) { return c == 'u' || c == 'U'; } … … 118 118 } // if 119 119 120 Expression * ret = new ConstantExpr( Constant( new BasicType( emptyQualifiers, kind[Unsigned][size] ), str, v ) );120 Expression * ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[Unsigned][size] ), str, v ) ); 121 121 delete &str; // created by lex 122 122 return ret; … … 153 153 } // if 154 154 155 Expression * ret = new ConstantExpr( Constant( new BasicType( emptyQualifiers, kind[complx][size] ), str, v ) );155 Expression * ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[complx][size] ), str, v ) ); 156 156 delete &str; // created by lex 157 157 return ret; … … 159 159 160 160 Expression *build_constantChar( const std::string & str ) { 161 Expression * ret = new ConstantExpr( Constant( new BasicType( emptyQualifiers, BasicType::Char ), str, (unsigned long long int)(unsigned char)str[1] ) );161 Expression * ret = new ConstantExpr( Constant( new BasicType( noQualifiers, BasicType::Char ), str, (unsigned long long int)(unsigned char)str[1] ) ); 162 162 delete &str; // created by lex 163 163 return ret; … … 166 166 ConstantExpr *build_constantStr( const std::string & str ) { 167 167 // string should probably be a primitive type 168 ArrayType *at = new ArrayType( emptyQualifiers, new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ),168 ArrayType *at = new ArrayType( noQualifiers, new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), 169 169 new ConstantExpr( Constant::from_ulong( str.size() + 1 - 2 ) ), // +1 for '\0' and -2 for '"' 170 170 false, false ); … … 176 176 177 177 Expression *build_constantZeroOne( const std::string & str ) { 178 Expression * ret = new ConstantExpr( Constant( str == "0" ? (Type *)new ZeroType( emptyQualifiers ) : (Type*)new OneType( emptyQualifiers ), str,178 Expression * ret = new ConstantExpr( Constant( str == "0" ? (Type *)new ZeroType( noQualifiers ) : (Type*)new OneType( noQualifiers ), str, 179 179 str == "0" ? (unsigned long long int)0 : (unsigned long long int)1 ) ); 180 180 delete &str; // created by lex -
src/Parser/TypeData.cc
rb15f6cf rac10576 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jul 14 16:58:00 201713 // Update Count : 56 512 // Last Modified On : Tus Jul 18 10:10:00 2017 13 // Update Count : 566 14 14 // 15 15 … … 454 454 case TypeData::Builtin: 455 455 if(td->builtintype == DeclarationNode::Zero) { 456 return new ZeroType( emptyQualifiers );456 return new ZeroType( noQualifiers ); 457 457 } 458 458 else if(td->builtintype == DeclarationNode::One) { 459 return new OneType( emptyQualifiers );459 return new OneType( noQualifiers ); 460 460 } 461 461 else { -
src/Parser/parserutility.cc
rb15f6cf rac10576 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 15:30:39 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Jun 28 22:11:32201713 // Update Count : 711 // Last Modified By : Andrew Beach 12 // Last Modified On : Tus Jul 18 10:12:00 2017 13 // Update Count : 8 14 14 // 15 15 … … 26 26 UntypedExpr *comparison = new UntypedExpr( new NameExpr( "?!=?" ) ); 27 27 comparison->get_args().push_back( orig ); 28 comparison->get_args().push_back( new ConstantExpr( Constant( new ZeroType( emptyQualifiers ), "0", (unsigned long long int)0 ) ) );28 comparison->get_args().push_back( new ConstantExpr( Constant( new ZeroType( noQualifiers ), "0", (unsigned long long int)0 ) ) ); 29 29 return new CastExpr( comparison, new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ); 30 30 }
Note: See TracChangeset
for help on using the changeset viewer.