Halide
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 
12 #include "Module.h"
13 #include "Target.h"
14 
15 namespace llvm {
16 class Module;
17 class TargetOptions;
18 class LLVMContext;
19 class raw_fd_ostream;
20 class raw_pwrite_stream;
21 class raw_ostream;
22 } // namespace llvm
23 
24 namespace Halide {
25 
26 namespace Internal {
27 typedef llvm::raw_pwrite_stream LLVMOStream;
28 }
29 
30 /** Generate an LLVM module. */
31 std::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. */
34 std::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
llvm
Definition: CodeGen_Internal.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::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.
Target.h
Halide::Module
A halide module.
Definition: Module.h:136
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AddAtomicMutex.h:21
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Halide::compile_llvm_module_to_assembly
void compile_llvm_module_to_assembly(llvm::Module &module, Internal::LLVMOStream &out)
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).
Halide::Internal::LLVMOStream
llvm::raw_pwrite_stream LLVMOStream
Definition: LLVM_Output.h:27
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_assembly
void compile_llvm_module_to_llvm_assembly(llvm::Module &module, Internal::LLVMOStream &out)
Module.h
Halide::Target
A struct representing a target machine and os to generate code for.
Definition: Target.h:19