blob: 0c0cc4bdc3c6b1f14e199a2f50de80d3e5c4b360 [file] [log] [blame]
Bill Wendlingbbee8c92009-05-15 00:11:17 +00001//===--- 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 Wendlingb12b3d72009-05-15 09:23:25 +000014#ifndef CODEGEN_ASMPRINTER_DWARFLABEL_H__
15#define CODEGEN_ASMPRINTER_DWARFLABEL_H__
Bill Wendlingbbee8c92009-05-15 00:11:17 +000016
Bill Wendlingbbee8c92009-05-15 00:11:17 +000017namespace llvm {
18 class FoldingSetNodeID;
Chris Lattner1514e992009-08-23 01:01:17 +000019 class raw_ostream;
Bill Wendlingbbee8c92009-05-15 00:11:17 +000020
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 Lattner1514e992009-08-23 01:01:17 +000026 class DWLabel {
Bill Wendlingbbee8c92009-05-15 00:11:17 +000027 /// 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 Lattner1514e992009-08-23 01:01:17 +000047 void print(raw_ostream &O) const;
Bill Wendlingbbee8c92009-05-15 00:11:17 +000048#endif
49 };
50} // end llvm namespace
51
52#endif