]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
Merge llvm, clang, lld and lldb trunk r300890, and update build glue.
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / Mips / MCTargetDesc / MipsMCAsmInfo.cpp
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
19 void MipsMCAsmInfo::anchor() { }
20
21 MipsMCAsmInfo::MipsMCAsmInfo(const Triple &TheTriple) {
22   IsLittleEndian = TheTriple.isLittleEndian();
23
24   if ((TheTriple.getArch() == Triple::mips64el) ||
25       (TheTriple.getArch() == Triple::mips64)) {
26     CodePointerSize = CalleeSaveStackSlotSize = 8;
27   }
28
29   // FIXME: This condition isn't quite right but it's the best we can do until
30   //        this object can identify the ABI. It will misbehave when using O32
31   //        on a mips64*-* triple.
32   if ((TheTriple.getArch() == Triple::mipsel) ||
33       (TheTriple.getArch() == Triple::mips)) {
34     PrivateGlobalPrefix = "$";
35     PrivateLabelPrefix = "$";
36   }
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   // Enable IAS by default for O32.
57   if (TheTriple.getArch() == Triple::mips ||
58       TheTriple.getArch() == Triple::mipsel)
59     UseIntegratedAssembler = true;
60
61   // Enable IAS by default for Debian mips64/mips64el.
62   if (TheTriple.getEnvironment() == Triple::GNUABI64)
63     UseIntegratedAssembler = true;
64 }