]> granicus.if.org Git - clang/commitdiff
Driver: Pull Phase info into separate file.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 13 Mar 2009 11:27:05 +0000 (11:27 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 13 Mar 2009 11:27:05 +0000 (11:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66880 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Phases.h [new file with mode: 0644]
lib/Driver/Phases.cpp [new file with mode: 0644]

diff --git a/include/clang/Driver/Phases.h b/include/clang/Driver/Phases.h
new file mode 100644 (file)
index 0000000..a0c42ea
--- /dev/null
@@ -0,0 +1,32 @@
+//===--- Phases.h - Transformations on Driver Types -------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_DRIVER_PHASES_H_
+#define CLANG_DRIVER_PHASES_H_
+
+namespace clang {
+namespace driver {
+namespace phases {
+  /// ID - Ordered values for successive stages in the
+  /// compilation process which interact with user options.
+  enum ID {
+    Preprocess,
+    Precompile,
+    Compile,
+    Assemble,
+    Link
+  };
+
+  const char *getPhaseName(ID Id);
+
+} // end namespace phases
+} // end namespace driver
+} // end namespace clang
+
+#endif
diff --git a/lib/Driver/Phases.cpp b/lib/Driver/Phases.cpp
new file mode 100644 (file)
index 0000000..704540e
--- /dev/null
@@ -0,0 +1,27 @@
+//===--- Phases.cpp - Transformations on Driver Types -------------------*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Driver/Phases.h"
+
+#include <cassert>
+
+using namespace clang::driver;
+
+const char *phases::getPhaseName(ID Id) {
+  switch (Id) {
+  case Preprocess: return "preprocess";
+  case Precompile: return "precompile";
+  case Compile: return "compile";
+  case Assemble: return "assemble";
+  case Link: return "link";
+  }
+
+  assert(0 && "Invalid phase id.");
+  return 0;
+}