-class VariableDesc;
-
-//===----------------------------------------------------------------------===//
-/// DIVisitor - Subclasses of this class apply steps to each of the fields in
-/// the supplied DebugInfoDesc.
-class DIVisitor {
-public:
- DIVisitor() {}
- virtual ~DIVisitor() {}
-
- /// ApplyToFields - Target the visitor to each field of the debug information
- /// descriptor.
- void ApplyToFields(DebugInfoDesc *DD);
-
- /// Apply - Subclasses override each of these methods to perform the
- /// appropriate action for the type of field.
- virtual void Apply(int &Field) = 0;
- virtual void Apply(unsigned &Field) = 0;
- virtual void Apply(int64_t &Field) = 0;
- virtual void Apply(uint64_t &Field) = 0;
- virtual void Apply(bool &Field) = 0;
- virtual void Apply(std::string &Field) = 0;
- virtual void Apply(DebugInfoDesc *&Field) = 0;
- virtual void Apply(GlobalVariable *&Field) = 0;
- virtual void Apply(std::vector<DebugInfoDesc *> &Field) = 0;
-};
-
-//===----------------------------------------------------------------------===//
-/// DIDeserializer - This class is responsible for casting GlobalVariables
-/// into DebugInfoDesc objects.
-class DIDeserializer {
- // Previously defined gloabls.
- DenseMap<GlobalVariable*, DebugInfoDesc*> GlobalDescs;
-public:
- const DenseMap<GlobalVariable *, DebugInfoDesc *> &getGlobalDescs() const {
- return GlobalDescs;
- }
-
- /// Deserialize - Reconstitute a GlobalVariable into it's component
- /// DebugInfoDesc objects.
- DebugInfoDesc *Deserialize(Value *V);
- DebugInfoDesc *Deserialize(GlobalVariable *GV);
-};
-
-//===----------------------------------------------------------------------===//
-/// DISerializer - This class is responsible for casting DebugInfoDesc objects
-/// into GlobalVariables.
-class DISerializer {
- Module *M; // Definition space module.
- PointerType *StrPtrTy; // A "i8*" type. Created lazily.
- PointerType *EmptyStructPtrTy; // A "{ }*" type. Created lazily.
-
- // Types per Tag. Created lazily.
- std::map<unsigned, StructType *> TagTypes;
-
- // Previously defined descriptors.
- DenseMap<DebugInfoDesc *, GlobalVariable *> DescGlobals;
-
- // Previously defined strings.
- DenseMap<const char *, Constant*> StringCache;
-public:
- DISerializer()
- : M(NULL), StrPtrTy(NULL), EmptyStructPtrTy(NULL), TagTypes(),
- DescGlobals(), StringCache()
- {}