lower.cpp 900 B

1234567891011121314151617181920212223
  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. #include "toolchain/lower/lower.h"
  5. #include "toolchain/lower/file_context.h"
  6. namespace Carbon::Lower {
  7. auto LowerToLLVM(llvm::LLVMContext& llvm_context,
  8. std::optional<llvm::ArrayRef<Parse::GetTreeAndSubtreesFn>>
  9. all_trees_and_subtrees_for_debug_info,
  10. llvm::StringRef module_name, const SemIR::File& sem_ir,
  11. const SemIR::InstNamer* inst_namer,
  12. llvm::raw_ostream* vlog_stream)
  13. -> std::unique_ptr<llvm::Module> {
  14. FileContext context(llvm_context, all_trees_and_subtrees_for_debug_info,
  15. module_name, sem_ir, inst_namer, vlog_stream);
  16. return context.Run();
  17. }
  18. } // namespace Carbon::Lower