[Lldb-commits] [PATCH] D14415: [swig] Simplify check_lldb_swig_executable_file_exists.

2015-11-05 Thread Bruce Mitchener via lldb-commits
brucem created this revision.
brucem added reviewers: zturner, domipheus.
brucem added a subscriber: lldb-commits.

Remove per-platform variants of this in favor of just having
Windows and Unix. The code that was previously specific to
Linux can be further simplified and used on all non-Windows
platforms that are currently supported as build hosts.

This code only runs when --swigExecutable isn't given on the
command line. cmake always passes that in, so this is never
actually used in current practice.

http://reviews.llvm.org/D14415

Files:
  scripts/buildSwigWrapperClasses.py

Index: scripts/buildSwigWrapperClasses.py
===
--- scripts/buildSwigWrapperClasses.py
+++ scripts/buildSwigWrapperClasses.py
@@ -310,108 +310,49 @@
 return (nResult, strStatusMsg)
 
 #++---
-# Details:  Dummy function - system unknown. Function should not be called.
-# Args: vDictArgs   - (R) Program input parameters.
-# Returns:  Bool- False = Program logic error.
-#   Str - Error message.
-# Throws:   None.
-#--
-def check_lldb_swig_executable_file_exists_Unknown(vDictArgs):
-dbg = utilsDebug.CDebugFnVerbose("check_lldb_swig_executable_file_exists_Unknown()")
-# Do nothing
-return (False, strMsgErrorOsTypeUnknown)
-
-#++---
-# Details:  Locate the SWIG executable file in a Windows system. Several hard
-#   coded predetermined possible file path locations are searched.
-#   (This is good candidate for a derived class object)
+# Details:  Locate the SWIG executable file in a Windows system. This actually
+#   just assumes that it is on the path and performs no checks.
 # Args: vDictArgs   - (W) Program input parameters.
 # Returns:  Bool- True = Success.
 #   - False = Failure file not found.
 #   Str - Error message.
 # Throws:   None.
 #--
-def check_lldb_swig_executable_file_exists_Windows(vDictArgs):
-dbg = utilsDebug.CDebugFnVerbose("check_lldb_swig_executable_file_exists_Windows()")
+def check_lldb_swig_executable_file_exists_windows(vDictArgs):
+dbg = utilsDebug.CDebugFnVerbose("check_lldb_swig_executable_file_exists_windows()")
 
 # Will always be true as it assumed the path to SWIG executable will be
 # in the OS system environmental variable %PATH%. Easier this way as the
 # user may have renamed the directory and or custom path installation.
-bExeFileFound = True
 vDictArgs["--swigExePath"] = ""
 vDictArgs["--swigExeName"] = "swig.exe"
-return (bExeFileFound, None)
+return (True, None)
 
 #++---
-# Details:  Locate the SWIG executable file in a Linux system. Several hard
+# Details:  Locate the SWIG executable file in a Unix system. Several hard
 #   coded predetermined possible file path locations are searched.
 #   (This is good candidate for a derived class object)
 # Args: vDictArgs   - (W) Program input parameters.
 # Returns:  Bool- True = Success.
 #   - False = Failure file not found.
 #   Str - Error message.
 # Throws:   None.
 #--
-def check_lldb_swig_executable_file_exists_Linux(vDictArgs):
-dbg = utilsDebug.CDebugFnVerbose("check_lldb_swig_executable_file_exists_Linux()")
-bExeFileFound = False
-
-strSwigExe = "swig"
-strSwigExePath = "/usr/bin"
-strExe = os.path.normcase("%s/%s" % (strSwigExePath, strSwigExe))
-if os.path.isfile(strExe) and os.access(strExe, os.X_OK):
-bExeFileFound = True
-vDictArgs["--swigExePath"] = os.path.normcase(strSwigExePath)
-vDictArgs["--swigExeName"] = strSwigExe
-return (bExeFileFound, None)
-
-strSwigExePath = "/usr/local/bin"
-strExe = os.path.normcase("%s/%s" % (strSwigExePath, strSwigExe))
-if os.path.isfile(strExe) and os.access(strExe, os.X_OK):
-bExeFileFound = True
-vDictArgs["--swigExePath"] = os.path.normcase(strSwigExePath)
-vDictArgs["--swigExeName"] = strSwigExe
-return (bExeFileFound, None)
-
-return (bExeFileFound, strSwigExeFileNotFound)
-
-#++---
-# Details:  Locate the SWIG executable file in a OSX system. Several hard
-#   coded predetermined possible file path locations are searched.
-#   (This is good candidate for a derived class object)
-# Args: vDictArgs   - (W) Program input parameters.
-# Returns:  Bool- True = Success.
-#   - False = Failure file not found.
-#   Str - Error message.
-# Throws:   None.
-#--
-def check_lldb_swig_executable_file_exists_Darwin(vDictArgs):
-dbg = utilsDebug.CDebugFnVerbose("check_lldb_swig_executable_file_exists_Darwin()")
-bExeFileF

Re: [Lldb-commits] [PATCH] D14415: [swig] Simplify check_lldb_swig_executable_file_exists.

2015-11-06 Thread Zachary Turner via lldb-commits
zturner added a comment.

If it's never used in practice, can you just delete the codepath entirely?  I'm 
a strong proponent of deleting code that nobody cares about.  (Of course, if 
you found this because you do care about it and this codepath didn't work when 
you tried to use it, that's a different story)


http://reviews.llvm.org/D14415



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14415: [swig] Simplify check_lldb_swig_executable_file_exists.

2015-11-06 Thread Bruce Mitchener via lldb-commits
brucem added a comment.

Well, I'm pretty sure ... but I don't know if someone in some configuration or 
set of build arrangements might use it. It might also be used if we ever make 
the Makefiles or xcode projects use these scripts.


http://reviews.llvm.org/D14415



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14415: [swig] Simplify check_lldb_swig_executable_file_exists.

2015-11-06 Thread Zachary Turner via lldb-commits
zturner added a comment.

Eh, just delete it IMO.  I don't like leaving code around "just in case".  
These scripts already need to be practically re-written (due to not using the 
standard argparse module), the less work we have to do the better.  CMake is 
the only user of this script as far as I know.  If it breaks someone they'll 
chime in presumably


http://reviews.llvm.org/D14415



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14415: [swig] Simplify check_lldb_swig_executable_file_exists.

2015-11-06 Thread Bruce Mitchener via lldb-commits
brucem updated this revision to Diff 39558.
brucem added a comment.

Instead of simplifying, just remove. Expand scope of removal as well.


http://reviews.llvm.org/D14415

Files:
  scripts/Python/buildSwigPython.py
  scripts/buildSwigWrapperClasses.py

Index: scripts/buildSwigWrapperClasses.py
===
--- scripts/buildSwigWrapperClasses.py
+++ scripts/buildSwigWrapperClasses.py
@@ -80,7 +80,7 @@
 automatically. Python install directory.\n\
 --argsFile= The args are read from a file instead of the\n\
 command line. Other command line args are ignored.\n\
---swigExecutable=   (optional) Full path of swig executable.\n\
+--swigExecutable=   Full path of swig executable.\n\
 \n\
 Usage:\n\
 buildSwigWrapperClasses.py --srcRoot=ADirPath --targetDir=ADirPath\n\
@@ -310,137 +310,6 @@
 return (nResult, strStatusMsg)
 
 #++---
-# Details:  Dummy function - system unknown. Function should not be called.
-# Args: vDictArgs   - (R) Program input parameters.
-# Returns:  Bool- False = Program logic error.
-#   Str - Error message.
-# Throws:   None.
-#--
-def check_lldb_swig_executable_file_exists_Unknown(vDictArgs):
-dbg = utilsDebug.CDebugFnVerbose("check_lldb_swig_executable_file_exists_Unknown()")
-# Do nothing
-return (False, strMsgErrorOsTypeUnknown)
-
-#++---
-# Details:  Locate the SWIG executable file in a Windows system. Several hard
-#   coded predetermined possible file path locations are searched.
-#   (This is good candidate for a derived class object)
-# Args: vDictArgs   - (W) Program input parameters.
-# Returns:  Bool- True = Success.
-#   - False = Failure file not found.
-#   Str - Error message.
-# Throws:   None.
-#--
-def check_lldb_swig_executable_file_exists_Windows(vDictArgs):
-dbg = utilsDebug.CDebugFnVerbose("check_lldb_swig_executable_file_exists_Windows()")
-
-# Will always be true as it assumed the path to SWIG executable will be
-# in the OS system environmental variable %PATH%. Easier this way as the
-# user may have renamed the directory and or custom path installation.
-bExeFileFound = True
-vDictArgs["--swigExePath"] = ""
-vDictArgs["--swigExeName"] = "swig.exe"
-return (bExeFileFound, None)
-
-#++---
-# Details:  Locate the SWIG executable file in a Linux system. Several hard
-#   coded predetermined possible file path locations are searched.
-#   (This is good candidate for a derived class object)
-# Args: vDictArgs   - (W) Program input parameters.
-# Returns:  Bool- True = Success.
-#   - False = Failure file not found.
-#   Str - Error message.
-# Throws:   None.
-#--
-def check_lldb_swig_executable_file_exists_Linux(vDictArgs):
-dbg = utilsDebug.CDebugFnVerbose("check_lldb_swig_executable_file_exists_Linux()")
-bExeFileFound = False
-
-strSwigExe = "swig"
-strSwigExePath = "/usr/bin"
-strExe = os.path.normcase("%s/%s" % (strSwigExePath, strSwigExe))
-if os.path.isfile(strExe) and os.access(strExe, os.X_OK):
-bExeFileFound = True
-vDictArgs["--swigExePath"] = os.path.normcase(strSwigExePath)
-vDictArgs["--swigExeName"] = strSwigExe
-return (bExeFileFound, None)
-
-strSwigExePath = "/usr/local/bin"
-strExe = os.path.normcase("%s/%s" % (strSwigExePath, strSwigExe))
-if os.path.isfile(strExe) and os.access(strExe, os.X_OK):
-bExeFileFound = True
-vDictArgs["--swigExePath"] = os.path.normcase(strSwigExePath)
-vDictArgs["--swigExeName"] = strSwigExe
-return (bExeFileFound, None)
-
-return (bExeFileFound, strSwigExeFileNotFound)
-
-#++---
-# Details:  Locate the SWIG executable file in a OSX system. Several hard
-#   coded predetermined possible file path locations are searched.
-#   (This is good candidate for a derived class object)
-# Args: vDictArgs   - (W) Program input parameters.
-# Returns:  Bool- True = Success.
-#   - False = Failure file not found.
-#   Str - Error message.
-# Throws:   None.
-#--
-def check_lldb_swig_executable_file_exists_Darwin(vDictArgs):
-dbg = utilsDebug.CDebugFnVerbose("check_lldb_swig_executable_file_exists_Darwin()")
-bExeFileFound = False
-# ToDo: Find the SWIG executable and add the path to the args dictionary
-#vDictArgs.["--swigExePath"] = "/usr/bin/swig"
-strStatusMsg = "Sorry function 'check_lldb_swig_executable_file_exists_Darwin()' is not implemented"
-
-return (bExeFileFound, strStatusMsg)
-
-#++-

Re: [Lldb-commits] [PATCH] D14415: [swig] Simplify check_lldb_swig_executable_file_exists.

2015-11-06 Thread Bruce Mitchener via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL252330: [swig] Remove 
check_lldb_swig_executable_file_exists. (authored by brucem).

Changed prior to commit:
  http://reviews.llvm.org/D14415?vs=39558&id=39562#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D14415

Files:
  lldb/trunk/scripts/Python/buildSwigPython.py
  lldb/trunk/scripts/buildSwigWrapperClasses.py

Index: lldb/trunk/scripts/buildSwigWrapperClasses.py
===
--- lldb/trunk/scripts/buildSwigWrapperClasses.py
+++ lldb/trunk/scripts/buildSwigWrapperClasses.py
@@ -80,7 +80,7 @@
 automatically. Python install directory.\n\
 --argsFile= The args are read from a file instead of the\n\
 command line. Other command line args are ignored.\n\
---swigExecutable=   (optional) Full path of swig executable.\n\
+--swigExecutable=   Full path of swig executable.\n\
 \n\
 Usage:\n\
 buildSwigWrapperClasses.py --srcRoot=ADirPath --targetDir=ADirPath\n\
@@ -310,137 +310,6 @@
 return (nResult, strStatusMsg)
 
 #++---
-# Details:  Dummy function - system unknown. Function should not be called.
-# Args: vDictArgs   - (R) Program input parameters.
-# Returns:  Bool- False = Program logic error.
-#   Str - Error message.
-# Throws:   None.
-#--
-def check_lldb_swig_executable_file_exists_Unknown(vDictArgs):
-dbg = utilsDebug.CDebugFnVerbose("check_lldb_swig_executable_file_exists_Unknown()")
-# Do nothing
-return (False, strMsgErrorOsTypeUnknown)
-
-#++---
-# Details:  Locate the SWIG executable file in a Windows system. Several hard
-#   coded predetermined possible file path locations are searched.
-#   (This is good candidate for a derived class object)
-# Args: vDictArgs   - (W) Program input parameters.
-# Returns:  Bool- True = Success.
-#   - False = Failure file not found.
-#   Str - Error message.
-# Throws:   None.
-#--
-def check_lldb_swig_executable_file_exists_Windows(vDictArgs):
-dbg = utilsDebug.CDebugFnVerbose("check_lldb_swig_executable_file_exists_Windows()")
-
-# Will always be true as it assumed the path to SWIG executable will be
-# in the OS system environmental variable %PATH%. Easier this way as the
-# user may have renamed the directory and or custom path installation.
-bExeFileFound = True
-vDictArgs["--swigExePath"] = ""
-vDictArgs["--swigExeName"] = "swig.exe"
-return (bExeFileFound, None)
-
-#++---
-# Details:  Locate the SWIG executable file in a Linux system. Several hard
-#   coded predetermined possible file path locations are searched.
-#   (This is good candidate for a derived class object)
-# Args: vDictArgs   - (W) Program input parameters.
-# Returns:  Bool- True = Success.
-#   - False = Failure file not found.
-#   Str - Error message.
-# Throws:   None.
-#--
-def check_lldb_swig_executable_file_exists_Linux(vDictArgs):
-dbg = utilsDebug.CDebugFnVerbose("check_lldb_swig_executable_file_exists_Linux()")
-bExeFileFound = False
-
-strSwigExe = "swig"
-strSwigExePath = "/usr/bin"
-strExe = os.path.normcase("%s/%s" % (strSwigExePath, strSwigExe))
-if os.path.isfile(strExe) and os.access(strExe, os.X_OK):
-bExeFileFound = True
-vDictArgs["--swigExePath"] = os.path.normcase(strSwigExePath)
-vDictArgs["--swigExeName"] = strSwigExe
-return (bExeFileFound, None)
-
-strSwigExePath = "/usr/local/bin"
-strExe = os.path.normcase("%s/%s" % (strSwigExePath, strSwigExe))
-if os.path.isfile(strExe) and os.access(strExe, os.X_OK):
-bExeFileFound = True
-vDictArgs["--swigExePath"] = os.path.normcase(strSwigExePath)
-vDictArgs["--swigExeName"] = strSwigExe
-return (bExeFileFound, None)
-
-return (bExeFileFound, strSwigExeFileNotFound)
-
-#++---
-# Details:  Locate the SWIG executable file in a OSX system. Several hard
-#   coded predetermined possible file path locations are searched.
-#   (This is good candidate for a derived class object)
-# Args: vDictArgs   - (W) Program input parameters.
-# Returns:  Bool- True = Success.
-#   - False = Failure file not found.
-#   Str - Error message.
-# Throws:   None.
-#--
-def check_lldb_swig_executable_file_exists_Darwin(vDictArgs):
-dbg = utilsDebug.CDebugFnVerbose("check_lldb_swig_executable_file_exists_Darwin()")
-bExeFileFound = False
-# ToDo: Find the SWIG executable and add the path to the args dictionary
-#vDictArgs.["--swigExeP