Changes in src/Parser/ExpressionNode.cc [ac71a86:7ecbb7e]
- File:
-
- 1 edited
-
src/Parser/ExpressionNode.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
rac71a86 r7ecbb7e 57 57 static inline bool checkX( char c ) { return c == 'x' || c == 'X'; } 58 58 59 Expression *build_constantInteger( conststd::string & str ) {59 Expression *build_constantInteger( 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( conststd::string & str ) {125 Expression *build_constantFloat( 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( conststd::string & str ) {155 Expression *build_constantChar( 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( conststd::string & str ) {159 ConstantExpr *build_constantStr( 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 Expression* ret = new SizeofExpr( decl_node->buildType() ); 216 delete decl_node; 217 return ret; 215 return new SizeofExpr( decl_node->buildType() ); 218 216 } 219 217 Expression *build_alignOfexpr( ExpressionNode *expr_node ) { … … 224 222 } 225 223 Expression *build_offsetOf( DeclarationNode *decl_node, NameExpr *member ) { 226 Expression* ret = new UntypedOffsetofExpr( decl_node->buildType(), member->get_name() ); 227 delete decl_node; 228 delete member; 229 return ret; 224 return new UntypedOffsetofExpr( decl_node->buildType(), member->get_name() ); 230 225 } 231 226
Note:
See TracChangeset
for help on using the changeset viewer.