2011-01-01 01:31:54 +08:00
|
|
|
//===--- Phases.cpp - Transformations on Driver Types ---------------------===//
|
2009-03-13 19:27:05 +08:00
|
|
|
//
|
|
|
|
// 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"
|
2011-09-23 13:57:42 +08:00
|
|
|
#include "llvm/Support/ErrorHandling.h"
|
2009-03-13 19:27:05 +08:00
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
using namespace clang::driver;
|
|
|
|
|
|
|
|
const char *phases::getPhaseName(ID Id) {
|
|
|
|
switch (Id) {
|
2009-03-14 01:52:07 +08:00
|
|
|
case Preprocess: return "preprocessor";
|
2009-03-13 19:36:01 +08:00
|
|
|
case Precompile: return "precompiler";
|
|
|
|
case Compile: return "compiler";
|
Reapply "Change -save-temps to emit unoptimized bitcode files."
This reapplies r224503 along with a fix for compiling Fortran by having the
clang driver invoke gcc (see r224546, where it was reverted). I have added
a testcase for that as well.
Original commit message:
It is often convenient to use -save-temps to collect the intermediate
results of a compilation, e.g., when triaging a bug report. Besides the
temporary files for preprocessed source and assembly code, this adds the
unoptimized bitcode files as well.
This adds a new BackendJobAction, which is mostly mechanical, to run after
the CompileJobAction. When not using -save-temps, the BackendJobAction is
combined into one job with the CompileJobAction, similar to the way the
integrated assembler is handled. I've implemented this entirely as a
driver change, so under the hood, it is just using -disable-llvm-optzns
to get the unoptimized bitcode.
Based in part on a patch by Steven Wu.
rdar://problem/18909437
llvm-svn: 224688
2014-12-21 15:00:00 +08:00
|
|
|
case Backend: return "backend";
|
2009-03-13 19:36:01 +08:00
|
|
|
case Assemble: return "assembler";
|
|
|
|
case Link: return "linker";
|
2009-03-13 19:27:05 +08:00
|
|
|
}
|
|
|
|
|
2011-09-23 13:06:16 +08:00
|
|
|
llvm_unreachable("Invalid phase id.");
|
2009-03-13 19:27:05 +08:00
|
|
|
}
|