aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsTargetAsmInfo.cpp
blob: f7a0acb8e54435759eaeaa22ddb8eb3d4f9f277a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//===-- MipsTargetAsmInfo.cpp - Mips asm properties -------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the declarations of the MipsTargetAsmInfo properties.
//
//===----------------------------------------------------------------------===//

#include "MipsTargetAsmInfo.h"
#include "MipsTargetMachine.h"
#include "llvm/GlobalVariable.h"

using namespace llvm;

MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM):
  ELFTargetAsmInfo(TM) {

  AlignmentIsInBytes          = false;
  COMMDirectiveTakesAlignment = true;
  Data16bitsDirective         = "\t.half\t";
  Data32bitsDirective         = "\t.word\t";
  Data64bitsDirective         = NULL;
  PrivateGlobalPrefix         = "$";
  JumpTableDataSection        = "\t.rdata";
  CommentString               = "#";
  ZeroDirective               = "\t.space\t";
  BSSSection                  = "\t.section\t.bss";
  CStringSection              = ".rodata.str";

  if (!TM.getSubtarget<MipsSubtarget>().hasABICall()) {
    JumpTableDirective = "\t.word\t";
    SmallDataSection = getNamedSection("\t.sdata", SectionFlags::Writeable);
    SmallBSSSection = getNamedSection("\t.sbss",
                                      SectionFlags::Writeable |
                                      SectionFlags::BSS);
  } else {
    JumpTableDirective = "\t.gpword\t";
  }
}