2009-05-15 08:11:17 +08:00
|
|
|
//===--- 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.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-05-15 17:23:25 +08:00
|
|
|
#ifndef CODEGEN_ASMPRINTER_DWARFLABEL_H__
|
|
|
|
#define CODEGEN_ASMPRINTER_DWARFLABEL_H__
|
2009-05-15 08:11:17 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class FoldingSetNodeID;
|
2009-08-23 09:01:17 +08:00
|
|
|
class raw_ostream;
|
2009-05-15 08:11:17 +08:00
|
|
|
|
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
/// 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.
|
2009-08-23 09:01:17 +08:00
|
|
|
class DWLabel {
|
2009-05-15 08:11:17 +08:00
|
|
|
/// 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
|
2009-08-23 09:01:17 +08:00
|
|
|
void print(raw_ostream &O) const;
|
2009-05-15 08:11:17 +08:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
} // end llvm namespace
|
|
|
|
|
|
|
|
#endif
|