[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:55:27 PDT 2020


arichardson updated this revision to Diff 278849.
arichardson added a comment.

Naive workaround for different configs.

I am not sure if this is sufficient but it works for my standalone libunwind+libcxx testing


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84055/new/

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,18 @@
     self._compileFlag = compileFlag
     self._linkFlag = linkFlag
     self._isSupported = when
+    self.__cachedIsSupported = {}
 
   def isSupported(self, config):
     """
     Return whether the feature is supported by the given TestingConfig.
     """
-    return self._isSupported(config)
+    result = self.__cachedIsSupported.get(config, None)
+    if result is None:
+      result = self._isSupported(config)
+      assert result is not None, "Should return True or False"
+      self.__cachedIsSupported[config] = result
+    return result
 
   def enableIn(self, config):
     """


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


More information about the libcxx-commits mailing list