[libcxx-commits] [PATCH] D84055: [libcxx][lit] Cache the value of the feature lambda

Alexander Richardson via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 17 10:40:38 PDT 2020


arichardson created this revision.
arichardson added reviewers: libc++, ldionne.
Herald added subscribers: libcxx-commits, dexonsmith.
Herald added a project: libc++.
Herald added 1 blocking reviewer(s): libc++.

This avoids running configuration tests multiple times. I discovered this
using the collect binaries executor (D84045 <https://reviews.llvm.org/D84045>) since the output directory
contained two folders for each locale check:

Before:
check_locale_cs_CZ.ISO8859-22l9izs95.cpp.dir
check_locale_cs_CZ.ISO8859-2kai5chqg.cpp.dir
check_locale_en_US.UTF-8av355dei.cpp.dir
check_locale_en_US.UTF-8bh_vxteu.cpp.dir
check_locale_fr_CA.ISO8859-16iqfdts7.cpp.dir
check_locale_fr_CA.ISO8859-1jytt_wqw.cpp.dir
check_locale_fr_FR.UTF-8jxintigp.cpp.dir
check_locale_fr_FR.UTF-8lp3_p554.cpp.dir
check_locale_ru_RU.UTF-84wd2uc3q.cpp.dir
check_locale_ru_RU.UTF-8pjuyogc7.cpp.dir
check_locale_zh_CN.UTF-8eekw_qhg.cpp.dir
check_locale_zh_CN.UTF-8zfw71vzu.cpp.dir

After:
check_locale_cs_CZ.ISO8859-2ldoy7luu.cpp.dir
check_locale_en_US.UTF-824v0soux.cpp.dir
check_locale_fr_CA.ISO8859-18nhriebb.cpp.dir
check_locale_fr_FR.UTF-82nn3grpg.cpp.dir
check_locale_ru_RU.UTF-8k4aduyv1.cpp.dir
check_locale_zh_CN.UTF-8pr4ax8yr.cpp.dir

This should speed up running individual tests using an SSH executor (it can
take up to 10 seconds to compile and run a single test in some emulated
environments).
ideally we would only


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84055

Files:
  libcxx/utils/libcxx/test/dsl.py


Index: libcxx/utils/libcxx/test/dsl.py
===================================================================
--- libcxx/utils/libcxx/test/dsl.py
+++ libcxx/utils/libcxx/test/dsl.py
@@ -222,12 +222,16 @@
     self._compileFlag = compileFlag
     self._linkFlag = linkFlag
     self._isSupported = when
+    self.__cachedIsSupported = None
 
   def isSupported(self, config):
     """
     Return whether the feature is supported by the given TestingConfig.
     """
-    return self._isSupported(config)
+    if self.__cachedIsSupported is None:
+      self.__cachedIsSupported = self._isSupported(config)
+      assert self.__cachedIsSupported is not None, "Should return True or False"
+    return self.__cachedIsSupported
 
   def enableIn(self, config):
     """


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84055.278846.patch
Type: text/x-patch
Size: 764 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200717/391685a7/attachment.bin>


More information about the libcxx-commits mailing list