static const char *getVersionString();
LTOCodeGenerator();
+ LTOCodeGenerator(std::unique_ptr<LLVMContext> Context);
~LTOCodeGenerator();
// Merge given module, return true on success.
- bool addModule(struct LTOModule*, std::string &errMsg);
+ bool addModule(struct LTOModule *);
void setTargetOptions(TargetOptions options);
void setDebugInfo(lto_debug_model);
bool disableOpt,
bool disableInline,
bool disableGVNLoadPRE,
+ bool disableVectorization,
std::string &errMsg);
// As with compile_to_file(), this function compiles the merged module into
bool disableOpt,
bool disableInline,
bool disableGVNLoadPRE,
+ bool disableVectorization,
std::string &errMsg);
void setDiagnosticHandler(lto_diagnostic_handler_t, void *);
+ LLVMContext &getContext() { return Context; }
+
private:
void initializeLTOPasses();
bool generateObjectFile(raw_ostream &out, bool disableOpt, bool disableInline,
- bool disableGVNLoadPRE, std::string &errMsg);
+ bool disableGVNLoadPRE, bool disableVectorization,
+ std::string &errMsg);
void applyScopeRestrictions();
- void applyRestriction(GlobalValue &GV, const ArrayRef<StringRef> &Libcalls,
+ void applyRestriction(GlobalValue &GV, ArrayRef<StringRef> Libcalls,
std::vector<const char *> &MustPreserveList,
SmallPtrSetImpl<GlobalValue *> &AsmUsed,
Mangler &Mangler);
typedef StringMap<uint8_t> StringSet;
+ void initialize();
+ std::unique_ptr<LLVMContext> OwnedContext;
LLVMContext &Context;
Linker IRLinker;
TargetMachine *TargetMach;
lto_codegen_model CodeModel;
StringSet MustPreserveSymbols;
StringSet AsmUndefinedRefs;
- MemoryBuffer *NativeObjectFile;
+ std::unique_ptr<MemoryBuffer> NativeObjectFile;
std::vector<char *> CodegenOptions;
std::string MCpu;
std::string MAttr;