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/MCAsmInfo.h"
12 #include "llvm/MC/MCContext.h"
13 #include "llvm/MC/MCSymbol.h"
14 #include "llvm/Support/raw_ostream.h"
17 //===----------------------------------------------------------------------===//
19 //===----------------------------------------------------------------------===//
21 MCSymbol *MCSection::getEndSymbol(MCContext &Ctx) {
23 End = Ctx.createTempSymbol("sec_end", true);
27 bool MCSection::hasEnded() const { return End && End->isInSection(); }
29 MCSection::~MCSection() {
32 void MCSection::setBundleLockState(BundleLockStateType NewState) {
33 if (NewState == NotBundleLocked) {
34 if (BundleLockNestingDepth == 0) {
35 report_fatal_error("Mismatched bundle_lock/unlock directives");
37 if (--BundleLockNestingDepth == 0) {
38 BundleLockState = NotBundleLocked;
43 // If any of the directives is an align_to_end directive, the whole nested
44 // group is align_to_end. So don't downgrade from align_to_end to just locked.
45 if (BundleLockState != BundleLockedAlignToEnd) {
46 BundleLockState = NewState;
48 ++BundleLockNestingDepth;