Bill Wendling | bbee8c9 | 2009-05-15 00:11:17 +0000 | [diff] [blame] | 1 | //===--- lib/CodeGen/DwarfLabel.h - Dwarf Label -----------------*- 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 | // DWARF Labels. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Bill Wendling | b12b3d7 | 2009-05-15 09:23:25 +0000 | [diff] [blame] | 14 | #ifndef CODEGEN_ASMPRINTER_DWARFLABEL_H__ |
| 15 | #define CODEGEN_ASMPRINTER_DWARFLABEL_H__ |
Bill Wendling | bbee8c9 | 2009-05-15 00:11:17 +0000 | [diff] [blame] | 16 | |
Bill Wendling | bbee8c9 | 2009-05-15 00:11:17 +0000 | [diff] [blame] | 17 | namespace llvm { |
| 18 | class FoldingSetNodeID; |
Chris Lattner | 1514e99 | 2009-08-23 01:01:17 +0000 | [diff] [blame] | 19 | class raw_ostream; |
Bill Wendling | bbee8c9 | 2009-05-15 00:11:17 +0000 | [diff] [blame] | 20 | |
| 21 | //===--------------------------------------------------------------------===// |
| 22 | /// DWLabel - Labels are used to track locations in the assembler file. |
| 23 | /// Labels appear in the form @verbatim <prefix><Tag><Number> @endverbatim, |
| 24 | /// where the tag is a category of label (Ex. location) and number is a value |
| 25 | /// unique in that category. |
Chris Lattner | 1514e99 | 2009-08-23 01:01:17 +0000 | [diff] [blame] | 26 | class DWLabel { |
Bill Wendling | bbee8c9 | 2009-05-15 00:11:17 +0000 | [diff] [blame] | 27 | /// Tag - Label category tag. Should always be a statically declared C |
| 28 | /// string. |
| 29 | /// |
| 30 | const char *Tag; |
| 31 | |
| 32 | /// Number - Value to make label unique. |
| 33 | /// |
| 34 | unsigned Number; |
| 35 | public: |
| 36 | DWLabel(const char *T, unsigned N) : Tag(T), Number(N) {} |
| 37 | |
| 38 | // Accessors. |
| 39 | const char *getTag() const { return Tag; } |
| 40 | unsigned getNumber() const { return Number; } |
| 41 | |
| 42 | /// Profile - Used to gather unique data for the folding set. |
| 43 | /// |
| 44 | void Profile(FoldingSetNodeID &ID) const; |
| 45 | |
| 46 | #ifndef NDEBUG |
Chris Lattner | 1514e99 | 2009-08-23 01:01:17 +0000 | [diff] [blame] | 47 | void print(raw_ostream &O) const; |
Bill Wendling | bbee8c9 | 2009-05-15 00:11:17 +0000 | [diff] [blame] | 48 | #endif |
| 49 | }; |
| 50 | } // end llvm namespace |
| 51 | |
| 52 | #endif |