Improvements to constant folding.
We can now do constant folding with all basic datatypes (the previous implementation handled int32 well, but had limited, if any, coverage for other datatypes.) Reduced a bit of repeated code in the constant folding implementation through template helper functions.
This commit is contained in:
2
parse.yy
2
parse.yy
@@ -2287,7 +2287,7 @@ lFinalizeEnumeratorSymbols(std::vector<Symbol *> &enums,
|
||||
enums[i]->type = enumType;
|
||||
if (enums[i]->constValue != NULL) {
|
||||
/* Already has a value, so first update nextVal with it. */
|
||||
int count = enums[i]->constValue->AsUInt32(&nextVal);
|
||||
int count = enums[i]->constValue->GetValues(&nextVal);
|
||||
AssertPos(enums[i]->pos, count == 1);
|
||||
++nextVal;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user