make sure to delete the llvm module before calling llvm_shutdown,
[oota-llvm.git] / tools / lto / LTOCodeGenerator.h
index 5548050fda01d68f481405fc5dc2b6fd4d0359f8..cac3b8c8bf6781fdd7e8949504ce74f53a1b8da1 100644 (file)
 // C++ class which implements the opaque lto_code_gen_t
 //
 
-class LTOCodeGenerator {
-public:
+struct LTOCodeGenerator {
     static const char*        getVersionString();
     
                             LTOCodeGenerator();
                             ~LTOCodeGenerator();
                             
-    bool                addModule(class LTOModule*, std::string& errMsg);
+    bool                addModule(struct LTOModule*, std::string& errMsg);
     bool                setDebugInfo(lto_debug_model, std::string& errMsg);
     bool                setCodePICModel(lto_codegen_model, std::string& errMsg);
-    void                setGccPath(const char* path);
     void                setAssemblerPath(const char* path);
     void                addMustPreserveSymbol(const char* sym);
     bool                writeMergedModules(const char* path, 
@@ -45,7 +43,7 @@ public:
     const void*         compile(size_t* length, std::string& errMsg);
     void                setCodeGenDebugOptions(const char *opts); 
 private:
-    bool                generateAssemblyCode(llvm::raw_ostream& out, 
+    bool                generateAssemblyCode(llvm::formatted_raw_ostream& out, 
                                              std::string& errMsg);
     bool                assemble(const std::string& asmPath, 
                             const std::string& objPath, std::string& errMsg);
@@ -63,7 +61,6 @@ private:
     StringSet                   _mustPreserveSymbols;
     llvm::MemoryBuffer*         _nativeObjectFile;
     std::vector<const char*>    _codegenOptions;
-    llvm::sys::Path*            _gccPath;
     llvm::sys::Path*            _assemblerPath;
 };