1
1
#!/usr/bin/env python
2
2
3
- # This tool helps dump the APIs of imported modules for a module, SDK,
4
- # or set of SDKs. It is primarily useful in determining the effect of
5
- # changes to the Clang importer .
3
+ # This tool helps assess the impact of automatically applying
4
+ # heuristics that omit 'needless' words from APIs imported from Clang
5
+ # into Swift .
6
6
7
7
from __future__ import print_function
8
8
9
9
import argparse
10
- import multiprocessing
11
10
import os
12
11
import re
13
12
import subprocess
14
- import sys
13
+ import multiprocessing
15
14
16
15
DEFAULT_TARGET_BASED_ON_SDK = {
17
16
'macosx' : 'x86_64-apple-macosx10.11' ,
47
46
}
48
47
49
48
def create_parser ():
50
- script_path = os .path .dirname (sys .argv [0 ])
51
- script_path = os .path .abspath (script_path )
52
- default_swift_ide_test = '%s/swift-ide-test' % (script_path )
53
-
54
49
parser = argparse .ArgumentParser (
55
50
description = "Determines the effects of omitting 'needless' words from imported APIs" ,
56
51
prog = 'omit-needless-words.py' ,
@@ -59,7 +54,7 @@ def create_parser():
59
54
parser .add_argument ('-j' , '--jobs' , type = int , help = 'The number of parallel jobs to execute' )
60
55
parser .add_argument ('-s' , '--sdk' , nargs = '+' , required = True , help = "The SDKs to use." )
61
56
parser .add_argument ('-t' , '--target' , help = "The target triple to use." )
62
- parser .add_argument ('-i' , '--swift-ide-test' , default = default_swift_ide_test , help = "The swift-ide-test executable." )
57
+ parser .add_argument ('-i' , '--swift-ide-test' , default = 'swift-ide-test' , help = "The swift-ide-test executable." )
63
58
parser .add_argument ('-3' , '--swift-3' , action = 'store_true' , help = "Use Swift 3 transformation" )
64
59
parser .add_argument ('-o' , '--output-dir' , default = os .getcwd (), help = 'Directory to which the output will be emitted.' )
65
60
parser .add_argument ('-q' , '--quiet' , action = 'store_true' , help = 'Suppress printing of status messages.' )
0 commit comments