def setUp(self):
     self.encoder = json_serialization.create_encoder()
     self.decoder = json_serialization.create_decoder()
     json_serialization.DataContainerObjectRenderer.set_safe_constructors(
         data_container.DataContainer,
         self.MockSubclass,
         self.MockEnum,
     )
 def setUp(self):
   self.encoder = json_serialization.create_encoder()
   self.decoder = json_serialization.create_decoder()
   json_serialization.DataContainerObjectRenderer.set_safe_constructors(
       data_container.DataContainer,
       self.MockSubclass,
       self.MockEnum,
   )
Пример #3
0
def _build_pre_ast(args):
    result_paths = _get_result_paths(args.results_directory_path)
    include_directories = _get_include_directories(args.linux_repository_path)

    encoder = json_serialization.create_encoder()
    _set_safe_constructors_for_pre_ast_json_serialization()

    # From source to Pre-AST.
    _parse_encode_and_dump_pre_ast(
        args.source_file_path,
        include_directories,
        result_paths,
        encoder,
    )
Пример #4
0
def _build_pre_ast(args):
  result_paths = _get_result_paths(args.results_directory_path)
  include_directories = _get_include_directories(args.linux_repository_path)

  encoder = json_serialization.create_encoder()
  _set_safe_constructors_for_pre_ast_json_serialization()

  # From source to Pre-AST.
  _parse_encode_and_dump_pre_ast(
      args.source_file_path,
      include_directories,
      result_paths,
      encoder,
  )
Пример #5
0
def _make_profile(args):
    """A procedure that loads Pre-AST, computes a profile and stores it."""
    result_paths = _get_result_paths(args.results_directory_path)
    encoder = json_serialization.create_encoder()
    decoder = json_serialization.create_decoder()
    _set_safe_constructors_for_pre_ast_json_serialization()

    # From Pre-AST to preprocessed Pre-AST.
    _load_preprocess_and_dump_preprocessed_pre_ast(
        args.source_file_path,
        args.config_file_path,
        result_paths,
        encoder,
        decoder,
    )

    # From preprocessed Pre-AST to preprocessed source.
    _load_preprocessed_pre_ast_and_write_preprocessed_source_file(
        result_paths,
        decoder,
    )

    # From preprocessed source to AST.
    _parse_encode_and_dump_ast(
        result_paths,
        encoder,
    )

    # From AST to profile
    _set_safe_constructors_for_ast_json_serialization()
    _load_ast_compute_and_dump_profile(
        result_paths,
        args.config_file_path,
        args.system_map_file_path,
        args.layouts_to_compute,
        decoder,
    )
Пример #6
0
def _make_profile(args):
  """A procedure that loads Pre-AST, computes a profile and stores it."""
  result_paths = _get_result_paths(args.results_directory_path)
  encoder = json_serialization.create_encoder()
  decoder = json_serialization.create_decoder()
  _set_safe_constructors_for_pre_ast_json_serialization()

  # From Pre-AST to preprocessed Pre-AST.
  _load_preprocess_and_dump_preprocessed_pre_ast(
      args.source_file_path,
      args.config_file_path,
      result_paths,
      encoder,
      decoder,
  )

  # From preprocessed Pre-AST to preprocessed source.
  _load_preprocessed_pre_ast_and_write_preprocessed_source_file(
      result_paths,
      decoder,
  )

  # From preprocessed source to AST.
  _parse_encode_and_dump_ast(
      result_paths,
      encoder,
  )

  # From AST to profile
  _set_safe_constructors_for_ast_json_serialization()
  _load_ast_compute_and_dump_profile(
      result_paths,
      args.config_file_path,
      args.system_map_file_path,
      args.layouts_to_compute,
      decoder,
  )