check.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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. #ifndef CARBON_TOOLCHAIN_CHECK_CHECK_H_
  5. #define CARBON_TOOLCHAIN_CHECK_CHECK_H_
  6. #include "common/ostream.h"
  7. #include "toolchain/base/value_store.h"
  8. #include "toolchain/diagnostics/diagnostic_emitter.h"
  9. #include "toolchain/lex/tokenized_buffer.h"
  10. #include "toolchain/parse/tree.h"
  11. #include "toolchain/sem_ir/file.h"
  12. namespace Carbon::Check {
  13. // Checking information that's tracked per file.
  14. struct Unit {
  15. SharedValueStores* value_stores;
  16. const Lex::TokenizedBuffer* tokens;
  17. const Parse::Tree* parse_tree;
  18. DiagnosticConsumer* consumer;
  19. // The generated IR. Unset on input, set on output.
  20. std::optional<SemIR::File>* sem_ir;
  21. };
  22. // Checks a group of parse trees. This will use imports to decide the order of
  23. // checking.
  24. auto CheckParseTrees(llvm::MutableArrayRef<Unit> units, bool prelude_import,
  25. llvm::raw_ostream* vlog_stream) -> void;
  26. } // namespace Carbon::Check
  27. #endif // CARBON_TOOLCHAIN_CHECK_CHECK_H_