From 926f4f76c3f819d5c8441574c560ddc476f84722 Mon Sep 17 00:00:00 2001 From: Puyan Lotfi Date: Thu, 22 Aug 2019 23:44:34 +0000 Subject: [clang][ifs] Dropping older experimental interface stub formats. I've been working on a new tool, llvm-ifs, for merging interface stub files generated by clang and I've iterated on my derivative format of TBE to a newer format. llvm-ifs will only support the new format, so I am going to drop the older experimental interface stubs formats in this commit to make things simpler. Differential Revision: https://reviews.llvm.org/D66573 llvm-svn: 369719 --- clang/lib/Frontend/CompilerInvocation.cpp | 37 ++++++++++++++++--------------- 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index c0539cd..c45b751 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1728,25 +1728,28 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, case OPT_emit_pch: Opts.ProgramAction = frontend::GeneratePCH; break; case OPT_emit_iterface_stubs: { + StringRef ArgStr = + Args.hasArg(OPT_iterface_stub_version_EQ) + ? Args.getLastArgValue(OPT_iterface_stub_version_EQ) + : ""; llvm::Optional ProgramAction = - llvm::StringSwitch>( - Args.hasArg(OPT_iterface_stub_version_EQ) - ? Args.getLastArgValue(OPT_iterface_stub_version_EQ) - : "") - .Case("experimental-yaml-elf-v1", - frontend::GenerateInterfaceYAMLExpV1) - .Case("experimental-tapi-elf-v1", - frontend::GenerateInterfaceTBEExpV1) - .Case("experimental-ifs-v1", - frontend::GenerateInterfaceIfsExpV1) + llvm::StringSwitch>(ArgStr) + .Case("experimental-ifs-v1", frontend::GenerateInterfaceIfsExpV1) .Default(llvm::None); - if (!ProgramAction) + if (!ProgramAction) { + std::string ErrorMessage = + "Invalid interface stub format: " + ArgStr.str() + + ((ArgStr == "experimental-yaml-elf-v1" || + ArgStr == "experimental-tapi-elf-v1") + ? " is deprecated." + : "."); Diags.Report(diag::err_drv_invalid_value) - << "Must specify a valid interface stub format type using " - << "-interface-stub-version="; - Opts.ProgramAction = *ProgramAction; + << "Must specify a valid interface stub format type, ie: " + "-interface-stub-version=experimental-ifs-v1" + << ErrorMessage; + } else { + Opts.ProgramAction = *ProgramAction; + } break; } case OPT_init_only: @@ -3186,8 +3189,6 @@ static bool isStrictlyPreprocessorAction(frontend::ActionKind Action) { case frontend::GenerateModuleInterface: case frontend::GenerateHeaderModule: case frontend::GeneratePCH: - case frontend::GenerateInterfaceYAMLExpV1: - case frontend::GenerateInterfaceTBEExpV1: case frontend::GenerateInterfaceIfsExpV1: case frontend::ParseSyntaxOnly: case frontend::ModuleFileInfo: -- cgit v1.1