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"
19 #include "llvm/Target/TargetAsmInfo.h"
23 class MachineFunction;
93 class formatted_raw_ostream;
96 formatted_raw_ostream &O;
97 const TargetAsmInfo *TAI;
101 // EmitDebugDirectives is set if debug information is available. Default
102 // value for it is false.
103 bool EmitDebugDirectives;
106 PIC16DbgInfo(formatted_raw_ostream &o, const TargetAsmInfo *T)
110 EmitDebugDirectives = false;
113 void BeginModule (Module &M);
114 void BeginFunction (const MachineFunction &MF);
115 void ChangeDebugLoc (const MachineFunction &MF, const DebugLoc &DL,
116 bool IsInBeginFunction = false);
117 void EndFunction (const MachineFunction &MF);
118 void EndModule (Module &M);
122 void SwitchToCU (GlobalVariable *CU);
123 void SwitchToLine (unsigned Line, bool IsInBeginFunction = false);
125 void PopulateDebugInfo (DIType Ty, unsigned short &TypeNo, bool &HasAux,
126 int Aux[], std::string &TypeName);
127 void PopulateBasicTypeInfo (DIType Ty, unsigned short &TypeNo);
128 void PopulateDerivedTypeInfo (DIType Ty, unsigned short &TypeNo,
129 bool &HasAux, int Aux[],
130 std::string &TypeName);
132 void PopulateCompositeTypeInfo (DIType Ty, unsigned short &TypeNo,
133 bool &HasAux, int Aux[],
134 std::string &TypeName);
135 void PopulateArrayTypeInfo (DIType Ty, unsigned short &TypeNo,
136 bool &HasAux, int Aux[],
137 std::string &TypeName);
139 void PopulateStructOrUnionTypeInfo (DIType Ty, unsigned short &TypeNo,
140 bool &HasAux, int Aux[],
141 std::string &TypeName);
142 void PopulateEnumTypeInfo (DIType Ty, unsigned short &TypeNo);
144 unsigned GetTypeDebugNumber(std::string &Type);
145 short getStorageClass(DIGlobalVariable DIGV);
146 void EmitFunctBeginDI(const Function *F);
147 void EmitCompositeTypeDecls(Module &M);
148 void EmitCompositeTypeElements (DICompositeType CTy,
149 std::string UniqueSuffix);
150 void EmitFunctEndDI(const Function *F, unsigned Line);
151 void EmitAuxEntry(const std::string VarName, int Aux[],
152 int num = PIC16Dbg::AuxSize, std::string TagName = "");
153 inline void EmitSymbol(std::string Name, short Class,
154 unsigned short Type = PIC16Dbg::T_NULL,
155 unsigned long Value = 0);
156 void EmitVarDebugInfo(Module &M);
159 } // end namespace llvm;