From b9c1b51e45b845debb76d8658edabca70ca56079 Mon Sep 17 00:00:00 2001 From: Kate Stone Date: Tue, 6 Sep 2016 20:57:50 +0000 Subject: =?UTF-8?q?***=20This=20commit=20represents=20a=20complete=20refor?= =?UTF-8?q?matting=20of=20the=20LLDB=20source=20code=20***=20to=20conform?= =?UTF-8?q?=20to=20clang-format=E2=80=99s=20LLVM=20style.=20=20This=20kind?= =?UTF-8?q?=20of=20mass=20change=20has=20***=20two=20obvious=20implication?= =?UTF-8?q?s:?= 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 +++++++++++++++++----- .../lldbsuite/test/plugins/builder_darwin.py | 11 +++- .../lldbsuite/test/plugins/builder_freebsd.py | 8 ++- .../Python/lldbsuite/test/plugins/builder_linux.py | 8 ++- .../lldbsuite/test/plugins/builder_netbsd.py | 8 ++- .../Python/lldbsuite/test/plugins/builder_win32.py | 8 ++- 6 files changed, 91 insertions(+), 21 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/plugins') diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_base.py index a467a45..bd6656b 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)]) diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py index 8a907cc..06a2a86 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_darwin.py @@ -5,13 +5,20 @@ import lldbsuite.test.lldbtest as lldbtest from builder_base import * -def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDsym( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): """Build the binaries with dsym debug info.""" commands = [] if clean: commands.append(["make", "clean", getCmdLine(dictionary)]) - commands.append(["make", "MAKE_DSYM=YES", getArchSpec(architecture), getCCSpec(compiler), getCmdLine(dictionary)]) + commands.append(["make", "MAKE_DSYM=YES", getArchSpec( + architecture), getCCSpec(compiler), getCmdLine(dictionary)]) runBuildCommands(commands, sender=sender) diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_freebsd.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_freebsd.py index e56be42..d9e654d 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_freebsd.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_freebsd.py @@ -1,4 +1,10 @@ from builder_base import * -def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDsym( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): return False diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_linux.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_linux.py index e56be42..d9e654d 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_linux.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_linux.py @@ -1,4 +1,10 @@ from builder_base import * -def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDsym( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): return False diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_netbsd.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_netbsd.py index e56be42..d9e654d 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_netbsd.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_netbsd.py @@ -1,4 +1,10 @@ from builder_base import * -def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDsym( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): return False diff --git a/lldb/packages/Python/lldbsuite/test/plugins/builder_win32.py b/lldb/packages/Python/lldbsuite/test/plugins/builder_win32.py index e56be42..d9e654d 100644 --- a/lldb/packages/Python/lldbsuite/test/plugins/builder_win32.py +++ b/lldb/packages/Python/lldbsuite/test/plugins/builder_win32.py @@ -1,4 +1,10 @@ from builder_base import * -def buildDsym(sender=None, architecture=None, compiler=None, dictionary=None, clean=True): + +def buildDsym( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + clean=True): return False -- cgit v1.1