SparcMCAsmInfo.cpp revision d8de58e24cf5874c0d6f903d15333406787ea944
1//===-- SparcMCAsmInfo.cpp - Sparc 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 SparcMCAsmInfo properties.
11//
12//===----------------------------------------------------------------------===//
13
14#include "SparcMCAsmInfo.h"
15#include "llvm/ADT/Triple.h"
16
17using namespace llvm;
18
19void SparcELFMCAsmInfo::anchor() { }
20
21SparcELFMCAsmInfo::SparcELFMCAsmInfo(StringRef TT) {
22  IsLittleEndian = false;
23  Triple TheTriple(TT);
24  bool isV9 = (TheTriple.getArch() == Triple::sparcv9);
25
26  if (isV9) {
27    PointerSize = CalleeSaveStackSlotSize = 8;
28  }
29
30  Data16bitsDirective = "\t.half\t";
31  Data32bitsDirective = "\t.word\t";
32  // .xword is only supported by V9.
33  Data64bitsDirective = (isV9) ? "\t.xword\t" : 0;
34  ZeroDirective = "\t.skip\t";
35  CommentString = "!";
36  HasLEB128 = true;
37  SupportsDebugInformation = true;
38
39  SunStyleELFSectionSwitchSyntax = true;
40  UsesELFSectionDirectiveForBSS = true;
41
42  WeakRefDirective = "\t.weak\t";
43
44  PrivateGlobalPrefix = ".L";
45}
46
47
48