Halide 22.0.0 Halide compiler and libraries

LLVM_Output.h
Go to the documentation of this file.
1#ifndef HALIDE_LLVM_OUTPUTS_H
2#define HALIDE_LLVM_OUTPUTS_H
3
4/** \file
5 *
6 */
7
8#include <memory>
9#include <string>
10#include <vector>
11
12namespace llvm {
13class Module;
14class TargetOptions;
15class LLVMContext;
16class raw_fd_ostream;
17class raw_pwrite_stream;
18class raw_ostream;
19} // namespace llvm
20
21namespace Halide {
22
23class Module;
24struct Target;
25
26namespace Internal {
27 typedef llvm::raw_pwrite_stream LLVMOStream;
28}
29
30/** Generate an LLVM module. */
31std::unique_ptr<llvm::Module> compile_module_to_llvm_module(const Module &module, llvm::LLVMContext &context);
32
33/** Construct an llvm output stream for writing to files. */
34std::unique_ptr<llvm::raw_fd_ostream> make_raw_fd_ostream(const std::string &filename);
35
36/** Compile an LLVM module to native targets (objects, native assembly). */
37// @{
38 void compile_llvm_module_to_object(llvm::Module &module, Internal::LLVMOStream &out);
39 void compile_llvm_module_to_assembly(llvm::Module &module, Internal::LLVMOStream &out);
40// @}
41
42/** Compile an LLVM module to LLVM targets (bitcode, LLVM assembly). */
43// @{
44 void compile_llvm_module_to_llvm_bitcode(llvm::Module &module, Internal::LLVMOStream &out);
45 void compile_llvm_module_to_llvm_assembly(llvm::Module &module, Internal::LLVMOStream &out);
46// @}
47
48/**
49 * Concatenate the list of src_files into dst_file, using the appropriate
50 * static library format for the given target (e.g., .a or .lib).
51 * If deterministic is true, emit 0 for all GID/UID/timestamps, and 0644 for
52 * all modes (equivalent to the ar -D option).
53 */
54 void create_static_library(const std::vector<std::string> &src_files, const Target &target,
55 const std::string &dst_file, bool deterministic = true);
56} // namespace Halide
57
58#endif
Halide::Module
A halide module.
Definition: Module.h:142
Halide::Internal::LLVMOStream
llvm::raw_pwrite_stream LLVMOStream
Definition: LLVM_Output.h:27
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AbstractGenerator.h:19
Halide::create_static_library
void create_static_library(const std::vector< std::string > &src_files, const Target &target, const std::string &dst_file, bool deterministic=true)
Concatenate the list of src_files into dst_file, using the appropriate static library format for the ...
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Halide::compile_llvm_module_to_llvm_assembly
void compile_llvm_module_to_llvm_assembly(llvm::Module &module, Internal::LLVMOStream &out)
Halide::compile_module_to_llvm_module
std::unique_ptr< llvm::Module > compile_module_to_llvm_module(const Module &module, llvm::LLVMContext &context)
Generate an LLVM module.
Halide::make_raw_fd_ostream
std::unique_ptr< llvm::raw_fd_ostream > make_raw_fd_ostream(const std::string &filename)
Construct an llvm output stream for writing to files.
Halide::compile_llvm_module_to_assembly
void compile_llvm_module_to_assembly(llvm::Module &module, Internal::LLVMOStream &out)
Halide::compile_llvm_module_to_object
void compile_llvm_module_to_object(llvm::Module &module, Internal::LLVMOStream &out)
Compile an LLVM module to native targets (objects, native assembly).
Halide::compile_llvm_module_to_llvm_bitcode
void compile_llvm_module_to_llvm_bitcode(llvm::Module &module, Internal::LLVMOStream &out)
Compile an LLVM module to LLVM targets (bitcode, LLVM assembly).
llvm
Definition: CodeGen_Internal.h:18
Halide::Target
A struct representing a target machine and os to generate code for.
Definition: Target.h:19