This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Allow specifying conditional compile flags dependent on basic Lit features
ClosedPublic

Authored by ldionne on Aug 24 2022, 10:30 AM.

Details

Summary

This patch adds support for passing basic Lit features to the
ADDITIONAL_COMPILE_FLAGS keyword by enclosing them in parentheses.
This is done to support https://llvm.org/D131836.

In the future, we should instead add proper support for conditional
keywords in Lit, so that we can evaluate arbitrary Lit boolean
expressions such as ADDITIONAL_COMPILE_FLAGS(x && !y): -flag.

Note that I can see this being exceptionally useful when combined
with RUN commands, which would allow using different commands on
different systems. For example:

RUN(!buildhost=windows): something
RUN(buildhost=windows): something-else

Diff Detail

Event Timeline

ldionne created this revision.Aug 24 2022, 10:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2022, 10:30 AM
Herald added a subscriber: arichardson. · View Herald Transcript
ldionne requested review of this revision.Aug 24 2022, 10:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2022, 10:30 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Mordante accepted this revision.Aug 24 2022, 10:54 AM

Thanks for the quick patch! LGTM!

This revision is now accepted and ready to land.Aug 24 2022, 10:54 AM
ldionne updated this revision to Diff 455554.Aug 25 2022, 5:55 AM

Try to fix CI on AIX.