SynthTraceParser.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #ifndef HERMES_SYNTHTRACEPARSER_H
  8. #define HERMES_SYNTHTRACEPARSER_H
  9. #ifdef HERMESVM_API_TRACE
  10. #include <tuple>
  11. #include "hermes/Public/RuntimeConfig.h"
  12. #include "hermes/SynthTrace.h"
  13. #include "hermes/VM/MockedEnvironment.h"
  14. namespace facebook {
  15. namespace hermes {
  16. namespace tracing {
  17. /// Parse a trace from a JSON string stored in a MemoryBuffer.
  18. std::tuple<
  19. SynthTrace,
  20. ::hermes::vm::RuntimeConfig,
  21. ::hermes::vm::MockedEnvironment>
  22. parseSynthTrace(std::unique_ptr<llvm::MemoryBuffer> trace);
  23. /// Parse a trace from a JSON string stored in the given file name.
  24. std::tuple<
  25. SynthTrace,
  26. ::hermes::vm::RuntimeConfig,
  27. ::hermes::vm::MockedEnvironment>
  28. parseSynthTrace(const std::string &tracefile);
  29. } // namespace tracing
  30. } // namespace hermes
  31. } // namespace facebook
  32. #endif // HERMESVM_API_TRACE
  33. #endif // HERMES_SYNTHTRACEPARSER_H