Changeset 12df6fe for src/CodeGen
- Timestamp:
- Sep 19, 2022, 11:48:13 AM (21 months ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 4520b77e
- Parents:
- b0d9ff7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
rb0d9ff7 r12df6fe 277 277 std::list< Declaration* > &memb = enumDecl->get_members(); 278 278 if (enumDecl->base && ! memb.empty()) { 279 unsigned long long last_val = -1; 279 unsigned long long last_val = -1; // if the first enum value has no explicit initializer, 280 // as other 280 281 for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end(); i++) { 281 282 ObjectDecl * obj = dynamic_cast< ObjectDecl* >( *i ); … … 289 290 if ( obj->get_init() ) { 290 291 obj->get_init()->accept( *visitor ); 291 //last_val = ((ConstantExpr *)(((SingleInit *)(obj->init))->value))->constant.get_ival();292 last_val = ((ConstantExpr *)(((SingleInit *)(obj->init))->value))->constant.get_ival(); 292 293 } else { 293 294 output << ++last_val;
Note: See TracChangeset
for help on using the changeset viewer.