Changeset 80722d0 for src/Parser/ExpressionNode.cc
- Timestamp:
- Aug 20, 2016, 7:06:26 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- ab57786, d30790f
- Parents:
- e6955b1 (diff), 4a7d895 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
re6955b1 r80722d0 57 57 static inline bool checkX( char c ) { return c == 'x' || c == 'X'; } 58 58 59 Expression *build_constantInteger( std::string & str ) {59 Expression *build_constantInteger( const std::string & str ) { 60 60 static const BasicType::Kind kind[2][3] = { 61 61 { BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt }, … … 123 123 } // build_constantInteger 124 124 125 Expression *build_constantFloat( std::string & str ) {125 Expression *build_constantFloat( const std::string & str ) { 126 126 static const BasicType::Kind kind[2][3] = { 127 127 { BasicType::Float, BasicType::Double, BasicType::LongDouble }, … … 153 153 } // build_constantFloat 154 154 155 Expression *build_constantChar( std::string & str ) {155 Expression *build_constantChar( const std::string & str ) { 156 156 return new ConstantExpr( Constant( new BasicType( emptyQualifiers, BasicType::Char ), str ) ); 157 157 } // build_constantChar 158 158 159 ConstantExpr *build_constantStr( std::string & str ) {159 ConstantExpr *build_constantStr( const std::string & str ) { 160 160 // string should probably be a primitive type 161 161 ArrayType *at = new ArrayType( emptyQualifiers, new BasicType( emptyQualifiers, BasicType::Char ), … … 213 213 } 214 214 Expression *build_sizeOftype( DeclarationNode *decl_node ) { 215 return new SizeofExpr( decl_node->buildType() ); 215 Expression* ret = new SizeofExpr( decl_node->buildType() ); 216 delete decl_node; 217 return ret; 216 218 } 217 219 Expression *build_alignOfexpr( ExpressionNode *expr_node ) { … … 222 224 } 223 225 Expression *build_offsetOf( DeclarationNode *decl_node, NameExpr *member ) { 224 return new UntypedOffsetofExpr( decl_node->buildType(), member->get_name() ); 226 Expression* ret = new UntypedOffsetofExpr( decl_node->buildType(), member->get_name() ); 227 delete decl_node; 228 delete member; 229 return ret; 225 230 } 226 231
Note: See TracChangeset
for help on using the changeset viewer.