1 //===- MCLabel.h - Machine Code Directional Local Labels --------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declaration of the MCLabel class.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_MC_MCLABEL_H
15 #define LLVM_MC_MCLABEL_H
17 #include "llvm/Support/Compiler.h"
23 /// MCLabel - Instances of this class represent a label name in the MC file,
24 /// and MCLabel are created and unique'd by the MCContext class. MCLabel
25 /// should only be constructed for valid instances in the object file.
27 // Instance - the instance number of this Directional Local Label
30 private: // MCContext creates and uniques these.
31 friend class MCContext;
32 MCLabel(unsigned instance)
33 : Instance(instance) {}
35 MCLabel(const MCLabel&) LLVM_DELETED_FUNCTION;
36 void operator=(const MCLabel&) LLVM_DELETED_FUNCTION;
38 /// getInstance - Get the current instance of this Directional Local Label.
39 unsigned getInstance() const { return Instance; }
41 /// incInstance - Increment the current instance of this Directional Local
43 unsigned incInstance() { return ++Instance; }
45 /// print - Print the value to the stream \p OS.
46 void print(raw_ostream &OS) const;
48 /// dump - Print the value to stderr.
52 inline raw_ostream &operator<<(raw_ostream &OS, const MCLabel &Label) {
56 } // end namespace llvm