LLVM 20.0.0git
PPCMCAsmInfo.cpp
Go to the documentation of this file.
1//===-- PPCMCAsmInfo.cpp - PPC asm properties -----------------------------===//
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// This file contains the declarations of the MCAsmInfoDarwin properties.
10//
11//===----------------------------------------------------------------------===//
12
13#include "PPCMCAsmInfo.h"
15
16using namespace llvm;
17
18void PPCELFMCAsmInfo::anchor() { }
19
21 // FIXME: This is not always needed. For example, it is not needed in the
22 // v2 abi.
23 NeedsLocalForSize = true;
24
25 if (is64Bit) {
27 }
29 T.getArch() == Triple::ppc64le || T.getArch() == Triple::ppcle;
30
31 // ".comm align is in bytes but .align is pow-2."
32 AlignmentIsInBytes = false;
33
34 CommentString = "#";
35
36 // Uses '.section' before '.bss' directive
38
39 // Debug Information
41
42 DollarIsPC = true;
43
44 // Set up DWARF directives
46
47 // Exceptions handling
49
50 ZeroDirective = "\t.space\t";
51 Data64bitsDirective = is64Bit ? "\t.quad\t" : nullptr;
52 AssemblerDialect = 1; // New-Style mnemonics.
54}
55
56void PPCXCOFFMCAsmInfo::anchor() {}
57
59 if (T.getArch() == Triple::ppc64le || T.getArch() == Triple::ppcle)
60 report_fatal_error("XCOFF is not supported for little-endian targets");
61 CodePointerSize = CalleeSaveStackSlotSize = Is64Bit ? 8 : 4;
62
63 // A size of 8 is only supported by the assembler under 64-bit.
64 Data64bitsDirective = Is64Bit ? "\t.vbyte\t8, " : nullptr;
65
66 // Debug Information
68
69 // Set up DWARF directives
71
72 // Support $ as PC in inline asm
73 DollarIsPC = true;
74}
static bool is64Bit(const char *name)
unsigned MinInstAlignment
Every possible instruction length is a multiple of this value.
Definition: MCAsmInfo.h:107
const char * Data64bitsDirective
Definition: MCAsmInfo.h:283
bool DollarIsPC
The '$' token, when not referencing an identifier or constant, refers to the current PC.
Definition: MCAsmInfo.h:111
bool NeedsLocalForSize
Definition: MCAsmInfo.h:155
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:426
LCOMM::LCOMMType LCOMMDirectiveAlignmentType
Describes if the .lcomm directive for the target supports an alignment argument and how it is interpr...
Definition: MCAsmInfo.h:349
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
Definition: MCAsmInfo.h:314
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:423
unsigned AssemblerDialect
Which dialect of an assembler variant to use. Defaults to 0.
Definition: MCAsmInfo.h:185
bool AlignmentIsInBytes
If this is true (the default) then the asmprinter emits ".align N" directives, where N is the number ...
Definition: MCAsmInfo.h:324
const char * ZeroDirective
This should be set to the directive used to get some number of zero (and non-zero if supported by the...
Definition: MCAsmInfo.h:244
bool IsLittleEndian
True if target is little endian. Default is true.
Definition: MCAsmInfo.h:79
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:72
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition: MCAsmInfo.h:76
StringRef CommentString
This indicates the comment string used by the assembler.
Definition: MCAsmInfo.h:127
PPCELFMCAsmInfo(bool is64Bit, const Triple &)
PPCXCOFFMCAsmInfo(bool is64Bit, const Triple &)
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
@ ByteAlignment
Definition: MCAsmInfo.h:50
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ DwarfCFI
DWARF-like instruction based exceptions.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:167