[cfe-commits] r66880 - in /cfe/trunk: include/clang/Driver/Phases.h lib/Driver/Phases.cpp
Daniel Dunbar
daniel at zuster.org
Fri Mar 13 04:27:15 PDT 2009
Author: ddunbar
Date: Fri Mar 13 06:27:05 2009
New Revision: 66880
URL: http://llvm.org/viewvc/llvm-project?rev=66880&view=rev
Log:
Driver: Pull Phase info into separate file.
Added:
cfe/trunk/include/clang/Driver/Phases.h
cfe/trunk/lib/Driver/Phases.cpp
Added: cfe/trunk/include/clang/Driver/Phases.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Phases.h?rev=66880&view=auto
==============================================================================
--- cfe/trunk/include/clang/Driver/Phases.h (added)
+++ cfe/trunk/include/clang/Driver/Phases.h Fri Mar 13 06:27:05 2009
@@ -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
Added: cfe/trunk/lib/Driver/Phases.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Phases.cpp?rev=66880&view=auto
==============================================================================
--- cfe/trunk/lib/Driver/Phases.cpp (added)
+++ cfe/trunk/lib/Driver/Phases.cpp Fri Mar 13 06:27:05 2009
@@ -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;
+}
More information about the cfe-commits
mailing list