1 //===-- llvm/CodeGen/MachineDebugInfo.h -------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by James M. Laskey and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Collect debug information for a module. This information should be in a
11 // neutral form that can be used by different debugging schemes.
13 // The organization of information is primarily clustered around the source
14 // compile units. The main exception is source line correspondence where
15 // inlining may interleave code from various compile units.
17 // The following information can be retrieved from the MachineDebugInfo.
19 // -- Source directories - Directories are uniqued based on their canonical
20 // string and assigned a sequential numeric ID (base 1.)
21 // -- Source files - Files are also uniqued based on their name and directory
22 // ID. A file ID is sequential number (base 1.)
23 // -- Source line coorespondence - A vector of file ID, line#, column# triples.
24 // A DEBUG_LOCATION instruction is generated by the DAG Legalizer
25 // corresponding to each entry in the source line list. This allows a debug
26 // emitter to generate labels referenced by debug information tables.
28 //===----------------------------------------------------------------------===//
30 #ifndef LLVM_CODEGEN_MACHINEDEBUGINFO_H
31 #define LLVM_CODEGEN_MACHINEDEBUGINFO_H
33 #include "llvm/Support/Dwarf.h"
34 #include "llvm/Support/DataTypes.h"
35 #include "llvm/ADT/UniqueVector.h"
36 #include "llvm/GlobalValue.h"
37 #include "llvm/Pass.h"
38 #include "llvm/User.h"
45 //===----------------------------------------------------------------------===//
46 // Forward declarations.
54 //===----------------------------------------------------------------------===//
55 // Debug info constants.
58 LLVMDebugVersion = 1, // Current version of debug information.
59 DIInvalid = ~0U, // Invalid result indicator.
61 // DebugInfoDesc type identifying tags.
64 DI_TAG_global_variable,
80 //===----------------------------------------------------------------------===//
81 /// DIVisitor - Subclasses of this class apply steps to each of the fields in
82 /// the supplied DebugInfoDesc.
86 virtual ~DIVisitor() {}
88 /// ApplyToFields - Target the visitor to each field of the debug information
90 void ApplyToFields(DebugInfoDesc *DD);
92 /// Apply - Subclasses override each of these methods to perform the
93 /// appropriate action for the type of field.
94 virtual void Apply(int &Field) = 0;
95 virtual void Apply(unsigned &Field) = 0;
96 virtual void Apply(int64_t &Field) = 0;
97 virtual void Apply(uint64_t &Field) = 0;
98 virtual void Apply(bool &Field) = 0;
99 virtual void Apply(std::string &Field) = 0;
100 virtual void Apply(DebugInfoDesc *&Field) = 0;
101 virtual void Apply(GlobalVariable *&Field) = 0;
102 virtual void Apply(std::vector<DebugInfoDesc *> &Field) = 0;
105 //===----------------------------------------------------------------------===//
106 /// DebugInfoDesc - This class is the base class for debug info descriptors.
108 class DebugInfoDesc {
110 unsigned Tag; // Content indicator. Dwarf values are
111 // used but that does not limit use to
115 DebugInfoDesc(unsigned T) : Tag(T) {}
118 virtual ~DebugInfoDesc() {}
121 unsigned getTag() const { return Tag; }
123 /// TagFromGlobal - Returns the Tag number from a debug info descriptor
124 /// GlobalVariable. Return DIIValid if operand is not an unsigned int.
125 static unsigned TagFromGlobal(GlobalVariable *GV);
127 /// DescFactory - Create an instance of debug info descriptor based on Tag.
128 /// Return NULL if not a recognized Tag.
129 static DebugInfoDesc *DescFactory(unsigned Tag);
131 /// getLinkage - get linkage appropriate for this type of descriptor.
133 virtual GlobalValue::LinkageTypes getLinkage() const;
135 //===--------------------------------------------------------------------===//
136 // Subclasses should supply the following static methods.
138 // Implement isa/cast/dyncast.
139 static bool classof(const DebugInfoDesc *) { return true; }
141 //===--------------------------------------------------------------------===//
142 // Subclasses should supply the following virtual methods.
144 /// ApplyToFields - Target the vistor to the fields of the descriptor.
146 virtual void ApplyToFields(DIVisitor *Visitor);
148 /// getDescString - Return a string used to compose global names and labels.
150 virtual const char *getDescString() const = 0;
152 /// getTypeString - Return a string used to label this descriptor's type.
154 virtual const char *getTypeString() const = 0;
157 virtual void dump() = 0;
161 //===----------------------------------------------------------------------===//
162 /// AnchorDesc - Descriptors of this class act as markers for identifying
163 /// descriptors of certain groups.
164 class AnchorDesc : public DebugInfoDesc {
166 std::string Name; // Anchor type string.
170 : DebugInfoDesc(DI_TAG_anchor)
173 AnchorDesc(const std::string &N)
174 : DebugInfoDesc(DI_TAG_anchor)
179 const std::string &getName() const { return Name; }
181 // Implement isa/cast/dyncast.
182 static bool classof(const AnchorDesc *) { return true; }
183 static bool classof(const DebugInfoDesc *D) {
184 return D->getTag() == DI_TAG_anchor;
187 /// getLinkage - get linkage appropriate for this type of descriptor.
189 virtual GlobalValue::LinkageTypes getLinkage() const;
191 /// ApplyToFields - Target the visitor to the fields of the AnchorDesc.
193 virtual void ApplyToFields(DIVisitor *Visitor);
195 /// getDescString - Return a string used to compose global names and labels.
197 virtual const char *getDescString() const;
199 /// getTypeString - Return a string used to label this descriptor's type.
201 virtual const char *getTypeString() const;
208 //===----------------------------------------------------------------------===//
209 /// AnchoredDesc - This class manages anchors for a variety of top level
211 class AnchoredDesc : public DebugInfoDesc {
213 AnchorDesc *Anchor; // Anchor for all descriptors of the
218 AnchoredDesc(unsigned T);
222 AnchorDesc *getAnchor() const { return Anchor; }
223 void setAnchor(AnchorDesc *A) { Anchor = A; }
225 //===--------------------------------------------------------------------===//
226 // Subclasses should supply the following virtual methods.
228 /// ApplyToFields - Target the visitor to the fields of the AnchoredDesc.
230 virtual void ApplyToFields(DIVisitor *Visitor);
233 //===----------------------------------------------------------------------===//
234 /// CompileUnitDesc - This class packages debug information associated with a
235 /// source/header file.
236 class CompileUnitDesc : public AnchoredDesc {
238 unsigned DebugVersion; // LLVM debug version when produced.
239 unsigned Language; // Language number (ex. DW_LANG_C89.)
240 std::string FileName; // Source file name.
241 std::string Directory; // Source file directory.
242 std::string Producer; // Compiler string.
248 unsigned getDebugVersion() const { return DebugVersion; }
249 unsigned getLanguage() const { return Language; }
250 const std::string &getFileName() const { return FileName; }
251 const std::string &getDirectory() const { return Directory; }
252 const std::string &getProducer() const { return Producer; }
253 void setLanguage(unsigned L) { Language = L; }
254 void setFileName(const std::string &FN) { FileName = FN; }
255 void setDirectory(const std::string &D) { Directory = D; }
256 void setProducer(const std::string &P) { Producer = P; }
258 // FIXME - Need translation unit getter/setter.
260 // Implement isa/cast/dyncast.
261 static bool classof(const CompileUnitDesc *) { return true; }
262 static bool classof(const DebugInfoDesc *D) {
263 return D->getTag() == DI_TAG_compile_unit;
266 /// DebugVersionFromGlobal - Returns the version number from a compile unit
267 /// GlobalVariable. Return DIIValid if operand is not an unsigned int.
268 static unsigned DebugVersionFromGlobal(GlobalVariable *GV);
270 /// ApplyToFields - Target the visitor to the fields of the CompileUnitDesc.
272 virtual void ApplyToFields(DIVisitor *Visitor);
274 /// getDescString - Return a string used to compose global names and labels.
276 virtual const char *getDescString() const;
278 /// getTypeString - Return a string used to label this descriptor's type.
280 virtual const char *getTypeString() const;
282 /// getAnchorString - Return a string used to label this descriptor's anchor.
284 virtual const char *getAnchorString() const;
291 //===----------------------------------------------------------------------===//
292 /// TypeDesc - This class packages debug information associated with a type.
294 class TypeDesc : public DebugInfoDesc {
296 DebugInfoDesc *Context; // Context debug descriptor.
297 std::string Name; // Type name (may be empty.)
298 CompileUnitDesc *File; // Declared compile unit (may be NULL.)
299 int Line; // Declared line# (may be zero.)
300 uint64_t Size; // Type size (may be zero.)
303 TypeDesc(unsigned T);
307 DebugInfoDesc *getContext() const { return Context; }
308 const std::string &getName() const { return Name; }
309 CompileUnitDesc *getFile() const { return File; }
310 int getLine() const { return Line; }
311 uint64_t getSize() const { return Size; }
312 void setContext(DebugInfoDesc *C) { Context = C; }
313 void setName(const std::string &N) { Name = N; }
314 void setFile(CompileUnitDesc *U) { File = U; }
315 void setLine(int L) { Line = L; }
316 void setSize(uint64_t S) { Size = S; }
318 /// ApplyToFields - Target the visitor to the fields of the TypeDesc.
320 virtual void ApplyToFields(DIVisitor *Visitor);
322 /// getDescString - Return a string used to compose global names and labels.
324 virtual const char *getDescString() const;
326 /// getTypeString - Return a string used to label this descriptor's type.
328 virtual const char *getTypeString() const;
335 //===----------------------------------------------------------------------===//
336 /// BasicTypeDesc - This class packages debug information associated with a
337 /// basic type (eg. int, bool, double.)
338 class BasicTypeDesc : public TypeDesc {
340 unsigned Encoding; // Type encoding.
346 unsigned getEncoding() const { return Encoding; }
347 void setEncoding(unsigned E) { Encoding = E; }
349 // Implement isa/cast/dyncast.
350 static bool classof(const BasicTypeDesc *) { return true; }
351 static bool classof(const DebugInfoDesc *D) {
352 return D->getTag() == DI_TAG_basictype;
355 /// ApplyToFields - Target the visitor to the fields of the BasicTypeDesc.
357 virtual void ApplyToFields(DIVisitor *Visitor);
359 /// getDescString - Return a string used to compose global names and labels.
361 virtual const char *getDescString() const;
363 /// getTypeString - Return a string used to label this descriptor's type.
365 virtual const char *getTypeString() const;
373 //===----------------------------------------------------------------------===//
374 /// DerivedTypeDesc - This class packages debug information associated with a
375 /// derived types (eg., typedef, pointer, reference.)
376 class DerivedTypeDesc : public TypeDesc {
378 TypeDesc *FromType; // Type derived from.
381 DerivedTypeDesc(unsigned T);
384 TypeDesc *getFromType() const { return FromType; }
385 void setFromType(TypeDesc *F) { FromType = F; }
387 // Implement isa/cast/dyncast.
388 static bool classof(const DerivedTypeDesc *) { return true; }
389 static bool classof(const DebugInfoDesc *D) {
390 unsigned T = D->getTag();
394 case DI_TAG_reference:
396 case DI_TAG_volatile:
397 case DI_TAG_restrict:
404 /// ApplyToFields - Target the visitor to the fields of the DerivedTypeDesc.
406 virtual void ApplyToFields(DIVisitor *Visitor);
408 /// getDescString - Return a string used to compose global names and labels.
410 virtual const char *getDescString() const;
412 /// getTypeString - Return a string used to label this descriptor's type.
414 virtual const char *getTypeString() const;
421 //===----------------------------------------------------------------------===//
422 /// CompositeTypeDesc - This class packages debug information associated with a
423 /// array/struct types (eg., arrays, struct, union, enums.)
424 class CompositeTypeDesc : public DerivedTypeDesc {
426 std::vector<DebugInfoDesc *> Elements;// Information used to compose type.
429 CompositeTypeDesc(unsigned T);
432 std::vector<DebugInfoDesc *> &getElements() { return Elements; }
434 // Implement isa/cast/dyncast.
435 static bool classof(const CompositeTypeDesc *) { return true; }
436 static bool classof(const DebugInfoDesc *D) {
437 unsigned T = D->getTag();
449 /// ApplyToFields - Target the visitor to the fields of the CompositeTypeDesc.
451 virtual void ApplyToFields(DIVisitor *Visitor);
453 /// getDescString - Return a string used to compose global names and labels.
455 virtual const char *getDescString() const;
457 /// getTypeString - Return a string used to label this descriptor's type.
459 virtual const char *getTypeString() const;
466 //===----------------------------------------------------------------------===//
467 /// SubrangeDesc - This class packages debug information associated with integer
469 class SubrangeDesc : public DebugInfoDesc {
471 int64_t Lo; // Low value of range
472 int64_t Hi; // High value of range
478 int64_t getLo() const { return Lo; }
479 int64_t getHi() const { return Hi; }
480 void setLo(int64_t L) { Lo = L; }
481 void setHi(int64_t H) { Hi = H; }
483 // Implement isa/cast/dyncast.
484 static bool classof(const SubrangeDesc *) { return true; }
485 static bool classof(const DebugInfoDesc *D) {
486 return D->getTag() == DI_TAG_subrange;
489 /// ApplyToFields - Target the visitor to the fields of the SubrangeDesc.
491 virtual void ApplyToFields(DIVisitor *Visitor);
493 /// getDescString - Return a string used to compose global names and labels.
495 virtual const char *getDescString() const;
497 /// getTypeString - Return a string used to label this descriptor's type.
499 virtual const char *getTypeString() const;
506 //===----------------------------------------------------------------------===//
507 /// GlobalDesc - This class is the base descriptor for global functions and
509 class GlobalDesc : public AnchoredDesc {
511 DebugInfoDesc *Context; // Context debug descriptor.
512 std::string Name; // Global name.
513 TypeDesc *TyDesc; // Type debug descriptor.
514 bool IsStatic; // Is the global a static.
515 bool IsDefinition; // Is the global defined in context.
518 GlobalDesc(unsigned T);
522 DebugInfoDesc *getContext() const { return Context; }
523 const std::string &getName() const { return Name; }
524 TypeDesc *getTypeDesc() const { return TyDesc; }
525 bool isStatic() const { return IsStatic; }
526 bool isDefinition() const { return IsDefinition; }
527 void setContext(DebugInfoDesc *C) { Context = C; }
528 void setName(const std::string &N) { Name = N; }
529 void setTypeDesc(TypeDesc *T) { TyDesc = T; }
530 void setIsStatic(bool IS) { IsStatic = IS; }
531 void setIsDefinition(bool ID) { IsDefinition = ID; }
533 /// ApplyToFields - Target the visitor to the fields of the GlobalDesc.
535 virtual void ApplyToFields(DIVisitor *Visitor);
538 //===----------------------------------------------------------------------===//
539 /// GlobalVariableDesc - This class packages debug information associated with a
541 class GlobalVariableDesc : public GlobalDesc {
543 GlobalVariable *Global; // llvm global.
544 unsigned Line; // Source line number.
547 GlobalVariableDesc();
550 GlobalVariable *getGlobalVariable() const { return Global; }
551 unsigned getLine() const { return Line; }
552 void setGlobalVariable(GlobalVariable *GV) { Global = GV; }
553 void setLine(unsigned L) { Line = L; }
555 // Implement isa/cast/dyncast.
556 static bool classof(const GlobalVariableDesc *) { return true; }
557 static bool classof(const DebugInfoDesc *D) {
558 return D->getTag() == DI_TAG_global_variable;
561 /// ApplyToFields - Target the visitor to the fields of the
562 /// GlobalVariableDesc.
563 virtual void ApplyToFields(DIVisitor *Visitor);
565 /// getDescString - Return a string used to compose global names and labels.
567 virtual const char *getDescString() const;
569 /// getTypeString - Return a string used to label this descriptor's type.
571 virtual const char *getTypeString() const;
573 /// getAnchorString - Return a string used to label this descriptor's anchor.
575 virtual const char *getAnchorString() const;
582 //===----------------------------------------------------------------------===//
583 /// SubprogramDesc - This class packages debug information associated with a
584 /// subprogram/function.
585 class SubprogramDesc : public GlobalDesc {
587 // FIXME - Other attributes
593 // FIXME - Other getters/setters.
595 // Implement isa/cast/dyncast.
596 static bool classof(const SubprogramDesc *) { return true; }
597 static bool classof(const DebugInfoDesc *D) {
598 return D->getTag() == DI_TAG_subprogram;
601 /// ApplyToFields - Target the visitor to the fields of the SubprogramDesc.
603 virtual void ApplyToFields(DIVisitor *Visitor);
605 /// getDescString - Return a string used to compose global names and labels.
607 virtual const char *getDescString() const;
609 /// getTypeString - Return a string used to label this descriptor's type.
611 virtual const char *getTypeString() const;
613 /// getAnchorString - Return a string used to label this descriptor's anchor.
615 virtual const char *getAnchorString() const;
622 //===----------------------------------------------------------------------===//
623 /// DIDeserializer - This class is responsible for casting GlobalVariables
624 /// into DebugInfoDesc objects.
625 class DIDeserializer {
627 unsigned DebugVersion; // Version of debug information in use.
628 std::map<GlobalVariable *, DebugInfoDesc *> GlobalDescs;
629 // Previously defined gloabls.
632 DIDeserializer() : DebugVersion(LLVMDebugVersion) {}
636 unsigned getDebugVersion() const { return DebugVersion; }
638 /// Deserialize - Reconstitute a GlobalVariable into it's component
639 /// DebugInfoDesc objects.
640 DebugInfoDesc *Deserialize(Value *V);
641 DebugInfoDesc *Deserialize(GlobalVariable *GV);
644 //===----------------------------------------------------------------------===//
645 /// DISerializer - This class is responsible for casting DebugInfoDesc objects
646 /// into GlobalVariables.
649 Module *M; // Definition space module.
650 PointerType *StrPtrTy; // A "sbyte *" type. Created lazily.
651 PointerType *EmptyStructPtrTy; // A "{ }*" type. Created lazily.
652 std::map<unsigned, StructType *> TagTypes;
653 // Types per Tag. Created lazily.
654 std::map<DebugInfoDesc *, GlobalVariable *> DescGlobals;
655 // Previously defined descriptors.
656 std::map<const std::string, Constant *> StringCache;
657 // Previously defined strings.
663 , EmptyStructPtrTy(NULL)
671 Module *getModule() const { return M; };
672 void setModule(Module *module) { M = module; }
674 /// getStrPtrType - Return a "sbyte *" type.
676 const PointerType *getStrPtrType();
678 /// getEmptyStructPtrType - Return a "{ }*" type.
680 const PointerType *getEmptyStructPtrType();
682 /// getTagType - Return the type describing the specified descriptor (via
684 const StructType *getTagType(DebugInfoDesc *DD);
686 /// getString - Construct the string as constant string global.
688 Constant *getString(const std::string &String);
690 /// Serialize - Recursively cast the specified descriptor into a
691 /// GlobalVariable so that it can be serialized to a .bc or .ll file.
692 GlobalVariable *Serialize(DebugInfoDesc *DD);
695 //===----------------------------------------------------------------------===//
696 /// DIVerifier - This class is responsible for verifying the given network of
697 /// GlobalVariables are valid as DebugInfoDesc objects.
700 unsigned DebugVersion; // Version of debug information in use.
701 std::set<GlobalVariable *> Visited; // Tracks visits during recursion.
702 std::map<unsigned, unsigned> Counts; // Count of fields per Tag type.
704 /// markVisited - Return true if the GlobalVariable hase been "seen" before.
705 /// Mark markVisited otherwise.
706 bool markVisited(GlobalVariable *GV);
709 DIVerifier() : DebugVersion(LLVMDebugVersion) {}
712 /// Verify - Return true if the GlobalVariable appears to be a valid
713 /// serialization of a DebugInfoDesc.
714 bool Verify(Value *V);
715 bool Verify(GlobalVariable *GV);
718 //===----------------------------------------------------------------------===//
719 /// SourceLineInfo - This class is used to record source line correspondence.
721 class SourceLineInfo {
723 unsigned Line; // Source line number.
724 unsigned Column; // Source column.
725 unsigned SourceID; // Source ID number.
728 SourceLineInfo(unsigned L, unsigned C, unsigned S)
729 : Line(L), Column(C), SourceID(S) {}
732 unsigned getLine() const { return Line; }
733 unsigned getColumn() const { return Column; }
734 unsigned getSourceID() const { return SourceID; }
737 //===----------------------------------------------------------------------===//
738 /// SourceFileInfo - This class is used to track source information.
740 class SourceFileInfo {
742 unsigned DirectoryID; // Directory ID number.
743 std::string Name; // File name (not including directory.)
746 SourceFileInfo(unsigned D, const std::string &N) : DirectoryID(D), Name(N) {}
749 unsigned getDirectoryID() const { return DirectoryID; }
750 const std::string &getName() const { return Name; }
752 /// operator== - Used by UniqueVector to locate entry.
754 bool operator==(const SourceFileInfo &SI) const {
755 return getDirectoryID() == SI.getDirectoryID() && getName() == SI.getName();
758 /// operator< - Used by UniqueVector to locate entry.
760 bool operator<(const SourceFileInfo &SI) const {
761 return getDirectoryID() < SI.getDirectoryID() ||
762 (getDirectoryID() == SI.getDirectoryID() && getName() < SI.getName());
766 //===----------------------------------------------------------------------===//
767 /// MachineDebugInfo - This class contains debug information specific to a
768 /// module. Queries can be made by different debugging schemes and reformated
769 /// for specific use.
771 class MachineDebugInfo : public ImmutablePass {
773 // Use the same serializer/deserializer/verifier for the module.
776 // CompileUnits - Uniquing vector for compile units.
777 UniqueVector<CompileUnitDesc *> CompileUnits;
779 // Directories - Uniquing vector for directories.
780 UniqueVector<std::string> Directories;
782 // SourceFiles - Uniquing vector for source files.
783 UniqueVector<SourceFileInfo> SourceFiles;
785 // Lines - List of of source line correspondence.
786 std::vector<SourceLineInfo *> Lines;
792 /// doInitialization - Initialize the debug state for a new module.
794 bool doInitialization();
796 /// doFinalization - Tear down the debug state after completion of a module.
798 bool doFinalization();
800 /// getDescFor - Convert a Value to a debug information descriptor.
802 // FIXME - use new Value type when available.
803 DebugInfoDesc *getDescFor(Value *V);
805 /// Verify - Verify that a Value is debug information descriptor.
807 bool Verify(Value *V);
809 /// AnalyzeModule - Scan the module for global debug information.
811 void AnalyzeModule(Module &M);
813 /// hasInfo - Returns true if valid debug info is present.
815 bool hasInfo() const { return !CompileUnits.empty(); }
817 /// RecordLabel - Records location information and associates it with a
818 /// debug label. Returns a unique label ID used to generate a label and
819 /// provide correspondence to the source line list.
820 unsigned RecordLabel(unsigned Line, unsigned Column, unsigned Source) {
821 Lines.push_back(new SourceLineInfo(Line, Column, Source));
825 /// RecordSource - Register a source file with debug info. Returns an source
827 unsigned RecordSource(const std::string &Directory,
828 const std::string &Source) {
829 unsigned DirectoryID = Directories.insert(Directory);
830 return SourceFiles.insert(SourceFileInfo(DirectoryID, Source));
832 unsigned RecordSource(const CompileUnitDesc *CompileUnit) {
833 return RecordSource(CompileUnit->getDirectory(),
834 CompileUnit->getFileName());
837 /// getDirectories - Return the UniqueVector of std::string representing
839 const UniqueVector<std::string> &getDirectories() const {
843 /// getSourceFiles - Return the UniqueVector of source files.
845 const UniqueVector<SourceFileInfo> &getSourceFiles() const {
849 /// getSourceLines - Return a vector of source lines. Vector index + 1
851 const std::vector<SourceLineInfo *> &getSourceLines() const {
855 /// SetupCompileUnits - Set up the unique vector of compile units.
857 void SetupCompileUnits(Module &M);
859 /// getCompileUnits - Return a vector of debug compile units.
861 const UniqueVector<CompileUnitDesc *> getCompileUnits() const;
863 /// getGlobalVariablesUsing - Return all of the GlobalVariables that use the
864 /// named GlobalVariable.
865 std::vector<GlobalVariable*>
866 getGlobalVariablesUsing(Module &M, const std::string &RootName);
868 /// getAnchoredDescriptors - Return a vector of anchored debug descriptors.
870 template <class T>std::vector<T *> getAnchoredDescriptors(Module &M) {
872 std::vector<GlobalVariable *> Globals =
873 getGlobalVariablesUsing(M, Desc.getAnchorString());
874 std::vector<T *> AnchoredDescs;
875 for (unsigned i = 0, N = Globals.size(); i < N; ++i) {
876 AnchoredDescs.push_back(cast<T>(DR.Deserialize(Globals[i])));
879 return AnchoredDescs;
882 }; // End class MachineDebugInfo
884 } // End llvm namespace