LLVM API Documentation
00001 //===-- PIC16AsmPrinter.h - PIC16 LLVM assembly writer ------------------===// 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 a printer that converts from our internal representation 00011 // of machine-dependent LLVM code to PIC16 assembly language. 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #ifndef PIC16ASMPRINTER_H 00016 #define PIC16ASMPRINTER_H 00017 00018 #include "PIC16.h" 00019 #include "PIC16TargetMachine.h" 00020 #include "llvm/CodeGen/AsmPrinter.h" 00021 #include "llvm/Support/CommandLine.h" 00022 #include "llvm/Target/TargetAsmInfo.h" 00023 #include "llvm/Target/TargetMachine.h" 00024 00025 namespace llvm { 00026 struct VISIBILITY_HIDDEN PIC16AsmPrinter : public AsmPrinter { 00027 PIC16AsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T) 00028 : AsmPrinter(O, TM, T) { 00029 CurrentBankselLabelInBasicBlock = ""; 00030 IsRomData = false; 00031 } 00032 private : 00033 virtual const char *getPassName() const { 00034 return "PIC16 Assembly Printer"; 00035 } 00036 00037 bool runOnMachineFunction(MachineFunction &F); 00038 void printOperand(const MachineInstr *MI, int opNum); 00039 void printCCOperand(const MachineInstr *MI, int opNum); 00040 bool printInstruction(const MachineInstr *MI); // definition autogenerated. 00041 bool printMachineInstruction(const MachineInstr *MI); 00042 void EmitExternsAndGlobals (Module &M); 00043 void EmitInitData (Module &M); 00044 void EmitUnInitData (Module &M); 00045 void EmitRomData (Module &M); 00046 void emitFunctionData(MachineFunction &MF); 00047 void emitFunctionTempData(MachineFunction &MF, unsigned &FrameSize); 00048 00049 protected: 00050 bool doInitialization(Module &M); 00051 bool doFinalization(Module &M); 00052 bool inSameBank(char *s1, char *s2); 00053 00054 private: 00055 std::string CurrentBankselLabelInBasicBlock; 00056 bool IsRomData; 00057 }; 00058 } // end of namespace 00059 00060 #endif