LLVM  10.0.0svn
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"
14 #include "llvm/ADT/Triple.h"
15 
16 using namespace llvm;
17 
18 void PPCMCAsmInfoDarwin::anchor() { }
19 
21  if (is64Bit) {
23  }
24  IsLittleEndian = false;
25 
26  SeparatorString = "@";
27  CommentString = ";";
29 
30  if (!is64Bit)
31  Data64bitsDirective = nullptr; // We can't emit a 64-bit unit in PPC32 mode.
32 
33  AssemblerDialect = 1; // New-Style mnemonics.
34  SupportsDebugInformation= true; // Debug information.
35 
36  // The installed assembler for OSX < 10.6 lacks some directives.
37  // FIXME: this should really be a check on the assembler characteristics
38  // rather than OS version
39  if (T.isMacOSX() && T.isMacOSXVersionLT(10, 6))
41 
43 }
44 
45 void PPCELFMCAsmInfo::anchor() { }
46 
48  // FIXME: This is not always needed. For example, it is not needed in the
49  // v2 abi.
50  NeedsLocalForSize = true;
51 
52  if (is64Bit) {
54  }
56 
57  // ".comm align is in bytes but .align is pow-2."
58  AlignmentIsInBytes = false;
59 
60  CommentString = "#";
61 
62  // Uses '.section' before '.bss' directive
64 
65  // Debug Information
67 
68  DollarIsPC = true;
69 
70  // Set up DWARF directives
71  MinInstAlignment = 4;
72 
73  // Exceptions handling
75 
76  ZeroDirective = "\t.space\t";
77  Data64bitsDirective = is64Bit ? "\t.quad\t" : nullptr;
78  AssemblerDialect = 1; // New-Style mnemonics.
80 
82 }
83 
84 void PPCXCOFFMCAsmInfo::anchor() {}
85 
87  assert(!IsLittleEndian && "Little-endian XCOFF not supported.");
88  CodePointerSize = CalleeSaveStackSlotSize = Is64Bit ? 8 : 4;
89  ZeroDirective = "\t.space\t";
90 }
LCOMM::LCOMMType LCOMMDirectiveAlignmentType
Describes if the .lcomm directive for the target supports an alignment argument and how it is interpr...
Definition: MCAsmInfo.h:275
bool UseIntegratedAssembler
Should we use the integrated assembler? The integrated assembler should be enabled by default (by the...
Definition: MCAsmInfo.h:379
This class represents lattice values for constants.
Definition: AllocatorList.h:23
bool isMacOSX() const
isMacOSX - Is this a Mac OS X triple.
Definition: Triple.h:453
PPCELFMCAsmInfo(bool is64Bit, const Triple &)
const char * Data64bitsDirective
Definition: MCAsmInfo.h:197
const char * ZeroDirective
This should be set to the directive used to get some number of zero bytes emitted to the current sect...
Definition: MCAsmInfo.h:178
bool IsLittleEndian
True if target is little endian. Default is true.
Definition: MCAsmInfo.h:70
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition: MCAsmInfo.h:67
unsigned AssemblerDialect
Which dialect of an assembler variant to use. Defaults to 0.
Definition: MCAsmInfo.h:153
bool HasWeakDefCanBeHiddenDirective
True if we have a directive to declare a global as being a weak defined symbol that can be hidden (un...
Definition: MCAsmInfo.h:314
bool AlignmentIsInBytes
If this is true (the default) then the asmprinter emits ".align N" directives, where N is the number ...
Definition: MCAsmInfo.h:235
const char * SeparatorString
This string, if specified, is used to separate instructions from each other when on the same line...
Definition: MCAsmInfo.h:110
StringRef CommentString
This indicates the comment character used by the assembler.
Definition: MCAsmInfo.h:114
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF &#39;.section&#39; directive before the &#39;.bss&#39; one.
Definition: MCAsmInfo.h:225
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:296
bool DollarIsPC
The &#39;$&#39; token, when not referencing an identifier or constant, refers to the current PC...
Definition: MCAsmInfo.h:106
static bool is64Bit(const char *name)
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:340
PPCXCOFFMCAsmInfo(bool is64Bit, const Triple &)
PPCMCAsmInfoDarwin(bool is64Bit, const Triple &)
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:43
bool NeedsLocalForSize
Definition: MCAsmInfo.h:123
unsigned MinInstAlignment
Every possible instruction length is a multiple of this value.
Definition: MCAsmInfo.h:102
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:63
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:343
bool isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
isMacOSXVersionLT - Comparison function for checking OS X version compatibility, which handles suppor...
Definition: Triple.h:438
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
DWARF-like instruction based exceptions.