[PATCH] D11730: Improve lit "native" feature to check if the native backend is builtin

Justin Bogner mail at justinbogner.com
Mon Aug 3 23:45:44 PDT 2015


Mehdi Amini <mehdi.amini at apple.com> writes:

>> On Aug 3, 2015, at 10:42 PM, Justin Bogner <mail at justinbogner.com> wrote:
>> 
>> 
>> Mehdi AMINI <mehdi.amini at apple.com> writes:
>>> joker.eph created this revision.
>>> joker.eph added a subscriber: llvm-commits.
>>> 
>>> The goal is to have 'ninja check' passing even if the X86 backend is
>>> not built.
>> 
>> LGTM. Minor comment below.
>> 
>>> http://reviews.llvm.org/D11730
>>> 
>>> Files:
>>>  test/lit.cfg
>>>  test/lit.site.cfg.in
>>> 
>>> Index: test/lit.site.cfg.in
>>> ===================================================================
>>> --- test/lit.site.cfg.in
>>> +++ test/lit.site.cfg.in
>>> @@ -23,6 +23,7 @@
>>> config.enable_shared = @ENABLE_SHARED@
>>> config.enable_assertions = @ENABLE_ASSERTIONS@
>>> config.targets_to_build = "@TARGETS_TO_BUILD@"
>>> +config.native_target = "@LLVM_NATIVE_ARCH@"
>>> config.llvm_bindings = "@LLVM_BINDINGS@".split(' ')
>>> config.host_os = "@HOST_OS@"
>>> config.host_arch = "@HOST_ARCH@"
>>> Index: test/lit.cfg
>>> ===================================================================
>>> --- test/lit.cfg
>>> +++ test/lit.cfg
>>> @@ -333,10 +333,11 @@
>>> else:
>>>     config.available_features.add("nozlib")
>>> 
>>> -# Native compilation: host arch == target arch
>>> +# Native compilation: host arch == target arch and native backend built-in
>>> # FIXME: Consider cases that target can be executed
>>> # even if host_triple were different from target_triple.
>>> -if config.host_triple == config.target_triple:
>>> +if config.host_triple == config.target_triple and \
>>> +   config.native_target in config.targets_to_build:
>> 
>> I'd wrap the condition in parens rather than use a line continuation. No
>> strong opinion though, either's fine.
>
> I usually use a line continuation to keep my python pep8 compliant,
> but llvm does not seem to care, so I guess I can change it here.

FTR, PEP8 agrees with me here on preferring extraneous parens to a line
continuation character.

Quoth PEP8:
> The preferred way of wrapping long lines is by using Python's implied
> line continuation inside parentheses, brackets and braces. Long lines
> can be broken over multiple lines by wrapping expressions in
> parentheses. These should be used in preference to using a backslash for
> line continuation.



More information about the llvm-commits mailing list