DebugInfo: Remove DIType
[oota-llvm.git] / include / llvm / Linker / Linker.h
index 9e45245321047ca4d3e05a4f98916796e92ea1ad..5ca815c325a087347bf466f06dec71bf603de03c 100644 (file)
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseSet.h"
-
-#include <functional>
+#include "llvm/IR/DiagnosticInfo.h"
 
 namespace llvm {
-class DiagnosticInfo;
 class Module;
 class StructType;
 class Type;
@@ -28,8 +26,6 @@ class Type;
 /// something with it after the linking.
 class Linker {
 public:
-  typedef std::function<void(const DiagnosticInfo &)> DiagnosticHandlerFunction;
-
   struct StructTypeKeyInfo {
     struct KeyTy {
       ArrayRef<Type *> ETypes;
@@ -47,8 +43,7 @@ public:
     static bool isEqual(const StructType *LHS, const StructType *RHS);
   };
 
-  typedef DenseMap<StructType *, bool, StructTypeKeyInfo>
-      NonOpaqueStructTypeSet;
+  typedef DenseSet<StructType *, StructTypeKeyInfo> NonOpaqueStructTypeSet;
   typedef DenseSet<StructType *> OpaqueStructTypeSet;
 
   struct IdentifiedStructTypeSet {
@@ -59,6 +54,7 @@ public:
     NonOpaqueStructTypeSet NonOpaqueStructTypes;
 
     void addNonOpaque(StructType *Ty);
+    void switchToNonOpaque(StructType *Ty);
     void addOpaque(StructType *Ty);
     StructType *findNonOpaque(ArrayRef<Type *> ETypes, bool IsPacked);
     bool hasType(StructType *Ty);
@@ -75,6 +71,9 @@ public:
   /// Returns true on error.
   bool linkInModule(Module *Src);
 
+  /// \brief Set the composite to the passed-in module.
+  void setModule(Module *Dst);
+
   static bool LinkModules(Module *Dest, Module *Src,
                           DiagnosticHandlerFunction DiagnosticHandler);