- const void *compile(size_t *length,
- bool disableOpt,
- bool disableInline,
- bool disableGVNLoadPRE,
- std::string &errMsg);
+ std::unique_ptr<MemoryBuffer> compile(bool disableInline,
+ bool disableGVNLoadPRE,
+ bool disableVectorization,
+ std::string &errMsg);
+
+ // Optimizes the merged module. Returns true on success.
+ bool optimize(bool disableInline,
+ bool disableGVNLoadPRE,
+ bool disableVectorization,
+ std::string &errMsg);
+
+ // Compiles the merged optimized module into a single object file. It brings
+ // the object to a buffer, and returns the buffer to the caller. Return NULL
+ // if the compilation was not successful.
+ std::unique_ptr<MemoryBuffer> compileOptimized(std::string &errMsg);
+
+ // Compile the merged optimized module into out.size() object files each
+ // representing a linkable partition of the module. If out contains more than
+ // one element, code generation is done in parallel with out.size() threads.
+ // Object files will be written to members of out. Returns true on success.
+ bool compileOptimized(ArrayRef<raw_pwrite_stream *> out, std::string &errMsg);