LLVM API Documentation
#include <LTOCodeGenerator.h>
Public Member Functions | |
LTOCodeGenerator () | |
~LTOCodeGenerator () | |
bool | addModule (struct LTOModule *, std::string &errMsg) |
void | setTargetOptions (llvm::TargetOptions options) |
void | setDebugInfo (lto_debug_model) |
void | setCodePICModel (lto_codegen_model) |
void | setCpu (const char *mCpu) |
void | addMustPreserveSymbol (const char *sym) |
void | setCodeGenDebugOptions (const char *opts) |
void | parseCodeGenDebugOptions () |
bool | writeMergedModules (const char *path, std::string &errMsg) |
bool | compile_to_file (const char **name, bool disableOpt, bool disableInline, bool disableGVNLoadPRE, std::string &errMsg) |
const void * | compile (size_t *length, bool disableOpt, bool disableInline, bool disableGVNLoadPRE, std::string &errMsg) |
Static Public Member Functions | |
static const char * | getVersionString () |
LTOCodeGenerator - C++ class which implements the opaque lto_code_gen_t type.
Definition at line 61 of file LTOCodeGenerator.h.
LTOCodeGenerator::LTOCodeGenerator | ( | ) |
Definition at line 62 of file LTOCodeGenerator.cpp.
LTOCodeGenerator::~LTOCodeGenerator | ( | ) |
Definition at line 69 of file LTOCodeGenerator.cpp.
References llvm::Linker::deleteModule(), llvm::LibFunc::free, and I.
Definition at line 113 of file LTOCodeGenerator.cpp.
References LTOModule::getAsmUndefinedRefs(), LTOModule::getLLVVMModule(), and llvm::Linker::linkInModule().
|
inline |
Definition at line 76 of file LTOCodeGenerator.h.
const void * LTOCodeGenerator::compile | ( | size_t * | length, |
bool | disableOpt, | ||
bool | disableInline, | ||
bool | disableGVNLoadPRE, | ||
std::string & | errMsg | ||
) |
Definition at line 237 of file LTOCodeGenerator.cpp.
References compile_to_file(), llvm::MemoryBuffer::getBufferSize(), llvm::MemoryBuffer::getBufferStart(), llvm::LibFunc::remove, and llvm::OwningPtr< T >::take().
bool LTOCodeGenerator::compile_to_file | ( | const char ** | name, |
bool | disableOpt, | ||
bool | disableInline, | ||
bool | disableGVNLoadPRE, | ||
std::string & | errMsg | ||
) |
Definition at line 200 of file LTOCodeGenerator.cpp.
References llvm::SmallString< InternalLen >::c_str(), llvm::sys::fs::createTemporaryFile(), llvm::error_code::message(), and llvm::LibFunc::remove.
Referenced by compile().
|
static |
Definition at line 54 of file LTOCodeGenerator.cpp.
void LTOCodeGenerator::parseCodeGenDebugOptions | ( | ) |
Definition at line 516 of file LTOCodeGenerator.cpp.
References llvm::cl::ParseCommandLineOptions().
void LTOCodeGenerator::setCodeGenDebugOptions | ( | const char * | options | ) |
setCodeGenDebugOptions - Set codegen debugging options to aid in debugging LTO problems.
Definition at line 505 of file LTOCodeGenerator.cpp.
References llvm::getToken(), and llvm::LibFunc::strdup.
void LTOCodeGenerator::setCodePICModel | ( | lto_codegen_model | model | ) |
Definition at line 157 of file LTOCodeGenerator.cpp.
References llvm_unreachable, LTO_CODEGEN_PIC_MODEL_DYNAMIC, LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC, and LTO_CODEGEN_PIC_MODEL_STATIC.
|
inline |
Definition at line 74 of file LTOCodeGenerator.h.
void LTOCodeGenerator::setDebugInfo | ( | lto_debug_model | debug | ) |
Definition at line 144 of file LTOCodeGenerator.cpp.
References llvm_unreachable, LTO_DEBUG_MODEL_DWARF, and LTO_DEBUG_MODEL_NONE.
void LTOCodeGenerator::setTargetOptions | ( | llvm::TargetOptions | options | ) |
Definition at line 123 of file LTOCodeGenerator.cpp.
References llvm::TargetOptions::AllowFPOpFusion, llvm::TargetOptions::DisableTailCalls, llvm::TargetOptions::EnableSegmentedStacks, llvm::TargetOptions::FloatABIType, llvm::TargetOptions::GuaranteedTailCallOpt, llvm::TargetOptions::HonorSignDependentRoundingFPMathOption, llvm::TargetOptions::LessPreciseFPMADOption, llvm::TargetOptions::NoFramePointerElim, llvm::TargetOptions::NoInfsFPMath, llvm::TargetOptions::NoNaNsFPMath, llvm::TargetOptions::NoZerosInBSS, llvm::TargetOptions::PositionIndependentExecutable, llvm::TargetOptions::StackAlignmentOverride, llvm::TargetOptions::TrapFuncName, llvm::TargetOptions::UnsafeFPMath, llvm::TargetOptions::UseInitArray, and llvm::TargetOptions::UseSoftFloat.
bool LTOCodeGenerator::writeMergedModules | ( | const char * | path, |
std::string & | errMsg | ||
) |
Definition at line 168 of file LTOCodeGenerator.cpp.
References llvm::raw_fd_ostream::clear_error(), llvm::raw_fd_ostream::close(), llvm::sys::fs::F_Binary, llvm::Linker::getModule(), llvm::raw_fd_ostream::has_error(), llvm::tool_output_file::keep(), llvm::tool_output_file::os(), and llvm::WriteBitcodeToFile().