blob: ee093d9bbfa59c80724eb65b90115f573cbe44a4 [file] [log] [blame]
Bill Wendling88423ee2009-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
14#ifndef DWARFLABEL_H__
15#define DWARFLABEL_H__
16
17#include "llvm/Support/Compiler.h"
18#include <iosfwd>
19#include <vector>
20
21namespace llvm {
22 class FoldingSetNodeID;
23
24 //===--------------------------------------------------------------------===//
25 /// DWLabel - Labels are used to track locations in the assembler file.
26 /// Labels appear in the form @verbatim <prefix><Tag><Number> @endverbatim,
27 /// where the tag is a category of label (Ex. location) and number is a value
28 /// unique in that category.
29 class VISIBILITY_HIDDEN DWLabel {
30 /// Tag - Label category tag. Should always be a statically declared C
31 /// string.
32 ///
33 const char *Tag;
34
35 /// Number - Value to make label unique.
36 ///
37 unsigned Number;
38 public:
39 DWLabel(const char *T, unsigned N) : Tag(T), Number(N) {}
40
41 // Accessors.
42 const char *getTag() const { return Tag; }
43 unsigned getNumber() const { return Number; }
44
45 /// Profile - Used to gather unique data for the folding set.
46 ///
47 void Profile(FoldingSetNodeID &ID) const;
48
49#ifndef NDEBUG
50 void print(std::ostream *O) const;
51 void print(std::ostream &O) const;
52#endif
53 };
54} // end llvm namespace
55
56#endif