DwarfDebug.h revision f410608271b6318bfc9e26c0d199f185d5a89ccb
1//===-- llvm/CodeGen/DwarfDebug.h - Dwarf Debug Framework ------*- C++ -*--===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file contains support for writing dwarf debug info into asm files.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef CODEGEN_ASMPRINTER_DWARFDEBUG_H__
15#define CODEGEN_ASMPRINTER_DWARFDEBUG_H__
16
17#include "llvm/CodeGen/AsmPrinter.h"
18#include "llvm/CodeGen/MachineLocation.h"
19#include "DIE.h"
20#include "llvm/ADT/DenseMap.h"
21#include "llvm/ADT/FoldingSet.h"
22#include "llvm/ADT/SmallPtrSet.h"
23#include "llvm/ADT/StringMap.h"
24#include "llvm/ADT/UniqueVector.h"
25#include "llvm/Support/Allocator.h"
26#include "llvm/Support/DebugLoc.h"
27
28namespace llvm {
29
30class CompileUnit;
31class DbgConcreteScope;
32class DbgScope;
33class DbgVariable;
34class MachineFrameInfo;
35class MachineModuleInfo;
36class MachineOperand;
37class MCAsmInfo;
38class DIEAbbrev;
39class DIE;
40class DIEBlock;
41class DIEEntry;
42
43class DIEnumerator;
44class DIDescriptor;
45class DIVariable;
46class DIGlobal;
47class DIGlobalVariable;
48class DISubprogram;
49class DIBasicType;
50class DIDerivedType;
51class DIType;
52class DINameSpace;
53class DISubrange;
54class DICompositeType;
55class DITemplateTypeParameter;
56class DITemplateValueParameter;
57
58//===----------------------------------------------------------------------===//
59/// SrcLineInfo - This class is used to record source line correspondence.
60///
61class SrcLineInfo {
62  unsigned Line;                     // Source line number.
63  unsigned Column;                   // Source column.
64  unsigned SourceID;                 // Source ID number.
65  MCSymbol *Label;                   // Label in code ID number.
66public:
67  SrcLineInfo(unsigned L, unsigned C, unsigned S, MCSymbol *label)
68    : Line(L), Column(C), SourceID(S), Label(label) {}
69
70  // Accessors
71  unsigned getLine() const { return Line; }
72  unsigned getColumn() const { return Column; }
73  unsigned getSourceID() const { return SourceID; }
74  MCSymbol *getLabel() const { return Label; }
75};
76
77/// DotDebugLocEntry - This struct describes location entries emitted in
78/// .debug_loc section.
79typedef struct DotDebugLocEntry {
80  const MCSymbol *Begin;
81  const MCSymbol *End;
82  MachineLocation Loc;
83  bool Merged;
84  DotDebugLocEntry() : Begin(0), End(0), Merged(false) {}
85  DotDebugLocEntry(const MCSymbol *B, const MCSymbol *E, MachineLocation &L)
86    : Begin(B), End(E), Loc(L), Merged(false) {}
87  /// Empty entries are also used as a trigger to emit temp label. Such
88  /// labels are referenced is used to find debug_loc offset for a given DIE.
89  bool isEmpty() { return Begin == 0 && End == 0; }
90  bool isMerged() { return Merged; }
91  void Merge(DotDebugLocEntry *Next) {
92    if (!(Begin && Loc == Next->Loc && End == Next->Begin))
93      return;
94    Next->Begin = Begin;
95    Merged = true;
96  }
97} DotDebugLocEntry;
98
99class DwarfDebug {
100  /// Asm - Target of Dwarf emission.
101  AsmPrinter *Asm;
102
103  /// MMI - Collected machine module information.
104  MachineModuleInfo *MMI;
105
106  //===--------------------------------------------------------------------===//
107  // Attributes used to construct specific Dwarf sections.
108  //
109
110  CompileUnit *FirstCU;
111  DenseMap <const MDNode *, CompileUnit *> CUMap;
112
113  /// AbbreviationsSet - Used to uniquely define abbreviations.
114  ///
115  FoldingSet<DIEAbbrev> AbbreviationsSet;
116
117  /// Abbreviations - A list of all the unique abbreviations in use.
118  ///
119  std::vector<DIEAbbrev *> Abbreviations;
120
121  /// SourceIdMap - Source id map, i.e. pair of directory id and source file
122  /// id mapped to a unique id.
123  StringMap<unsigned> SourceIdMap;
124
125  /// DIEBlocks - A list of all the DIEBlocks in use.
126  std::vector<DIEBlock *> DIEBlocks;
127
128  // DIEValueAllocator - All DIEValues are allocated through this allocator.
129  BumpPtrAllocator DIEValueAllocator;
130
131  /// StringPool - A String->Symbol mapping of strings used by indirect
132  /// references.
133  StringMap<std::pair<MCSymbol*, unsigned> > StringPool;
134  unsigned NextStringPoolNumber;
135
136  MCSymbol *getStringPoolEntry(StringRef Str);
137
138  /// SectionMap - Provides a unique id per text section.
139  ///
140  UniqueVector<const MCSection*> SectionMap;
141
142  // CurrentFnDbgScope - Top level scope for the current function.
143  //
144  DbgScope *CurrentFnDbgScope;
145
146  /// DbgScopeMap - Tracks the scopes in the current function.  Owns the
147  /// contained DbgScope*s.
148  ///
149  DenseMap<const MDNode *, DbgScope *> DbgScopeMap;
150
151  /// ConcreteScopes - Tracks the concrete scopees in the current function.
152  /// These scopes are also included in DbgScopeMap.
153  DenseMap<const MDNode *, DbgScope *> ConcreteScopes;
154
155  /// AbstractScopes - Tracks the abstract scopes a module. These scopes are
156  /// not included DbgScopeMap.  AbstractScopes owns its DbgScope*s.
157  DenseMap<const MDNode *, DbgScope *> AbstractScopes;
158
159  /// AbstractSPDies - Collection of abstract subprogram DIEs.
160  DenseMap<const MDNode *, DIE *> AbstractSPDies;
161
162  /// AbstractScopesList - Tracks abstract scopes constructed while processing
163  /// a function. This list is cleared during endFunction().
164  SmallVector<DbgScope *, 4>AbstractScopesList;
165
166  /// AbstractVariables - Collection on abstract variables.  Owned by the
167  /// DbgScopes in AbstractScopes.
168  DenseMap<const MDNode *, DbgVariable *> AbstractVariables;
169
170  /// DbgVariableToFrameIndexMap - Tracks frame index used to find
171  /// variable's value.
172  DenseMap<const DbgVariable *, int> DbgVariableToFrameIndexMap;
173
174  /// DbgVariableToDbgInstMap - Maps DbgVariable to corresponding DBG_VALUE
175  /// machine instruction.
176  DenseMap<const DbgVariable *, const MachineInstr *> DbgVariableToDbgInstMap;
177
178  /// DotDebugLocEntries - Collection of DotDebugLocEntry.
179  SmallVector<DotDebugLocEntry, 4> DotDebugLocEntries;
180
181  /// UseDotDebugLocEntry - DW_AT_location attributes for the DIEs in this set
182  /// idetifies corresponding .debug_loc entry offset.
183  SmallPtrSet<const DIE *, 4> UseDotDebugLocEntry;
184
185  /// VarToAbstractVarMap - Maps DbgVariable with corresponding Abstract
186  /// DbgVariable, if any.
187  DenseMap<const DbgVariable *, const DbgVariable *> VarToAbstractVarMap;
188
189  /// InliendSubprogramDIEs - Collection of subprgram DIEs that are marked
190  /// (at the end of the module) as DW_AT_inline.
191  SmallPtrSet<DIE *, 4> InlinedSubprogramDIEs;
192
193  /// ContainingTypeMap - This map is used to keep track of subprogram DIEs that
194  /// need DW_AT_containing_type attribute. This attribute points to a DIE that
195  /// corresponds to the MDNode mapped with the subprogram DIE.
196  DenseMap<DIE *, const MDNode *> ContainingTypeMap;
197
198  typedef SmallVector<DbgScope *, 2> ScopeVector;
199
200  SmallPtrSet<const MachineInstr *, 8> InsnsEndScopeSet;
201
202  /// InlineInfo - Keep track of inlined functions and their location.  This
203  /// information is used to populate debug_inlined section.
204  typedef std::pair<const MCSymbol *, DIE *> InlineInfoLabels;
205  DenseMap<const MDNode *, SmallVector<InlineInfoLabels, 4> > InlineInfo;
206  SmallVector<const MDNode *, 4> InlinedSPNodes;
207
208  // ProcessedSPNodes - This is a collection of subprogram MDNodes that
209  // are processed to create DIEs.
210  SmallPtrSet<const MDNode *, 16> ProcessedSPNodes;
211
212  /// LabelsBeforeInsn - Maps instruction with label emitted before
213  /// instruction.
214  DenseMap<const MachineInstr *, MCSymbol *> LabelsBeforeInsn;
215
216  /// LabelsAfterInsn - Maps instruction with label emitted after
217  /// instruction.
218  DenseMap<const MachineInstr *, MCSymbol *> LabelsAfterInsn;
219
220  /// insnNeedsLabel - Collection of instructions that need a label to mark
221  /// a debuggging information entity.
222  SmallPtrSet<const MachineInstr *, 8> InsnNeedsLabel;
223
224  SmallVector<const MCSymbol *, 8> DebugRangeSymbols;
225
226  /// Previous instruction's location information. This is used to determine
227  /// label location to indicate scope boundries in dwarf debug info.
228  DebugLoc PrevInstLoc;
229  MCSymbol *PrevLabel;
230
231  struct FunctionDebugFrameInfo {
232    unsigned Number;
233    std::vector<MachineMove> Moves;
234
235    FunctionDebugFrameInfo(unsigned Num, const std::vector<MachineMove> &M)
236      : Number(Num), Moves(M) {}
237  };
238
239  std::vector<FunctionDebugFrameInfo> DebugFrames;
240
241  // Section Symbols: these are assembler temporary labels that are emitted at
242  // the beginning of each supported dwarf section.  These are used to form
243  // section offsets and are created by EmitSectionLabels.
244  MCSymbol *DwarfFrameSectionSym, *DwarfInfoSectionSym, *DwarfAbbrevSectionSym;
245  MCSymbol *DwarfStrSectionSym, *TextSectionSym, *DwarfDebugRangeSectionSym;
246  MCSymbol *DwarfDebugLocSectionSym;
247  MCSymbol *FunctionBeginSym, *FunctionEndSym;
248
249  DIEInteger *DIEIntegerOne;
250private:
251
252  /// getNumSourceIds - Return the number of unique source ids.
253  unsigned getNumSourceIds() const {
254    return SourceIdMap.size();
255  }
256
257  /// assignAbbrevNumber - Define a unique number for the abbreviation.
258  ///
259  void assignAbbrevNumber(DIEAbbrev &Abbrev);
260
261  /// createDIEEntry - Creates a new DIEEntry to be a proxy for a debug
262  /// information entry.
263  DIEEntry *createDIEEntry(DIE *Entry);
264
265  /// addUInt - Add an unsigned integer attribute data and value.
266  ///
267  void addUInt(DIE *Die, unsigned Attribute, unsigned Form, uint64_t Integer);
268
269  /// addSInt - Add an signed integer attribute data and value.
270  ///
271  void addSInt(DIE *Die, unsigned Attribute, unsigned Form, int64_t Integer);
272
273  /// addString - Add a string attribute data and value.
274  ///
275  void addString(DIE *Die, unsigned Attribute, unsigned Form,
276                 const StringRef Str);
277
278  /// addLabel - Add a Dwarf label attribute data and value.
279  ///
280  void addLabel(DIE *Die, unsigned Attribute, unsigned Form,
281                const MCSymbol *Label);
282
283  /// addSectionOffset - Add a Dwarf section relative label attribute data and
284  /// value.
285  ///
286  void addSectionOffset(DIE *Die, unsigned Attribute, unsigned Form,
287                const MCSymbol *Label);
288
289  /// addDelta - Add a label delta attribute data and value.
290  ///
291  void addDelta(DIE *Die, unsigned Attribute, unsigned Form,
292                const MCSymbol *Hi, const MCSymbol *Lo);
293
294  /// addDIEEntry - Add a DIE attribute data and value.
295  ///
296  void addDIEEntry(DIE *Die, unsigned Attribute, unsigned Form, DIE *Entry);
297
298  /// addBlock - Add block data.
299  ///
300  void addBlock(DIE *Die, unsigned Attribute, unsigned Form, DIEBlock *Block);
301
302  /// addSourceLine - Add location information to specified debug information
303  /// entry.
304  void addSourceLine(DIE *Die, DIVariable V);
305  void addSourceLine(DIE *Die, DIGlobalVariable G);
306  void addSourceLine(DIE *Die, DISubprogram SP);
307  void addSourceLine(DIE *Die, DIType Ty);
308  void addSourceLine(DIE *Die, DINameSpace NS);
309
310  /// addAddress - Add an address attribute to a die based on the location
311  /// provided.
312  void addAddress(DIE *Die, unsigned Attribute,
313                  const MachineLocation &Location);
314
315  /// addRegisterAddress - Add register location entry in variable DIE.
316  bool addRegisterAddress(DIE *Die, const MachineOperand &MO);
317
318  /// addConstantValue - Add constant value entry in variable DIE.
319  bool addConstantValue(DIE *Die, const MachineOperand &MO);
320  bool addConstantValue(DIE *Die, ConstantInt *CI, bool Unsigned);
321
322  /// addConstantFPValue - Add constant value entry in variable DIE.
323  bool addConstantFPValue(DIE *Die, const MachineOperand &MO);
324
325  /// addComplexAddress - Start with the address based on the location provided,
326  /// and generate the DWARF information necessary to find the actual variable
327  /// (navigating the extra location information encoded in the type) based on
328  /// the starting location.  Add the DWARF information to the die.
329  ///
330  void addComplexAddress(DbgVariable *&DV, DIE *Die, unsigned Attribute,
331                         const MachineLocation &Location);
332
333  // FIXME: Should be reformulated in terms of addComplexAddress.
334  /// addBlockByrefAddress - Start with the address based on the location
335  /// provided, and generate the DWARF information necessary to find the
336  /// actual Block variable (navigating the Block struct) based on the
337  /// starting location.  Add the DWARF information to the die.  Obsolete,
338  /// please use addComplexAddress instead.
339  ///
340  void addBlockByrefAddress(DbgVariable *&DV, DIE *Die, unsigned Attribute,
341                            const MachineLocation &Location);
342
343  /// addVariableAddress - Add DW_AT_location attribute for a DbgVariable based
344  /// on provided frame index.
345  void addVariableAddress(DbgVariable *&DV, DIE *Die, int64_t FI);
346
347  /// addToContextOwner - Add Die into the list of its context owner's children.
348  void addToContextOwner(DIE *Die, DIDescriptor Context);
349
350  /// addType - Add a new type attribute to the specified entity.
351  void addType(DIE *Entity, DIType Ty);
352
353
354  /// getOrCreateNameSpace - Create a DIE for DINameSpace.
355  DIE *getOrCreateNameSpace(DINameSpace NS);
356
357  /// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
358  /// given DIType.
359  DIE *getOrCreateTypeDIE(DIType Ty);
360
361  /// getOrCreateTemplateTypeParameterDIE - Find existing DIE or create new DIE
362  /// for the given DITemplateTypeParameter.
363  DIE *getOrCreateTemplateTypeParameterDIE(DITemplateTypeParameter TP);
364
365  /// getOrCreateTemplateValueParameterDIE - Find existing DIE or create new DIE
366  /// for the given DITemplateValueParameter.
367  DIE *getOrCreateTemplateValueParameterDIE(DITemplateValueParameter TVP);
368
369  void addPubTypes(DISubprogram SP);
370
371  /// constructTypeDIE - Construct basic type die from DIBasicType.
372  void constructTypeDIE(DIE &Buffer,
373                        DIBasicType BTy);
374
375  /// constructTypeDIE - Construct derived type die from DIDerivedType.
376  void constructTypeDIE(DIE &Buffer,
377                        DIDerivedType DTy);
378
379  /// constructTypeDIE - Construct type DIE from DICompositeType.
380  void constructTypeDIE(DIE &Buffer,
381                        DICompositeType CTy);
382
383  /// constructSubrangeDIE - Construct subrange DIE from DISubrange.
384  void constructSubrangeDIE(DIE &Buffer, DISubrange SR, DIE *IndexTy);
385
386  /// constructArrayTypeDIE - Construct array type DIE from DICompositeType.
387  void constructArrayTypeDIE(DIE &Buffer,
388                             DICompositeType *CTy);
389
390  /// constructEnumTypeDIE - Construct enum type DIE from DIEnumerator.
391  DIE *constructEnumTypeDIE(DIEnumerator ETy);
392
393  /// createMemberDIE - Create new member DIE.
394  DIE *createMemberDIE(DIDerivedType DT);
395
396  /// createSubprogramDIE - Create new DIE using SP.
397  DIE *createSubprogramDIE(DISubprogram SP);
398
399  /// getOrCreateDbgScope - Create DbgScope for the scope.
400  DbgScope *getOrCreateDbgScope(const MDNode *Scope, const MDNode *InlinedAt);
401
402  DbgScope *getOrCreateAbstractScope(const MDNode *N);
403
404  /// findAbstractVariable - Find abstract variable associated with Var.
405  DbgVariable *findAbstractVariable(DIVariable &Var, DebugLoc Loc);
406
407  /// updateSubprogramScopeDIE - Find DIE for the given subprogram and
408  /// attach appropriate DW_AT_low_pc and DW_AT_high_pc attributes.
409  /// If there are global variables in this scope then create and insert
410  /// DIEs for these variables.
411  DIE *updateSubprogramScopeDIE(const MDNode *SPNode);
412
413  /// constructLexicalScope - Construct new DW_TAG_lexical_block
414  /// for this scope and attach DW_AT_low_pc/DW_AT_high_pc labels.
415  DIE *constructLexicalScopeDIE(DbgScope *Scope);
416
417  /// constructInlinedScopeDIE - This scope represents inlined body of
418  /// a function. Construct DIE to represent this concrete inlined copy
419  /// of the function.
420  DIE *constructInlinedScopeDIE(DbgScope *Scope);
421
422  /// constructVariableDIE - Construct a DIE for the given DbgVariable.
423  DIE *constructVariableDIE(DbgVariable *DV, DbgScope *S);
424
425  /// constructScopeDIE - Construct a DIE for this scope.
426  DIE *constructScopeDIE(DbgScope *Scope);
427
428  /// EmitSectionLabels - Emit initial Dwarf sections with a label at
429  /// the start of each one.
430  void EmitSectionLabels();
431
432  /// emitDIE - Recusively Emits a debug information entry.
433  ///
434  void emitDIE(DIE *Die);
435
436  /// computeSizeAndOffset - Compute the size and offset of a DIE.
437  ///
438  unsigned computeSizeAndOffset(DIE *Die, unsigned Offset, bool Last);
439
440  /// computeSizeAndOffsets - Compute the size and offset of all the DIEs.
441  ///
442  void computeSizeAndOffsets();
443
444  /// EmitDebugInfo - Emit the debug info section.
445  ///
446  void emitDebugInfo();
447
448  /// emitAbbreviations - Emit the abbreviation section.
449  ///
450  void emitAbbreviations() const;
451
452  /// emitEndOfLineMatrix - Emit the last address of the section and the end of
453  /// the line matrix.
454  ///
455  void emitEndOfLineMatrix(unsigned SectionEnd);
456
457  /// emitCommonDebugFrame - Emit common frame info into a debug frame section.
458  ///
459  void emitCommonDebugFrame();
460
461  /// emitFunctionDebugFrame - Emit per function frame info into a debug frame
462  /// section.
463  void emitFunctionDebugFrame(const FunctionDebugFrameInfo &DebugFrameInfo);
464
465  /// emitDebugPubNames - Emit visible names into a debug pubnames section.
466  ///
467  void emitDebugPubNames();
468
469  /// emitDebugPubTypes - Emit visible types into a debug pubtypes section.
470  ///
471  void emitDebugPubTypes();
472
473  /// emitDebugStr - Emit visible names into a debug str section.
474  ///
475  void emitDebugStr();
476
477  /// emitDebugLoc - Emit visible names into a debug loc section.
478  ///
479  void emitDebugLoc();
480
481  /// EmitDebugARanges - Emit visible names into a debug aranges section.
482  ///
483  void EmitDebugARanges();
484
485  /// emitDebugRanges - Emit visible names into a debug ranges section.
486  ///
487  void emitDebugRanges();
488
489  /// emitDebugMacInfo - Emit visible names into a debug macinfo section.
490  ///
491  void emitDebugMacInfo();
492
493  /// emitDebugInlineInfo - Emit inline info using following format.
494  /// Section Header:
495  /// 1. length of section
496  /// 2. Dwarf version number
497  /// 3. address size.
498  ///
499  /// Entries (one "entry" for each function that was inlined):
500  ///
501  /// 1. offset into __debug_str section for MIPS linkage name, if exists;
502  ///   otherwise offset into __debug_str for regular function name.
503  /// 2. offset into __debug_str section for regular function name.
504  /// 3. an unsigned LEB128 number indicating the number of distinct inlining
505  /// instances for the function.
506  ///
507  /// The rest of the entry consists of a {die_offset, low_pc}  pair for each
508  /// inlined instance; the die_offset points to the inlined_subroutine die in
509  /// the __debug_info section, and the low_pc is the starting address  for the
510  ///  inlining instance.
511  void emitDebugInlineInfo();
512
513  /// GetOrCreateSourceID - Look up the source id with the given directory and
514  /// source file names. If none currently exists, create a new id and insert it
515  /// in the SourceIds map.
516  unsigned GetOrCreateSourceID(StringRef FullName);
517
518  /// constructCompileUnit - Create new CompileUnit for the given
519  /// metadata node with tag DW_TAG_compile_unit.
520  void constructCompileUnit(const MDNode *N);
521
522  /// getCompielUnit - Get CompileUnit DIE.
523  CompileUnit *getCompileUnit(const MDNode *N) const;
524
525  /// constructGlobalVariableDIE - Construct global variable DIE.
526  void constructGlobalVariableDIE(const MDNode *N);
527
528  /// construct SubprogramDIE - Construct subprogram DIE.
529  void constructSubprogramDIE(const MDNode *N);
530
531  /// recordSourceLine - Register a source line with debug info. Returns the
532  /// unique label that was emitted and which provides correspondence to
533  /// the source line list.
534  MCSymbol *recordSourceLine(unsigned Line, unsigned Col, const MDNode *Scope);
535
536  /// recordVariableFrameIndex - Record a variable's index.
537  void recordVariableFrameIndex(const DbgVariable *V, int Index);
538
539  /// findVariableFrameIndex - Return true if frame index for the variable
540  /// is found. Update FI to hold value of the index.
541  bool findVariableFrameIndex(const DbgVariable *V, int *FI);
542
543  /// findDbgScope - Find DbgScope for the debug loc attached with an
544  /// instruction.
545  DbgScope *findDbgScope(const MachineInstr *MI);
546
547  /// identifyScopeMarkers() - Indentify instructions that are marking
548  /// beginning of or end of a scope.
549  void identifyScopeMarkers();
550
551  /// extractScopeInformation - Scan machine instructions in this function
552  /// and collect DbgScopes. Return true, if atleast one scope was found.
553  bool extractScopeInformation();
554
555  /// collectVariableInfo - Populate DbgScope entries with variables' info.
556  void collectVariableInfo(const MachineFunction *,
557                           SmallPtrSet<const MDNode *, 16> &ProcessedVars);
558
559  /// collectVariableInfoFromMMITable - Collect variable information from
560  /// side table maintained by MMI.
561  void collectVariableInfoFromMMITable(const MachineFunction * MF,
562                                       SmallPtrSet<const MDNode *, 16> &P);
563public:
564  //===--------------------------------------------------------------------===//
565  // Main entry points.
566  //
567  DwarfDebug(AsmPrinter *A, Module *M);
568  ~DwarfDebug();
569
570  /// beginModule - Emit all Dwarf sections that should come prior to the
571  /// content.
572  void beginModule(Module *M);
573
574  /// endModule - Emit all Dwarf sections that should come after the content.
575  ///
576  void endModule();
577
578  /// beginFunction - Gather pre-function debug information.  Assumes being
579  /// emitted immediately after the function entry point.
580  void beginFunction(const MachineFunction *MF);
581
582  /// endFunction - Gather and emit post-function debug information.
583  ///
584  void endFunction(const MachineFunction *MF);
585
586  /// getLabelBeforeInsn - Return Label preceding the instruction.
587  const MCSymbol *getLabelBeforeInsn(const MachineInstr *MI);
588
589  /// getLabelAfterInsn - Return Label immediately following the instruction.
590  const MCSymbol *getLabelAfterInsn(const MachineInstr *MI);
591
592  /// beginInstruction - Process beginning of an instruction.
593  void beginInstruction(const MachineInstr *MI);
594
595  /// endInstruction - Prcess end of an instruction.
596  void endInstruction(const MachineInstr *MI);
597};
598} // End of namespace llvm
599
600#endif
601