LLVM API Documentation

DwarfLabel.h

Go to the documentation of this file.
00001 //===--- lib/CodeGen/DwarfLabel.h - Dwarf Label -----------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // DWARF Labels.
00011 // 
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef CODEGEN_ASMPRINTER_DWARFLABEL_H__
00015 #define CODEGEN_ASMPRINTER_DWARFLABEL_H__
00016 
00017 #include "llvm/Support/Compiler.h"
00018 #include <iosfwd>
00019 #include <vector>
00020 
00021 namespace llvm {
00022   class FoldingSetNodeID;
00023 
00024   //===--------------------------------------------------------------------===//
00025   /// DWLabel - Labels are used to track locations in the assembler file.
00026   /// Labels appear in the form @verbatim <prefix><Tag><Number> @endverbatim,
00027   /// where the tag is a category of label (Ex. location) and number is a value
00028   /// unique in that category.
00029   class VISIBILITY_HIDDEN DWLabel {
00030     /// Tag - Label category tag. Should always be a statically declared C
00031     /// string.
00032     /// 
00033     const char *Tag;
00034 
00035     /// Number - Value to make label unique.
00036     /// 
00037     unsigned Number;
00038   public:
00039     DWLabel(const char *T, unsigned N) : Tag(T), Number(N) {}
00040 
00041     // Accessors.
00042     const char *getTag() const { return Tag; }
00043     unsigned getNumber() const { return Number; }
00044 
00045     /// Profile - Used to gather unique data for the folding set.
00046     ///
00047     void Profile(FoldingSetNodeID &ID) const;
00048 
00049 #ifndef NDEBUG
00050     void print(std::ostream *O) const;
00051     void print(std::ostream &O) const;
00052 #endif
00053   };
00054 } // end llvm namespace
00055 
00056 #endif