• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- MipsMCAsmInfo.cpp - Mips Asm Properties ---------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declarations of the MipsMCAsmInfo properties.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "MipsMCAsmInfo.h"
15 #include "llvm/ADT/Triple.h"
16 
17 using namespace llvm;
18 
anchor()19 void MipsMCAsmInfo::anchor() { }
20 
MipsMCAsmInfo(const Triple & TheTriple)21 MipsMCAsmInfo::MipsMCAsmInfo(const Triple &TheTriple) {
22   IsLittleEndian = TheTriple.isLittleEndian();
23 
24   if (TheTriple.isMIPS64()) {
25     CodePointerSize = CalleeSaveStackSlotSize = 8;
26   }
27 
28   // FIXME: This condition isn't quite right but it's the best we can do until
29   //        this object can identify the ABI. It will misbehave when using O32
30   //        on a mips64*-* triple.
31   if (TheTriple.isMIPS32()) {
32     PrivateGlobalPrefix = "$";
33     PrivateLabelPrefix = "$";
34   }
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";
48   UseAssignmentForEHBegin = true;
49   SupportsDebugInformation = true;
50   ExceptionsType = ExceptionHandling::DwarfCFI;
51   DwarfRegNumForCFI = true;
52   HasMipsExpressions = true;
53 
54   // Enable IAS by default for O32.
55   if (TheTriple.isMIPS32())
56     UseIntegratedAssembler = true;
57 
58   // Enable IAS by default for Debian mips64/mips64el.
59   if (TheTriple.getEnvironment() == Triple::GNUABI64)
60     UseIntegratedAssembler = true;
61 
62   // Enable IAS by default for Android mips64el that uses N64 ABI.
63   if (TheTriple.getArch() == Triple::mips64el && TheTriple.isAndroid())
64     UseIntegratedAssembler = true;
65 
66   // Enable IAS by default for FreeBSD / OpenBSD mips64/mips64el.
67   if (TheTriple.isOSFreeBSD() ||
68       TheTriple.isOSOpenBSD())
69     UseIntegratedAssembler = true;
70 }
71