35 #ifndef LLVM_LTO_LTOCODEGENERATOR_H
36 #define LLVM_LTO_LTOCODEGENERATOR_H
53 class TargetLibraryInfo;
56 class raw_pwrite_stream;
78 void setCpu(
const char *mCpu) { MCpu = mCpu; }
79 void setAttr(
const char *mAttr) { MAttr = mAttr; }
111 bool disableGVNLoadPRE,
112 bool disableVectorization,
113 std::string &errMsg);
120 std::unique_ptr<MemoryBuffer>
compile(
bool disableInline,
121 bool disableGVNLoadPRE,
122 bool disableVectorization,
123 std::string &errMsg);
127 bool disableGVNLoadPRE,
128 bool disableVectorization,
129 std::string &errMsg);
141 void initializeLTOPasses();
144 bool compileOptimizedToFile(
const char **
name, std::string &errMsg);
145 void applyScopeRestrictions();
147 std::vector<const char *> &MustPreserveList,
150 bool determineTarget(std::string &errMsg);
158 void destroyMergedModule();
159 std::unique_ptr<LLVMContext> OwnedContext;
163 bool EmitDwarfDebugInfo =
false;
164 bool ScopeRestrictionsDone =
false;
168 std::vector<char *> CodegenOptions;
171 std::string NativeObjectPath;
173 unsigned OptLevel = 2;
175 void *DiagContext =
nullptr;
177 bool ShouldInternalize =
true;
178 bool ShouldEmbedUselists =
false;
void setCpu(const char *mCpu)
LLVMContext & getContext()
bool compile_to_file(const char **name, bool disableInline, bool disableGVNLoadPRE, bool disableVectorization, std::string &errMsg)
bool optimize(bool disableInline, bool disableGVNLoadPRE, bool disableVectorization, std::string &errMsg)
Optimize merged modules using various IPO passes.
bool addModule(struct LTOModule *)
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
void addMustPreserveSymbol(StringRef sym)
void setTargetOptions(TargetOptions options)
static const char * getVersionString()
This class provides the core functionality of linking in LLVM.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
void setShouldEmbedUselists(bool Value)
bool writeMergedModules(const char *path, std::string &errMsg)
This is the base abstract class for diagnostic reporting in the backend.
void setCodeGenDebugOptions(const char *opts)
setCodeGenDebugOptions - Set codegen debugging options to aid in debugging LTO problems.
This is an important class for using LLVM in a threaded context.
void setModule(struct LTOModule *)
void setAttr(const char *mAttr)
void setShouldInternalize(bool Value)
C++ class which implements the opaque lto_module_t type.
void(* lto_diagnostic_handler_t)(lto_codegen_diagnostic_severity_t severity, const char *diag, void *ctxt)
Diagnostic handler type.
C++ class which implements the opaque lto_code_gen_t type.
std::unique_ptr< MemoryBuffer > compileOptimized(std::string &errMsg)
An abstract base class for streams implementations that also support a pwrite operation.
LLVM Value Representation.
void setCodePICModel(lto_codegen_model)
StringSet - A wrapper for StringMap that provides set-like functionality.
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
void parseCodeGenDebugOptions()
std::unique_ptr< MemoryBuffer > compile(bool disableInline, bool disableGVNLoadPRE, bool disableVectorization, std::string &errMsg)
void setDiagnosticHandler(lto_diagnostic_handler_t, void *)
void setOptLevel(unsigned optLevel)
void setDebugInfo(lto_debug_model)