blob: f7a0acb8e54435759eaeaa22ddb8eb3d4f9f277a [file] [log] [blame]
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +00001//===-- MipsTargetAsmInfo.cpp - Mips asm properties -------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file contains the declarations of the MipsTargetAsmInfo properties.
11//
12//===----------------------------------------------------------------------===//
13
14#include "MipsTargetAsmInfo.h"
Bruno Cardoso Lopes753a9872007-11-12 19:49:57 +000015#include "MipsTargetMachine.h"
Dan Gohman8f613f32008-08-05 15:32:23 +000016#include "llvm/GlobalVariable.h"
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000017
18using namespace llvm;
19
Anton Korobeynikovae408e62008-07-19 13:16:11 +000020MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM):
21 ELFTargetAsmInfo(TM) {
Bruno Cardoso Lopes43d526d2008-07-14 14:42:54 +000022
23 AlignmentIsInBytes = false;
24 COMMDirectiveTakesAlignment = true;
25 Data16bitsDirective = "\t.half\t";
26 Data32bitsDirective = "\t.word\t";
27 Data64bitsDirective = NULL;
28 PrivateGlobalPrefix = "$";
29 JumpTableDataSection = "\t.rdata";
30 CommentString = "#";
Bruno Cardoso Lopes43d526d2008-07-14 14:42:54 +000031 ZeroDirective = "\t.space\t";
32 BSSSection = "\t.section\t.bss";
Bruno Cardoso Lopes91fd5322008-07-21 18:52:34 +000033 CStringSection = ".rodata.str";
Bruno Cardoso Lopes753a9872007-11-12 19:49:57 +000034
Chris Lattner013e6b62009-07-24 03:11:51 +000035 if (!TM.getSubtarget<MipsSubtarget>().hasABICall()) {
Bruno Cardoso Lopes753a9872007-11-12 19:49:57 +000036 JumpTableDirective = "\t.word\t";
Bruno Cardoso Lopes92e87f22008-07-23 16:01:50 +000037 SmallDataSection = getNamedSection("\t.sdata", SectionFlags::Writeable);
Anton Korobeynikov00181a32008-09-24 22:20:27 +000038 SmallBSSSection = getNamedSection("\t.sbss",
39 SectionFlags::Writeable |
Bruno Cardoso Lopes92e87f22008-07-23 16:01:50 +000040 SectionFlags::BSS);
Chris Lattner013e6b62009-07-24 03:11:51 +000041 } else {
Bruno Cardoso Lopes753a9872007-11-12 19:49:57 +000042 JumpTableDirective = "\t.gpword\t";
Bruno Cardoso Lopesfeb95cc2008-07-22 15:34:27 +000043 }
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000044}