Start libc++ python cleanup and consolidation.

Libc++ frequently creates and uses utilities written in python.
Currently there are python modules under both libcxx/test and
libcxx/util. My goal with these changes is to consolidate them
into a single package under libcxx/utils/libcxx.

llvm-svn: 294644
This commit is contained in:
Eric Fiselier 2017-02-09 22:53:14 +00:00
parent 751f169657
commit 0b37f209bf
16 changed files with 27 additions and 10 deletions

View File

@ -332,7 +332,7 @@ if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
# after cxx builds.
add_custom_command(TARGET cxx_shared POST_BUILD
COMMAND
${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/gen_link_script/gen_link_script.py
${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/gen_link_script.py
ARGS
"$<TARGET_LINKER_FILE:cxx_shared>"
${LIBCXX_INTERFACE_LIBRARY_NAMES}

View File

@ -27,7 +27,7 @@ endif()
if (LIBCXX_HAS_ABILIST_CONFIGURATION)
set(ABILIST_FILE "${CMAKE_CURRENT_LIST_DIR}/${GENERIC_TARGET_TRIPLE}.abilist")
set(SYMDIFF_EXE "${LIBCXX_SOURCE_DIR}/utils/sym_check/sym_diff.py")
set(SYMDIFF_EXE "${LIBCXX_SOURCE_DIR}/utils/sym_diff.py")
add_custom_target(check-cxx-abilist
${SYMDIFF_EXE} --only-stdlib-symbols --strict ${ABILIST_FILE}
$<TARGET_SONAME_FILE:cxx_shared>

View File

@ -932,7 +932,7 @@ class Configuration(object):
# Configure run shortcut
sub.append(('%run', exec_str + ' %t.exe'))
# Configure not program substitutions
not_py = os.path.join(self.libcxx_src_root, 'utils', 'not', 'not.py')
not_py = os.path.join(self.libcxx_src_root, 'utils', 'not.py')
not_str = '%s %s ' % (sys.executable, not_py)
sub.append(('not ', not_str))

View File

@ -0,0 +1,17 @@
#===----------------------------------------------------------------------===##
#
# The LLVM Compiler Infrastructure
#
# This file is dual licensed under the MIT and the University of Illinois Open
# Source Licenses. See LICENSE.TXT for details.
#
#===----------------------------------------------------------------------===##
"""libcxx python utilities"""
__author__ = 'Eric Fiselier'
__email__ = 'eric@efcs.ca'
__versioninfo__ = (0, 1, 0)
__version__ = ' '.join(str(v) for v in __versioninfo__) + 'dev'
__all__ = []

View File

@ -11,7 +11,7 @@
diff - A set of functions for diff-ing two symbol lists.
"""
from sym_check import util
from libcxx.sym_check import util
def _symbol_difference(lhs, rhs):

View File

@ -14,7 +14,7 @@ import distutils.spawn
import sys
import re
from sym_check import util
from libcxx.sym_check import util
extract_ignore_names = ['_init', '_fini']

View File

@ -152,9 +152,9 @@ def is_library_file(filename):
def extract_or_load(filename):
import sym_check.extract
import libcxx.sym_check.extract
if is_library_file(filename):
return sym_check.extract.extract_symbols(filename)
return libcxx.sym_check.extract.extract_symbols(filename)
return read_syms_from_file(filename)
def adjust_mangled_name(name):

View File

@ -13,7 +13,7 @@ sym_diff - Compare two symbol lists and output the differences.
from argparse import ArgumentParser
import sys
from sym_check import diff, util
from libcxx.sym_check import diff, util
def main():

View File

@ -11,7 +11,7 @@
sym_extract - Extract and output a list of symbols from a shared library.
"""
from argparse import ArgumentParser
from sym_check import extract, util
from libcxx.sym_check import extract, util
def main():

View File

@ -13,7 +13,7 @@ sym_match - Match all symbols in a list against a list of regexes.
"""
from argparse import ArgumentParser
import sys
from sym_check import util, match, extract
from libcxx.sym_check import util, match, extract
def main():