-/// getTypeString - Return a string used to label this descriptors type.
-///
-const char *GlobalVariableDesc::getTypeString() const {
- return "llvm.dbg.global_variable.type";
-}
-
-/// getAnchorString - Return a string used to label this descriptor's anchor.
-///
-const char *GlobalVariableDesc::AnchorString = "llvm.dbg.global_variables";
-const char *GlobalVariableDesc::getAnchorString() const {
- return AnchorString;
-}
-
-#ifndef NDEBUG
-void GlobalVariableDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Anchor(" << getAnchor() << "), "
- << "Name(\"" << getName() << "\"), "
- << "FullName(\"" << getFullName() << "\"), "
- << "LinkageName(\"" << getLinkageName() << "\"), "
- << "File(" << getFile() << "),"
- << "Line(" << getLine() << "),"
- << "Type(" << getType() << "), "
- << "IsStatic(" << (isStatic() ? "true" : "false") << "), "
- << "IsDefinition(" << (isDefinition() ? "true" : "false") << "), "
- << "Global(" << Global << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-SubprogramDesc::SubprogramDesc()
-: GlobalDesc(DW_TAG_subprogram)
-{}
-
-// Implement isa/cast/dyncast.
-bool SubprogramDesc::classof(const DebugInfoDesc *D) {
- return D->getTag() == DW_TAG_subprogram;
-}
-
-/// ApplyToFields - Target the visitor to the fields of the
-/// SubprogramDesc.
-void SubprogramDesc::ApplyToFields(DIVisitor *Visitor) {
- GlobalDesc::ApplyToFields(Visitor);
-}
-
-/// getDescString - Return a string used to compose global names and labels.
-///
-const char *SubprogramDesc::getDescString() const {
- return "llvm.dbg.subprogram";
-}
-
-/// getTypeString - Return a string used to label this descriptors type.
-///
-const char *SubprogramDesc::getTypeString() const {
- return "llvm.dbg.subprogram.type";
-}
-
-/// getAnchorString - Return a string used to label this descriptor's anchor.
-///
-const char *SubprogramDesc::AnchorString = "llvm.dbg.subprograms";
-const char *SubprogramDesc::getAnchorString() const {
- return AnchorString;
-}
-
-#ifndef NDEBUG
-void SubprogramDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Anchor(" << getAnchor() << "), "
- << "Name(\"" << getName() << "\"), "
- << "FullName(\"" << getFullName() << "\"), "
- << "LinkageName(\"" << getLinkageName() << "\"), "
- << "File(" << getFile() << "),"
- << "Line(" << getLine() << "),"
- << "Type(" << getType() << "), "
- << "IsStatic(" << (isStatic() ? "true" : "false") << "), "
- << "IsDefinition(" << (isDefinition() ? "true" : "false") << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-BlockDesc::BlockDesc()
-: DebugInfoDesc(DW_TAG_lexical_block)
-, Context(NULL)
-{}
-
-// Implement isa/cast/dyncast.
-bool BlockDesc::classof(const DebugInfoDesc *D) {
- return D->getTag() == DW_TAG_lexical_block;
-}
-
-/// ApplyToFields - Target the visitor to the fields of the BlockDesc.
-///
-void BlockDesc::ApplyToFields(DIVisitor *Visitor) {
- DebugInfoDesc::ApplyToFields(Visitor);
-
- Visitor->Apply(Context);
-}
-
-/// getDescString - Return a string used to compose global names and labels.
-///
-const char *BlockDesc::getDescString() const {
- return "llvm.dbg.block";
-}
-
-/// getTypeString - Return a string used to label this descriptors type.
-///
-const char *BlockDesc::getTypeString() const {
- return "llvm.dbg.block.type";
-}
-
-#ifndef NDEBUG
-void BlockDesc::dump() {
- cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "),"
- << "Context(" << Context << ")\n";
-}
-#endif
-
-//===----------------------------------------------------------------------===//
-
-DebugInfoDesc *DIDeserializer::Deserialize(Value *V) {
- return Deserialize(getGlobalVariable(V));
-}
-DebugInfoDesc *DIDeserializer::Deserialize(GlobalVariable *GV) {
- // Handle NULL.
- if (!GV) return NULL;
-
- // Check to see if it has been already deserialized.
- DebugInfoDesc *&Slot = GlobalDescs[GV];
- if (Slot) return Slot;
-
- // Get the Tag from the global.
- unsigned Tag = DebugInfoDesc::TagFromGlobal(GV);
-
- // Create an empty instance of the correct sort.
- Slot = DebugInfoDesc::DescFactory(Tag);
-
- // If not a user defined descriptor.
- if (Slot) {
- // Deserialize the fields.
- DIDeserializeVisitor DRAM(*this, GV);
- DRAM.ApplyToFields(Slot);