Wrap const MDNode * inside DIDescriptor.
[oota-llvm.git] / tools / lto / LTOModule.h
index c2337401dac44724e948b702dfb4e4e489b48418..7f475d40aa0a88edf6aeaf241a52e8e0069fc899 100644 (file)
@@ -38,8 +38,7 @@ namespace llvm {
 //
 // C++ class which implements the opaque lto_module_t
 //
-class LTOModule {
-public:
+struct LTOModule {
 
     static bool              isBitcodeFile(const void* mem, size_t length);
     static bool              isBitcodeFile(const char* path);
@@ -50,9 +49,10 @@ public:
     static bool              isBitcodeFileForTarget(const char* path, 
                                                     const char* triplePrefix);
 
-    static LTOModule*        makeLTOModule(const char* path, std::string& errMsg);
+    static LTOModule*        makeLTOModule(const char* path,
+                                          std::string& errMsg);
     static LTOModule*        makeLTOModule(const void* mem, size_t length,
-                                                            std::string& errMsg);
+                                           std::string& errMsg);
 
     const char*              getTargetTriple();
     uint32_t                 getSymbolCount();
@@ -77,13 +77,19 @@ private:
     void                    addDefinedDataSymbol(llvm::GlobalValue* v, 
                                                         llvm::Mangler &mangler);
     void                    addAsmGlobalSymbol(const char *);
-    static bool             isTargetMatch(llvm::MemoryBuffer* memBuffer, 
+    void                    addObjCClass(llvm::GlobalVariable* clgv);
+    void                    addObjCCategory(llvm::GlobalVariable* clgv);
+    void                    addObjCClassRef(llvm::GlobalVariable* clgv);
+    bool                    objcClassNameFromExpression(llvm::Constant* c, 
+                                                    std::string& name);
+
+    static bool             isTargetMatch(llvm::MemoryBuffer* memBuffer,
                                                     const char* triplePrefix);
-    
-    static LTOModule*       makeLTOModule(llvm::MemoryBuffer* buffer, 
+
+    static LTOModule*       makeLTOModule(llvm::MemoryBuffer* buffer,
                                                         std::string& errMsg);
-       static llvm::MemoryBuffer* makeBuffer(const void* mem, size_t length);
-                                                        
+    static llvm::MemoryBuffer* makeBuffer(const void* mem, size_t length);
+
     typedef llvm::StringMap<uint8_t> StringSet;
     
     struct NameAndAttributes { 
@@ -100,7 +106,5 @@ private:
     llvm::StringMap<NameAndAttributes>      _undefines;
 };
 
-extern std::string getFeatureString(const char *TargetTriple);
-
 #endif // LTO_MODULE_H