- Update comments.
[oota-llvm.git] / include / llvm / CodeGen / MachineDebugInfoDesc.h
1 //===-- llvm/CodeGen/MachineDebugInfoDesc.h ---------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Debug descriptor information for a module.
11 // 
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_CODEGEN_MACHINEDEBUGINFODESC_H
15 #define LLVM_CODEGEN_MACHINEDEBUGINFODESC_H
16
17 #include "llvm/Support/DataTypes.h"
18 #include <string>
19 #include <vector>
20
21 namespace llvm {
22
23 //===----------------------------------------------------------------------===//
24 // Forward declarations.
25 class DIVisitor;
26 class GlobalVariable;
27
28 //===----------------------------------------------------------------------===//
29 // Debug info description constants.
30
31 enum {
32   LLVMDebugVersion     = (6 << 16),     // Current version of debug information.
33   LLVMDebugVersion5    = (5 << 16),     // Constant for version 5.
34   LLVMDebugVersion4    = (4 << 16),     // Constant for version 4.
35   LLVMDebugVersionMask = 0xffff0000     // Mask for version number.
36 };
37
38 //===----------------------------------------------------------------------===//
39 /// DebugInfoDesc - This class is the base class for debug info descriptors.
40
41 class DebugInfoDesc {
42   // Content indicator. Dwarf values are used but that does not limit use to
43   // Dwarf writers.
44   unsigned Tag;
45 protected:
46   explicit DebugInfoDesc(unsigned T) : Tag(T | LLVMDebugVersion) {}
47 public:
48   virtual ~DebugInfoDesc();
49
50   // Accessors
51   unsigned getTag()          const { return Tag & ~LLVMDebugVersionMask; }
52   unsigned getVersion()      const { return Tag &  LLVMDebugVersionMask; }
53   void setTag(unsigned T)          { Tag = T | LLVMDebugVersion; }
54   
55   /// TagFromGlobal - Returns the tag number from a debug info descriptor
56   /// GlobalVariable.  Return DIIValid if operand is not an unsigned int. 
57   static unsigned TagFromGlobal(GlobalVariable *GV);
58
59   /// VersionFromGlobal - Returns the version number from a debug info
60   /// descriptor GlobalVariable. Return DIIValid if operand is not an unsigned
61   /// int.
62   static unsigned VersionFromGlobal(GlobalVariable *GV);
63
64   /// DescFactory - Create an instance of debug info descriptor based on Tag.
65   /// Return NULL if not a recognized Tag.
66   static DebugInfoDesc *DescFactory(unsigned Tag);
67   
68   /// getLinkage - get linkage appropriate for this type of descriptor.
69   ///
70   virtual unsigned getLinkage() const;
71     
72   //===--------------------------------------------------------------------===//
73   // Subclasses should supply the following virtual methods.
74   
75   /// ApplyToFields - Target the vistor to the fields of the descriptor.
76   ///
77   virtual void ApplyToFields(DIVisitor *Visitor);
78
79   /// getDescString - Return a string used to compose global names and labels.
80   ///
81   virtual const char *getDescString() const = 0;
82   
83   /// getTypeString - Return a string used to label this descriptor's type.
84   ///
85   virtual const char *getTypeString() const = 0;
86   
87 #ifndef NDEBUG
88   virtual void dump() = 0;
89 #endif
90
91   //===--------------------------------------------------------------------===//
92   // Subclasses should supply the following static methods.
93   
94   // Implement isa/cast/dyncast.
95   static bool classof(const DebugInfoDesc *) { return true; }  
96 };
97
98 //===----------------------------------------------------------------------===//
99 /// AnchorDesc - Descriptors of this class act as markers for identifying
100 /// descriptors of certain groups.
101 class AnchoredDesc;
102 class AnchorDesc : public DebugInfoDesc {
103   // Tag number of descriptors anchored by this object.
104   unsigned AnchorTag;
105 public:
106   AnchorDesc();
107   explicit AnchorDesc(AnchoredDesc *D);
108   
109   // Accessors
110   unsigned getAnchorTag() const { return AnchorTag; }
111
112   /// getLinkage - get linkage appropriate for this type of descriptor.
113   ///
114   virtual unsigned getLinkage() const;
115
116   /// ApplyToFields - Target the visitor to the fields of the AnchorDesc.
117   ///
118   virtual void ApplyToFields(DIVisitor *Visitor);
119
120   /// getDescString - Return a string used to compose global names and labels.
121   ///
122   virtual const char *getDescString() const;
123     
124   /// getTypeString - Return a string used to label this descriptor's type.
125   ///
126   virtual const char *getTypeString() const {
127     return "llvm.dbg.anchor.type";
128   }
129     
130 #ifndef NDEBUG
131   virtual void dump();
132 #endif
133
134   // Implement isa/cast/dyncast.
135   static bool classof(const AnchorDesc *) { return true; }
136   static bool classof(const DebugInfoDesc *D);
137 };
138
139 //===----------------------------------------------------------------------===//
140 /// AnchoredDesc - This class manages anchors for a variety of top level
141 /// descriptors.
142 class AnchoredDesc : public DebugInfoDesc {
143   // Anchor for all descriptors of the same type.
144   DebugInfoDesc *Anchor;
145 protected:
146   explicit AnchoredDesc(unsigned T);
147 public:  
148   // Accessors.
149   AnchorDesc *getAnchor() const { return static_cast<AnchorDesc *>(Anchor); }
150   void setAnchor(AnchorDesc *A) { Anchor = static_cast<DebugInfoDesc *>(A); }
151
152   //===--------------------------------------------------------------------===//
153   // Subclasses should supply the following virtual methods.
154   
155   /// getAnchorString - Return a string used to label descriptor's anchor.
156   ///
157   virtual const char *getAnchorString() const = 0;
158     
159   /// ApplyToFields - Target the visitor to the fields of the AnchoredDesc.
160   ///
161   virtual void ApplyToFields(DIVisitor *Visitor);
162 };
163
164 //===----------------------------------------------------------------------===//
165 /// CompileUnitDesc - This class packages debug information associated with a 
166 /// source/header file.
167 class CompileUnitDesc : public AnchoredDesc {
168   unsigned Language;                    // Language number (ex. DW_LANG_C89.)
169   std::string FileName;                 // Source file name.
170   std::string Directory;                // Source file directory.
171   std::string Producer;                 // Compiler string.
172 public:
173   CompileUnitDesc();
174   
175   // Accessors
176   unsigned getLanguage()                  const { return Language; }
177   const std::string &getFileName()        const { return FileName; }
178   const std::string &getDirectory()       const { return Directory; }
179   const std::string &getProducer()        const { return Producer; }
180   void setLanguage(unsigned L)                  { Language = L; }
181   void setFileName(const std::string &FN)       { FileName = FN; }
182   void setDirectory(const std::string &D)       { Directory = D; }
183   void setProducer(const std::string &P)        { Producer = P; }
184   
185   // FIXME - Need translation unit getter/setter.
186
187   /// ApplyToFields - Target the visitor to the fields of the CompileUnitDesc.
188   ///
189   virtual void ApplyToFields(DIVisitor *Visitor);
190
191   /// getDescString - Return a string used to compose global names and labels.
192   ///
193   virtual const char *getDescString() const {
194     return "llvm.dbg.compile_unit";
195   }
196
197   /// getTypeString - Return a string used to label this descriptor's type.
198   ///
199   virtual const char *getTypeString() const {
200     return "llvm.dbg.compile_unit.type";
201   }
202
203   /// getAnchorString - Return a string used to label this descriptor's anchor.
204   ///
205   const char *getAnchorString() const {
206     return "llvm.dbg.compile_units";
207   }
208     
209 #ifndef NDEBUG
210   virtual void dump();
211 #endif
212
213   // Implement isa/cast/dyncast.
214   static bool classof(const CompileUnitDesc *) { return true; }
215   static bool classof(const DebugInfoDesc *D);
216 };
217
218 //===----------------------------------------------------------------------===//
219 /// TypeDesc - This class packages debug information associated with a type.
220 ///
221 class TypeDesc : public DebugInfoDesc {
222   enum {
223     FlagPrivate    = 1 << 0,
224     FlagProtected  = 1 << 1
225   };
226   DebugInfoDesc *Context;               // Context debug descriptor.
227   std::string Name;                     // Type name (may be empty.)
228   DebugInfoDesc *File;                  // Defined compile unit (may be NULL.)
229   unsigned Line;                        // Defined line# (may be zero.)
230   uint64_t Size;                        // Type bit size (may be zero.)
231   uint64_t Align;                       // Type bit alignment (may be zero.)
232   uint64_t Offset;                      // Type bit offset (may be zero.)
233   unsigned Flags;                       // Miscellaneous flags.
234 public:
235   explicit TypeDesc(unsigned T);
236
237   // Accessors
238   DebugInfoDesc *getContext() const  { return Context; }
239   const std::string &getName() const { return Name; }
240   CompileUnitDesc *getFile() const {
241     return static_cast<CompileUnitDesc *>(File);
242   }
243   unsigned getLine() const   { return Line; }
244   uint64_t getSize() const   { return Size; }
245   uint64_t getAlign() const  { return Align; }
246   uint64_t getOffset() const { return Offset; }
247   bool isPrivate() const {
248     return (Flags & FlagPrivate) != 0;
249   }
250   bool isProtected() const {
251     return (Flags & FlagProtected) != 0;
252   }
253   void setContext(DebugInfoDesc *C)  { Context = C; }
254   void setName(const std::string &N) { Name = N; }
255   void setFile(CompileUnitDesc *U) {
256     File = static_cast<DebugInfoDesc *>(U);
257   }
258   void setLine(unsigned L)   { Line = L; }
259   void setSize(uint64_t S)   { Size = S; }
260   void setAlign(uint64_t A)  { Align = A; }
261   void setOffset(uint64_t O) { Offset = O; }
262   void setIsPrivate()        { Flags |= FlagPrivate; }
263   void setIsProtected()      { Flags |= FlagProtected; }
264   
265   /// ApplyToFields - Target the visitor to the fields of the TypeDesc.
266   ///
267   virtual void ApplyToFields(DIVisitor *Visitor);
268
269   /// getDescString - Return a string used to compose global names and labels.
270   ///
271   virtual const char *getDescString() const {
272     return "llvm.dbg.type";
273   }
274
275   /// getTypeString - Return a string used to label this descriptor's type.
276   ///
277   virtual const char *getTypeString() const {
278     return "llvm.dbg.type.type";
279   }
280   
281 #ifndef NDEBUG
282   virtual void dump();
283 #endif
284 };
285
286 //===----------------------------------------------------------------------===//
287 /// BasicTypeDesc - This class packages debug information associated with a
288 /// basic type (eg. int, bool, double.)
289 class BasicTypeDesc : public TypeDesc {
290   unsigned Encoding;                    // Type encoding.
291 public:
292   BasicTypeDesc();
293   
294   // Accessors
295   unsigned getEncoding() const { return Encoding; }
296   void setEncoding(unsigned E) { Encoding = E; }
297   
298   /// ApplyToFields - Target the visitor to the fields of the BasicTypeDesc.
299   ///
300   virtual void ApplyToFields(DIVisitor *Visitor);
301
302   /// getDescString - Return a string used to compose global names and labels.
303   ///
304   virtual const char *getDescString() const {
305     return "llvm.dbg.basictype";
306   }
307
308   /// getTypeString - Return a string used to label this descriptor's type.
309   ///
310   virtual const char *getTypeString() const {
311     return "llvm.dbg.basictype.type";
312   }
313
314 #ifndef NDEBUG
315   virtual void dump();
316 #endif
317
318   // Implement isa/cast/dyncast.
319   static bool classof(const BasicTypeDesc *) { return true; }
320   static bool classof(const DebugInfoDesc *D);
321 };
322
323 //===----------------------------------------------------------------------===//
324 /// DerivedTypeDesc - This class packages debug information associated with a
325 /// derived types (eg., typedef, pointer, reference.)
326 class DerivedTypeDesc : public TypeDesc {
327   DebugInfoDesc *FromType;              // Type derived from.
328 public:
329   explicit DerivedTypeDesc(unsigned T);
330   
331   // Accessors
332   TypeDesc *getFromType() const {
333     return static_cast<TypeDesc *>(FromType);
334   }
335   void setFromType(TypeDesc *F) {
336     FromType = static_cast<DebugInfoDesc *>(F);
337   }
338   
339   /// ApplyToFields - Target the visitor to the fields of the DerivedTypeDesc.
340   ///
341   virtual void ApplyToFields(DIVisitor *Visitor);
342
343   /// getDescString - Return a string used to compose global names and labels.
344   ///
345   virtual const char *getDescString() const {
346     return "llvm.dbg.derivedtype";
347   }
348
349   /// getTypeString - Return a string used to label this descriptor's type.
350   ///
351   virtual const char *getTypeString() const {
352     return "llvm.dbg.derivedtype.type";
353   }
354
355 #ifndef NDEBUG
356   virtual void dump();
357 #endif
358
359   // Implement isa/cast/dyncast.
360   static bool classof(const DerivedTypeDesc *) { return true; }
361   static bool classof(const DebugInfoDesc *D);
362 };
363
364 //===----------------------------------------------------------------------===//
365 /// CompositeTypeDesc - This class packages debug information associated with a
366 /// array/struct types (eg., arrays, struct, union, enums.)
367 class CompositeTypeDesc : public DerivedTypeDesc {
368   std::vector<DebugInfoDesc *> Elements; // Information used to compose type.
369 public:
370   explicit CompositeTypeDesc(unsigned T);
371   
372   // Accessors
373   std::vector<DebugInfoDesc *> &getElements() { return Elements; }
374   
375   /// ApplyToFields - Target the visitor to the fields of the CompositeTypeDesc.
376   ///
377   virtual void ApplyToFields(DIVisitor *Visitor);
378
379   /// getDescString - Return a string used to compose global names and labels.
380   ///
381   virtual const char *getDescString() const {
382     return "llvm.dbg.compositetype";
383   }
384
385   /// getTypeString - Return a string used to label this descriptor's type.
386   ///
387   virtual const char *getTypeString() const {
388     return "llvm.dbg.compositetype.type";
389   }
390
391 #ifndef NDEBUG
392   virtual void dump();
393 #endif
394
395   // Implement isa/cast/dyncast.
396   static bool classof(const CompositeTypeDesc *) { return true; }
397   static bool classof(const DebugInfoDesc *D);
398 };
399
400 //===----------------------------------------------------------------------===//
401 /// SubrangeDesc - This class packages debug information associated with integer
402 /// value ranges.
403 class SubrangeDesc : public DebugInfoDesc {
404   int64_t Lo;                           // Low value of range.
405   int64_t Hi;                           // High value of range.
406 public:
407   SubrangeDesc();
408   
409   // Accessors
410   int64_t getLo()                            const { return Lo; }
411   int64_t getHi()                            const { return Hi; }
412   void setLo(int64_t L)                            { Lo = L; }
413   void setHi(int64_t H)                            { Hi = H; }
414   
415   /// ApplyToFields - Target the visitor to the fields of the SubrangeDesc.
416   ///
417   virtual void ApplyToFields(DIVisitor *Visitor);
418
419   /// getDescString - Return a string used to compose global names and labels.
420   ///
421   virtual const char *getDescString() const {
422     return "llvm.dbg.subrange";
423   }
424   
425   /// getTypeString - Return a string used to label this descriptor's type.
426   ///
427   virtual const char *getTypeString() const {
428     return "llvm.dbg.subrange.type";
429   }
430
431 #ifndef NDEBUG
432   virtual void dump();
433 #endif
434
435   // Implement isa/cast/dyncast.
436   static bool classof(const SubrangeDesc *) { return true; }
437   static bool classof(const DebugInfoDesc *D);
438 };
439
440 //===----------------------------------------------------------------------===//
441 /// EnumeratorDesc - This class packages debug information associated with
442 /// named integer constants.
443 class EnumeratorDesc : public DebugInfoDesc {
444   std::string Name;                     // Enumerator name.
445   int64_t Value;                        // Enumerator value.
446 public:
447   EnumeratorDesc();
448   
449   // Accessors
450   const std::string &getName() const { return Name; }
451   int64_t getValue() const { return Value; }
452   void setName(const std::string &N) { Name = N; }
453   void setValue(int64_t V) { Value = V; }
454   
455   /// ApplyToFields - Target the visitor to the fields of the EnumeratorDesc.
456   ///
457   virtual void ApplyToFields(DIVisitor *Visitor);
458
459   /// getDescString - Return a string used to compose global names and labels.
460   ///
461   virtual const char *getDescString() const {
462     return "llvm.dbg.enumerator";
463   }
464   
465   /// getTypeString - Return a string used to label this descriptor's type.
466   ///
467   virtual const char *getTypeString() const {
468     return "llvm.dbg.enumerator.type";
469   }
470
471 #ifndef NDEBUG
472   virtual void dump();
473 #endif
474
475   // Implement isa/cast/dyncast.
476   static bool classof(const EnumeratorDesc *) { return true; }
477   static bool classof(const DebugInfoDesc *D);
478 };
479
480 //===----------------------------------------------------------------------===//
481 /// VariableDesc - This class packages debug information associated with a
482 /// subprogram variable.
483 ///
484 class VariableDesc : public DebugInfoDesc {
485   DebugInfoDesc *Context;               // Context debug descriptor.
486   std::string Name;                     // Type name (may be empty.)
487   DebugInfoDesc *File;                  // Defined compile unit (may be NULL.)
488   unsigned Line;                        // Defined line# (may be zero.)
489   DebugInfoDesc *TyDesc;                // Type of variable.
490 public:
491   explicit VariableDesc(unsigned T);
492
493   // Accessors
494   DebugInfoDesc *getContext() const  { return Context; }
495   const std::string &getName() const { return Name; }
496   CompileUnitDesc *getFile() const {
497     return static_cast<CompileUnitDesc *>(File);
498   }
499   unsigned getLine() const { return Line; }
500   TypeDesc *getType() const {
501     return static_cast<TypeDesc*>(TyDesc);
502   }
503   void setContext(DebugInfoDesc *C)  { Context = C; }
504   void setName(const std::string &N) { Name = N; }
505   void setFile(CompileUnitDesc *U) {
506     File = static_cast<DebugInfoDesc *>(U);
507   }
508   void setLine(unsigned L) { Line = L; }
509   void setType(TypeDesc *T) {
510     TyDesc = static_cast<DebugInfoDesc *>(T);
511   }
512   
513   /// ApplyToFields - Target the visitor to the fields of the VariableDesc.
514   ///
515   virtual void ApplyToFields(DIVisitor *Visitor);
516
517   /// getDescString - Return a string used to compose global names and labels.
518   ///
519   virtual const char *getDescString() const {
520     return "llvm.dbg.variable";
521   }
522
523   /// getTypeString - Return a string used to label this descriptor's type.
524   ///
525   virtual const char *getTypeString() const {
526     return "llvm.dbg.variable.type";
527   }
528
529 #ifndef NDEBUG
530   virtual void dump();
531 #endif
532   
533   // Implement isa/cast/dyncast.
534   static bool classof(const VariableDesc *) { return true; }
535   static bool classof(const DebugInfoDesc *D);
536 };
537
538 //===----------------------------------------------------------------------===//
539 /// GlobalDesc - This class is the base descriptor for global functions and
540 /// variables.
541 class GlobalDesc : public AnchoredDesc {
542   DebugInfoDesc *Context;               // Context debug descriptor.
543   std::string Name;                     // Global name.
544   std::string FullName;                 // Fully qualified name.
545   std::string LinkageName;              // Name for binding to MIPS linkage.
546   DebugInfoDesc *File;                  // Defined compile unit (may be NULL.)
547   unsigned Line;                        // Defined line# (may be zero.)
548   DebugInfoDesc *TyDesc;                // Type debug descriptor.
549   bool IsStatic;                        // Is the global a static.
550   bool IsDefinition;                    // Is the global defined in context.
551 protected:
552   explicit GlobalDesc(unsigned T);
553 public:
554   // Accessors
555   DebugInfoDesc *getContext()                const { return Context; }
556   const std::string &getName()               const { return Name; }
557   const std::string &getFullName()           const { return FullName; }
558   const std::string &getLinkageName()        const { return LinkageName; }
559   CompileUnitDesc *getFile() const {
560     return static_cast<CompileUnitDesc *>(File);
561   }
562   unsigned getLine()                         const { return Line; }
563   TypeDesc *getType() const {
564     return static_cast<TypeDesc *>(TyDesc);
565   }
566   bool isStatic()                            const { return IsStatic; }
567   bool isDefinition()                        const { return IsDefinition; }
568   void setContext(DebugInfoDesc *C)                { Context = C; }
569   void setName(const std::string &N)               { Name = N; }
570   void setFullName(const std::string &N)           { FullName = N; }
571   void setLinkageName(const std::string &N)        { LinkageName = N; }
572   void setFile(CompileUnitDesc *U) {
573     File = static_cast<DebugInfoDesc *>(U);
574   }
575   void setLine(unsigned L)                         { Line = L; }
576   void setType(TypeDesc *T) {
577     TyDesc = static_cast<DebugInfoDesc *>(T);
578   }
579   void setIsStatic(bool IS)                        { IsStatic = IS; }
580   void setIsDefinition(bool ID)                    { IsDefinition = ID; }
581
582   /// ApplyToFields - Target the visitor to the fields of the GlobalDesc.
583   ///
584   virtual void ApplyToFields(DIVisitor *Visitor);
585 };
586
587 //===----------------------------------------------------------------------===//
588 /// GlobalVariableDesc - This class packages debug information associated with a
589 /// GlobalVariable.
590 class GlobalVariableDesc : public GlobalDesc {
591   GlobalVariable *Global;               // llvm global.
592 public:
593   GlobalVariableDesc();
594
595   // Accessors.
596   GlobalVariable *getGlobalVariable()        const { return Global; }
597   void setGlobalVariable(GlobalVariable *GV)       { Global = GV; }
598   
599   /// ApplyToFields - Target the visitor to the fields of the
600   /// GlobalVariableDesc.
601   virtual void ApplyToFields(DIVisitor *Visitor);
602
603   /// getDescString - Return a string used to compose global names and labels.
604   ///
605   virtual const char *getDescString() const {
606     return "llvm.dbg.global_variable";
607   }
608
609   /// getTypeString - Return a string used to label this descriptor's type.
610   ///
611   virtual const char *getTypeString() const {
612     return "llvm.dbg.global_variable.type";
613   }
614   
615   /// getAnchorString - Return a string used to label this descriptor's anchor.
616   ///
617   const char *getAnchorString() const {
618     return "llvm.dbg.global_variables";
619   }
620     
621 #ifndef NDEBUG
622   virtual void dump();
623 #endif
624  
625   // Implement isa/cast/dyncast.
626   static bool classof(const GlobalVariableDesc *) { return true; }
627   static bool classof(const DebugInfoDesc *D);
628 };
629
630 //===----------------------------------------------------------------------===//
631 /// SubprogramDesc - This class packages debug information associated with a
632 /// subprogram/function.
633 struct SubprogramDesc : public GlobalDesc {
634   SubprogramDesc();
635   
636   /// ApplyToFields - Target the visitor to the fields of the SubprogramDesc.
637   ///
638   virtual void ApplyToFields(DIVisitor *Visitor);
639
640   /// getDescString - Return a string used to compose global names and labels.
641   ///
642   virtual const char *getDescString() const {
643     return "llvm.dbg.subprogram";
644   }
645
646   /// getTypeString - Return a string used to label this descriptor's type.
647   ///
648   virtual const char *getTypeString() const {
649     return "llvm.dbg.subprogram.type";
650   }
651   
652   /// getAnchorString - Return a string used to label this descriptor's anchor.
653   ///
654   const char *getAnchorString() const {
655     return "llvm.dbg.subprograms";
656   }
657     
658 #ifndef NDEBUG
659   virtual void dump();
660 #endif
661   
662   // Implement isa/cast/dyncast.
663   static bool classof(const SubprogramDesc *) { return true; }
664   static bool classof(const DebugInfoDesc *D);
665 };
666
667 //===----------------------------------------------------------------------===//
668 /// BlockDesc - This descriptor groups variables and blocks nested in a block.
669 ///
670 class BlockDesc : public DebugInfoDesc {
671   DebugInfoDesc *Context;               // Context debug descriptor.
672 public:
673   BlockDesc();
674   
675   // Accessors
676   DebugInfoDesc *getContext()                const { return Context; }
677   void setContext(DebugInfoDesc *C)                { Context = C; }
678   
679   /// ApplyToFields - Target the visitor to the fields of the BlockDesc.
680   ///
681   virtual void ApplyToFields(DIVisitor *Visitor);
682
683   /// getDescString - Return a string used to compose global names and labels.
684   ///
685   virtual const char *getDescString() const {
686     return "llvm.dbg.block";
687   }
688
689   /// getTypeString - Return a string used to label this descriptor's type.
690   ///
691   virtual const char *getTypeString() const {
692     return "llvm.dbg.block.type";
693   }
694  
695 #ifndef NDEBUG
696   virtual void dump();
697 #endif
698   
699   // Implement isa/cast/dyncast.
700   static bool classof(const BlockDesc *) { return true; }
701   static bool classof(const DebugInfoDesc *D);
702 };
703
704 } // End llvm namespace
705
706 #endif