diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -3501,6 +3501,11 @@ if (Args.hasArg(options::OPT_emit_interface_stubs)) { llvm::SmallVector PhaseList; if (Args.hasArg(options::OPT_c)) { + // Claim -emit-merged-ifs if we aren't going to invoke llvm-ifs. + // The intention of -emit-merged-ifs is to force llvm-ifs to generate text + // instead of a ifso. Perhaps this should be inverted. + if (Args.hasArg(options::OPT_emit_merged_ifs)) + Args.ClaimAllArgs(options::OPT_emit_merged_ifs); llvm::SmallVector CompilePhaseList; types::getCompilationPhases(types::TY_IFS_CPP, CompilePhaseList); llvm::copy_if(CompilePhaseList, std::back_inserter(PhaseList), diff --git a/clang/test/InterfaceStubs/warnings.c b/clang/test/InterfaceStubs/warnings.c new file mode 100644 --- /dev/null +++ b/clang/test/InterfaceStubs/warnings.c @@ -0,0 +1,3 @@ +// RUN: %clang -emit-interface-stubs -emit-merged-ifs -c %s -o - 2>&1 | FileCheck %s +// CHECK-NOT: warning: argument unused during compilation: '-emit-merged-ifs' +int main() {}