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 
anchor()19 void MipsMCAsmInfo::anchor() { }
20 
MipsMCAsmInfo(const Triple & TheTriple,const MCTargetOptions & Options)21 MipsMCAsmInfo::MipsMCAsmInfo(const Triple &TheTriple,
22                              const MCTargetOptions &Options) {
23   IsLittleEndian = TheTriple.isLittleEndian();
24 
25   MipsABIInfo ABI = MipsABIInfo::computeTargetABI(TheTriple, "", Options);
26 
27   if (TheTriple.isMIPS64() && !ABI.IsN32())
28     CodePointerSize = CalleeSaveStackSlotSize = 8;
29 
30   if (ABI.IsO32())
31     PrivateGlobalPrefix = "$";
32   else if (ABI.IsN32() || ABI.IsN64())
33     PrivateGlobalPrefix = ".L";
34   PrivateLabelPrefix = PrivateGlobalPrefix;
35 
36   IsCheriPurecapABI = ABI.IsCheriPureCap();
37 
38   AlignmentIsInBytes          = false;
39   Data16bitsDirective         = "\t.2byte\t";
40   Data32bitsDirective         = "\t.4byte\t";
41   Data64bitsDirective         = "\t.8byte\t";
42   CommentString               = "#";
43   ZeroDirective               = "\t.space\t";
44   GPRel32Directive            = "\t.gpword\t";
45   GPRel64Directive            = "\t.gpdword\t";
46   DTPRel32Directive           = "\t.dtprelword\t";
47   DTPRel64Directive           = "\t.dtpreldword\t";
48   TPRel32Directive            = "\t.tprelword\t";
49   TPRel64Directive            = "\t.tpreldword\t";
50   UseAssignmentForEHBegin = true;
51   SupportsDebugInformation = true;
52   ExceptionsType = ExceptionHandling::DwarfCFI;
53   DwarfRegNumForCFI = true;
54   HasMipsExpressions = true;
55 }
56