diff options
author | Bob Wilson <bob.wilson@apple.com> | 2014-12-21 07:00:00 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2014-12-21 07:00:00 +0000 |
commit | 23a55f1eeeb15ef6b8002e98e90cd025d53c97f2 (patch) | |
tree | 34f5c8b767fd4d89c2ec05f808c340cce7e7bb25 /clang/lib/Driver/Action.cpp | |
parent | 01dcd8a31dc03ff556fa9a0a602968c47eca99e6 (diff) | |
download | bcm5719-llvm-23a55f1eeeb15ef6b8002e98e90cd025d53c97f2.tar.gz bcm5719-llvm-23a55f1eeeb15ef6b8002e98e90cd025d53c97f2.zip |
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
Diffstat (limited to 'clang/lib/Driver/Action.cpp')
-rw-r--r-- | clang/lib/Driver/Action.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Driver/Action.cpp b/clang/lib/Driver/Action.cpp index d4f339d376d..360dbeecabf 100644 --- a/clang/lib/Driver/Action.cpp +++ b/clang/lib/Driver/Action.cpp @@ -29,6 +29,7 @@ const char *Action::getClassName(ActionClass AC) { case AnalyzeJobClass: return "analyzer"; case MigrateJobClass: return "migrator"; case CompileJobClass: return "compiler"; + case BackendJobClass: return "backend"; case AssembleJobClass: return "assembler"; case LinkJobClass: return "linker"; case LipoJobClass: return "lipo"; @@ -92,6 +93,12 @@ CompileJobAction::CompileJobAction(std::unique_ptr<Action> Input, types::ID OutputType) : JobAction(CompileJobClass, std::move(Input), OutputType) {} +void BackendJobAction::anchor() {} + +BackendJobAction::BackendJobAction(std::unique_ptr<Action> Input, + types::ID OutputType) + : JobAction(BackendJobClass, std::move(Input), OutputType) {} + void AssembleJobAction::anchor() {} AssembleJobAction::AssembleJobAction(std::unique_ptr<Action> Input, |