[Import as member] add inference support to swift-api-dump script

This commit is contained in:
Michael Ilseman
2016-03-08 16:55:24 -08:00
parent bbe1f7a0a5
commit 24417848ec

View File

@@ -83,6 +83,7 @@ def create_parser():
parser.add_argument('-o', '--output-dir', default=os.getcwd(), help='Directory to which the output will be emitted.')
parser.add_argument('-q', '--quiet', action='store_true', help='Suppress printing of status messages.')
parser.add_argument('-v', '--verbose', action='store_true', help='Print extra information.')
parser.add_argument('--enable-infer-import-as-member', action='store_true', help='Infer when a global could be imported as a member.')
parser.add_argument('-F', '--framework-dir', action='append', help='Add additional framework directories')
parser.add_argument('-I', '--include-dir', action='append', help='Add additional include directories')
return parser
@@ -243,6 +244,8 @@ def main():
extra_args = ['-skip-imports']
if args.swift_3:
extra_args = extra_args + ['-enable-omit-needless-words', '-enable-infer-default-arguments']
if args.enable_infer_import_as_member:
extra_args = extra_args + ['-enable-infer-import-as-member']
# Create a .swift file we can feed into swift-ide-test
subprocess.call(['touch', source_filename])