blob: fdd1ae008e0a345068a1acc097a912bc9d294e6d [file] [log] [blame]
Sanjiv Gupta0e687712008-05-13 09:02:57 +00001//===-- 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"
15
Chris Lattner3878bff2009-08-02 04:41:14 +000016// FIXME: Layering violation to get enums and static function, should be moved
17// to separate headers.
18#include "PIC16.h"
19#include "PIC16ISelLowering.h"
Sanjiv Gupta0e687712008-05-13 09:02:57 +000020using namespace llvm;
21
22PIC16TargetAsmInfo::
Chris Lattner3878bff2009-08-02 04:41:14 +000023PIC16TargetAsmInfo() {
Sanjiv Gupta0e687712008-05-13 09:02:57 +000024 CommentString = ";";
Sanjiv Gupta211f3622009-05-10 05:23:47 +000025 GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL);
26 GlobalDirective = "\tglobal\t";
27 ExternDirective = "\textern\t";
28
Sanjiv Guptab1b5ffd2008-11-19 11:00:54 +000029 Data8bitsDirective = " db ";
Sanjiv Guptac8d7bc82009-01-30 04:25:10 +000030 Data16bitsDirective = " dw ";
31 Data32bitsDirective = " dl ";
Sanjiv Gupta53cf8292009-07-06 18:09:11 +000032 Data64bitsDirective = NULL;
Sanjiv Guptab1b5ffd2008-11-19 11:00:54 +000033 ZeroDirective = NULL;
Sanjiv Gupta1b046942009-01-13 19:18:47 +000034 AsciiDirective = " dt ";
35 AscizDirective = NULL;
Chris Lattner5fe575f2009-07-27 05:32:16 +000036
Chris Lattnerf0144122009-07-28 03:13:23 +000037 RomData8bitsDirective = " dw ";
38 RomData16bitsDirective = " rom_di ";
39 RomData32bitsDirective = " rom_dl ";
40
41
Sanjiv Guptadd4694b2009-05-28 18:24:11 +000042 // Set it to false because we weed to generate c file name and not bc file
43 // name.
44 HasSingleParameterDotFile = false;
Sanjiv Gupta0e687712008-05-13 09:02:57 +000045}
Sanjiv Guptac8d7bc82009-01-30 04:25:10 +000046
Chris Lattnerf0144122009-07-28 03:13:23 +000047const char *PIC16TargetAsmInfo::
48getDataASDirective(unsigned Size, unsigned AS) const {
49 if (AS != PIC16ISD::ROM_SPACE)
50 return 0;
51
Chris Lattner83757c72009-07-20 17:12:46 +000052 switch (Size) {
53 case 8: return RomData8bitsDirective;
54 case 16: return RomData16bitsDirective;
55 case 32: return RomData32bitsDirective;
56 default: return NULL;
57 }
Sanjiv Gupta3b020fe2009-02-02 16:53:06 +000058}
Sanjiv Guptac8d7bc82009-01-30 04:25:10 +000059