mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Rename "Name Binding" action to "Resolve Imports"
This commit is contained in:
@@ -545,7 +545,7 @@ public:
|
||||
///
|
||||
/// Like a parse-only invocation, a single file is required. Unlike a
|
||||
/// parse-only invocation, module imports will be processed.
|
||||
void performParseAndNameBindingOnly();
|
||||
void performParseAndResolveImportsOnly();
|
||||
|
||||
private:
|
||||
SourceFile *
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
enum class ActionType {
|
||||
NoneAction, ///< No specific action
|
||||
Parse, ///< Parse only
|
||||
NameBind, ///< Parse and perform name-binding only
|
||||
ResolveImports, ///< Parse and resolve imports only
|
||||
Typecheck, ///< Parse and type-check only
|
||||
DumpParse, ///< Parse only and dump AST
|
||||
DumpInterfaceHash, ///< Parse and dump the interface token hash.
|
||||
|
||||
@@ -637,8 +637,8 @@ def fixit_all : Flag<["-"], "fixit-all">,
|
||||
def parse: Flag<["-"], "parse">,
|
||||
HelpText<"Parse input file(s)">, ModeOpt,
|
||||
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild]>;
|
||||
def namebind : Flag<["-"], "name-bind">,
|
||||
HelpText<"Parse and perform name binding on input file(s)">, ModeOpt,
|
||||
def resolve_imports : Flag<["-"], "resolve-imports">,
|
||||
HelpText<"Parse and resolve imports in input file(s)">, ModeOpt,
|
||||
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild]>;
|
||||
def typecheck : Flag<["-"], "typecheck">,
|
||||
HelpText<"Parse and type-check input file(s)">, ModeOpt,
|
||||
|
||||
@@ -1370,7 +1370,7 @@ void Driver::buildOutputInfo(const ToolChain &TC, const DerivedArgList &Args,
|
||||
OI.LinkAction = LinkKind::None;
|
||||
break;
|
||||
case options::OPT_parse:
|
||||
case options::OPT_namebind:
|
||||
case options::OPT_resolve_imports:
|
||||
case options::OPT_typecheck:
|
||||
case options::OPT_dump_parse:
|
||||
case options::OPT_dump_ast:
|
||||
|
||||
@@ -322,8 +322,8 @@ ArgsToFrontendOptionsConverter::determineRequestedAction(const ArgList &args) {
|
||||
return FrontendOptions::ActionType::EmitImportedModules;
|
||||
if (Opt.matches(OPT_parse))
|
||||
return FrontendOptions::ActionType::Parse;
|
||||
if (Opt.matches(OPT_namebind))
|
||||
return FrontendOptions::ActionType::NameBind;
|
||||
if (Opt.matches(OPT_resolve_imports))
|
||||
return FrontendOptions::ActionType::ResolveImports;
|
||||
if (Opt.matches(OPT_typecheck))
|
||||
return FrontendOptions::ActionType::Typecheck;
|
||||
if (Opt.matches(OPT_dump_parse))
|
||||
|
||||
@@ -425,7 +425,7 @@ shouldImplicityImportSwiftOnoneSupportModule(CompilerInvocation &Invocation) {
|
||||
return Invocation.getFrontendOptions().isCreatingSIL();
|
||||
}
|
||||
|
||||
void CompilerInstance::performParseAndNameBindingOnly() {
|
||||
void CompilerInstance::performParseAndResolveImportsOnly() {
|
||||
performSemaUpTo(SourceFile::NameBound);
|
||||
}
|
||||
|
||||
@@ -474,7 +474,6 @@ void CompilerInstance::performSemaUpTo(SourceFile::ASTStage_t LimitStage) {
|
||||
parseAndCheckTypesUpTo(implicitImports, LimitStage);
|
||||
}
|
||||
|
||||
|
||||
CompilerInstance::ImplicitImports::ImplicitImports(CompilerInstance &compiler) {
|
||||
kind = compiler.Invocation.getImplicitModuleImportKind();
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ bool FrontendOptions::needsProperModuleName(ActionType action) {
|
||||
switch (action) {
|
||||
case ActionType::NoneAction:
|
||||
case ActionType::Parse:
|
||||
case ActionType::NameBind:
|
||||
case ActionType::ResolveImports:
|
||||
case ActionType::Typecheck:
|
||||
case ActionType::DumpParse:
|
||||
case ActionType::DumpAST:
|
||||
@@ -66,7 +66,7 @@ bool FrontendOptions::isActionImmediate(ActionType action) {
|
||||
switch (action) {
|
||||
case ActionType::NoneAction:
|
||||
case ActionType::Parse:
|
||||
case ActionType::NameBind:
|
||||
case ActionType::ResolveImports:
|
||||
case ActionType::Typecheck:
|
||||
case ActionType::DumpParse:
|
||||
case ActionType::DumpAST:
|
||||
@@ -136,7 +136,7 @@ FrontendOptions::suffixForPrincipalOutputFileForAction(ActionType action) {
|
||||
return StringRef();
|
||||
|
||||
case ActionType::Parse:
|
||||
case ActionType::NameBind:
|
||||
case ActionType::ResolveImports:
|
||||
case ActionType::Typecheck:
|
||||
case ActionType::DumpParse:
|
||||
case ActionType::DumpInterfaceHash:
|
||||
@@ -198,7 +198,7 @@ bool FrontendOptions::canActionEmitDependencies(ActionType action) {
|
||||
case ActionType::Immediate:
|
||||
case ActionType::REPL:
|
||||
return false;
|
||||
case ActionType::NameBind:
|
||||
case ActionType::ResolveImports:
|
||||
case ActionType::Typecheck:
|
||||
case ActionType::MergeModules:
|
||||
case ActionType::EmitModuleOnly:
|
||||
@@ -220,7 +220,7 @@ bool FrontendOptions::canActionEmitReferenceDependencies(ActionType action) {
|
||||
switch (action) {
|
||||
case ActionType::NoneAction:
|
||||
case ActionType::Parse:
|
||||
case ActionType::NameBind:
|
||||
case ActionType::ResolveImports:
|
||||
case ActionType::DumpParse:
|
||||
case ActionType::DumpInterfaceHash:
|
||||
case ActionType::DumpAST:
|
||||
@@ -263,7 +263,7 @@ bool FrontendOptions::canActionEmitObjCHeader(ActionType action) {
|
||||
case ActionType::REPL:
|
||||
return false;
|
||||
case ActionType::Parse:
|
||||
case ActionType::NameBind:
|
||||
case ActionType::ResolveImports:
|
||||
case ActionType::Typecheck:
|
||||
case ActionType::MergeModules:
|
||||
case ActionType::EmitModuleOnly:
|
||||
@@ -294,7 +294,7 @@ bool FrontendOptions::canActionEmitLoadedModuleTrace(ActionType action) {
|
||||
case ActionType::Immediate:
|
||||
case ActionType::REPL:
|
||||
return false;
|
||||
case ActionType::NameBind:
|
||||
case ActionType::ResolveImports:
|
||||
case ActionType::Typecheck:
|
||||
case ActionType::MergeModules:
|
||||
case ActionType::EmitModuleOnly:
|
||||
@@ -316,7 +316,7 @@ bool FrontendOptions::canActionEmitModule(ActionType action) {
|
||||
switch (action) {
|
||||
case ActionType::NoneAction:
|
||||
case ActionType::Parse:
|
||||
case ActionType::NameBind:
|
||||
case ActionType::ResolveImports:
|
||||
case ActionType::Typecheck:
|
||||
case ActionType::DumpParse:
|
||||
case ActionType::DumpInterfaceHash:
|
||||
@@ -351,7 +351,7 @@ bool FrontendOptions::canActionEmitModuleDoc(ActionType action) {
|
||||
bool FrontendOptions::doesActionProduceOutput(ActionType action) {
|
||||
switch (action) {
|
||||
case ActionType::Parse:
|
||||
case ActionType::NameBind:
|
||||
case ActionType::ResolveImports:
|
||||
case ActionType::Typecheck:
|
||||
case ActionType::DumpParse:
|
||||
case ActionType::DumpAST:
|
||||
@@ -397,7 +397,7 @@ bool FrontendOptions::doesActionProduceTextualOutput(ActionType action) {
|
||||
return false;
|
||||
|
||||
case ActionType::Parse:
|
||||
case ActionType::NameBind:
|
||||
case ActionType::ResolveImports:
|
||||
case ActionType::Typecheck:
|
||||
case ActionType::DumpParse:
|
||||
case ActionType::DumpInterfaceHash:
|
||||
|
||||
@@ -898,8 +898,8 @@ static bool performCompile(CompilerInstance &Instance,
|
||||
if (FrontendOptions::shouldActionOnlyParse(Action)) {
|
||||
Instance.performParseOnly(/*EvaluateConditionals*/
|
||||
Action == FrontendOptions::ActionType::EmitImportedModules);
|
||||
} else if (Action == FrontendOptions::ActionType::NameBind) {
|
||||
Instance.performParseAndNameBindingOnly();
|
||||
} else if (Action == FrontendOptions::ActionType::ResolveImports) {
|
||||
Instance.performParseAndResolveImportsOnly();
|
||||
} else {
|
||||
Instance.performSema();
|
||||
}
|
||||
@@ -922,7 +922,7 @@ static bool performCompile(CompilerInstance &Instance,
|
||||
(void)emitMakeDependenciesIfNeeded(Context.Diags,
|
||||
Instance.getDependencyTracker(), opts);
|
||||
|
||||
if (Action == FrontendOptions::ActionType::NameBind)
|
||||
if (Action == FrontendOptions::ActionType::ResolveImports)
|
||||
return Context.hadError();
|
||||
|
||||
if (observer)
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
// PARSE_NO_REFERENCE_DEPS: error: this mode does not support emitting reference dependency files{{$}}
|
||||
// RUN: not %target-swift-frontend -dump-ast -emit-reference-dependencies %s 2>&1 | %FileCheck -check-prefix=DUMP_NO_REFERENCE_DEPS %s
|
||||
// DUMP_NO_REFERENCE_DEPS: error: this mode does not support emitting reference dependency files{{$}}
|
||||
// RUN: not %target-swift-frontend -resolve-imports -emit-reference-dependencies %s 2>&1 | %FileCheck -check-prefix=RESOLVE_IMPORTS_NO_REFERENCE_DEPS %s
|
||||
// RESOLVE_IMPORTS_NO_REFERENCE_DEPS: error: this mode does not support emitting reference dependency files{{$}}
|
||||
|
||||
// Should not fail with non-zero exit code.
|
||||
// RUN: %target-swift-frontend -emit-silgen %S/Inputs/invalid-module-name.swift > /dev/null
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
// RUN: %empty-directory(%t)
|
||||
|
||||
// RUN: %target-swift-frontend -emit-dependencies-path - -name-bind %S/../Inputs/empty\ file.swift | %FileCheck -check-prefix=CHECK-BASIC %s
|
||||
// RUN: %target-swift-frontend -emit-dependencies-path - -resolve-imports %S/../Inputs/empty\ file.swift | %FileCheck -check-prefix=CHECK-BASIC %s
|
||||
// RUN: %target-swift-frontend -emit-reference-dependencies-path - -typecheck -primary-file %S/../Inputs/empty\ file.swift | %FileCheck -check-prefix=CHECK-BASIC-YAML %s
|
||||
|
||||
// RUN: %target-swift-frontend -emit-dependencies-path %t.d -emit-reference-dependencies-path %t.swiftdeps -typecheck -primary-file %S/../Inputs/empty\ file.swift
|
||||
@@ -38,7 +38,7 @@
|
||||
// CHECK-MULTIPLE-OUTPUTS: Swift.swiftmodule
|
||||
// CHECK-MULTIPLE-OUTPUTS-NOT: :
|
||||
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -import-objc-header %S/Inputs/dependencies/extra-header.h -emit-dependencies-path - -name-bind %s | %FileCheck -check-prefix=CHECK-IMPORT %s
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -import-objc-header %S/Inputs/dependencies/extra-header.h -emit-dependencies-path - -resolve-imports %s | %FileCheck -check-prefix=CHECK-IMPORT %s
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -import-objc-header %S/Inputs/dependencies/extra-header.h -emit-reference-dependencies-path - -typecheck -primary-file %s | %FileCheck -check-prefix=CHECK-IMPORT-YAML %s
|
||||
|
||||
// CHECK-IMPORT-LABEL: - :
|
||||
|
||||
Reference in New Issue
Block a user