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. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294644 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -332,7 +332,7 @@ if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
|
|||||||
# after cxx builds.
|
# after cxx builds.
|
||||||
add_custom_command(TARGET cxx_shared POST_BUILD
|
add_custom_command(TARGET cxx_shared POST_BUILD
|
||||||
COMMAND
|
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
|
ARGS
|
||||||
"$<TARGET_LINKER_FILE:cxx_shared>"
|
"$<TARGET_LINKER_FILE:cxx_shared>"
|
||||||
${LIBCXX_INTERFACE_LIBRARY_NAMES}
|
${LIBCXX_INTERFACE_LIBRARY_NAMES}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ endif()
|
|||||||
|
|
||||||
if (LIBCXX_HAS_ABILIST_CONFIGURATION)
|
if (LIBCXX_HAS_ABILIST_CONFIGURATION)
|
||||||
set(ABILIST_FILE "${CMAKE_CURRENT_LIST_DIR}/${GENERIC_TARGET_TRIPLE}.abilist")
|
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
|
add_custom_target(check-cxx-abilist
|
||||||
${SYMDIFF_EXE} --only-stdlib-symbols --strict ${ABILIST_FILE}
|
${SYMDIFF_EXE} --only-stdlib-symbols --strict ${ABILIST_FILE}
|
||||||
$<TARGET_SONAME_FILE:cxx_shared>
|
$<TARGET_SONAME_FILE:cxx_shared>
|
||||||
|
|||||||
@@ -932,7 +932,7 @@ class Configuration(object):
|
|||||||
# Configure run shortcut
|
# Configure run shortcut
|
||||||
sub.append(('%run', exec_str + ' %t.exe'))
|
sub.append(('%run', exec_str + ' %t.exe'))
|
||||||
# Configure not program substitutions
|
# 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)
|
not_str = '%s %s ' % (sys.executable, not_py)
|
||||||
sub.append(('not ', not_str))
|
sub.append(('not ', not_str))
|
||||||
|
|
||||||
|
|||||||
17
utils/libcxx/__init__.py
Normal file
17
utils/libcxx/__init__.py
Normal 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__ = []
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
diff - A set of functions for diff-ing two symbol lists.
|
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):
|
def _symbol_difference(lhs, rhs):
|
||||||
@@ -14,7 +14,7 @@ import distutils.spawn
|
|||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from sym_check import util
|
from libcxx.sym_check import util
|
||||||
|
|
||||||
extract_ignore_names = ['_init', '_fini']
|
extract_ignore_names = ['_init', '_fini']
|
||||||
|
|
||||||
@@ -152,9 +152,9 @@ def is_library_file(filename):
|
|||||||
|
|
||||||
|
|
||||||
def extract_or_load(filename):
|
def extract_or_load(filename):
|
||||||
import sym_check.extract
|
import libcxx.sym_check.extract
|
||||||
if is_library_file(filename):
|
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)
|
return read_syms_from_file(filename)
|
||||||
|
|
||||||
def adjust_mangled_name(name):
|
def adjust_mangled_name(name):
|
||||||
@@ -13,7 +13,7 @@ sym_diff - Compare two symbol lists and output the differences.
|
|||||||
|
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
import sys
|
import sys
|
||||||
from sym_check import diff, util
|
from libcxx.sym_check import diff, util
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
sym_extract - Extract and output a list of symbols from a shared library.
|
sym_extract - Extract and output a list of symbols from a shared library.
|
||||||
"""
|
"""
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from sym_check import extract, util
|
from libcxx.sym_check import extract, util
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@@ -13,7 +13,7 @@ sym_match - Match all symbols in a list against a list of regexes.
|
|||||||
"""
|
"""
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
import sys
|
import sys
|
||||||
from sym_check import util, match, extract
|
from libcxx.sym_check import util, match, extract
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
Reference in New Issue
Block a user