lower.cpp 848 B

12345678910111213141516171819202122
  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, bool include_debug_info,
  8. const Check::SemIRDiagnosticConverter& converter,
  9. llvm::StringRef module_name, const SemIR::File& sem_ir,
  10. const SemIR::InstNamer* inst_namer,
  11. llvm::raw_ostream* vlog_stream)
  12. -> std::unique_ptr<llvm::Module> {
  13. FileContext context(llvm_context, include_debug_info, converter, module_name,
  14. sem_ir, inst_namer, vlog_stream);
  15. return context.Run();
  16. }
  17. } // namespace Carbon::Lower