exec_program.h 842 B

123456789101112131415161718192021222324
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. // Helpers should be added here when logic in syntax.ypp is more than a single
  5. // statement. The intent is to minimize the amount of C++ in the .ypp file, to
  6. // improve ease of maintenance.
  7. #ifndef CARBON_EXPLORER_INTERPRETER_EXEC_PROGRAM_H_
  8. #define CARBON_EXPLORER_INTERPRETER_EXEC_PROGRAM_H_
  9. #include "explorer/ast/ast.h"
  10. #include "llvm/Support/raw_ostream.h"
  11. namespace Carbon {
  12. // Runs the top-level declaration list.
  13. auto ExecProgram(Nonnull<Arena*> arena, AST ast,
  14. std::optional<Nonnull<llvm::raw_ostream*>> trace_stream)
  15. -> ErrorOr<int>;
  16. } // namespace Carbon
  17. #endif // CARBON_EXPLORER_INTERPRETER_EXEC_PROGRAM_H_