ConstFolder class
#include <derCompiler/ConstFold.h>
Computes literal constant-folding rewrites for one fold unit.
Public static functions
-
static void ComputeFolds(const std::
vector<FoldInputLine>& lines, std:: vector<FoldEdit>& edits)
Function documentation
static void ShaderCompiler:: ConstFolder:: ComputeFolds(const std:: vector<FoldInputLine>& lines,
std:: vector<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.