aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2021-09-29 15:19:36 -0400
committerNico Weber <thakis@chromium.org>2021-09-30 14:17:14 -0400
commitfa32fd3bf7c070e62487e5ccba00557d57b2ee5c (patch)
tree46176bbbb527507fac409dafe83065efb8d47649 /clang/lib/Driver/Driver.cpp
parent6714e1ce3b5ec02af2f9ab878bd10d273f02aa7e (diff)
downloadllvm-fa32fd3bf7c070e62487e5ccba00557d57b2ee5c.zip
llvm-fa32fd3bf7c070e62487e5ccba00557d57b2ee5c.tar.gz
llvm-fa32fd3bf7c070e62487e5ccba00557d57b2ee5c.tar.bz2
[clang] Remove duplication in types::getCompilationPhases()
Call Driver::getFinalPhase() instead of duplicating it. https://reviews.llvm.org/D65993 added the duplication, then 02e35832c301e maded it more obviously a copy of getFinalPhase(). The only difference is that getCompilationPhases() used to use LastPhase / IfsMerge where getFinalPhase() used Link. Adapt getFinalPhase() to return IfsMerge when needed. No intentional behavior change. Differential Revision: https://reviews.llvm.org/D110770
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp5
1 files changed, 4 insertions, 1 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;