Sanjiv Gupta | 0e68771 | 2008-05-13 09:02:57 +0000 | [diff] [blame] | 1 | //===-- PIC16TargetAsmInfo.cpp - PIC16 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 PIC16TargetAsmInfo properties. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "PIC16TargetAsmInfo.h" |
Dan Gohman | 8f09225 | 2008-11-03 18:22:42 +0000 | [diff] [blame] | 15 | #include "PIC16TargetMachine.h" |
Sanjiv Gupta | 1b04694 | 2009-01-13 19:18:47 +0000 | [diff] [blame] | 16 | #include "llvm/GlobalValue.h" |
Sanjiv Gupta | d8d27f4 | 2009-05-06 08:02:01 +0000 | [diff] [blame] | 17 | #include "llvm/GlobalVariable.h" |
| 18 | #include "llvm/DerivedTypes.h" |
Sanjiv Gupta | 0e68771 | 2008-05-13 09:02:57 +0000 | [diff] [blame] | 19 | |
| 20 | using namespace llvm; |
| 21 | |
| 22 | PIC16TargetAsmInfo:: |
Sanjiv Gupta | b1b5ffd | 2008-11-19 11:00:54 +0000 | [diff] [blame] | 23 | PIC16TargetAsmInfo(const PIC16TargetMachine &TM) |
Dan Gohman | 8f09225 | 2008-11-03 18:22:42 +0000 | [diff] [blame] | 24 | : TargetAsmInfo(TM) { |
Sanjiv Gupta | 0e68771 | 2008-05-13 09:02:57 +0000 | [diff] [blame] | 25 | CommentString = ";"; |
Sanjiv Gupta | 211f362 | 2009-05-10 05:23:47 +0000 | [diff] [blame] | 26 | GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL); |
| 27 | GlobalDirective = "\tglobal\t"; |
| 28 | ExternDirective = "\textern\t"; |
| 29 | |
Sanjiv Gupta | b1b5ffd | 2008-11-19 11:00:54 +0000 | [diff] [blame] | 30 | Data8bitsDirective = " db "; |
Sanjiv Gupta | c8d7bc8 | 2009-01-30 04:25:10 +0000 | [diff] [blame] | 31 | Data16bitsDirective = " dw "; |
| 32 | Data32bitsDirective = " dl "; |
Sanjiv Gupta | 53cf829 | 2009-07-06 18:09:11 +0000 | [diff] [blame] | 33 | Data64bitsDirective = NULL; |
Sanjiv Gupta | b1b5ffd | 2008-11-19 11:00:54 +0000 | [diff] [blame] | 34 | ZeroDirective = NULL; |
Sanjiv Gupta | 1b04694 | 2009-01-13 19:18:47 +0000 | [diff] [blame] | 35 | AsciiDirective = " dt "; |
| 36 | AscizDirective = NULL; |
Sanjiv Gupta | 1b04694 | 2009-01-13 19:18:47 +0000 | [diff] [blame] | 37 | SwitchToSectionDirective = ""; |
Chris Lattner | 5fe575f | 2009-07-27 05:32:16 +0000 | [diff] [blame] | 38 | |
Chris Lattner | f014412 | 2009-07-28 03:13:23 +0000 | [diff] [blame^] | 39 | RomData8bitsDirective = " dw "; |
| 40 | RomData16bitsDirective = " rom_di "; |
| 41 | RomData32bitsDirective = " rom_dl "; |
| 42 | |
| 43 | |
Sanjiv Gupta | dd4694b | 2009-05-28 18:24:11 +0000 | [diff] [blame] | 44 | // Set it to false because we weed to generate c file name and not bc file |
| 45 | // name. |
| 46 | HasSingleParameterDotFile = false; |
Sanjiv Gupta | 0e68771 | 2008-05-13 09:02:57 +0000 | [diff] [blame] | 47 | } |
Sanjiv Gupta | c8d7bc8 | 2009-01-30 04:25:10 +0000 | [diff] [blame] | 48 | |
Chris Lattner | f014412 | 2009-07-28 03:13:23 +0000 | [diff] [blame^] | 49 | const char *PIC16TargetAsmInfo:: |
| 50 | getDataASDirective(unsigned Size, unsigned AS) const { |
| 51 | if (AS != PIC16ISD::ROM_SPACE) |
| 52 | return 0; |
| 53 | |
Chris Lattner | 83757c7 | 2009-07-20 17:12:46 +0000 | [diff] [blame] | 54 | switch (Size) { |
| 55 | case 8: return RomData8bitsDirective; |
| 56 | case 16: return RomData16bitsDirective; |
| 57 | case 32: return RomData32bitsDirective; |
| 58 | default: return NULL; |
| 59 | } |
Sanjiv Gupta | 3b020fe | 2009-02-02 16:53:06 +0000 | [diff] [blame] | 60 | } |
Sanjiv Gupta | c8d7bc8 | 2009-01-30 04:25:10 +0000 | [diff] [blame] | 61 | |