From b9c1b51e45b845debb76d8658edabca70ca56079 Mon Sep 17 00:00:00 2001 From: Kate Stone Date: Tue, 6 Sep 2016 20:57:50 +0000 Subject: *** This commit represents a complete reformatting of the LLDB source code *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751 --- .../Python/lldbsuite/test/plugins/builder_base.py | 69 +++++++++++++++++----- 1 file changed, 54 insertions(+), 15 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/plugins/builder_base.py') diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py index a467a458d5d..bd6656bd5e8 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py @@ -23,36 +23,41 @@ import lldbsuite.test.lldbtest as lldbtest import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test_event import build_exception + def getArchitecture(): """Returns the architecture in effect the test suite is running with.""" return os.environ["ARCH"] if "ARCH" in os.environ else "" + def getCompiler(): """Returns the compiler in effect the test suite is running with.""" compiler = os.environ.get("CC", "clang") compiler = lldbutil.which(compiler) return os.path.realpath(compiler) + def getArchFlag(): """Returns the flag required to specify the arch""" compiler = getCompiler() if compiler is None: - return "" + return "" elif "gcc" in compiler: - archflag = "-m" + archflag = "-m" elif "clang" in compiler: - archflag = "-arch" + archflag = "-arch" else: - archflag = None + archflag = None return ("ARCHFLAG=" + archflag) if archflag else "" + def getMake(): """Returns the name for GNU make""" if platform.system() == "FreeBSD" or platform.system() == "NetBSD": - return "gmake" + return "gmake" else: - return "make" + return "make" + def getArchSpec(architecture): """ @@ -65,6 +70,7 @@ def getArchSpec(architecture): return ("ARCH=" + arch) if arch else "" + def getCCSpec(compiler): """ Helper function to return the key-value string to specify the compiler @@ -78,6 +84,7 @@ def getCCSpec(compiler): else: return "" + def getCmdLine(d): """ Helper function to return a properly formatted command line argument(s) @@ -109,55 +116,87 @@ def runBuildCommands(commands, sender): raise build_exception.BuildError(called_process_error) -def buildDefault(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): +def buildDefault( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): """Build the binaries the default way.""" commands = [] if clean: commands.append([getMake(), "clean", getCmdLine(dictionary)]) - commands.append([getMake(), getArchSpec(architecture), getCCSpec(compiler), getCmdLine(dictionary)]) + commands.append([getMake(), getArchSpec(architecture), + getCCSpec(compiler), getCmdLine(dictionary)]) runBuildCommands(commands, sender=sender) # True signifies that we can handle building default. return True -def buildDwarf(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDwarf( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): """Build the binaries with dwarf debug info.""" commands = [] if clean: commands.append([getMake(), "clean", getCmdLine(dictionary)]) - commands.append([getMake(), "MAKE_DSYM=NO", getArchSpec(architecture), getCCSpec(compiler), getCmdLine(dictionary)]) + commands.append([getMake(), "MAKE_DSYM=NO", getArchSpec( + architecture), getCCSpec(compiler), getCmdLine(dictionary)]) runBuildCommands(commands, sender=sender) # True signifies that we can handle building dwarf. return True -def buildDwo(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDwo( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): """Build the binaries with dwarf debug info.""" commands = [] if clean: commands.append([getMake(), "clean", getCmdLine(dictionary)]) - commands.append([getMake(), "MAKE_DSYM=NO", "MAKE_DWO=YES", getArchSpec(architecture), getCCSpec(compiler), getCmdLine(dictionary)]) + commands.append([getMake(), "MAKE_DSYM=NO", "MAKE_DWO=YES", getArchSpec( + architecture), getCCSpec(compiler), getCmdLine(dictionary)]) runBuildCommands(commands, sender=sender) # True signifies that we can handle building dwo. return True -def buildGModules(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildGModules( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): """Build the binaries with dwarf debug info.""" commands = [] if clean: commands.append([getMake(), "clean", getCmdLine(dictionary)]) - commands.append([getMake(), "MAKE_DSYM=NO", "MAKE_GMODULES=YES", getArchSpec(architecture), getCCSpec(compiler), getCmdLine(dictionary)]) + commands.append([getMake(), + "MAKE_DSYM=NO", + "MAKE_GMODULES=YES", + getArchSpec(architecture), + getCCSpec(compiler), + getCmdLine(dictionary)]) lldbtest.system(commands, sender=sender) # True signifies that we can handle building with gmodules. return True + def cleanup(sender=None, dictionary=None): """Perform a platform-specific cleanup after the test.""" #import traceback - #traceback.print_stack() + # traceback.print_stack() commands = [] if os.path.isfile("Makefile"): commands.append([getMake(), "clean", getCmdLine(dictionary)]) -- cgit v1.2.3