]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
Merge ^/head r306906 through r307382.
[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   if ((TheTriple.getArch() == Triple::mips) ||
23       (TheTriple.getArch() == Triple::mips64))
24     IsLittleEndian = false;
25
26   if ((TheTriple.getArch() == Triple::mips64el) ||
27       (TheTriple.getArch() == Triple::mips64)) {
28     PointerSize = CalleeSaveStackSlotSize = 8;
29   }
30
31   // FIXME: This condition isn't quite right but it's the best we can do until
32   //        this object can identify the ABI. It will misbehave when using O32
33   //        on a mips64*-* triple.
34   if ((TheTriple.getArch() == Triple::mipsel) ||
35       (TheTriple.getArch() == Triple::mips)) {
36     PrivateGlobalPrefix = "$";
37     PrivateLabelPrefix = "$";
38   }
39
40   AlignmentIsInBytes          = false;
41   Data16bitsDirective         = "\t.2byte\t";
42   Data32bitsDirective         = "\t.4byte\t";
43   Data64bitsDirective         = "\t.8byte\t";
44   CommentString               = "#";
45   ZeroDirective               = "\t.space\t";
46   GPRel32Directive            = "\t.gpword\t";
47   GPRel64Directive            = "\t.gpdword\t";
48   UseAssignmentForEHBegin = true;
49   SupportsDebugInformation = true;
50   ExceptionsType = ExceptionHandling::DwarfCFI;
51   DwarfRegNumForCFI = true;
52
53   // Enable IAS by default for O32.
54   if (TheTriple.getArch() == Triple::mips ||
55       TheTriple.getArch() == Triple::mipsel)
56     UseIntegratedAssembler = true;
57 }