aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Driver/Driver.cpp5
-rw-r--r--clang/lib/Driver/Types.cpp41
2 files changed, 5 insertions, 41 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index b32fc65..0c73db8 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -304,6 +304,9 @@ phases::ID Driver::getFinalPhase(const DerivedArgList &DAL,
} else if ((PhaseArg = DAL.getLastArg(options::OPT_c))) {
FinalPhase = phases::Assemble;
+ } else if ((PhaseArg = DAL.getLastArg(options::OPT_emit_interface_stubs))) {
+ FinalPhase = phases::IfsMerge;
+
// Otherwise do everything.
} else
FinalPhase = phases::Link;
@@ -3841,7 +3844,7 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
if (Args.hasArg(options::OPT_emit_interface_stubs)) {
auto PhaseList = types::getCompilationPhases(
types::TY_IFS_CPP,
- Args.hasArg(options::OPT_c) ? phases::Compile : phases::LastPhase);
+ Args.hasArg(options::OPT_c) ? phases::Compile : phases::IfsMerge);
ActionList MergerInputs;
diff --git a/clang/lib/Driver/Types.cpp b/clang/lib/Driver/Types.cpp
index 3cb2d6e..1bd187a 100644
--- a/clang/lib/Driver/Types.cpp
+++ b/clang/lib/Driver/Types.cpp
@@ -362,46 +362,7 @@ types::getCompilationPhases(ID Id, phases::ID LastPhase) {
llvm::SmallVector<phases::ID, phases::MaxNumberOfPhases>
types::getCompilationPhases(const clang::driver::Driver &Driver,
llvm::opt::DerivedArgList &DAL, ID Id) {
- phases::ID LastPhase;
-
- // Filter to compiler mode. When the compiler is run as a preprocessor then
- // compilation is not an option.
- // -S runs the compiler in Assembly listing mode.
- if (Driver.CCCIsCPP() || DAL.getLastArg(options::OPT_E) ||
- DAL.getLastArg(options::OPT__SLASH_EP) ||
- DAL.getLastArg(options::OPT_M, options::OPT_MM) ||
- DAL.getLastArg(options::OPT__SLASH_P))
- LastPhase = phases::Preprocess;
-
- // --precompile only runs up to precompilation.
- // This is a clang extension and is not compatible with GCC.
- else if (DAL.getLastArg(options::OPT__precompile))
- LastPhase = phases::Precompile;
-
- // -{fsyntax-only,-analyze,emit-ast} only run up to the compiler.
- else if (DAL.getLastArg(options::OPT_fsyntax_only) ||
- DAL.getLastArg(options::OPT_print_supported_cpus) ||
- DAL.getLastArg(options::OPT_module_file_info) ||
- DAL.getLastArg(options::OPT_verify_pch) ||
- DAL.getLastArg(options::OPT_rewrite_objc) ||
- DAL.getLastArg(options::OPT_rewrite_legacy_objc) ||
- DAL.getLastArg(options::OPT__migrate) ||
- DAL.getLastArg(options::OPT__analyze) ||
- DAL.getLastArg(options::OPT_emit_ast))
- LastPhase = phases::Compile;
-
- else if (DAL.getLastArg(options::OPT_S) ||
- DAL.getLastArg(options::OPT_emit_llvm))
- LastPhase = phases::Backend;
-
- else if (DAL.getLastArg(options::OPT_c))
- LastPhase = phases::Assemble;
-
- // Generally means, do every phase until Link.
- else
- LastPhase = phases::LastPhase;
-
- return types::getCompilationPhases(Id, LastPhase);
+ return types::getCompilationPhases(Id, Driver.getFinalPhase(DAL));
}
ID types::lookupCXXTypeForCType(ID Id) {