Remove redundant Transform.getName() definitions.

At some point, pass definitions were heavily macro-ized. Pass
descriptive names were added in two places. This is not only redundant
but a source of confusion. You could waste a lot of time grepping for
the wrong string. I removed all the getName() overrides which, at
around 90 passes, was a fairly significant amount of code bloat.

Any pass that we want to be able to invoke by name from a tool
(sil-opt) or pipeline plan *should* have unique type name, enum value,
commend-line string, and name string. I removed a comment about the
various inliner passes that contradicted that.

Side note: We should be consistent with the policy that a pass is
identified by its type. We have a couple passes, LICM and CSE, which
currently violate that convention.
This commit is contained in:
Andrew Trick
2017-04-08 18:52:22 -07:00
parent 3bcbf04d38
commit be1881aa1f
103 changed files with 82 additions and 184 deletions

View File

@@ -1602,7 +1602,6 @@ class COWArrayOptPass : public SILFunctionTransform {
}
}
StringRef getName() override { return "SIL COW Array Optimization"; }
};
} // end anonymous namespace
@@ -2346,7 +2345,6 @@ class SwiftArrayOptPass : public SILFunctionTransform {
}
}
StringRef getName() override { return "SIL Swift Array Optimization"; }
};
} // end anonymous namespace