Fix libLTO by #include'ing the initializers for all targets and all asm
[oota-llvm.git] / tools / lto / LTOCodeGenerator.h
index eab076ebc88015dd3294161a9608872165e33cec..e02a7ab1159f1b6ed267e3970e49ed80db067f44 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "llvm/Linker.h"
 #include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/SmallVector.h"
 
 #include <string>
 
@@ -24,6 +25,7 @@
 //
 // C++ class which implements the opaque lto_code_gen_t
 //
+
 class LTOCodeGenerator {
 public:
     static const char*        getVersionString();
@@ -34,14 +36,16 @@ public:
     bool                addModule(class 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, 
                                                            std::string& errMsg);
     const void*         compile(size_t* length, std::string& errMsg);
-    
+    void                setCodeGenDebugOptions(const char *opts); 
 private:
-    bool                generateAssemblyCode(std::ostream& out, 
-                                                        std::string& errMsg);
+    bool                generateAssemblyCode(llvm::raw_ostream& out, 
+                                             std::string& errMsg);
     bool                assemble(const std::string& asmPath, 
                             const std::string& objPath, std::string& errMsg);
     void                applyScopeRestrictions();
@@ -56,6 +60,9 @@ private:
     lto_codegen_model           _codeModel;
     StringSet                   _mustPreserveSymbols;
     llvm::MemoryBuffer*         _nativeObjectFile;
+    std::vector<const char*>    _codegenOptions;
+    llvm::sys::Path*            _gccPath;
+    llvm::sys::Path*            _assemblerPath;
 };
 
 #endif // LTO_CODE_GENERATOR_H