blob: a6331e64ccc268dfd45b076f80f2d6efc7acd363 [file] [log] [blame]
Chris Lattner621c44d2009-08-22 20:48:53 +00001//===-- PIC16MCAsmInfo.cpp - PIC16 asm properties -------------------------===//
Sanjiv Gupta09bb4202008-05-13 09:02:57 +00002//
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//
Chris Lattner621c44d2009-08-22 20:48:53 +000010// This file contains the declarations of the PIC16MCAsmInfo properties.
Sanjiv Gupta09bb4202008-05-13 09:02:57 +000011//
12//===----------------------------------------------------------------------===//
13
Chris Lattner621c44d2009-08-22 20:48:53 +000014#include "PIC16MCAsmInfo.h"
Sanjiv Gupta09bb4202008-05-13 09:02:57 +000015
Chris Lattner055f6862009-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"
Sanjiv Guptaac2620e2009-10-15 19:26:25 +000019#include "PIC16ABINames.h"
Chris Lattner055f6862009-08-02 04:41:14 +000020#include "PIC16ISelLowering.h"
Sanjiv Gupta09bb4202008-05-13 09:02:57 +000021using namespace llvm;
22
Chris Lattnera9182162010-01-19 22:42:28 +000023PIC16MCAsmInfo::PIC16MCAsmInfo(const Target &T, const StringRef &TT)
24: MCAsmInfo(true) {
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;
Chris Lattnerd8310522009-07-27 05:32:16 +000037
Chris Lattnerc4c40a92009-07-28 03:13:23 +000038 RomData8bitsDirective = " dw ";
39 RomData16bitsDirective = " rom_di ";
40 RomData32bitsDirective = " rom_dl ";
41
42
Sanjiv Gupta14eba042009-05-28 18:24:11 +000043 // Set it to false because we weed to generate c file name and not bc file
44 // name.
45 HasSingleParameterDotFile = false;
Sanjiv Gupta09bb4202008-05-13 09:02:57 +000046}
Sanjiv Guptadc2943d2009-01-30 04:25:10 +000047
Chris Lattner621c44d2009-08-22 20:48:53 +000048const char *PIC16MCAsmInfo::getDataASDirective(unsigned Size,
49 unsigned AS) const {
Chris Lattnerc4c40a92009-07-28 03:13:23 +000050 if (AS != PIC16ISD::ROM_SPACE)
51 return 0;
52
Chris Lattnerc8859c52009-07-20 17:12:46 +000053 switch (Size) {
54 case 8: return RomData8bitsDirective;
55 case 16: return RomData16bitsDirective;
56 case 32: return RomData32bitsDirective;
57 default: return NULL;
58 }
Sanjiv Gupta46fc9fe2009-02-02 16:53:06 +000059}
Sanjiv Guptadc2943d2009-01-30 04:25:10 +000060