1 //===-- PIC16DebugInfo.h - Interfaces for PIC16 Debug Information ============//
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 helper functions for representing debug information.
12 //===----------------------------------------------------------------------===//
17 #include "llvm/Analysis/DebugInfo.h"
18 #include "llvm/Module.h"
21 class MachineFunction;
99 // EmitDebugDirectives is set if debug information is available. Default
100 // value for it is false.
101 bool EmitDebugDirectives;
104 PIC16DbgInfo(MCStreamer &os, const MCAsmInfo *T) : OS(os), MAI(T) {
107 EmitDebugDirectives = false;
110 void BeginModule (Module &M);
111 void BeginFunction (const MachineFunction &MF);
112 void ChangeDebugLoc (const MachineFunction &MF, const DebugLoc &DL,
113 bool IsInBeginFunction = false);
114 void EndFunction (const MachineFunction &MF);
115 void EndModule (Module &M);
119 void SwitchToCU (MDNode *CU);
120 void SwitchToLine (unsigned Line, bool IsInBeginFunction = false);
122 void PopulateDebugInfo (DIType Ty, unsigned short &TypeNo, bool &HasAux,
123 int Aux[], std::string &TypeName);
124 void PopulateBasicTypeInfo (DIType Ty, unsigned short &TypeNo);
125 void PopulateDerivedTypeInfo (DIType Ty, unsigned short &TypeNo,
126 bool &HasAux, int Aux[],
127 std::string &TypeName);
129 void PopulateCompositeTypeInfo (DIType Ty, unsigned short &TypeNo,
130 bool &HasAux, int Aux[],
131 std::string &TypeName);
132 void PopulateArrayTypeInfo (DIType Ty, unsigned short &TypeNo,
133 bool &HasAux, int Aux[],
134 std::string &TypeName);
136 void PopulateStructOrUnionTypeInfo (DIType Ty, unsigned short &TypeNo,
137 bool &HasAux, int Aux[],
138 std::string &TypeName);
139 void PopulateEnumTypeInfo (DIType Ty, unsigned short &TypeNo);
141 unsigned GetTypeDebugNumber(std::string &Type);
142 short getStorageClass(DIGlobalVariable DIGV);
143 void EmitFunctBeginDI(const Function *F);
144 void EmitCompositeTypeDecls(Module &M);
145 void EmitCompositeTypeElements (DICompositeType CTy, std::string Suffix);
146 void EmitFunctEndDI(const Function *F, unsigned Line);
147 void EmitAuxEntry(const std::string VarName, int Aux[],
148 int num = PIC16Dbg::AuxSize, std::string TagName = "");
149 inline void EmitSymbol(std::string Name, short Class,
150 unsigned short Type = PIC16Dbg::T_NULL,
151 unsigned long Value = 0);
152 void EmitVarDebugInfo(Module &M);
155 } // end namespace llvm;