ConstFolder class
Computes literal constant-folding rewrites for one fold unit.
Public static functions
- static void ComputeFolds(const SmallVectorImpl<FoldInputLine>& lines, SmallVectorImpl<FoldEdit>& edits)
Function documentation
static void ShaderCompiler:: ConstFolder:: ComputeFolds(const SmallVectorImpl<FoldInputLine>& lines,
SmallVectorImpl<FoldEdit>& edits)
Parses the token stream of lines and appends one FoldEdit per maximal multi-token literal-only subexpression that collapses to a single literal. Edits are sorted by (Index, Begin), never overlap and never span lines; the caller applies them back to front.