LLVM  14.0.0git
MipsMCAsmInfo.cpp
Go to the documentation of this file.
1 //===-- MipsMCAsmInfo.cpp - Mips 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 MipsMCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "MipsMCAsmInfo.h"
14 #include "MipsABIInfo.h"
15 #include "llvm/ADT/Triple.h"
16 
17 using namespace llvm;
18 
19 void MipsMCAsmInfo::anchor() { }
20 
22  const MCTargetOptions &Options) {
23  IsLittleEndian = TheTriple.isLittleEndian();
24 
26 
27  if (TheTriple.isMIPS64() && !ABI.IsN32())
29 
30  if (ABI.IsO32())
31  PrivateGlobalPrefix = "$";
32  else if (ABI.IsN32() || ABI.IsN64())
33  PrivateGlobalPrefix = ".L";
35 
36  AlignmentIsInBytes = false;
37  Data16bitsDirective = "\t.2byte\t";
38  Data32bitsDirective = "\t.4byte\t";
39  Data64bitsDirective = "\t.8byte\t";
40  CommentString = "#";
41  ZeroDirective = "\t.space\t";
42  GPRel32Directive = "\t.gpword\t";
43  GPRel64Directive = "\t.gpdword\t";
44  DTPRel32Directive = "\t.dtprelword\t";
45  DTPRel64Directive = "\t.dtpreldword\t";
46  TPRel32Directive = "\t.tprelword\t";
47  TPRel64Directive = "\t.tpreldword\t";
51  DwarfRegNumForCFI = true;
52  HasMipsExpressions = true;
53 }
ABI
Generic address nodes are lowered to some combination of target independent and machine specific ABI
Definition: Relocation.txt:34
llvm::MCAsmInfo::GPRel64Directive
const char * GPRel64Directive
If non-null, a directive that is used to emit a word which should be relocated as a 64-bit GP-relativ...
Definition: MCAsmInfo.h:296
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::MCAsmInfo::HasMipsExpressions
bool HasMipsExpressions
Definition: MCAsmInfo.h:523
llvm::MipsABIInfo
Definition: MipsABIInfo.h:22
llvm::MCAsmInfo::TPRel32Directive
const char * TPRel32Directive
Definition: MCAsmInfo.h:308
llvm::MCAsmInfo::SupportsDebugInformation
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:445
llvm::MCAsmInfo::AlignmentIsInBytes
bool AlignmentIsInBytes
If this is true (the default) then the asmprinter emits ".align N" directives, where N is the number ...
Definition: MCAsmInfo.h:329
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::MCAsmInfo::UseAssignmentForEHBegin
bool UseAssignmentForEHBegin
Definition: MCAsmInfo.h:160
llvm::MCAsmInfo::Data64bitsDirective
const char * Data64bitsDirective
Definition: MCAsmInfo.h:288
llvm::MCAsmInfo::PrivateLabelPrefix
StringRef PrivateLabelPrefix
This prefix is used for labels for basic blocks.
Definition: MCAsmInfo.h:172
llvm::MCAsmInfo::TPRel64Directive
const char * TPRel64Directive
Definition: MCAsmInfo.h:309
llvm::MCAsmInfo::Data32bitsDirective
const char * Data32bitsDirective
Definition: MCAsmInfo.h:287
llvm::Triple::isLittleEndian
bool isLittleEndian() const
Tests whether the target triple is little endian.
Definition: Triple.cpp:1574
llvm::MCAsmInfo::PrivateGlobalPrefix
StringRef PrivateGlobalPrefix
This prefix is used for globals like constant pool entries that are completely private to the ....
Definition: MCAsmInfo.h:168
llvm::MipsABIInfo::computeTargetABI
static MipsABIInfo computeTargetABI(const Triple &TT, StringRef CPU, const MCTargetOptions &Options)
Definition: MipsABIInfo.cpp:56
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
llvm::Triple::isMIPS64
bool isMIPS64() const
Tests whether the target is MIPS 64-bit (little and big endian).
Definition: Triple.h:747
llvm::MCAsmInfo::CommentString
StringRef CommentString
This indicates the comment string used by the assembler.
Definition: MCAsmInfo.h:135
llvm::MCAsmInfo::DwarfRegNumForCFI
bool DwarfRegNumForCFI
True if dwarf register numbers are printed instead of symbolic register names in ....
Definition: MCAsmInfo.h:475
llvm::MCAsmInfo::CodePointerSize
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:72
llvm::MCAsmInfo::ZeroDirective
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:249
llvm::MCAsmInfo::Data16bitsDirective
const char * Data16bitsDirective
Definition: MCAsmInfo.h:286
llvm::MCTargetOptions
Definition: MCTargetOptions.h:36
Triple.h
llvm::MCAsmInfo::DTPRel32Directive
const char * DTPRel32Directive
If non-null, directives that are used to emit a word/dword which should be relocated as a 32/64-bit D...
Definition: MCAsmInfo.h:306
llvm::MCAsmInfo::DTPRel64Directive
const char * DTPRel64Directive
Definition: MCAsmInfo.h:307
llvm::MipsMCAsmInfo::MipsMCAsmInfo
MipsMCAsmInfo(const Triple &TheTriple, const MCTargetOptions &Options)
Definition: MipsMCAsmInfo.cpp:21
llvm::MCAsmInfo::CalleeSaveStackSlotSize
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition: MCAsmInfo.h:76
MipsABIInfo.h
llvm::MCAsmInfo::ExceptionsType
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:448
MipsMCAsmInfo.h
llvm::ExceptionHandling::DwarfCFI
@ DwarfCFI
DWARF-like instruction based exceptions.
llvm::MCAsmInfo::GPRel32Directive
const char * GPRel32Directive
If non-null, a directive that is used to emit a word which should be relocated as a 32-bit GP-relativ...
Definition: MCAsmInfo.h:301
llvm::MCAsmInfo::IsLittleEndian
bool IsLittleEndian
True if target is little endian. Default is true.
Definition: MCAsmInfo.h:79