1 //===--- llvm/Analysis/DebugInfo.h - Debug Information Helpers --*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines a bunch of datatypes that are useful for creating and
11 // walking debug info in LLVM IR form. They essentially provide wrappers around
12 // the information in the global variables that's needed when constructing the
15 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_ANALYSIS_DEBUGINFO_H
18 #define LLVM_ANALYSIS_DEBUGINFO_H
20 #include "llvm/ADT/SmallVector.h"
21 #include "llvm/ADT/SmallPtrSet.h"
22 #include "llvm/ADT/StringRef.h"
23 #include "llvm/Support/Dwarf.h"
35 struct DebugLocTracker;
40 /// DIDescriptor - A thin wraper around MDNode to access encoded debug info.
41 /// This should not be stored in a container, because underly MDNode may
42 /// change in certain situations.
47 /// DIDescriptor constructor. If the specified node is non-null, check
48 /// to make sure that the tag in the descriptor matches 'RequiredTag'. If
49 /// not, the debug info is corrupt and we ignore it.
50 DIDescriptor(MDNode *N, unsigned RequiredTag);
52 StringRef getStringField(unsigned Elt) const;
53 unsigned getUnsignedField(unsigned Elt) const {
54 return (unsigned)getUInt64Field(Elt);
56 uint64_t getUInt64Field(unsigned Elt) const;
57 DIDescriptor getDescriptorField(unsigned Elt) const;
59 template <typename DescTy>
60 DescTy getFieldAs(unsigned Elt) const {
61 return DescTy(getDescriptorField(Elt).getNode());
64 GlobalVariable *getGlobalVariableField(unsigned Elt) const;
67 explicit DIDescriptor() : DbgNode(0) {}
68 explicit DIDescriptor(MDNode *N) : DbgNode(N) {}
70 bool isNull() const { return DbgNode == 0; }
72 MDNode *getNode() const { return DbgNode; }
74 unsigned getVersion() const {
75 return getUnsignedField(0) & LLVMDebugVersionMask;
78 unsigned getTag() const {
79 return getUnsignedField(0) & ~LLVMDebugVersionMask;
82 /// ValidDebugInfo - Return true if N represents valid debug info value.
83 static bool ValidDebugInfo(MDNode *N, unsigned OptLevel);
85 /// dump - print descriptor.
88 bool isDerivedType() const;
89 bool isCompositeType() const;
90 bool isBasicType() const;
91 bool isVariable() const;
92 bool isSubprogram() const;
93 bool isGlobalVariable() const;
95 bool isCompileUnit() const;
96 bool isNameSpace() const;
97 bool isLexicalBlock() const;
98 bool isSubrange() const;
99 bool isEnumerator() const;
101 bool isGlobal() const;
104 /// DISubrange - This is used to represent ranges, for array bounds.
105 class DISubrange : public DIDescriptor {
107 explicit DISubrange(MDNode *N = 0)
108 : DIDescriptor(N, dwarf::DW_TAG_subrange_type) {}
110 int64_t getLo() const { return (int64_t)getUInt64Field(1); }
111 int64_t getHi() const { return (int64_t)getUInt64Field(2); }
114 /// DIArray - This descriptor holds an array of descriptors.
115 class DIArray : public DIDescriptor {
117 explicit DIArray(MDNode *N = 0)
120 unsigned getNumElements() const;
121 DIDescriptor getElement(unsigned Idx) const {
122 return getDescriptorField(Idx);
126 /// DIScope - A base class for various scopes.
127 class DIScope : public DIDescriptor {
129 explicit DIScope(MDNode *N = 0) : DIDescriptor (N) {
130 if (DbgNode && !isScope())
133 virtual ~DIScope() {}
135 StringRef getFilename() const;
136 StringRef getDirectory() const;
139 /// DICompileUnit - A wrapper for a compile unit.
140 class DICompileUnit : public DIScope {
142 explicit DICompileUnit(MDNode *N = 0) : DIScope(N) {
143 if (DbgNode && !isCompileUnit())
147 unsigned getLanguage() const { return getUnsignedField(2); }
148 StringRef getFilename() const { return getStringField(3); }
149 StringRef getDirectory() const { return getStringField(4); }
150 StringRef getProducer() const { return getStringField(5); }
152 /// isMain - Each input file is encoded as a separate compile unit in LLVM
153 /// debugging information output. However, many target specific tool chains
154 /// prefer to encode only one compile unit in an object file. In this
155 /// situation, the LLVM code generator will include debugging information
156 /// entities in the compile unit that is marked as main compile unit. The
157 /// code generator accepts maximum one main compile unit per module. If a
158 /// module does not contain any main compile unit then the code generator
159 /// will emit multiple compile units in the output object file.
161 bool isMain() const { return getUnsignedField(6); }
162 bool isOptimized() const { return getUnsignedField(7); }
163 StringRef getFlags() const { return getStringField(8); }
164 unsigned getRunTimeVersion() const { return getUnsignedField(9); }
166 /// Verify - Verify that a compile unit is well formed.
169 /// dump - print compile unit.
173 /// DIEnumerator - A wrapper for an enumerator (e.g. X and Y in 'enum {X,Y}').
174 /// FIXME: it seems strange that this doesn't have either a reference to the
175 /// type/precision or a file/line pair for location info.
176 class DIEnumerator : public DIDescriptor {
178 explicit DIEnumerator(MDNode *N = 0)
179 : DIDescriptor(N, dwarf::DW_TAG_enumerator) {}
181 StringRef getName() const { return getStringField(1); }
182 uint64_t getEnumValue() const { return getUInt64Field(2); }
185 /// DIType - This is a wrapper for a type.
186 /// FIXME: Types should be factored much better so that CV qualifiers and
187 /// others do not require a huge and empty descriptor full of zeros.
188 class DIType : public DIDescriptor {
191 FlagPrivate = 1 << 0,
192 FlagProtected = 1 << 1,
193 FlagFwdDecl = 1 << 2,
194 FlagAppleBlock = 1 << 3,
195 FlagBlockByrefStruct = 1 << 4,
200 DIType(MDNode *N, unsigned Tag)
201 : DIDescriptor(N, Tag) {}
202 // This ctor is used when the Tag has already been validated by a derived
204 DIType(MDNode *N, bool, bool) : DIDescriptor(N) {}
208 /// Verify - Verify that a type descriptor is well formed.
211 explicit DIType(MDNode *N);
215 DIDescriptor getContext() const { return getDescriptorField(1); }
216 StringRef getName() const { return getStringField(2); }
217 DICompileUnit getCompileUnit() const{ return getFieldAs<DICompileUnit>(3); }
218 unsigned getLineNumber() const { return getUnsignedField(4); }
219 uint64_t getSizeInBits() const { return getUInt64Field(5); }
220 uint64_t getAlignInBits() const { return getUInt64Field(6); }
221 // FIXME: Offset is only used for DW_TAG_member nodes. Making every type
222 // carry this is just plain insane.
223 uint64_t getOffsetInBits() const { return getUInt64Field(7); }
224 unsigned getFlags() const { return getUnsignedField(8); }
225 bool isPrivate() const {
226 return (getFlags() & FlagPrivate) != 0;
228 bool isProtected() const {
229 return (getFlags() & FlagProtected) != 0;
231 bool isForwardDecl() const {
232 return (getFlags() & FlagFwdDecl) != 0;
234 // isAppleBlock - Return true if this is the Apple Blocks extension.
235 bool isAppleBlockExtension() const {
236 return (getFlags() & FlagAppleBlock) != 0;
238 bool isBlockByrefStruct() const {
239 return (getFlags() & FlagBlockByrefStruct) != 0;
241 bool isVirtual() const {
242 return (getFlags() & FlagVirtual) != 0;
245 /// dump - print type.
249 /// DIBasicType - A basic type, like 'int' or 'float'.
250 class DIBasicType : public DIType {
252 explicit DIBasicType(MDNode *N = 0)
253 : DIType(N, dwarf::DW_TAG_base_type) {}
255 unsigned getEncoding() const { return getUnsignedField(9); }
257 /// dump - print basic type.
261 /// DIDerivedType - A simple derived type, like a const qualified type,
262 /// a typedef, a pointer or reference, etc.
263 class DIDerivedType : public DIType {
265 explicit DIDerivedType(MDNode *N, bool, bool)
266 : DIType(N, true, true) {}
268 explicit DIDerivedType(MDNode *N = 0)
269 : DIType(N, true, true) {
270 if (DbgNode && !isDerivedType())
274 DIType getTypeDerivedFrom() const { return getFieldAs<DIType>(9); }
276 /// getOriginalTypeSize - If this type is derived from a base type then
277 /// return base type size.
278 uint64_t getOriginalTypeSize() const;
279 /// dump - print derived type.
282 /// replaceAllUsesWith - Replace all uses of debug info referenced by
283 /// this descriptor. After this completes, the current debug info value
285 void replaceAllUsesWith(DIDescriptor &D);
288 /// DICompositeType - This descriptor holds a type that can refer to multiple
289 /// other types, like a function or struct.
290 /// FIXME: Why is this a DIDerivedType??
291 class DICompositeType : public DIDerivedType {
293 explicit DICompositeType(MDNode *N = 0)
294 : DIDerivedType(N, true, true) {
295 if (N && !isCompositeType())
299 DIArray getTypeArray() const { return getFieldAs<DIArray>(10); }
300 unsigned getRunTimeLang() const { return getUnsignedField(11); }
301 DICompositeType getContainingType() const {
302 return getFieldAs<DICompositeType>(12);
305 /// Verify - Verify that a composite type descriptor is well formed.
308 /// dump - print composite type.
312 /// DIGlobal - This is a common class for global variables and subprograms.
313 class DIGlobal : public DIDescriptor {
315 explicit DIGlobal(MDNode *N, unsigned RequiredTag)
316 : DIDescriptor(N, RequiredTag) {}
319 virtual ~DIGlobal() {}
321 DIDescriptor getContext() const { return getDescriptorField(2); }
322 StringRef getName() const { return getStringField(3); }
323 StringRef getDisplayName() const { return getStringField(4); }
324 StringRef getLinkageName() const { return getStringField(5); }
325 DICompileUnit getCompileUnit() const{ return getFieldAs<DICompileUnit>(6); }
326 unsigned getLineNumber() const { return getUnsignedField(7); }
327 DIType getType() const { return getFieldAs<DIType>(8); }
329 /// isLocalToUnit - Return true if this subprogram is local to the current
330 /// compile unit, like 'static' in C.
331 unsigned isLocalToUnit() const { return getUnsignedField(9); }
332 unsigned isDefinition() const { return getUnsignedField(10); }
334 /// dump - print global.
338 /// DISubprogram - This is a wrapper for a subprogram (e.g. a function).
339 class DISubprogram : public DIScope {
341 explicit DISubprogram(MDNode *N = 0) : DIScope(N) {
342 if (DbgNode && !isSubprogram())
346 DIDescriptor getContext() const { return getDescriptorField(2); }
347 StringRef getName() const { return getStringField(3); }
348 StringRef getDisplayName() const { return getStringField(4); }
349 StringRef getLinkageName() const { return getStringField(5); }
350 DICompileUnit getCompileUnit() const{ return getFieldAs<DICompileUnit>(6); }
351 unsigned getLineNumber() const { return getUnsignedField(7); }
352 DICompositeType getType() const { return getFieldAs<DICompositeType>(8); }
354 /// getReturnTypeName - Subprogram return types are encoded either as
355 /// DIType or as DICompositeType.
356 StringRef getReturnTypeName() const {
357 DICompositeType DCT(getFieldAs<DICompositeType>(8));
359 DIArray A = DCT.getTypeArray();
360 DIType T(A.getElement(0).getNode());
363 DIType T(getFieldAs<DIType>(8));
367 /// isLocalToUnit - Return true if this subprogram is local to the current
368 /// compile unit, like 'static' in C.
369 unsigned isLocalToUnit() const { return getUnsignedField(9); }
370 unsigned isDefinition() const { return getUnsignedField(10); }
372 unsigned getVirtuality() const { return getUnsignedField(11); }
373 unsigned getVirtualIndex() const { return getUnsignedField(12); }
375 DICompositeType getContainingType() const {
376 return getFieldAs<DICompositeType>(13);
378 unsigned isArtificial() const { return getUnsignedField(14); }
380 StringRef getFilename() const { return getCompileUnit().getFilename();}
381 StringRef getDirectory() const { return getCompileUnit().getDirectory();}
383 /// Verify - Verify that a subprogram descriptor is well formed.
386 /// dump - print subprogram.
389 /// describes - Return true if this subprogram provides debugging
390 /// information for the function F.
391 bool describes(const Function *F);
394 /// DIGlobalVariable - This is a wrapper for a global variable.
395 class DIGlobalVariable : public DIGlobal {
397 explicit DIGlobalVariable(MDNode *N = 0)
398 : DIGlobal(N, dwarf::DW_TAG_variable) {}
400 GlobalVariable *getGlobal() const { return getGlobalVariableField(11); }
402 /// Verify - Verify that a global variable descriptor is well formed.
405 /// dump - print global variable.
409 /// DIVariable - This is a wrapper for a variable (e.g. parameter, local,
411 class DIVariable : public DIDescriptor {
413 explicit DIVariable(MDNode *N = 0)
415 if (DbgNode && !isVariable())
419 DIDescriptor getContext() const { return getDescriptorField(1); }
420 StringRef getName() const { return getStringField(2); }
421 DICompileUnit getCompileUnit() const{ return getFieldAs<DICompileUnit>(3); }
422 unsigned getLineNumber() const { return getUnsignedField(4); }
423 DIType getType() const { return getFieldAs<DIType>(5); }
426 /// Verify - Verify that a variable descriptor is well formed.
429 /// HasComplexAddr - Return true if the variable has a complex address.
430 bool hasComplexAddress() const {
431 return getNumAddrElements() > 0;
434 unsigned getNumAddrElements() const;
436 uint64_t getAddrElement(unsigned Idx) const {
437 return getUInt64Field(Idx+6);
440 /// isBlockByrefVariable - Return true if the variable was declared as
441 /// a "__block" variable (Apple Blocks).
442 bool isBlockByrefVariable() const {
443 return getType().isBlockByrefStruct();
446 /// dump - print variable.
450 /// DILexicalBlock - This is a wrapper for a lexical block.
451 class DILexicalBlock : public DIScope {
453 explicit DILexicalBlock(MDNode *N = 0) : DIScope(N) {
454 if (DbgNode && !isLexicalBlock())
457 DIScope getContext() const { return getFieldAs<DIScope>(1); }
458 StringRef getDirectory() const { return getContext().getDirectory(); }
459 StringRef getFilename() const { return getContext().getFilename(); }
462 /// DINameSpace - A wrapper for a C++ style name space.
463 class DINameSpace : public DIScope {
465 explicit DINameSpace(MDNode *N = 0) : DIScope(N) {
466 if (DbgNode && !isNameSpace())
470 DIScope getContext() const { return getFieldAs<DIScope>(1); }
471 StringRef getName() const { return getStringField(2); }
472 StringRef getDirectory() const { return getContext().getDirectory(); }
473 StringRef getFilename() const { return getContext().getFilename(); }
474 DICompileUnit getCompileUnit() const { return getFieldAs<DICompileUnit>(3);}
475 unsigned getLineNumber() const { return getUnsignedField(4); }
478 /// DILocation - This object holds location information. This object
479 /// is not associated with any DWARF tag.
480 class DILocation : public DIDescriptor {
482 explicit DILocation(MDNode *N) : DIDescriptor(N) { }
484 unsigned getLineNumber() const { return getUnsignedField(0); }
485 unsigned getColumnNumber() const { return getUnsignedField(1); }
486 DIScope getScope() const { return getFieldAs<DIScope>(2); }
487 DILocation getOrigLocation() const { return getFieldAs<DILocation>(3); }
488 StringRef getFilename() const { return getScope().getFilename(); }
489 StringRef getDirectory() const { return getScope().getDirectory(); }
492 /// DIFactory - This object assists with the construction of the various
496 LLVMContext& VMContext;
498 Function *DeclareFn; // llvm.dbg.declare
499 Function *ValueFn; // llvm.dbg.value
501 DIFactory(const DIFactory &); // DO NOT IMPLEMENT
502 void operator=(const DIFactory&); // DO NOT IMPLEMENT
504 enum ComplexAddrKind { OpPlus=1, OpDeref };
506 explicit DIFactory(Module &m);
508 /// GetOrCreateArray - Create an descriptor for an array of descriptors.
509 /// This implicitly uniques the arrays created.
510 DIArray GetOrCreateArray(DIDescriptor *Tys, unsigned NumTys);
512 /// GetOrCreateSubrange - Create a descriptor for a value range. This
513 /// implicitly uniques the values returned.
514 DISubrange GetOrCreateSubrange(int64_t Lo, int64_t Hi);
516 /// CreateCompileUnit - Create a new descriptor for the specified compile
518 DICompileUnit CreateCompileUnit(unsigned LangID,
523 bool isOptimized = false,
524 StringRef Flags = "",
525 unsigned RunTimeVer = 0);
527 /// CreateEnumerator - Create a single enumerator value.
528 DIEnumerator CreateEnumerator(StringRef Name, uint64_t Val);
530 /// CreateBasicType - Create a basic type like int, float, etc.
531 DIBasicType CreateBasicType(DIDescriptor Context, StringRef Name,
532 DICompileUnit CompileUnit, unsigned LineNumber,
533 uint64_t SizeInBits, uint64_t AlignInBits,
534 uint64_t OffsetInBits, unsigned Flags,
537 /// CreateBasicType - Create a basic type like int, float, etc.
538 DIBasicType CreateBasicTypeEx(DIDescriptor Context, StringRef Name,
539 DICompileUnit CompileUnit, unsigned LineNumber,
540 Constant *SizeInBits, Constant *AlignInBits,
541 Constant *OffsetInBits, unsigned Flags,
544 /// CreateDerivedType - Create a derived type like const qualified type,
545 /// pointer, typedef, etc.
546 DIDerivedType CreateDerivedType(unsigned Tag, DIDescriptor Context,
548 DICompileUnit CompileUnit,
550 uint64_t SizeInBits, uint64_t AlignInBits,
551 uint64_t OffsetInBits, unsigned Flags,
554 /// CreateDerivedType - Create a derived type like const qualified type,
555 /// pointer, typedef, etc.
556 DIDerivedType CreateDerivedTypeEx(unsigned Tag, DIDescriptor Context,
558 DICompileUnit CompileUnit,
560 Constant *SizeInBits, Constant *AlignInBits,
561 Constant *OffsetInBits, unsigned Flags,
564 /// CreateCompositeType - Create a composite type like array, struct, etc.
565 DICompositeType CreateCompositeType(unsigned Tag, DIDescriptor Context,
567 DICompileUnit CompileUnit,
570 uint64_t AlignInBits,
571 uint64_t OffsetInBits, unsigned Flags,
574 unsigned RunTimeLang = 0,
575 MDNode *ContainingType = 0);
577 /// CreateCompositeType - Create a composite type like array, struct, etc.
578 DICompositeType CreateCompositeTypeEx(unsigned Tag, DIDescriptor Context,
580 DICompileUnit CompileUnit,
582 Constant *SizeInBits,
583 Constant *AlignInBits,
584 Constant *OffsetInBits, unsigned Flags,
587 unsigned RunTimeLang = 0);
589 /// CreateSubprogram - Create a new descriptor for the specified subprogram.
590 /// See comments in DISubprogram for descriptions of these fields.
591 DISubprogram CreateSubprogram(DIDescriptor Context, StringRef Name,
592 StringRef DisplayName,
593 StringRef LinkageName,
594 DICompileUnit CompileUnit, unsigned LineNo,
595 DIType Ty, bool isLocalToUnit,
600 bool isArtificial = 0);
602 /// CreateSubprogramDefinition - Create new subprogram descriptor for the
603 /// given declaration.
604 DISubprogram CreateSubprogramDefinition(DISubprogram &SPDeclaration);
606 /// CreateGlobalVariable - Create a new descriptor for the specified global.
608 CreateGlobalVariable(DIDescriptor Context, StringRef Name,
609 StringRef DisplayName,
610 StringRef LinkageName,
611 DICompileUnit CompileUnit,
612 unsigned LineNo, DIType Ty, bool isLocalToUnit,
613 bool isDefinition, llvm::GlobalVariable *GV);
615 /// CreateVariable - Create a new descriptor for the specified variable.
616 DIVariable CreateVariable(unsigned Tag, DIDescriptor Context,
618 DICompileUnit CompileUnit, unsigned LineNo,
621 /// CreateComplexVariable - Create a new descriptor for the specified
622 /// variable which has a complex address expression for its address.
623 DIVariable CreateComplexVariable(unsigned Tag, DIDescriptor Context,
624 const std::string &Name,
625 DICompileUnit CompileUnit, unsigned LineNo,
627 SmallVector<Value *, 9> &addr);
629 /// CreateLexicalBlock - This creates a descriptor for a lexical block
630 /// with the specified parent context.
631 DILexicalBlock CreateLexicalBlock(DIDescriptor Context);
633 /// CreateNameSpace - This creates new descriptor for a namespace
634 /// with the specified parent context.
635 DINameSpace CreateNameSpace(DIDescriptor Context, StringRef Name,
636 DICompileUnit CU, unsigned LineNo);
638 /// CreateLocation - Creates a debug info location.
639 DILocation CreateLocation(unsigned LineNo, unsigned ColumnNo,
640 DIScope S, DILocation OrigLoc);
642 /// CreateLocation - Creates a debug info location.
643 DILocation CreateLocation(unsigned LineNo, unsigned ColumnNo,
644 DIScope S, MDNode *OrigLoc = 0);
646 /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
647 Instruction *InsertDeclare(llvm::Value *Storage, DIVariable D,
648 BasicBlock *InsertAtEnd);
650 /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
651 Instruction *InsertDeclare(llvm::Value *Storage, DIVariable D,
652 Instruction *InsertBefore);
654 /// InsertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
655 Instruction *InsertDbgValueIntrinsic(llvm::Value *V, uint64_t Offset,
656 DIVariable D, BasicBlock *InsertAtEnd);
658 /// InsertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
659 Instruction *InsertDbgValueIntrinsic(llvm::Value *V, uint64_t Offset,
660 DIVariable D, Instruction *InsertBefore);
662 Constant *GetTagConstant(unsigned TAG);
665 bool getLocationInfo(const Value *V, std::string &DisplayName,
666 std::string &Type, unsigned &LineNo, std::string &File,
669 /// ExtractDebugLocation - Extract debug location information
671 DebugLoc ExtractDebugLocation(DILocation &Loc,
672 DebugLocTracker &DebugLocInfo);
674 /// getDISubprogram - Find subprogram that is enclosing this scope.
675 DISubprogram getDISubprogram(MDNode *Scope);
677 /// getDICompositeType - Find underlying composite type.
678 DICompositeType getDICompositeType(DIType T);
680 class DebugInfoFinder {
682 /// processModule - Process entire module and collect debug info
684 void processModule(Module &M);
687 /// processType - Process DIType.
688 void processType(DIType DT);
690 /// processLexicalBlock - Process DILexicalBlock.
691 void processLexicalBlock(DILexicalBlock LB);
693 /// processSubprogram - Process DISubprogram.
694 void processSubprogram(DISubprogram SP);
696 /// processDeclare - Process DbgDeclareInst.
697 void processDeclare(DbgDeclareInst *DDI);
699 /// processLocation - Process DILocation.
700 void processLocation(DILocation Loc);
702 /// addCompileUnit - Add compile unit into CUs.
703 bool addCompileUnit(DICompileUnit CU);
705 /// addGlobalVariable - Add global variable into GVs.
706 bool addGlobalVariable(DIGlobalVariable DIG);
708 // addSubprogram - Add subprgoram into SPs.
709 bool addSubprogram(DISubprogram SP);
711 /// addType - Add type into Tys.
712 bool addType(DIType DT);
715 typedef SmallVector<MDNode *, 8>::iterator iterator;
716 iterator compile_unit_begin() { return CUs.begin(); }
717 iterator compile_unit_end() { return CUs.end(); }
718 iterator subprogram_begin() { return SPs.begin(); }
719 iterator subprogram_end() { return SPs.end(); }
720 iterator global_variable_begin() { return GVs.begin(); }
721 iterator global_variable_end() { return GVs.end(); }
722 iterator type_begin() { return TYs.begin(); }
723 iterator type_end() { return TYs.end(); }
725 unsigned compile_unit_count() { return CUs.size(); }
726 unsigned global_variable_count() { return GVs.size(); }
727 unsigned subprogram_count() { return SPs.size(); }
728 unsigned type_count() { return TYs.size(); }
731 SmallVector<MDNode *, 8> CUs; // Compile Units
732 SmallVector<MDNode *, 8> SPs; // Subprograms
733 SmallVector<MDNode *, 8> GVs; // Global Variables;
734 SmallVector<MDNode *, 8> TYs; // Types
735 SmallPtrSet<MDNode *, 64> NodesSeen;
737 } // end namespace llvm