Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 1 | //===-- MipsTargetAsmInfo.cpp - Mips asm properties -------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains the declarations of the MipsTargetAsmInfo properties. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "MipsTargetAsmInfo.h" |
Bruno Cardoso Lopes | 753a987 | 2007-11-12 19:49:57 +0000 | [diff] [blame] | 15 | #include "MipsTargetMachine.h" |
Dan Gohman | 8f613f3 | 2008-08-05 15:32:23 +0000 | [diff] [blame] | 16 | #include "llvm/GlobalVariable.h" |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 17 | |
| 18 | using namespace llvm; |
| 19 | |
Anton Korobeynikov | ae408e6 | 2008-07-19 13:16:11 +0000 | [diff] [blame] | 20 | MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM): |
| 21 | ELFTargetAsmInfo(TM) { |
Bruno Cardoso Lopes | 43d526d | 2008-07-14 14:42:54 +0000 | [diff] [blame] | 22 | |
| 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 Lopes | 43d526d | 2008-07-14 14:42:54 +0000 | [diff] [blame] | 31 | ZeroDirective = "\t.space\t"; |
| 32 | BSSSection = "\t.section\t.bss"; |
Bruno Cardoso Lopes | 91fd532 | 2008-07-21 18:52:34 +0000 | [diff] [blame] | 33 | CStringSection = ".rodata.str"; |
Bruno Cardoso Lopes | 753a987 | 2007-11-12 19:49:57 +0000 | [diff] [blame] | 34 | |
Chris Lattner | 013e6b6 | 2009-07-24 03:11:51 +0000 | [diff] [blame] | 35 | if (!TM.getSubtarget<MipsSubtarget>().hasABICall()) { |
Bruno Cardoso Lopes | 753a987 | 2007-11-12 19:49:57 +0000 | [diff] [blame] | 36 | JumpTableDirective = "\t.word\t"; |
Bruno Cardoso Lopes | 92e87f2 | 2008-07-23 16:01:50 +0000 | [diff] [blame] | 37 | SmallDataSection = getNamedSection("\t.sdata", SectionFlags::Writeable); |
Anton Korobeynikov | 00181a3 | 2008-09-24 22:20:27 +0000 | [diff] [blame] | 38 | SmallBSSSection = getNamedSection("\t.sbss", |
| 39 | SectionFlags::Writeable | |
Bruno Cardoso Lopes | 92e87f2 | 2008-07-23 16:01:50 +0000 | [diff] [blame] | 40 | SectionFlags::BSS); |
Chris Lattner | 013e6b6 | 2009-07-24 03:11:51 +0000 | [diff] [blame] | 41 | } else { |
Bruno Cardoso Lopes | 753a987 | 2007-11-12 19:49:57 +0000 | [diff] [blame] | 42 | JumpTableDirective = "\t.gpword\t"; |
Bruno Cardoso Lopes | feb95cc | 2008-07-22 15:34:27 +0000 | [diff] [blame] | 43 | } |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 44 | } |