• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:output +full:- +full:lib

29 # Windows, waiting for the entire output to be ready can take a significant
32 def dumpbin_get_symbols(lib): argument
33 process = subprocess.Popen(['dumpbin','/symbols',lib], bufsize=1,
44 def nm_get_symbols(lib): argument
45 process = subprocess.Popen(['nm',lib], bufsize=1,
56 def readobj_get_symbols(lib): argument
57 process = subprocess.Popen(['llvm-readobj','-symbols',lib], bufsize=1,
62 # When looking through the output of llvm-readobj we expect to see Name,
81 # Define functions which determine if the target is 32-bit Windows (as that's
84 def dumpbin_is_32bit_windows(lib): argument
85 # dumpbin /headers can output a huge amount of data (>100MB in a debug
86 # build) so we read only up to the 'machine' line then close the output.
87 process = subprocess.Popen(['dumpbin','/headers',lib], bufsize=1,
101 def objdump_is_32bit_windows(lib): argument
102 output = subprocess.check_output(['objdump','-f',lib],
104 for line in output:
107 return (match.group(1) == 'pe-i386')
110 def readobj_is_32bit_windows(lib): argument
111 output = subprocess.check_output(['llvm-readobj','-file-headers',lib],
113 for line in output:
116 return (match.group(1) == 'COFF-i386')
155 # from clang/lib/AST/MicrosoftMangle.cpp):
156 # <function-type> ::= <function-class> <this-cvr-qualifiers>
157 # <calling-convention> <return-type>
158 # <argument-list> <throw-spec>
159 # <function-class> ::= [A-Z]
160 # <this-cvr-qualifiers> ::= [A-Z0-9_]*
161 # <calling-convention> ::= [A-JQ]
162 # <return-type> ::= .+
163 # <argument-list> ::= X (void)
166 # <throw-spec> ::= exceptions are not allowed
167 elif re.search('(llvm|clang)@@[A-Z][A-Z0-9_]*[A-JQ].+(X|.+@|.*Z)$', symbol):
196 if re.match('[CD][123]', names[-1][0]) and names[-2][1]:
200 elif names[-1][1]:
250 match = re.match('S[A-Z0-9]*_(.+)', tmp)
278 match = re.match('NS[A-Z0-9]*_(.+)', arg)
284 # Skip past CV-qualifiers and ref qualifiers
313 get_symbols, should_keep_symbol, calling_convention_decoration, lib = arg
315 for symbol in get_symbols(lib):
322 tool_exes = ['dumpbin','nm','objdump','llvm-readobj']
325 parser.add_argument('--mangling', choices=['itanium','microsoft'],
327 parser.add_argument('--tools', choices=tool_exes, nargs='*',
330 parser.add_argument('libs', metavar='lib', type=str, nargs='+',
332 parser.add_argument('-o', metavar='file', type=str, help='output to file')
336 # and the function to use to determine if the target is 32-bit windows.
340 'llvm-readobj' : (readobj_get_symbols, readobj_is_32bit_windows) }
351 # Close std streams as we don't want any output and we don't
387 for lib in args.libs:
389 # libraries, so we need to add .lib/.a to the end and maybe lib to the
391 suffixes = ['.lib','.a','.obj','.o']
392 if not any([lib.endswith(s) for s in suffixes]):
394 if os.path.exists(lib+s):
395 lib = lib+s variable
397 if os.path.exists('lib'+lib+s):
398 lib = 'lib'+lib+s variable
400 if not any([lib.endswith(s) for s in suffixes]):
401 print("Don't know what to do with argument "+lib, file=sys.stderr)
403 libs.append(lib)
426 # On Ctrl-C terminate everything and exit
464 # checking if the second-to-last name in the list is a template.
469 if names and names[-2][1]:
474 # just leave it as-is.