Changes in src/Parser/ExpressionNode.cc [7ecbb7e:ac71a86]
- File:
-
- 1 edited
-
src/Parser/ExpressionNode.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
r7ecbb7e rac71a86 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.