summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/AsmPrinter/DwarfLabel.h
blob: b49390334bd26cecb66cf5c2c08f3b7ee6f24f93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//===--- lib/CodeGen/DwarfLabel.h - Dwarf Label -----------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// DWARF Labels.
// 
//===----------------------------------------------------------------------===//

#ifndef CODEGEN_ASMPRINTER_DWARFLABEL_H__
#define CODEGEN_ASMPRINTER_DWARFLABEL_H__

#include "llvm/Support/Compiler.h"
#include <iosfwd>
#include <vector>

namespace llvm {
  class FoldingSetNodeID;

  //===--------------------------------------------------------------------===//
  /// DWLabel - Labels are used to track locations in the assembler file.
  /// Labels appear in the form @verbatim <prefix><Tag><Number> @endverbatim,
  /// where the tag is a category of label (Ex. location) and number is a value
  /// unique in that category.
  class VISIBILITY_HIDDEN DWLabel {
    /// Tag - Label category tag. Should always be a statically declared C
    /// string.
    /// 
    const char *Tag;

    /// Number - Value to make label unique.
    /// 
    unsigned Number;
  public:
    DWLabel(const char *T, unsigned N) : Tag(T), Number(N) {}

    // Accessors.
    const char *getTag() const { return Tag; }
    unsigned getNumber() const { return Number; }

    /// Profile - Used to gather unique data for the folding set.
    ///
    void Profile(FoldingSetNodeID &ID) const;

#ifndef NDEBUG
    void print(std::ostream *O) const;
    void print(std::ostream &O) const;
#endif
  };
} // end llvm namespace

#endif
OpenPOWER on IntegriCloud