[Lldb-commits] [lldb] r254078 - Be *stupider* about what constitutes a supported language binding.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 25 09:49:48 PST 2015


Author: zturner
Date: Wed Nov 25 11:49:47 2015
New Revision: 254078

URL: http://llvm.org/viewvc/llvm-project?rev=254078&view=rev
Log:
Be *stupider* about what constitutes a supported language binding.

We were trying to be super smart and find all the supported language
bindings.  This led to us scanning the directory and treating all
subdirectories as language binding directories.  This makes it
hard to add unrelated code in this folder.

Besides, we only support one at the moment - Python.  And when new
ones are added it will be trivial to just add their names to a list.

So this patch gets stupider about how to look for language binding
subfolders.  Just put them in a list, and use the list.

Modified:
    lldb/trunk/scripts/finishSwigWrapperClasses.py
    lldb/trunk/scripts/prepare_bindings.py

Modified: lldb/trunk/scripts/finishSwigWrapperClasses.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/finishSwigWrapperClasses.py?rev=254078&r1=254077&r2=254078&view=diff
==============================================================================
--- lldb/trunk/scripts/finishSwigWrapperClasses.py (original)
+++ lldb/trunk/scripts/finishSwigWrapperClasses.py Wed Nov 25 11:49:47 2015
@@ -253,24 +253,7 @@ def run_post_process_for_each_script_sup
         return (-8, strScriptDirNotFound)
 
     # Look for any script language directories to build for
-    listDirs = []
-    nDepth = 1
-    for strPath, listDirs, listFiles in os.walk(strScriptDir):
-        nDepth = nDepth - 1
-        if nDepth == 0:
-            break
-
-    # Skip the directory that contains the interface files.
-    listDirs.remove('interface')
-    # and the svn directory.
-    if '.svn' in listDirs:
-        listDirs.remove('.svn')
-
-    if gbDbgFlag:
-        sys.stdout.write(strScriptLangsFound)
-        for dir in listDirs:
-            sys.stdout.write(dir)
-        print("\n")
+    listDirs = ["Python"]
 
     # Iterate script directory find any script language directories
     for scriptLang in listDirs:

Modified: lldb/trunk/scripts/prepare_bindings.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/prepare_bindings.py?rev=254078&r1=254077&r2=254078&view=diff
==============================================================================
--- lldb/trunk/scripts/prepare_bindings.py (original)
+++ lldb/trunk/scripts/prepare_bindings.py Wed Nov 25 11:49:47 2015
@@ -71,17 +71,7 @@ def prepare_all_bindings(options):
         logging.error("failed to find scripts dir: '%s'", scripts_dir)
         sys.exit(-8)
 
-    # Collect list of child directories.  We expect there to be one
-    # for each supported script language.
-    child_dirs = [f for f in os.listdir(scripts_dir)
-                  if os.path.isdir(os.path.join(scripts_dir, f))]
-
-    # Remove directories that do not represent script languages.
-    for removal_dir in [".svn", "interface", "__pycache__", "sphinx", "swig_bot_lib"]:
-        if removal_dir in child_dirs:
-            child_dirs.remove(removal_dir)
-
-    logging.info("found script directories: %s", child_dirs)
+    child_dirs = ["Python"]
 
     # Iterate script directory find any script language directories
     for script_lang in child_dirs:




More information about the lldb-commits mailing list