Use the pass's "tag" for command-line options.

A pass has an ID (C++ identifier), Tag (shell identifier),
and Name (human identifier).

Command line options that identify passes should obviously be compatibile with
with the pass' command line identifier. This is also what the user is used to
typing for the -debug-only option.
This commit is contained in:
Andrew Trick
2017-07-05 16:10:07 -07:00
parent 1734f0b18c
commit 89985ebacd
3 changed files with 34 additions and 19 deletions

View File

@@ -75,6 +75,12 @@ namespace swift {
/// Get the name of the transform.
llvm::StringRef getName() { return PassKindName(getPassKind()); }
/// Get the transform's (command-line) tag.
llvm::StringRef getTag() { return PassKindTag(getPassKind()); }
/// Get the transform's name as a C++ identifier.
llvm::StringRef getID() { return PassKindID(getPassKind()); }
protected:
/// \brief Searches for an analysis of type T in the list of registered
/// analysis. If the analysis is not found, the program terminates.