1 //===-- PIC16TargetAsmInfo.cpp - PIC16 asm properties ---------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declarations of the PIC16TargetAsmInfo properties.
12 //===----------------------------------------------------------------------===//
14 #include "PIC16TargetAsmInfo.h"
15 #include "PIC16TargetMachine.h"
16 #include "llvm/GlobalValue.h"
21 PIC16TargetAsmInfo(const PIC16TargetMachine
&TM
)
24 Data8bitsDirective
= " db ";
25 Data16bitsDirective
= " dw ";
26 Data32bitsDirective
= " dl ";
27 RomData8bitsDirective
= " dw ";
28 RomData16bitsDirective
= " rom_di ";
29 RomData32bitsDirective
= " rom_dl ";
31 AsciiDirective
= " dt ";
32 AscizDirective
= NULL
;
33 BSSSection_
= getNamedSection("udata.# UDATA",
34 SectionFlags::Writeable
| SectionFlags::BSS
);
35 ReadOnlySection
= getNamedSection("romdata.# ROMDATA", SectionFlags::None
);
36 DataSection
= getNamedSection("idata.# IDATA", SectionFlags::Writeable
);
37 SwitchToSectionDirective
= "";
38 // Need because otherwise a .text symbol is emitted by DwarfWriter
39 // in BeginModule, and gpasm cribbs for that .text symbol.
40 TextSection
= getUnnamedSection("", SectionFlags::Code
);
43 const char *PIC16TargetAsmInfo::getRomDirective(unsigned size
) const
46 return RomData8bitsDirective
;
48 return RomData16bitsDirective
;
50 return RomData32bitsDirective
;
56 const char *PIC16TargetAsmInfo::getASDirective(unsigned size
,
58 if (AS
== PIC16ISD::ROM_SPACE
)
59 return getRomDirective(size
);