+namespace llvm {
+ class LLVMContext;
+ class GlobalValue;
+ class Mangler;
+ class MemoryBuffer;
+ class TargetMachine;
+ class raw_ostream;
+}
+
+//===----------------------------------------------------------------------===//
+/// LTOCodeGenerator - C++ class which implements the opaque lto_code_gen_t
+/// type.
+///
+struct LTOCodeGenerator {
+ static const char *getVersionString();
+
+ LTOCodeGenerator();
+ ~LTOCodeGenerator();
+
+ bool addModule(struct LTOModule*, std::string &errMsg);
+ bool setDebugInfo(lto_debug_model, std::string &errMsg);
+ bool setCodePICModel(lto_codegen_model, std::string &errMsg);
+
+ void setCpu(const char* mCpu) { _mCpu = mCpu; }
+
+ void addMustPreserveSymbol(const char* sym) {
+ _mustPreserveSymbols[sym] = 1;
+ }
+
+ bool writeMergedModules(const char *path, std::string &errMsg);
+ bool compile_to_file(const char **name, std::string &errMsg);
+ const void *compile(size_t *length, std::string &errMsg);
+ void setCodeGenDebugOptions(const char *opts);