1 //===- lib/MC/MCSection.cpp - Machine Code Section Representation ---------===//
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 #include "llvm/MC/MCSection.h"
11 #include "llvm/MC/MCContext.h"
14 MCSection::~MCSection() {
17 MCSection::MCSection(const StringRef &N, bool isDirective, SectionKind K,
19 : Name(N), IsDirective(isDirective), Kind(K) {
20 MCSection *&Entry = Ctx.Sections[Name];
21 assert(Entry == 0 && "Multiple sections with the same name created");
25 MCSection *MCSection::Create(const StringRef &Name, bool IsDirective,
26 SectionKind K, MCContext &Ctx) {
27 return new (Ctx) MCSection(Name, IsDirective, K, Ctx);