
from . import product


class Swift(product.Product):

    def __init__(self, args, toolchain, source_dir, build_dir):
        product.Product.__init__(self, args, toolchain, source_dir,
                                 build_dir)
        # Add any runtime sanitizer arguments.
        self.cmake_options.extend(self._compute_runtime_use_sanitizer())

    def _compute_runtime_use_sanitizer(self):
        sanitizer_list = []
        if self.args.enable_tsan_runtime:
            sanitizer_list += ['Thread']
        if len(sanitizer_list) == 0:
            return []
        return ["-DSWIFT_RUNTIME_USE_SANITIZERS=%s" %
                ";".join(sanitizer_list)]


from . import product


class Swift(product.Product):

    def __init__(self, args, toolchain, source_dir, build_dir):
        product.Product.__init__(self, args, toolchain, source_dir,
                                 build_dir)
        # Add any runtime sanitizer arguments.
        self.cmake_options.extend(self._runtime_sanitizer_flags)

    @property
    def _runtime_sanitizer_flags(self):
        sanitizer_list = []
        if self.args.enable_tsan_runtime:
            sanitizer_list += ['Thread']
        if len(sanitizer_list) == 0:
            return []
        return ["-DSWIFT_RUNTIME_USE_SANITIZERS=%s" %
                ";".join(sanitizer_list)]

Change method _compute_runtime_use_sanitizer => property _runtime_sanitizer_flags. NFC.
[vacation-gardening] Change method _compute_runtime_use_sanitizer => property _runtime_sanitizer_flags. NFC.

  
  from . import product
  
  
  class Swift(product.Product):
  
      def __init__(self, args, toolchain, source_dir, build_dir):
          product.Product.__init__(self, args, toolchain, source_dir,
                                   build_dir)
          # Add any runtime sanitizer arguments.
-         self.cmake_options.extend(self._compute_runtime_use_sanitizer())
+         self.cmake_options.extend(self._runtime_sanitizer_flags)
  
+     @property
-     def _compute_runtime_use_sanitizer(self):
+     def _runtime_sanitizer_flags(self):
          sanitizer_list = []
          if self.args.enable_tsan_runtime:
              sanitizer_list += ['Thread']
          if len(sanitizer_list) == 0:
              return []
          return ["-DSWIFT_RUNTIME_USE_SANITIZERS=%s" %
                  ";".join(sanitizer_list)]
  
Change method _compute_runtime_use_sanitizer => property _runtime_sanitizer_flags. NFC.
## Code Before:

from . import product


class Swift(product.Product):

    def __init__(self, args, toolchain, source_dir, build_dir):
        product.Product.__init__(self, args, toolchain, source_dir,
                                 build_dir)
        # Add any runtime sanitizer arguments.
        self.cmake_options.extend(self._compute_runtime_use_sanitizer())

    def _compute_runtime_use_sanitizer(self):
        sanitizer_list = []
        if self.args.enable_tsan_runtime:
            sanitizer_list += ['Thread']
        if len(sanitizer_list) == 0:
            return []
        return ["-DSWIFT_RUNTIME_USE_SANITIZERS=%s" %
                ";".join(sanitizer_list)]

## Instruction:
Change method _compute_runtime_use_sanitizer => property _runtime_sanitizer_flags. NFC.
## Code After:

from . import product


class Swift(product.Product):

    def __init__(self, args, toolchain, source_dir, build_dir):
        product.Product.__init__(self, args, toolchain, source_dir,
                                 build_dir)
        # Add any runtime sanitizer arguments.
        self.cmake_options.extend(self._runtime_sanitizer_flags)

    @property
    def _runtime_sanitizer_flags(self):
        sanitizer_list = []
        if self.args.enable_tsan_runtime:
            sanitizer_list += ['Thread']
        if len(sanitizer_list) == 0:
            return []
        return ["-DSWIFT_RUNTIME_USE_SANITIZERS=%s" %
                ";".join(sanitizer_list)]
