Driver: Add cast<> support for Action, and some other accessors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66887 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Action.cpp b/lib/Driver/Action.cpp
index d9bfce1..86d676f 100644
--- a/lib/Driver/Action.cpp
+++ b/lib/Driver/Action.cpp
@@ -13,3 +13,20 @@
using namespace clang::driver;
Action::~Action() {}
+
+const char *Action::getClassName(ActionClass AC) {
+ switch (AC) {
+ case InputClass: return "input";
+ case BindArchClass: return "bind-arch";
+ case PreprocessJobClass: return "preprocess";
+ case PrecompileJobClass: return "precompile";
+ case AnalyzeJobClass: return "analyze";
+ case CompileJobClass: return "compile";
+ case AssembleJobClass: return "assemble";
+ case LinkJobClass: return "link";
+ case LipoJobClass: return "lipo";
+ }
+
+ assert(0 && "invalid class");
+ return 0;
+}