From 23cf9d557e2396291b461c7c16a889fc97fa25a3 Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Thu, 18 Dec 2014 06:08:26 +0000 Subject: Change -save-temps to emit unoptimized bitcode files. 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224503 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Action.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Driver/Action.cpp') diff --git a/lib/Driver/Action.cpp b/lib/Driver/Action.cpp index d4f339d376..360dbeecab 100644 --- a/lib/Driver/Action.cpp +++ b/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 Input, types::ID OutputType) : JobAction(CompileJobClass, std::move(Input), OutputType) {} +void BackendJobAction::anchor() {} + +BackendJobAction::BackendJobAction(std::unique_ptr Input, + types::ID OutputType) + : JobAction(BackendJobClass, std::move(Input), OutputType) {} + void AssembleJobAction::anchor() {} AssembleJobAction::AssembleJobAction(std::unique_ptr Input, -- cgit v1.2.3