[zorg] r261378 - Commit based on http://reviews.llvm.org/D17351. Patch by Mike Edwards.
Sean Silva via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 19 16:21:55 PST 2016
On Fri, Feb 19, 2016 at 3:44 PM, Galina Kistanova via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: gkistanova
> Date: Fri Feb 19 17:44:19 2016
> New Revision: 261378
>
> URL: http://llvm.org/viewvc/llvm-project?rev=261378&view=rev
> Log:
> Commit based on http://reviews.llvm.org/D17351. Patch by Mike Edwards.
>
> Modified:
> zorg/trunk/zorg/buildbot/builders/ClangAndLLDBuilder.py
>
> Modified: zorg/trunk/zorg/buildbot/builders/ClangAndLLDBuilder.py
> URL:
> http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/ClangAndLLDBuilder.py?rev=261378&r1=261377&r2=261378&view=diff
>
> ==============================================================================
> --- zorg/trunk/zorg/buildbot/builders/ClangAndLLDBuilder.py (original)
> +++ zorg/trunk/zorg/buildbot/builders/ClangAndLLDBuilder.py Fri Feb 19
> 17:44:19 2016
> @@ -13,12 +13,13 @@ def getClangAndLLDBuildFactory(
> clean=True,
> env=None,
> withLLD=True,
> - extraCmakeOptions=None,
> + extraCmakeOptions=[],
> extraCompilerOptions=None,
> buildWithSanitizerOptions=None,
> triple=None,
> isMSVC=False,
> - prefixCommand=["nice", "-n", "10"] # For backward
> compatibility.
> + prefixCommand=["nice", "-n", "10"], # For backward
> compatibility.
> + extraLitArgs=None
> ):
>
> llvm_srcdir = "llvm.src"
> @@ -100,44 +101,39 @@ def getClangAndLLDBuildFactory(
> if isMSVC:
> options = []
> if extraCompilerOptions:
> + assert not any(a.startswith('-DLLVM_LIT_ARGS=') for a in
> extraCmakeOptions), "Please use extraLitArgs for LIT arguments instead of
> defining them in extraCmakeOptions."
>
This assertion looks misplaced; it seems like it should be under `if
extraCmakeOptions:` below. While you are at it, can you change
extraCmakeOptions back to defaulting to None and use a more robust `if
extraCmakeOptions is not None:` which is good practice in python? (using
mutable lists as default arguments in Python is considered bad practice
since they behave unexpectedly)
-- Sean Silva
> options += extraCompilerOptions
>
> if buildWithSanitizerOptions:
> options += buildWithSanitizerOptions
>
> - # FIXME: This is a temporary workaround till all the slaves will
> - # be configured to have C_COMPILER and CXX_COMPILER set locally.
> - # Will be rolled back later.
> - # cmakeCommand = [
> - # "cmake",
> - # "-DCMAKE_BUILD_TYPE=Release",
> - # "-DLLVM_ENABLE_ASSERTIONS=ON",
> - # "-DCMAKE_CXX_FLAGS=\"%s\"" % (" ".join(options)),
> - # "-DLLVM_LIT_ARGS=\"-v\"",
> - # "-G", "Ninja",
> - # "../%s" % llvm_srcdir]
> + lit_args = ["-v"]
> + if extraLitArgs:
> + lit_args += extraLitArgs
> + lit_args_str = "-DLLVM_LIT_ARGS=\"%s\"" % (" ".join(lit_args))
>
> cmakeCommand = [
> "cmake",
> "-DCMAKE_BUILD_TYPE=Release",
> - "-DLLVM_ENABLE_ASSERTIONS=ON"]
> + "-DLLVM_ENABLE_ASSERTIONS=ON"
> + ]
> if buildWithSanitizerOptions:
> cmakeCommand += [
> "-DCMAKE_C_COMPILER=clang",
> - "-DCMAKE_CXX_COMPILER=clang++"]
> + "-DCMAKE_CXX_COMPILER=clang++"
> + ]
> if triple:
> cmakeCommand += [
> - "-DLLVM_DEFAULT_TARGET_TRIPLE=%s" % triple]
> -
> + "-DLLVM_DEFAULT_TARGET_TRIPLE=%s" % triple
> + ]
> if extraCmakeOptions:
> cmakeCommand += extraCmakeOptions
> -
> if not isMSVC:
> cmakeCommand += [
> "-DCMAKE_C_FLAGS=\"%s\"" % (" ".join(options)),
> "-DCMAKE_CXX_FLAGS=\"-std=c++11 %s\"" % (" ".join(options)),
> - "-DLLVM_LIT_ARGS=\"-v\"",
> ]
> + cmakeCommand += lit_args_str
> cmakeCommand += [
> "-G", "Ninja",
> "../%s" % llvm_srcdir
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160219/2f7d8bb6/attachment.html>
More information about the llvm-commits
mailing list