blob: 9912543a87cc3fc3506247cbf3624961e573f7f6 [file] [log] [blame]
Sanjiv Gupta09bb4202008-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"
Dan Gohmana004d7b2008-11-03 18:22:42 +000015#include "PIC16TargetMachine.h"
Sanjiv Gupta4affaea2009-01-13 19:18:47 +000016#include "llvm/GlobalValue.h"
Sanjiv Guptabb4a5c72009-05-06 08:02:01 +000017#include "llvm/GlobalVariable.h"
18#include "llvm/DerivedTypes.h"
Sanjiv Gupta09bb4202008-05-13 09:02:57 +000019
20using namespace llvm;
21
22PIC16TargetAsmInfo::
Sanjiv Gupta085ae4f2008-11-19 11:00:54 +000023PIC16TargetAsmInfo(const PIC16TargetMachine &TM)
Dan Gohmana004d7b2008-11-03 18:22:42 +000024 : TargetAsmInfo(TM) {
Sanjiv Gupta09bb4202008-05-13 09:02:57 +000025 CommentString = ";";
Sanjiv Guptaca549b72009-05-10 05:23:47 +000026 GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL);
27 GlobalDirective = "\tglobal\t";
28 ExternDirective = "\textern\t";
29
Sanjiv Gupta085ae4f2008-11-19 11:00:54 +000030 Data8bitsDirective = " db ";
Sanjiv Guptadc2943d2009-01-30 04:25:10 +000031 Data16bitsDirective = " dw ";
32 Data32bitsDirective = " dl ";
Sanjiv Gupta9197df22009-07-06 18:09:11 +000033 Data64bitsDirective = NULL;
Sanjiv Gupta085ae4f2008-11-19 11:00:54 +000034 ZeroDirective = NULL;
Sanjiv Gupta4affaea2009-01-13 19:18:47 +000035 AsciiDirective = " dt ";
36 AscizDirective = NULL;
Sanjiv Gupta4affaea2009-01-13 19:18:47 +000037 SwitchToSectionDirective = "";
Chris Lattnerd8310522009-07-27 05:32:16 +000038
Chris Lattnerc4c40a92009-07-28 03:13:23 +000039 RomData8bitsDirective = " dw ";
40 RomData16bitsDirective = " rom_di ";
41 RomData32bitsDirective = " rom_dl ";
42
43
Sanjiv Gupta14eba042009-05-28 18:24:11 +000044 // Set it to false because we weed to generate c file name and not bc file
45 // name.
46 HasSingleParameterDotFile = false;
Sanjiv Gupta09bb4202008-05-13 09:02:57 +000047}
Sanjiv Guptadc2943d2009-01-30 04:25:10 +000048
Chris Lattnerc4c40a92009-07-28 03:13:23 +000049const char *PIC16TargetAsmInfo::
50getDataASDirective(unsigned Size, unsigned AS) const {
51 if (AS != PIC16ISD::ROM_SPACE)
52 return 0;
53
Chris Lattnerc8859c52009-07-20 17:12:46 +000054 switch (Size) {
55 case 8: return RomData8bitsDirective;
56 case 16: return RomData16bitsDirective;
57 case 32: return RomData32bitsDirective;
58 default: return NULL;
59 }
Sanjiv Gupta46fc9fe2009-02-02 16:53:06 +000060}
Sanjiv Guptadc2943d2009-01-30 04:25:10 +000061