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
;
91 class formatted_raw_ostream
;
94 formatted_raw_ostream
&O
;
99 // EmitDebugDirectives is set if debug information is available. Default
100 // value for it is false.
101 bool EmitDebugDirectives
;
104 PIC16DbgInfo(formatted_raw_ostream
&o
, const MCAsmInfo
*T
)
108 EmitDebugDirectives
= false;
111 void BeginModule (Module
&M
);
112 void BeginFunction (const MachineFunction
&MF
);
113 void ChangeDebugLoc (const MachineFunction
&MF
, const DebugLoc
&DL
,
114 bool IsInBeginFunction
= false);
115 void EndFunction (const MachineFunction
&MF
);
116 void EndModule (Module
&M
);
120 void SwitchToCU (MDNode
*CU
);
121 void SwitchToLine (unsigned Line
, bool IsInBeginFunction
= false);
123 void PopulateDebugInfo (DIType Ty
, unsigned short &TypeNo
, bool &HasAux
,
124 int Aux
[], std::string
&TypeName
);
125 void PopulateBasicTypeInfo (DIType Ty
, unsigned short &TypeNo
);
126 void PopulateDerivedTypeInfo (DIType Ty
, unsigned short &TypeNo
,
127 bool &HasAux
, int Aux
[],
128 std::string
&TypeName
);
130 void PopulateCompositeTypeInfo (DIType Ty
, unsigned short &TypeNo
,
131 bool &HasAux
, int Aux
[],
132 std::string
&TypeName
);
133 void PopulateArrayTypeInfo (DIType Ty
, unsigned short &TypeNo
,
134 bool &HasAux
, int Aux
[],
135 std::string
&TypeName
);
137 void PopulateStructOrUnionTypeInfo (DIType Ty
, unsigned short &TypeNo
,
138 bool &HasAux
, int Aux
[],
139 std::string
&TypeName
);
140 void PopulateEnumTypeInfo (DIType Ty
, unsigned short &TypeNo
);
142 unsigned GetTypeDebugNumber(std::string
&Type
);
143 short getStorageClass(DIGlobalVariable DIGV
);
144 void EmitFunctBeginDI(const Function
*F
);
145 void EmitCompositeTypeDecls(Module
&M
);
146 void EmitCompositeTypeElements (DICompositeType CTy
, std::string Suffix
);
147 void EmitFunctEndDI(const Function
*F
, unsigned Line
);
148 void EmitAuxEntry(const std::string VarName
, int Aux
[],
149 int num
= PIC16Dbg::AuxSize
, std::string TagName
= "");
150 inline void EmitSymbol(std::string Name
, short Class
,
151 unsigned short Type
= PIC16Dbg::T_NULL
,
152 unsigned long Value
= 0);
153 void EmitVarDebugInfo(Module
&M
);
156 } // end namespace llvm;