lower.h 1019 B

12345678910111213141516171819202122232425262728
  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_LOWER_LOWER_H_
  5. #define CARBON_TOOLCHAIN_LOWER_LOWER_H_
  6. #include "llvm/ADT/ArrayRef.h"
  7. #include "llvm/IR/LLVMContext.h"
  8. #include "llvm/IR/Module.h"
  9. #include "toolchain/parse/tree_and_subtrees.h"
  10. #include "toolchain/sem_ir/file.h"
  11. #include "toolchain/sem_ir/inst_namer.h"
  12. namespace Carbon::Lower {
  13. // Lowers SemIR to LLVM IR.
  14. auto LowerToLLVM(llvm::LLVMContext& llvm_context,
  15. std::optional<llvm::ArrayRef<Parse::GetTreeAndSubtreesFn>>
  16. all_trees_and_subtrees_for_debug_info,
  17. llvm::StringRef module_name, const SemIR::File& sem_ir,
  18. const SemIR::InstNamer* inst_namer,
  19. llvm::raw_ostream* vlog_stream)
  20. -> std::unique_ptr<llvm::Module>;
  21. } // namespace Carbon::Lower
  22. #endif // CARBON_TOOLCHAIN_LOWER_LOWER_H_