LLVM API Documentation

PIC16TargetAsmInfo.cpp

Go to the documentation of this file.
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 
00016 // FIXME: Layering violation to get enums and static function, should be moved
00017 // to separate headers.
00018 #include "PIC16.h"
00019 #include "PIC16ISelLowering.h"
00020 using namespace llvm;
00021 
00022 PIC16TargetAsmInfo::PIC16TargetAsmInfo(const Target &T, const StringRef &TT) {
00023   CommentString = ";";
00024   GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL);
00025   GlobalDirective = "\tglobal\t";
00026   ExternDirective = "\textern\t";
00027 
00028   Data8bitsDirective = " db ";
00029   Data16bitsDirective = " dw ";
00030   Data32bitsDirective = " dl ";
00031   Data64bitsDirective = NULL;
00032   ZeroDirective = NULL;
00033   AsciiDirective = " dt ";
00034   AscizDirective = NULL;
00035     
00036   RomData8bitsDirective = " dw ";
00037   RomData16bitsDirective = " rom_di ";
00038   RomData32bitsDirective = " rom_dl ";
00039     
00040     
00041   // Set it to false because we weed to generate c file name and not bc file
00042   // name.
00043   HasSingleParameterDotFile = false;
00044 }
00045 
00046 const char *PIC16TargetAsmInfo::
00047 getDataASDirective(unsigned Size, unsigned AS) const {
00048   if (AS != PIC16ISD::ROM_SPACE)
00049     return 0;
00050   
00051   switch (Size) {
00052   case  8: return RomData8bitsDirective;
00053   case 16: return RomData16bitsDirective;
00054   case 32: return RomData32bitsDirective;
00055   default: return NULL;
00056   }
00057 }
00058