Skip to content
Success

Changes

Summary

  1. 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)
  2. 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)
Commit 3e135c895c889427f3db85749ee5eab83dd48070 by ajbeach
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.
The file was modifiedsrc/Virtual/Tables.cpp
Commit 0c327cee778443a440104253db33557cee4d2a92 by j82liang
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) }
The file was modifiedlibcfa/src/enum.hfa
The file was modifiedsrc/ControlStruct/TranslateEnumRange.cpp
The file was modifiedlibcfa/src/enum.cfa
The file was modifiedsrc/Parser/parser.yy
The file was modifiedsrc/AST/Expr.cpp
The file was modifiedsrc/AST/Print.cpp
The file was modifiedsrc/Validate/ImplementEnumFunc.cpp
The file was modifiedsrc/AST/Pass.impl.hpp
The file was modifiedsrc/AST/Expr.hpp
The file was modifiedsrc/ResolvExpr/CandidateFinder.cpp