Now FPOption object is stored in the bits of Stmt class. The space
there is limited by 7 bits, which is by far not enough as FPOption
is supposed to grow incorporating other options related to floating
point operations. The problem was discussed in
short, attempts to put FPOption as a field to relevant AST classes
result in substantial increase of AST size because such field would
consume memory even for nodes that do not deal with FP operations.
As a solution, a new statement node FloatingPragmaStmt has been
added. It represents a pragma that modifies floating point options.
This statement is placed at the beginning of corresponding
CompoundStmt. It provides persistency for the FP options and
allows to maintain actual FP state. Other nodes such as BinaryOperator
do not have to have a copy of FPOption, thus no unnecessary memory
If more than one pragma are specified in a compound statement, there
is a separate node for each. Each node keeps FP options accumulated
from all previous pragma nodes and from this one. Pragma specified
at file level results in pragma nodes implicitly inserted into every
function body affected by the pragma. In compilation option result
in non-default FP options, the synthesized pragma is inserted as well.
There are cases when an expression occurs outside compound statement.
These are global variable initializers, default arguments and some
other. This solution does not work for them, a special expression
node is required for them, it will be implemented later.