Skip to content

Commit 4d08e6a

Browse files
author
David Ungar
committed
---
yaml --- r: 340607 b: refs/heads/rxwei-patch-1 c: 6cfcabd h: refs/heads/master i: 340605: 3127938 340603: 74bd244 340599: b6624d5 340591: 6c16df8 340575: 3656f00 340543: 0495c87 340479: 1f0e439
1 parent 00986f3 commit 4d08e6a

File tree

7 files changed

+15
-8
lines changed

7 files changed

+15
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: 2d0a8f2c6af48be92d58e83fe2268f07a15647ec
1018+
refs/heads/rxwei-patch-1: 6cfcabd8e543c7ea30f6b13f1dee6519346d5d46
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/include/swift/Basic/LangOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ namespace swift {
240240

241241
/// Should we use \c ASTScope-based resolution for unqualified name lookup?
242242
bool EnableASTScopeLookup = false;
243+
244+
/// Someday, ASTScopeLookup will supplant lookup in the parser
245+
bool DisableParserLookup = false;
243246

244247
/// Sound we compare to ASTScope-based resolution for debugging?
245248
bool CompareToASTScopeLookup = false;

branches/rxwei-patch-1/include/swift/Option/Options.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,9 @@ def enable_astscope_lookup : Flag<["-"], "enable-astscope-lookup">,
857857
Flags<[FrontendOption]>,
858858
HelpText<"Enable ASTScope-based unqualified name lookup">;
859859

860+
def disable_parser_lookup : Flag<["-"], "disable_parser_lookup">,
861+
HelpText<"Disable parser lookup & use ast scope lookup only (experimental)">;
862+
860863
def index_file : Flag<["-"], "index-file">,
861864
HelpText<"Produce index data for a source file">, ModeOpt,
862865
Flags<[NoInteractiveOption, DoesNotAffectIncrementalBuild]>;

branches/rxwei-patch-1/include/swift/Parse/Parser.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -714,17 +714,15 @@ class Parser {
714714

715715
/// Add the given Decl to the current scope.
716716
void addToScope(ValueDecl *D, bool diagnoseRedefinitions = true) {
717-
// FIXME: ASTScope lookup is not yet ready for this.
718-
// if (Context.LangOpts.EnableASTScopeLookup)
719-
// return;
717+
if (Context.LangOpts.DisableParserLookup)
718+
return;
720719

721720
getScopeInfo().addToScope(D, *this, diagnoseRedefinitions);
722721
}
723722

724723
ValueDecl *lookupInScope(DeclName Name) {
725-
// FIXME: ASTScope lookup is not yet ready for this.
726-
// if (Context.LangOpts.EnableASTScopeLookup)
727-
// return nullptr;
724+
if (Context.LangOpts.DisableParserLookup)
725+
return nullptr;
728726

729727
return getScopeInfo().lookupValueName(Name);
730728
}

branches/rxwei-patch-1/lib/Driver/ToolChains.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ static void addCommonFrontendArgs(const ToolChain &TC, const OutputInfo &OI,
226226
inputArgs.AddLastArg(arguments, options::OPT_package_description_version);
227227
inputArgs.AddLastArg(arguments, options::OPT_serialize_diagnostics_path);
228228
inputArgs.AddLastArg(arguments, options::OPT_enable_astscope_lookup);
229+
inputArgs.AddLastArg(arguments, options::OPT_disable_parser_lookup);
229230

230231
// Pass on any build config options
231232
inputArgs.AddAllArgs(arguments, options::OPT_D);

branches/rxwei-patch-1/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
316316
= A->getOption().matches(OPT_enable_target_os_checking);
317317
}
318318

319-
Opts.EnableASTScopeLookup |= Args.hasArg(OPT_enable_astscope_lookup);
319+
Opts.EnableASTScopeLookup |= Args.hasArg(OPT_enable_astscope_lookup) || Args.hasArg(OPT_disable_parser_lookup);
320320
Opts.CompareToASTScopeLookup |= Args.hasArg(OPT_compare_to_astscope_lookup);
321321
Opts.DebugConstraintSolver |= Args.hasArg(OPT_debug_constraints);
322322
Opts.NamedLazyMemberLoading &= !Args.hasArg(OPT_disable_named_lazy_member_loading);

branches/rxwei-patch-1/test/lit.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,8 @@ if 'syntax_parser_lib' in config.available_features:
401401
config.substitutions.append( ('%swift-syntax-parser-test', config.swift_syntax_parser_test) )
402402
if '-enable-astscope-lookup' in config.swift_test_options:
403403
config.available_features.add("enable-astscope-lookup")
404+
if '-disable-parser-lookup' in config.swift_test_options:
405+
config.available_features.add("disable-parser-lookup")
404406
config.substitutions.append( ('%swift-format', config.swift_format) )
405407
config.substitutions.append( ('%llvm-link', config.llvm_link) )
406408
config.substitutions.append( ('%swift-llvm-opt', config.swift_llvm_opt) )

0 commit comments

Comments
 (0)