create sections with MCSection::Create instead of Context->getOrCreateSection.
[oota-llvm.git] / include / llvm / MC / MCSection.h
1 //===- MCSection.h - Machine Code Sections ----------------------*- 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 // This file declares the MCSection class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_MC_MCSECTION_H
15 #define LLVM_MC_MCSECTION_H
16
17 #include <string>
18 #include "llvm/ADT/StringRef.h"
19
20 namespace llvm {
21
22   /// MCSection - Instances of this class represent a uniqued identifier for a
23   /// section in the current translation unit.  The MCContext class uniques and
24   /// creates these.
25   class MCSection {
26     std::string Name;
27   private:
28     MCSection(const MCSection&);      // DO NOT IMPLEMENT
29     void operator=(const MCSection&); // DO NOT IMPLEMENT
30     MCSection(const StringRef &_Name, MCContext &Ctx);
31   public:
32
33     static MCSection *Create(const StringRef &_Name, MCContext &Ctx);
34     
35     const std::string &getName() const { return Name; }
36   };
37
38 } // end namespace llvm
39
40 #endif