-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Node-specific behavior into Node subclasses (#1039)
* Move ConstantFold into Node classes * Move Compare into Node classes * Move Coalesce into Node classes * Move Sort into Node classes * Move Cleanup into Node classes * Add separate Create methods for different kinds of expressions * Change null root invariant to check if the Root is null rather than if the Parent is null * Make Node Compare methods const * Add comments to Node methods * Make LeafExprNode::Compare const * Fix line lengths * Move PrettyPrint method to Node classes * Add comment to AddZero method describing the conditions where `e` must be canonically equivalent to `e + 0` * Add virtual Node destructor * Replace range-based for loop in BinaryOperatorNode::Coalesce with index-based for loop This fixes a crash that would happen on Linux for certain binary operators. * Don't evaluate BParent->Children.end() on every loop iteration * Make Coalesce, Sort, ConstantFold, Compare, PrettyPrint, and Cleanup pure virtual Node functions * Restore Node::Cleanup method
- Loading branch information
Showing
2 changed files
with
545 additions
and
559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.