Print flags of all frontend-integrated tools when -emit-supported-features is passed

This commit is contained in:
Owen Voorhees
2021-07-02 18:15:48 -07:00
parent 038af80a88
commit 63b03fc858
2 changed files with 8 additions and 1 deletions

View File

@@ -1048,7 +1048,13 @@ static bool printSwiftVersion(const CompilerInvocation &Invocation) {
static void printSingleFrontendOpt(llvm::opt::OptTable &table, options::ID id,
llvm::raw_ostream &OS) {
if (table.getOption(id).hasFlag(options::FrontendOption)) {
if (table.getOption(id).hasFlag(options::FrontendOption) ||
table.getOption(id).hasFlag(options::AutolinkExtractOption) ||
table.getOption(id).hasFlag(options::ModuleWrapOption) ||
table.getOption(id).hasFlag(options::SwiftIndentOption) ||
table.getOption(id).hasFlag(options::SwiftAPIExtractOption) ||
table.getOption(id).hasFlag(options::SwiftSymbolGraphExtractOption) ||
table.getOption(id).hasFlag(options::SwiftAPIDigesterOption)) {
auto name = StringRef(table.getOptionName(id));
if (!name.empty()) {
OS << " \"" << name << "\",\n";

View File

@@ -1,6 +1,7 @@
// RUN: %target-swift-frontend -emit-supported-features %s | %FileCheck %s
// CHECK: "SupportedArguments"
// CHECK: "abi"
// CHECK: "emit-module"
// CHECK: "LastOption"
// CHECK: "SupportedFeatures"