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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224688 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Driver/Action.h 11 additions, 0 deletionsinclude/clang/Driver/Action.h
- include/clang/Driver/Phases.h 1 addition, 0 deletionsinclude/clang/Driver/Phases.h
- include/clang/Driver/Tool.h 1 addition, 0 deletionsinclude/clang/Driver/Tool.h
- lib/Driver/Action.cpp 7 additions, 0 deletionslib/Driver/Action.cpp
- lib/Driver/Driver.cpp 48 additions, 11 deletionslib/Driver/Driver.cpp
- lib/Driver/Phases.cpp 1 addition, 0 deletionslib/Driver/Phases.cpp
- lib/Driver/ToolChain.cpp 1 addition, 0 deletionslib/Driver/ToolChain.cpp
- lib/Driver/Tools.cpp 17 additions, 6 deletionslib/Driver/Tools.cpp
- lib/Driver/Tools.h 1 addition, 0 deletionslib/Driver/Tools.h
- lib/Driver/Types.cpp 1 addition, 0 deletionslib/Driver/Types.cpp
- test/Driver/ast.c 4 additions, 3 deletionstest/Driver/ast.c
- test/Driver/darwin-dsymutil.c 8 additions, 7 deletionstest/Driver/darwin-dsymutil.c
- test/Driver/darwin-verify-debug.c 2 additions, 2 deletionstest/Driver/darwin-verify-debug.c
- test/Driver/fortran.f95 9 additions, 0 deletionstest/Driver/fortran.f95
- test/Driver/lto.c 7 additions, 4 deletionstest/Driver/lto.c
- test/Driver/phases.c 36 additions, 30 deletionstest/Driver/phases.c
- test/Driver/save-temps.c 11 additions, 0 deletionstest/Driver/save-temps.c
Loading
Please register or sign in to comment