Enhance documentation.

This commit is contained in:
chriseth 2021-11-23 10:42:18 +01:00 committed by Marenz
parent bd321b9f1f
commit 0e7a065a78
31 changed files with 35 additions and 30 deletions

View File

@ -36,6 +36,11 @@ struct Dialect;
/** /**
* Base class for both UnusedAssignEliminator and UnusedStoreEliminator. * Base class for both UnusedAssignEliminator and UnusedStoreEliminator.
* *
* The class tracks the state of abstract "stores" (assignments or mstore/sstore
* statements) across the control-flow. It is the job of the derived class to create
* the stores and track references, but the base class adjusts their "used state" at
* control-flow splits and joins.
*
* Prerequisite: Disambiguator, ForLoopInitRewriter. * Prerequisite: Disambiguator, ForLoopInitRewriter.
*/ */
class UnusedStoreBase: public ASTWalker class UnusedStoreBase: public ASTWalker

View File

@ -8,7 +8,7 @@
} }
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let a := 2 // let a := 2

View File

@ -14,7 +14,7 @@
mstore(x, 0) mstore(x, 0)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x // let x

View File

@ -13,7 +13,7 @@
mstore(x, 0x42) mstore(x, 0x42)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x // let x

View File

@ -16,7 +16,7 @@
x := 3 x := 3
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x // let x

View File

@ -13,7 +13,7 @@
mstore(x, 0x42) mstore(x, 0x42)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x // let x

View File

@ -12,7 +12,7 @@
} }
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x // let x

View File

@ -19,7 +19,7 @@
mstore(x, 0x42) mstore(x, 0x42)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x := 1 // let x := 1

View File

@ -26,7 +26,7 @@
x := 13 x := 13
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x := 1 // let x := 1

View File

@ -19,7 +19,7 @@
} }
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// for { } 1 { } // for { } 1 { }

View File

@ -35,7 +35,7 @@
mstore(x, 0x42) mstore(x, 0x42)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x := 1 // let x := 1

View File

@ -32,7 +32,7 @@
mstore(x, 0x42) mstore(x, 0x42)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x := 1 // let x := 1

View File

@ -11,7 +11,7 @@
x := 3 x := 3
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x // let x

View File

@ -23,7 +23,7 @@
mstore(x, 0x42) mstore(x, 0x42)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x := 1 // let x := 1

View File

@ -12,7 +12,7 @@
r := 2 r := 2
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let r // let r

View File

@ -10,7 +10,7 @@
mstore(0, d) mstore(0, d)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let c // let c

View File

@ -11,7 +11,7 @@
mstore(0, d) mstore(0, d)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let c // let c

View File

@ -11,7 +11,7 @@
mstore(0, d) mstore(0, d)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let c // let c

View File

@ -21,7 +21,7 @@
} }
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// function f(a, b) -> x // function f(a, b) -> x

View File

@ -9,7 +9,7 @@
y := 4 y := 4
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// function f() -> a, b // function f() -> a, b

View File

@ -6,7 +6,7 @@
a := b a := b
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let a := 2 // let a := 2

View File

@ -4,7 +4,7 @@
a := mload(0) a := mload(0)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let a // let a

View File

@ -12,7 +12,7 @@
} }
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let i := 0 // let i := 0

View File

@ -13,7 +13,7 @@
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let i := 0 // let i := 0

View File

@ -7,7 +7,7 @@
} }
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let a // let a

View File

@ -4,6 +4,6 @@
a := 2 a := 2
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { let a } // { let a }

View File

@ -8,7 +8,7 @@
mstore(x, 0) mstore(x, 0)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x // let x

View File

@ -7,7 +7,7 @@
mstore(x, 0) mstore(x, 0)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x // let x

View File

@ -8,7 +8,7 @@
mstore(x, 0) mstore(x, 0)
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x // let x

View File

@ -6,7 +6,7 @@
case 0 { mstore(0, 1) } case 0 { mstore(0, 1) }
} }
// ---- // ----
// step: redundantAssignEliminator // step: unusedAssignEliminator
// //
// { // {
// let x // let x

View File

@ -138,7 +138,7 @@ BOOST_AUTO_TEST_CASE(output_operator_should_create_concise_and_unambiguous_strin
BOOST_TEST(chromosome.length() == allSteps.size()); BOOST_TEST(chromosome.length() == allSteps.size());
BOOST_TEST(chromosome.optimisationSteps() == allSteps); BOOST_TEST(chromosome.optimisationSteps() == allSteps);
BOOST_TEST(toString(chromosome) == "flcCUnDvejsxIOoighFTLMRrmVatpud"); BOOST_TEST(toString(chromosome) == "flcCUnDvejsxIOoighFTLMRmVatrpud");
} }
BOOST_AUTO_TEST_CASE(optimisationSteps_should_translate_chromosomes_genes_to_optimisation_step_names) BOOST_AUTO_TEST_CASE(optimisationSteps_should_translate_chromosomes_genes_to_optimisation_step_names)