Codegen: Given a carbon file prints the assembly to the stdout (#2944)

Co-authored-by: Farzana Ahmed Siddique <fasiddique@google.com>
This commit is contained in:
Farzana Ahmed SiddiqueandFarzana Ahmed Siddique authored and GitHub committed 2023-06-23 15:23:39 -07:00
1 parent b908c6e274
commit aad4ed2083
7 files changed
+148 -1

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef CARBON_TOOLCHAIN_CODEGEN_CODEGEN_H_
#define CARBON_TOOLCHAIN_CODEGEN_CODEGEN_H_
#include <cstdint>
#include "llvm/IR/Module.h"
namespace Carbon {
// Prints the assembly to stdout for the given llvm module.
// If print fails, this returns false and any information about the failure is
// printed to the error stream.
auto PrintAssemblyFromModule(llvm::Module& module,
llvm::StringRef target_triple,
llvm::raw_pwrite_stream& error_stream,
llvm::raw_pwrite_stream& output_stream) -> bool;
} // namespace Carbon
#endif // CARBON_TOOLCHAIN_CODEGEN_CODEGEN_H_