give MCAsmInfo a 'has little endian' bit. This is unfortunate, but
[oota-llvm.git] / lib / Target / PIC16 / PIC16MCAsmInfo.cpp
1 //===-- PIC16MCAsmInfo.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 PIC16MCAsmInfo properties.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "PIC16MCAsmInfo.h"
15
16 // FIXME: Layering violation to get enums and static function, should be moved
17 // to separate headers.
18 #include "PIC16.h"
19 #include "PIC16ABINames.h"
20 #include "PIC16ISelLowering.h"
21 using namespace llvm;
22
23 PIC16MCAsmInfo::PIC16MCAsmInfo(const Target &T, const StringRef &TT)
24 : MCAsmInfo(true) {
25   CommentString = ";";
26   GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL);
27   GlobalDirective = "\tglobal\t";
28   ExternDirective = "\textern\t";
29
30   Data8bitsDirective = " db ";
31   Data16bitsDirective = " dw ";
32   Data32bitsDirective = " dl ";
33   Data64bitsDirective = NULL;
34   ZeroDirective = NULL;
35   AsciiDirective = " dt ";
36   AscizDirective = NULL;
37     
38   RomData8bitsDirective = " dw ";
39   RomData16bitsDirective = " rom_di ";
40   RomData32bitsDirective = " rom_dl ";
41     
42     
43   // Set it to false because we weed to generate c file name and not bc file
44   // name.
45   HasSingleParameterDotFile = false;
46 }
47
48 const char *PIC16MCAsmInfo::getDataASDirective(unsigned Size,
49                                                unsigned AS) const {
50   if (AS != PIC16ISD::ROM_SPACE)
51     return 0;
52   
53   switch (Size) {
54   case  8: return RomData8bitsDirective;
55   case 16: return RomData16bitsDirective;
56   case 32: return RomData32bitsDirective;
57   default: return NULL;
58   }
59 }
60