blob: d1a637345024f9c3278ae7d2547b26678b7dd7e1 [file] [log] [blame]
Sean Fertilef09d54e2019-07-09 19:21:01 +00001//===- lib/MC/MCSectionXCOFF.cpp - XCOFF Code Section Representation ------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "llvm/MC/MCSectionXCOFF.h"
10#include "llvm/MC/MCAsmInfo.h"
11#include "llvm/MC/MCExpr.h"
12#include "llvm/Support/raw_ostream.h"
13
14using namespace llvm;
15
16MCSectionXCOFF::~MCSectionXCOFF() = default;
17
18void MCSectionXCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
19 raw_ostream &OS,
20 const MCExpr *Subsection) const {
21 if (getKind().isText()) {
22 OS << "\t.csect " << getSectionName() << "["
23 << "PR"
24 << "]" << '\n';
25 return;
26 }
27
28 report_fatal_error("Printing for this SectionKind is unimplemented.");
29}
30
31bool MCSectionXCOFF::UseCodeAlign() const { return getKind().isText(); }
32
33bool MCSectionXCOFF::isVirtualSection() const { return !getKind().isCommon(); }