Summary
- Not sure why we copy in the return values all the time, but we do. This prevents an unused error from appearing when the library is being compiled (shows up about 4 times right now). Switching some passes around might have also solved the problem, but I think we should be generating normalized code instead of mixing in the normalization and code generation. (details)
- 1. Add bound check to Serial function: now compiler generates the unchecked functions in ImplementEnumFunc, and enum.hfa implements the bound check on top. Todo: Wrapped the checked version into a trait; 2. countof is now works on any type that implement Countof(). Because Countof() is implemented in enum.hfa for all CfaEnum, we can call countof on { T | CfaEnum(T) } (details)
The file was modified | src/Virtual/Tables.cpp |
The file was modified | libcfa/src/enum.hfa |
The file was modified | src/ControlStruct/TranslateEnumRange.cpp |
The file was modified | libcfa/src/enum.cfa |
The file was modified | src/Parser/parser.yy |
The file was modified | src/AST/Expr.cpp |
The file was modified | src/AST/Print.cpp |
The file was modified | src/Validate/ImplementEnumFunc.cpp |
The file was modified | src/AST/Pass.impl.hpp |
The file was modified | src/AST/Expr.hpp |
The file was modified | src/ResolvExpr/CandidateFinder.cpp |