LLVM  10.0.0svn
Go to the documentation of this file.
1 //===- 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 //===----------------------------------------------------------------------===//
10 #include "llvm/MC/MCAsmInfo.h"
11 #include "llvm/MC/MCExpr.h"
14 using namespace llvm;
19  raw_ostream &OS,
20  const MCExpr *Subsection) const {
21  if (getKind().isText()) {
23  llvm_unreachable("Unsupported storage-mapping class for .text csect");
25  OS << "\t.csect " << getSectionName() << "["
26  << "PR"
27  << "]" << '\n';
28  return;
29  }
31  if (getKind().isBSSLocal() || getKind().isCommon()) {
34  "Generated a storage-mapping class for a common/bss csect we don't "
35  "understand how to switch to.");
37  "wrong csect type for .bss csect");
38  // Don't have to print a directive for switching to section for commons.
39  // '.comm' and '.lcomm' directives for the variable will create the needed
40  // csect.
41  return;
42  }
44  report_fatal_error("Printing for this SectionKind is unimplemented.");
45 }
47 bool MCSectionXCOFF::UseCodeAlign() const { return getKind().isText(); }
SectionKind getKind() const
Definition: MCSection.h:105
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:139
This class represents lattice values for constants.
Definition: AllocatorList.h:23
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
bool isText() const
Definition: SectionKind.h:118
Common csect definition. For uninitialized storage.
Definition: XCOFF.h:147
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
bool isVirtualSection() const override
Check whether this section is "virtual", that is has no actual object file contents.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:43
XCOFF::SymbolType getCSectType() const
bool UseCodeAlign() const override
Return true if a .align directive should use "optimized nops" to fill instead of 0s.
Program Code.
Definition: XCOFF.h:29
void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, raw_ostream &OS, const MCExpr *Subsection) const override
XCOFF::StorageMappingClass getMappingClass() const
StringRef getSectionName() const
BSS class (uninitialized static internal)
Definition: XCOFF.h:47
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45
Read Write Data.
Definition: XCOFF.h:41