diff options
Diffstat (limited to 'include/llvm/LTO')
-rw-r--r-- | include/llvm/LTO/LTOCodeGenerator.h | 21 | ||||
-rw-r--r-- | include/llvm/LTO/LTOModule.h | 12 |
2 files changed, 24 insertions, 9 deletions
diff --git a/include/llvm/LTO/LTOCodeGenerator.h b/include/llvm/LTO/LTOCodeGenerator.h index 3d151b9..08e6374 100644 --- a/include/llvm/LTO/LTOCodeGenerator.h +++ b/include/llvm/LTO/LTOCodeGenerator.h @@ -39,6 +39,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/StringMap.h" #include "llvm/Linker.h" +#include "llvm/Target/TargetOptions.h" #include <string> #include <vector> @@ -64,6 +65,7 @@ struct LTOCodeGenerator { // Merge given module, return true on success. bool addModule(struct LTOModule*, std::string &errMsg); + void setTargetOptions(llvm::TargetOptions options); void setDebugInfo(lto_debug_model); void setCodePICModel(lto_codegen_model); @@ -90,7 +92,11 @@ struct LTOCodeGenerator { // Do not try to remove the object file in LTOCodeGenerator's destructor // as we don't who (LTOCodeGenerator or the obj file) will last longer. // - bool compile_to_file(const char **name, std::string &errMsg); + bool compile_to_file(const char **name, + bool disableOpt, + bool disableInline, + bool disableGVNLoadPRE, + std::string &errMsg); // As with compile_to_file(), this function compiles the merged module into // single object file. Instead of returning the object-file-path to the caller @@ -98,12 +104,20 @@ struct LTOCodeGenerator { // caller. This function should delete intermediate object file once its content // is brought to memory. Return NULL if the compilation was not successful. // - const void *compile(size_t *length, std::string &errMsg); + const void *compile(size_t *length, + bool disableOpt, + bool disableInline, + bool disableGVNLoadPRE, + std::string &errMsg); private: void initializeLTOPasses(); - bool generateObjectFile(llvm::raw_ostream &out, std::string &errMsg); + bool generateObjectFile(llvm::raw_ostream &out, + bool disableOpt, + bool disableInline, + bool disableGVNLoadPRE, + std::string &errMsg); void applyScopeRestrictions(); void applyRestriction(llvm::GlobalValue &GV, std::vector<const char*> &MustPreserveList, @@ -125,6 +139,7 @@ private: std::vector<char *> CodegenOptions; std::string MCpu; std::string NativeObjectPath; + llvm::TargetOptions Options; }; #endif // LTO_CODE_GENERATOR_H diff --git a/include/llvm/LTO/LTOModule.h b/include/llvm/LTO/LTOModule.h index 973466c..f4693c8 100644 --- a/include/llvm/LTO/LTOModule.h +++ b/include/llvm/LTO/LTOModule.h @@ -84,14 +84,17 @@ public: /// InitializeAllAsmPrinters(); /// InitializeAllAsmParsers(); static LTOModule *makeLTOModule(const char* path, + llvm::TargetOptions options, std::string &errMsg); static LTOModule *makeLTOModule(int fd, const char *path, - size_t size, std::string &errMsg); + size_t size, llvm::TargetOptions options, + std::string &errMsg); static LTOModule *makeLTOModule(int fd, const char *path, size_t map_size, - off_t offset, + off_t offset, llvm::TargetOptions options, std::string& errMsg); static LTOModule *makeLTOModule(const void *mem, size_t length, + llvm::TargetOptions options, std::string &errMsg); /// getTargetTriple - Return the Module's target triple. @@ -132,10 +135,6 @@ public: return _asm_undefines; } - /// getTargetOptions - Fill the TargetOptions object with the options - /// specified on the command line. - static void getTargetOptions(llvm::TargetOptions &Options); - private: /// parseSymbols - Parse the symbols from the module and model-level ASM and /// add them to either the defined or undefined lists. @@ -187,6 +186,7 @@ private: /// makeLTOModule - Create an LTOModule (private version). N.B. This /// method takes ownership of the buffer. static LTOModule *makeLTOModule(llvm::MemoryBuffer *buffer, + llvm::TargetOptions options, std::string &errMsg); /// makeBuffer - Create a MemoryBuffer from a memory range. |