LLVM API Documentation
00001 //===-- PIC16TargetAsmInfo.cpp - PIC16 asm properties ---------------------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file contains the declarations of the PIC16TargetAsmInfo properties. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #include "PIC16TargetAsmInfo.h" 00015 #include "PIC16TargetMachine.h" 00016 #include "llvm/GlobalValue.h" 00017 00018 using namespace llvm; 00019 00020 PIC16TargetAsmInfo:: 00021 PIC16TargetAsmInfo(const PIC16TargetMachine &TM) 00022 : TargetAsmInfo(TM) { 00023 CommentString = ";"; 00024 Data8bitsDirective = " db "; 00025 Data16bitsDirective = " dw "; 00026 Data32bitsDirective = " dl "; 00027 RomData8bitsDirective = " dw "; 00028 RomData16bitsDirective = " rom_di "; 00029 RomData32bitsDirective = " rom_dl "; 00030 ZeroDirective = NULL; 00031 AsciiDirective = " dt "; 00032 AscizDirective = NULL; 00033 BSSSection_ = getNamedSection("udata.# UDATA", 00034 SectionFlags::Writeable | SectionFlags::BSS); 00035 ReadOnlySection = getNamedSection("romdata.# ROMDATA", SectionFlags::None); 00036 DataSection = getNamedSection("idata.# IDATA", SectionFlags::Writeable); 00037 SwitchToSectionDirective = ""; 00038 } 00039 00040 const char *PIC16TargetAsmInfo::getRomDirective(unsigned size) const 00041 { 00042 if (size == 8) 00043 return RomData8bitsDirective; 00044 else if (size == 16) 00045 return RomData16bitsDirective; 00046 else if (size == 32) 00047 return RomData32bitsDirective; 00048 else 00049 return NULL; 00050 } 00051 00052 00053 const char *PIC16TargetAsmInfo::getASDirective(unsigned size, 00054 unsigned AS) const { 00055 if (AS == PIC16ISD::ROM_SPACE) 00056 return getRomDirective(size); 00057 else 00058 return NULL; 00059 } 00060